Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -0,0 +1,447 @@
|
||||
//--------------------------------------------
|
||||
// Set up our simple tag open values
|
||||
//--------------------------------------------
|
||||
|
||||
var B_open = 0;
|
||||
var I_open = 0;
|
||||
var U_open = 0;
|
||||
var QUOTE_open = 0;
|
||||
var CODE_open = 0;
|
||||
var SQL_open = 0;
|
||||
var HTML_open = 0;
|
||||
|
||||
var bbtags = new Array();
|
||||
|
||||
var fombj = document.REPLIER;
|
||||
|
||||
//==========================================
|
||||
// prep and set up
|
||||
//==========================================
|
||||
|
||||
prep_mode();
|
||||
|
||||
function prep_mode()
|
||||
{
|
||||
cvalue = my_getcookie( "bbmode" );
|
||||
|
||||
if (cvalue == 'ezmode')
|
||||
{
|
||||
fombj.bbmode[0].checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fombj.bbmode[1].checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Set BBCode mode
|
||||
//==========================================
|
||||
|
||||
function setmode(mVal)
|
||||
{
|
||||
my_setcookie( 'bbmode', mVal, 1 );
|
||||
}
|
||||
|
||||
|
||||
function get_easy_mode_state()
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Returns true if we've chosen easy mode
|
||||
//--------------------------------------------
|
||||
|
||||
if ( fombj.bbmode[0].checked )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Set the help bar status
|
||||
//==========================================
|
||||
|
||||
function hstat(msg)
|
||||
{
|
||||
fombj.helpbox.value = eval( "help_" + msg );
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Set the number of tags open box
|
||||
//==========================================
|
||||
|
||||
function cstat()
|
||||
{
|
||||
var c = stacksize(bbtags);
|
||||
|
||||
if ( (c < 1) || (c == null) ) {
|
||||
c = 0;
|
||||
}
|
||||
|
||||
if ( ! bbtags[0] ) {
|
||||
c = 0;
|
||||
}
|
||||
|
||||
fombj.tagcount.value = c;
|
||||
}
|
||||
|
||||
|
||||
//==========================================
|
||||
// Close all tags
|
||||
//==========================================
|
||||
|
||||
function closeall()
|
||||
{
|
||||
if (bbtags[0])
|
||||
{
|
||||
while (bbtags[0])
|
||||
{
|
||||
tagRemove = popstack(bbtags);
|
||||
fombj.Post.value += "[/" + tagRemove + "]";
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
// Ensure we're not looking for FONT, SIZE or COLOR as these
|
||||
// buttons don't exist, they are select lists instead.
|
||||
//--------------------------------------------
|
||||
|
||||
if ( (tagRemove != 'FONT') && (tagRemove != 'SIZE') && (tagRemove != 'COLOR') )
|
||||
{
|
||||
eval("fombj." + tagRemove + ".value = ' " + tagRemove + " '");
|
||||
eval(tagRemove + "_open = 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Ensure we got them all
|
||||
//--------------------------------------------
|
||||
|
||||
fombj.tagcount.value = 0;
|
||||
bbtags = new Array();
|
||||
fombj.Post.focus();
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// EMOTICONS
|
||||
//==========================================
|
||||
|
||||
function emoticon(theSmilie)
|
||||
{
|
||||
doInsert(" " + theSmilie + " ", "", false);
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// ADD CODE
|
||||
//==========================================
|
||||
|
||||
function add_code(NewCode)
|
||||
{
|
||||
fombj.Post.value += NewCode;
|
||||
fombj.Post.focus();
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// ALTER FONT
|
||||
//==========================================
|
||||
|
||||
function alterfont(theval, thetag)
|
||||
{
|
||||
if (theval == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( doInsert("[" + thetag + "=" + theval + "]", "[/" + thetag + "]", true) )
|
||||
{
|
||||
pushstack(bbtags, thetag);
|
||||
}
|
||||
|
||||
fombj.ffont.selectedIndex = 0;
|
||||
fombj.fsize.selectedIndex = 0;
|
||||
fombj.fcolor.selectedIndex = 0;
|
||||
|
||||
cstat();
|
||||
|
||||
}
|
||||
|
||||
|
||||
//==========================================
|
||||
// SIMPLE TAGS (such as B, I U, etc)
|
||||
//==========================================
|
||||
|
||||
function simpletag(thetag)
|
||||
{
|
||||
var tagOpen = eval(thetag + "_open");
|
||||
|
||||
if ( get_easy_mode_state() )
|
||||
{
|
||||
inserttext = prompt(prompt_start + "\n[" + thetag + "]xxx[/" + thetag + "]");
|
||||
if ( (inserttext != null) && (inserttext != "") )
|
||||
{
|
||||
doInsert("[" + thetag + "]" + inserttext + "[/" + thetag + "] ", "", false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tagOpen == 0)
|
||||
{
|
||||
if(doInsert("[" + thetag + "]", "[/" + thetag + "]", true))
|
||||
{
|
||||
eval(thetag + "_open = 1");
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
//--------------------------------------------
|
||||
|
||||
eval("fombj." + thetag + ".value += '*'");
|
||||
|
||||
pushstack(bbtags, thetag);
|
||||
cstat();
|
||||
hstat('click_close');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Find the last occurance of the opened tag
|
||||
//--------------------------------------------
|
||||
lastindex = 0;
|
||||
|
||||
for (i = 0 ; i < bbtags.length; i++ )
|
||||
{
|
||||
if ( bbtags[i] == thetag )
|
||||
{
|
||||
lastindex = i;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Close all tags opened up to that tag was opened
|
||||
//--------------------------------------------
|
||||
|
||||
while (bbtags[lastindex])
|
||||
{
|
||||
tagRemove = popstack(bbtags);
|
||||
doInsert("[/" + tagRemove + "]", "", false);
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
//--------------------------------------------
|
||||
|
||||
if ( (tagRemove != 'FONT') && (tagRemove != 'SIZE') && (tagRemove != 'COLOR') )
|
||||
{
|
||||
eval("fombj." + tagRemove + ".value = ' " + tagRemove + " '");
|
||||
eval(tagRemove + "_open = 0");
|
||||
}
|
||||
}
|
||||
|
||||
cstat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// List tag
|
||||
//==========================================
|
||||
|
||||
function tag_list()
|
||||
{
|
||||
var listvalue = "init";
|
||||
var thelist = "";
|
||||
|
||||
while ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
listvalue = prompt(list_prompt, "");
|
||||
if ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
thelist = thelist+"[*]"+listvalue+"\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ( thelist != "" )
|
||||
{
|
||||
doInsert( "[LIST]\n" + thelist + "[/LIST]\n", "", false);
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// URL tag
|
||||
//==========================================
|
||||
|
||||
function tag_url()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
var enterURL = prompt(text_enter_url, "http://");
|
||||
var enterTITLE = prompt(text_enter_url_name, jsfile_myweb_lang);
|
||||
|
||||
if (!enterURL) {
|
||||
FoundErrors += " " + error_no_url;
|
||||
}
|
||||
if (!enterTITLE) {
|
||||
FoundErrors += " " + error_no_title;
|
||||
}
|
||||
|
||||
if (FoundErrors) {
|
||||
alert(jsfile_error_lang + FoundErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
doInsert("[URL="+enterURL+"]"+enterTITLE+"[/URL]", "", false);
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Insert attachment tag
|
||||
//==========================================
|
||||
|
||||
function insert_attach_to_textarea(aid)
|
||||
{
|
||||
doInsert( "[attachmentid="+aid+"]" );
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Image tag
|
||||
//==========================================
|
||||
|
||||
function tag_image()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
var enterURL = prompt(text_enter_image, "http://");
|
||||
|
||||
if (!enterURL) {
|
||||
FoundErrors += " " + error_no_url;
|
||||
}
|
||||
|
||||
if (FoundErrors) {
|
||||
alert(jsfile_error_lang + FoundErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
doInsert("[IMG]"+enterURL+"[/IMG]", "", false);
|
||||
}
|
||||
|
||||
function tag_email()
|
||||
{
|
||||
var emailAddress = prompt(text_enter_email, "");
|
||||
|
||||
if (!emailAddress) {
|
||||
alert(error_no_email);
|
||||
return;
|
||||
}
|
||||
|
||||
doInsert("[EMAIL]"+emailAddress+"[/EMAIL]", "", false);
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// GENERAL INSERT FUNCTION
|
||||
//--------------------------------------------
|
||||
// ibTag: opening tag
|
||||
// ibClsTag: closing tag, used if we have selected text
|
||||
// isSingle: true if we do not close the tag right now
|
||||
// return value: true if the tag needs to be closed later
|
||||
|
||||
//
|
||||
|
||||
function doInsert(ibTag, ibClsTag, isSingle)
|
||||
{
|
||||
var isClose = false;
|
||||
var obj_ta = fombj.Post;
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
if ( (ua_vers >= 4) && is_ie && is_win)
|
||||
{
|
||||
if (obj_ta.isTextEdit)
|
||||
{
|
||||
obj_ta.focus();
|
||||
var sel = document.selection;
|
||||
var rng = sel.createRange();
|
||||
rng.colapse;
|
||||
if((sel.type == "Text" || sel.type == "None") && rng != null)
|
||||
{
|
||||
if(ibClsTag != "" && rng.text.length > 0)
|
||||
ibTag += rng.text + ibClsTag;
|
||||
else if(isSingle)
|
||||
isClose = true;
|
||||
|
||||
rng.text = ibTag;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( obj_ta.selectionEnd )
|
||||
{
|
||||
var ss = obj_ta.selectionStart;
|
||||
var st = obj_ta.scrollTop;
|
||||
var es = obj_ta.selectionEnd;
|
||||
|
||||
if (es <= 2)
|
||||
{
|
||||
es = obj_ta.textLength;
|
||||
}
|
||||
|
||||
var start = (obj_ta.value).substring(0, ss);
|
||||
var middle = (obj_ta.value).substring(ss, es);
|
||||
var end = (obj_ta.value).substring(es, obj_ta.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
|
||||
{
|
||||
middle = ibTag + middle + ibClsTag;
|
||||
}
|
||||
else
|
||||
{
|
||||
middle = ibTag + middle;
|
||||
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
}
|
||||
|
||||
obj_ta.value = start + middle + end;
|
||||
|
||||
var cpos = ss + (middle.length);
|
||||
|
||||
obj_ta.selectionStart = cpos;
|
||||
obj_ta.selectionEnd = cpos;
|
||||
obj_ta.scrollTop = st;
|
||||
|
||||
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's CRAPPY!
|
||||
//----------------------------------------
|
||||
else
|
||||
{
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
|
||||
obj_ta.focus();
|
||||
|
||||
return isClose;
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2
|
||||
// Text Editor Global Functions
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
var dontpassgo = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Keep an array of open tags
|
||||
//-------------------------------
|
||||
|
||||
var bbtags = new Array();
|
||||
|
||||
//-------------------------------
|
||||
// Define font faces
|
||||
//-------------------------------
|
||||
|
||||
var ips_primary_fonts = new Array(
|
||||
"arial",
|
||||
"arial black",
|
||||
"arial narrow",
|
||||
"book antiqua",
|
||||
"century gothic",
|
||||
"comic sans ms",
|
||||
"courier new",
|
||||
"fixedsys",
|
||||
"franklin gothic medium",
|
||||
"garamond",
|
||||
"georgia",
|
||||
"impact",
|
||||
"lucida console",
|
||||
"lucida sans unicode",
|
||||
"microsoft sans serif",
|
||||
"palatino linotype",
|
||||
"system",
|
||||
"tahoma",
|
||||
"times new roman",
|
||||
"trebuchet ms",
|
||||
"verdana"
|
||||
);
|
||||
|
||||
//-------------------------------
|
||||
// Remap font sizes
|
||||
//-------------------------------
|
||||
|
||||
var ips_fontsizes =
|
||||
{
|
||||
'8px' : 1,
|
||||
'10pt' : 2,
|
||||
'12pt' : 3,
|
||||
'14pt' : 4,
|
||||
'18pt' : 5,
|
||||
'24pt' : 6,
|
||||
'36pt' : 7
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Define sizes
|
||||
//-------------------------------
|
||||
|
||||
var ips_font_sizes = new Array( 1, 2, 3, 4, 5, 6, 7 );
|
||||
|
||||
//-------------------------------
|
||||
// Reverse them so we can look up
|
||||
// by ID
|
||||
//-------------------------------
|
||||
|
||||
var ips_reverse_primary_fonts = new Array();
|
||||
var ips_reverse_font_sizes = new Array();
|
||||
var ips_reverse_fontsizes = new Array();
|
||||
|
||||
for( var i in ips_primary_fonts )
|
||||
{
|
||||
ips_reverse_primary_fonts[ ips_primary_fonts[i] ] = i;
|
||||
}
|
||||
|
||||
for( var i in ips_font_sizes )
|
||||
{
|
||||
ips_reverse_font_sizes[ ips_font_sizes[i] ] = i;
|
||||
}
|
||||
|
||||
for( var i in ips_fontsizes )
|
||||
{
|
||||
ips_reverse_fontsizes[ ips_fontsizes[i] ] = i;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Close all tags
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function closeall()
|
||||
{
|
||||
if ( bbtags[0] )
|
||||
{
|
||||
while ( bbtags[0] )
|
||||
{
|
||||
tagRemove = popstack( bbtags )
|
||||
postformobj.Post.value += "[/" + tagRemove + "]";
|
||||
|
||||
if ( i_am == 'std' )
|
||||
{
|
||||
toggle_button( tagRemove );
|
||||
}
|
||||
else
|
||||
{
|
||||
rte_button_update( tagRemove );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Ensure we got them all
|
||||
//--------------------------------------------
|
||||
|
||||
bbtags = new Array();
|
||||
postformobj.Post.focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Close all nested tags
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function smart_close_tags( thetag )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Find the last occurance of the opened tag
|
||||
//--------------------------------------------
|
||||
|
||||
lastindex = 0;
|
||||
|
||||
for (i = 0 ; i < bbtags.length; i++ )
|
||||
{
|
||||
if ( bbtags[i] == thetag )
|
||||
{
|
||||
lastindex = i;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Close all tags opened up to that tag was opened
|
||||
//--------------------------------------------
|
||||
|
||||
while ( bbtags[lastindex] )
|
||||
{
|
||||
tagRemove = popstack(bbtags);
|
||||
|
||||
wrap_tags("[/" + tagRemove + "]", "")
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
//--------------------------------------------
|
||||
|
||||
if ( i_am == 'std' )
|
||||
{
|
||||
toggle_button( tagRemove );
|
||||
}
|
||||
else
|
||||
{
|
||||
rte_button_update( tagRemove );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Write font face box
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function write_fontface_box()
|
||||
{
|
||||
html = "";
|
||||
|
||||
for( var i in ips_primary_fonts )
|
||||
{
|
||||
option = ips_primary_fonts[i];
|
||||
display = ips_primary_fonts[i];
|
||||
|
||||
//-------------------------------
|
||||
// Tidy up show name
|
||||
// Make "courier new" "Courier New"
|
||||
//-------------------------------
|
||||
|
||||
var tmp = display.split( " " );
|
||||
var rtn = new Array;
|
||||
|
||||
for ( var id in tmp )
|
||||
{
|
||||
rtn[id] = tmp[id].substr(0, 1).toUpperCase() + tmp[id].substr(1);
|
||||
}
|
||||
|
||||
display = rtn.join( " " );
|
||||
|
||||
html += "\n<option style='font-family:" + display + "' value='" + display + "'>" + display + "</option>";
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Write font size box
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function write_fontsize_box()
|
||||
{
|
||||
html = "";
|
||||
|
||||
for( var i in ips_font_sizes )
|
||||
{
|
||||
option = ips_font_sizes[i];
|
||||
display = ips_font_sizes[i];
|
||||
|
||||
html += "\n<option value='" + display + "'>" + display + "</option>";
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Editor
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function init_editor()
|
||||
{
|
||||
if ( ! postformid )
|
||||
{
|
||||
postformid = 'postingform';
|
||||
}
|
||||
|
||||
if ( ! postfieldid )
|
||||
{
|
||||
postfieldid = 'postcontent';
|
||||
}
|
||||
|
||||
postformobj = document.getElementById( postformid );
|
||||
postfieldobj = document.getElementById( postfieldid );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Remove an attachment
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function removeattach(id)
|
||||
{
|
||||
if ( id != "" )
|
||||
{
|
||||
Override = 1;
|
||||
postformobj.removeattachid.value = id;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Insert attachment tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function insert_attach_to_textarea(aid)
|
||||
{
|
||||
rtewindow.focus();
|
||||
|
||||
wrap_tags( "[attachmentid="+aid+"]", "" );
|
||||
|
||||
rtewindow.focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Open emoticon window
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
var emowindow = '';
|
||||
|
||||
function emo_pop()
|
||||
{
|
||||
emowindow = window.open( ipb_var_base_url + "act=legends&CODE=emoticons","Legends","width=250,height=500,resizable=yes,scrollbars=yes");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// BBCode window
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function bbc_pop()
|
||||
{
|
||||
window.open( ipb_var_base_url + "act=legends&CODE=bbcode","Legends","width=700,height=500,resizable=yes,scrollbars=yes");
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Fix the amount of digging parents up.
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function getOffsetTop(elm)
|
||||
{
|
||||
var mOffsetTop = elm.offsetTop;
|
||||
var mOffsetParent = elm.offsetParent;
|
||||
var parents_up = 2;
|
||||
|
||||
while(parents_up > 0)
|
||||
{
|
||||
mOffsetTop += mOffsetParent.offsetTop;
|
||||
mOffsetParent = mOffsetParent.offsetParent;
|
||||
parents_up--;
|
||||
}
|
||||
|
||||
return mOffsetTop;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Fix the amount of digging parents up.
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function getOffsetLeft(elm)
|
||||
{
|
||||
var mOffsetLeft = elm.offsetLeft;
|
||||
var mOffsetParent = elm.offsetParent;
|
||||
var parents_up = 2;
|
||||
|
||||
while(parents_up > 0)
|
||||
{
|
||||
mOffsetLeft += mOffsetParent.offsetLeft;
|
||||
mOffsetParent = mOffsetParent.offsetParent;
|
||||
parents_up--;
|
||||
}
|
||||
|
||||
return mOffsetLeft;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,934 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2
|
||||
// STD Editor Functions
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
// SHOULD BE CALLED AFTER ipb_editor.js
|
||||
//------------------------------------------
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
var i_am = 'std';
|
||||
var rtewindow;
|
||||
var buttonbar;
|
||||
|
||||
var opentags =
|
||||
{
|
||||
'b' : 0,
|
||||
'i' : 0,
|
||||
's' : 0,
|
||||
'u' : 0,
|
||||
'img' : 0,
|
||||
'quote' : 0,
|
||||
'left' : 0,
|
||||
'center' : 0,
|
||||
'right' : 0,
|
||||
'color' : 0,
|
||||
'background' : 0,
|
||||
'indent' : 0,
|
||||
'code' : 0
|
||||
};
|
||||
|
||||
var tags_to_div =
|
||||
{
|
||||
'b' : 'do_bold',
|
||||
'i' : 'do_italic',
|
||||
's' : 'do_strikethrough',
|
||||
'u' : 'do_underline',
|
||||
'quote' : 'do_quote',
|
||||
'left' : 'do_justifyleft',
|
||||
'center' : 'do_justifycenter',
|
||||
'right' : 'do_justifyright',
|
||||
'color' : 'forecolor',
|
||||
'background' : 'hilitecolor',
|
||||
'indent' : 'do_indent',
|
||||
'code' : 'do_code'
|
||||
};
|
||||
|
||||
var rte_to_std =
|
||||
{
|
||||
'forecolor' : 'color',
|
||||
'hilitecolor' : 'background'
|
||||
};
|
||||
|
||||
var easymode = 0;
|
||||
|
||||
// IE bug fix
|
||||
var ie_range_cache = '';
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function init_std_editor()
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Pull in width of textarea
|
||||
//--------------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
rtewindow = document.getElementById( 'postcontent' );
|
||||
oldwidth = parseInt(document.getElementById( 'postcontent' ).style.width);
|
||||
buttonbar = document.getElementById( 'std-table-buttons' );
|
||||
widthunit = document.getElementById( 'postcontent' ).style.width.match( /%/ ) ? '%' : 'px';
|
||||
|
||||
if ( widthunit == 'px' )
|
||||
{
|
||||
if ( is_opera )
|
||||
{
|
||||
document.getElementById( 'postcontent' ).style.width = oldwidth - 4 + widthunit;
|
||||
buttonbar.style.width = parseInt( buttonbar.style.width ) - 4 + widthunit;
|
||||
}
|
||||
else if ( is_safari )
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( 'postcontent' ).style.width = oldwidth - 6 + widthunit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_ie || is_moz )
|
||||
{
|
||||
document.getElementById( 'postcontent' ).style.width = oldwidth - 1 + widthunit;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{}
|
||||
|
||||
cvalue = my_getcookie( "bbmode" );
|
||||
|
||||
if ( cvalue == 1 )
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_on;
|
||||
easymode = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_off;
|
||||
easymode = 0;
|
||||
}
|
||||
|
||||
|
||||
faceobj = document.getElementById('fontface');
|
||||
faceregex = /\<\!--FONTFACE--\>/gi;
|
||||
facecontent = faceobj.innerHTML.replace( faceregex, write_fontface_box() );
|
||||
faceobj.innerHTML = facecontent;
|
||||
|
||||
sizeobj = document.getElementById('fontsize');
|
||||
sizeregex = /\<\!--FONTSIZE--\>/gi;
|
||||
sizecontent = sizeobj.innerHTML.replace( sizeregex, write_fontsize_box() );
|
||||
sizeobj.innerHTML = sizecontent;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Toggle button highlighting (used when clicked on)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function toggle_button( tag )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
// Ensure we're not looking for FONT, SIZE or COLOR as these
|
||||
// buttons don't exist, they are select lists instead.
|
||||
//--------------------------------------------
|
||||
|
||||
if ( (tag == 'font') || (tag == 'size') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( opentags[ tag ] )
|
||||
{
|
||||
document.getElementById( tags_to_div[ tag ] ).className = 'rteimage';
|
||||
|
||||
// Turn off
|
||||
opentags[ tag ] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( tags_to_div[ tag ] ).className = 'rteImageRaised';
|
||||
|
||||
// Turn on
|
||||
opentags[ tag ] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Set BBCode mode
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function toggle_bbmode(mVal)
|
||||
{
|
||||
if ( easymode )
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_off;
|
||||
easymode = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_on;
|
||||
easymode = 1;
|
||||
}
|
||||
|
||||
my_setcookie( 'bbmode', easymode, 1 );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get easy mode state
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function get_easy_mode_state()
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Returns true if we've chosen easy mode
|
||||
//--------------------------------------------
|
||||
|
||||
if ( easymode )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Pop open and set up the color palette
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function popcolor( command )
|
||||
{
|
||||
//-------------------------------
|
||||
// Already open?
|
||||
//-------------------------------
|
||||
|
||||
if ( opentags[ rte_to_std[ command ] ] )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Smart close tags
|
||||
//--------------------------------------------
|
||||
|
||||
smart_close_tags( rte_to_std[ command ] );
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//-------------------------------
|
||||
// Save current values
|
||||
//-------------------------------
|
||||
|
||||
parent.command = command;
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
postfieldobj.focus();
|
||||
ie_range_cache = document.selection.createRange();
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Position and show color palette
|
||||
//-------------------------------
|
||||
|
||||
buttonElement = document.getElementById(command);
|
||||
|
||||
var iLeftPos = getOffsetLeft(buttonElement);
|
||||
var iTopPos = getOffsetTop(buttonElement) + (buttonElement.offsetHeight + 30);
|
||||
|
||||
document.getElementById('cp').style.left = (iLeftPos) + "px";
|
||||
document.getElementById('cp').style.top = (iTopPos) + "px";
|
||||
|
||||
if (document.getElementById('cp').style.visibility == "hidden")
|
||||
{
|
||||
document.getElementById('cp').style.visibility = "visible";
|
||||
document.getElementById('cp').style.display = "inline";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('cp').style.visibility = "hidden";
|
||||
document.getElementById('cp').style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Write the color
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function setColor(color)
|
||||
{
|
||||
var parentCommand = parent.command;
|
||||
|
||||
if ( parentCommand == "hilitecolor" )
|
||||
{
|
||||
if ( wrap_tags("[background=" +color+ "]", "[/background]", true ) )
|
||||
{
|
||||
toggle_button( "background" );
|
||||
pushstack(bbtags, "background");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( wrap_tags("[color=" +color+ "]", "[/color]", true ) )
|
||||
{
|
||||
toggle_button( "color" );
|
||||
pushstack(bbtags, "color");
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('cp').style.visibility = "hidden";
|
||||
document.getElementById('cp').style.display = "none";
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EMOTICONS
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function emoticon(theSmilie)
|
||||
{
|
||||
doInsert(" " + theSmilie + " ", "", false);
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win && emowindow != '' && emowindow != 'undefined' )
|
||||
{
|
||||
emowindow.focus();
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ALTER FONT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function alterfont(theval, thetag)
|
||||
{
|
||||
if (theval == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( wrap_tags("[" + thetag + "=" + theval + "]", "[/" + thetag + "]", true ) )
|
||||
{
|
||||
pushstack(bbtags, thetag);
|
||||
}
|
||||
|
||||
postformobj.ffont.selectedIndex = 0;
|
||||
postformobj.fsize.selectedIndex = 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// SIMPLE TAGS (such as B, I S U, etc)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function simpletag(thetag)
|
||||
{
|
||||
var tagOpen = opentags[ thetag ];
|
||||
|
||||
if ( get_easy_mode_state() )
|
||||
{
|
||||
inserttext = prompt(prompt_start + "\n[" + thetag + "]xxx[/" + thetag + "]");
|
||||
|
||||
if ( (inserttext != null) && (inserttext != "") )
|
||||
{
|
||||
wrap_tags("[" + thetag + "]" + inserttext + "[/" + thetag + "] ", "", false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( tagOpen == 0 )
|
||||
{
|
||||
if ( wrap_tags("[" + thetag + "]", "[/" + thetag + "]", true ) )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Toggle
|
||||
//--------------------------------------------
|
||||
|
||||
toggle_button( thetag );
|
||||
|
||||
pushstack(bbtags, thetag);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Smart close tags
|
||||
//--------------------------------------------
|
||||
|
||||
smart_close_tags( thetag );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// List tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_list( type )
|
||||
{
|
||||
var listvalue = "init";
|
||||
var thelist = "";
|
||||
|
||||
opentag = ( type == 'ordered' ) ? '[list=1]' : '[list]';
|
||||
|
||||
while ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
listvalue = prompt(list_prompt, "");
|
||||
|
||||
if ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
thelist = thelist+"[*]"+listvalue+"\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ( thelist != "" )
|
||||
{
|
||||
wrap_tags( opentag + "\n" + thelist + "[/list]\n", "");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// URL tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_url()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
|
||||
//----------------------------------------
|
||||
// Do we have ranged text?
|
||||
//----------------------------------------
|
||||
|
||||
if ( check_range() )
|
||||
{
|
||||
//----------------------------------------
|
||||
// Yes, just ask for the URL and wrap
|
||||
//----------------------------------------
|
||||
|
||||
var enterURL = prompt(text_enter_url, "http://");
|
||||
|
||||
if ( ! enterURL)
|
||||
{
|
||||
alert(error_no_url);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags( "[url="+enterURL+"]", "[/url]", "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
var enterURL = prompt(text_enter_url, "http://");
|
||||
var enterTITLE = prompt(text_enter_url_name, jsfile_myweb_lang );
|
||||
|
||||
if ( ! enterURL)
|
||||
{
|
||||
FoundErrors += " " + error_no_url;
|
||||
}
|
||||
if ( ! enterTITLE)
|
||||
{
|
||||
FoundErrors += " " + error_no_title;
|
||||
}
|
||||
|
||||
if ( FoundErrors )
|
||||
{
|
||||
alert( jsfile_error_lang +FoundErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags("[url="+enterURL+"]"+enterTITLE+"[/url]", "");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Image tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_image()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
|
||||
//----------------------------------------
|
||||
// Do we have ranged text?
|
||||
//----------------------------------------
|
||||
|
||||
if ( check_range() )
|
||||
{
|
||||
//----------------------------------------
|
||||
// Yes, just wrap text
|
||||
//----------------------------------------
|
||||
|
||||
wrap_tags( "[img]", "[/img]", "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
var enterURL = prompt(text_enter_image, "http://");
|
||||
|
||||
if ( ! enterURL )
|
||||
{
|
||||
alert(error_no_url);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags("[img]"+enterURL+"[/img]", "");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Email tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_email()
|
||||
{
|
||||
//----------------------------------------
|
||||
// Do we have ranged text?
|
||||
//----------------------------------------
|
||||
|
||||
if ( check_range() )
|
||||
{
|
||||
//----------------------------------------
|
||||
// Yes, just wrap text
|
||||
//----------------------------------------
|
||||
|
||||
wrap_tags( "[email]", "[/email]", "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
var emailAddress = prompt(text_enter_email, "");
|
||||
|
||||
if ( ! emailAddress )
|
||||
{
|
||||
alert(error_no_email);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags( "[email]"+emailAddress+"[/email]", "" );
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do we have ranged text?
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_range()
|
||||
{
|
||||
var has_range = false;
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win )
|
||||
{
|
||||
var sel = document.selection;
|
||||
var rng = sel.createRange();
|
||||
rng.colapse;
|
||||
|
||||
if ( (sel.type == "Text" || sel.type == "None") && rng != null )
|
||||
{
|
||||
if ( rng.text.length > 0)
|
||||
{
|
||||
has_range = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( postfieldobj.selectionEnd )
|
||||
{
|
||||
var ss = postfieldobj.selectionStart;
|
||||
var st = postfieldobj.scrollTop;
|
||||
var es = postfieldobj.selectionEnd;
|
||||
|
||||
if (es <= 2)
|
||||
{
|
||||
es = postfieldobj.textLength;
|
||||
}
|
||||
|
||||
var start = (postfieldobj.value).substring(0, ss);
|
||||
var middle = (postfieldobj.value).substring(ss, es);
|
||||
var end = (postfieldobj.value).substring(es, postfieldobj.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if (postfieldobj.selectionEnd - postfieldobj.selectionStart > 0)
|
||||
{
|
||||
has_range = true;
|
||||
}
|
||||
}
|
||||
|
||||
return has_range;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check message length
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_length()
|
||||
{
|
||||
MessageLength = postfieldobj.value.length;
|
||||
message = "";
|
||||
|
||||
if (MessageMax > 0)
|
||||
{
|
||||
message = js_post + ": " + js_max_length + " " + MessageMax + " " + js_characters +".";
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "";
|
||||
}
|
||||
|
||||
alert(message + " " + js_used + " " + MessageLength + " " + js_characters + ".");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// GENERAL INSERT FUNCTION
|
||||
// opentext : opening tag
|
||||
// closetext: closing tag, used if we have selected text
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function wrap_tags(opentext, closetext, issingle)
|
||||
{
|
||||
var has_closed = false;
|
||||
|
||||
if ( ! issingle )
|
||||
{
|
||||
issingle = false;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win )
|
||||
{
|
||||
if ( postfieldobj.isTextEdit )
|
||||
{
|
||||
postfieldobj.focus();
|
||||
|
||||
var sel = document.selection;
|
||||
|
||||
var rng = ie_range_cache ? ie_range_cache : sel.createRange();
|
||||
|
||||
var stored_range = rng.duplicate()
|
||||
stored_range.moveToElementText( postfieldobj );
|
||||
stored_range.setEndPoint( 'EndToEnd', rng );
|
||||
|
||||
// Stores start position of text selection
|
||||
postfieldobj.selectionStart = stored_range.text.length - rng.text.length;
|
||||
// Stores end position of text selection
|
||||
postfieldobj.selectionEnd = postfieldobj.selectionStart + rng.text.length;
|
||||
|
||||
rng.colapse;
|
||||
|
||||
if ( (sel.type == "Text" || sel.type == "None") && rng != null)
|
||||
{
|
||||
if (closetext != "" && rng.text && rng.text.length > 0)
|
||||
{
|
||||
opentext += rng.text + closetext;
|
||||
}
|
||||
else if ( issingle )
|
||||
{
|
||||
has_closed = true;
|
||||
}
|
||||
|
||||
rng.text = rng.text.charAt(rng.text.length - 1) == ' ' ? opentext + ' ' : opentext;
|
||||
}
|
||||
else
|
||||
{
|
||||
postfieldobj.value += opentext;
|
||||
has_closed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
postfieldobj.value += opentext;
|
||||
has_closed = true;
|
||||
}
|
||||
|
||||
ie_range_cache = null;
|
||||
|
||||
rng.select();
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( postfieldobj.selectionEnd )
|
||||
{
|
||||
var ss = postfieldobj.selectionStart;
|
||||
var st = postfieldobj.scrollTop;
|
||||
var es = postfieldobj.selectionEnd;
|
||||
|
||||
if (es <= 0)
|
||||
{
|
||||
es = postfieldobj.textLength;
|
||||
}
|
||||
|
||||
var start = (postfieldobj.value).substring(0, ss);
|
||||
var middle = (postfieldobj.value).substring(ss, es);
|
||||
var end = (postfieldobj.value).substring(es, postfieldobj.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if ( postfieldobj.selectionEnd - postfieldobj.selectionStart > 0 )
|
||||
{
|
||||
middle = opentext + middle + closetext;
|
||||
}
|
||||
else
|
||||
{
|
||||
middle = opentext + middle;
|
||||
|
||||
if ( issingle )
|
||||
{
|
||||
has_closed = true;
|
||||
}
|
||||
}
|
||||
|
||||
postfieldobj.value = start + middle + end;
|
||||
|
||||
var cpos = ss + (middle.length);
|
||||
|
||||
postfieldobj.selectionStart = cpos;
|
||||
postfieldobj.selectionEnd = cpos;
|
||||
postfieldobj.scrollTop = st;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's CRAPPY!
|
||||
//----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
if ( issingle )
|
||||
{
|
||||
has_closed = false;
|
||||
}
|
||||
|
||||
postfieldobj.value += opentext + ' ' + closetext;
|
||||
}
|
||||
|
||||
postfieldobj.focus();
|
||||
|
||||
return has_closed;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Make current STD window (n)px bigger
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function std_window_resize( pix )
|
||||
{
|
||||
var box = postfieldobj;
|
||||
var cur_height = parseInt( box.style.height ) ? parseInt( box.style.height ) : 300;
|
||||
var new_height = cur_height + pix;
|
||||
|
||||
if ( new_height > 0 )
|
||||
{
|
||||
box.style.height = new_height + "px";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Validate form (must always have this method defined!)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ValidateForm( isMsg )
|
||||
{
|
||||
MessageLength = postfieldobj.value.length;
|
||||
errors = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// Check for remove attachments
|
||||
//-----------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
if ( postformobj.removeattachid.value > 0 )
|
||||
{
|
||||
okdelete = confirm( js_remove_attach );
|
||||
|
||||
if ( okdelete == true )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
postformobj.removeattachid.value = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
if ( isMsg == 1)
|
||||
{
|
||||
if ( postformobj.msg_title.value.length < 2 )
|
||||
{
|
||||
errors = js_msg_no_title;
|
||||
}
|
||||
}
|
||||
|
||||
if ( MessageLength < 2 )
|
||||
{
|
||||
errors = js_no_message;
|
||||
}
|
||||
|
||||
if ( MessageMax !=0 )
|
||||
{
|
||||
if (MessageLength > MessageMax)
|
||||
{
|
||||
errors = js_max_length + " " + MessageMax + " " + js_characters + ". " + js_current + ": " + MessageLength;
|
||||
}
|
||||
}
|
||||
|
||||
if ( errors != "" && ! Override )
|
||||
{
|
||||
alert(errors);
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
postformobj.submit.disabled = true;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
try
|
||||
{
|
||||
postformobj.dosubmit.disabled = true;
|
||||
}
|
||||
catch(e) { }
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function doInsert(ibTag, ibClsTag, isSingle)
|
||||
{
|
||||
var isClose = false;
|
||||
var obj_ta = fombj.Post;
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
if ( (ua_vers >= 4) && is_ie && is_win)
|
||||
{
|
||||
if (obj_ta.isTextEdit)
|
||||
{
|
||||
obj_ta.focus();
|
||||
var sel = document.selection;
|
||||
var rng = sel.createRange();
|
||||
rng.colapse;
|
||||
if((sel.type == "Text" || sel.type == "None") && rng != null)
|
||||
{
|
||||
if(ibClsTag != "" && rng.text.length > 0)
|
||||
ibTag += rng.text + ibClsTag;
|
||||
else if(isSingle)
|
||||
isClose = true;
|
||||
|
||||
rng.text = ibTag;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( obj_ta.selectionEnd )
|
||||
{
|
||||
var ss = obj_ta.selectionStart;
|
||||
var st = obj_ta.scrollTop;
|
||||
var es = obj_ta.selectionEnd;
|
||||
|
||||
if (es <= 2)
|
||||
{
|
||||
es = obj_ta.textLength;
|
||||
}
|
||||
|
||||
var start = (obj_ta.value).substring(0, ss);
|
||||
var middle = (obj_ta.value).substring(ss, es);
|
||||
var end = (obj_ta.value).substring(es, obj_ta.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
|
||||
{
|
||||
middle = ibTag + middle + ibClsTag;
|
||||
}
|
||||
else
|
||||
{
|
||||
middle = ibTag + middle;
|
||||
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
}
|
||||
|
||||
obj_ta.value = start + middle + end;
|
||||
|
||||
var cpos = ss + (middle.length);
|
||||
|
||||
obj_ta.selectionStart = cpos;
|
||||
obj_ta.selectionEnd = cpos;
|
||||
obj_ta.scrollTop = st;
|
||||
|
||||
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's CRAPPY!
|
||||
//----------------------------------------
|
||||
else
|
||||
{
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
|
||||
obj_ta.focus();
|
||||
|
||||
return isClose;
|
||||
}
|
||||
var bbtags = new Array();
|
||||
|
||||
var fombj = document.REPLIER;
|
||||
|
||||
|
||||
|
||||
+1
-214
@@ -1,214 +1 @@
|
||||
/**************************************************
|
||||
* dom-drag.js
|
||||
* 09.25.2001
|
||||
* www.youngpup.net
|
||||
**************************************************
|
||||
* 10.28.2001 - fixed minor bug where events
|
||||
* sometimes fired off the handle, not the root.
|
||||
**************************************************
|
||||
* IPS CHANGES
|
||||
* 06.01.2005 - Added "cursorchange" to change
|
||||
* 07.18.2005 - Added cookie to store values
|
||||
* 07.18.2005 - Made it impossible to drag < 0 height (keeponscreen)
|
||||
* mouse cursor when over drag handle
|
||||
**************************************************/
|
||||
|
||||
|
||||
var Drag = {
|
||||
|
||||
obj : null,
|
||||
fx : null,
|
||||
fy : null,
|
||||
cookiename : null,
|
||||
keeponscreen: true,
|
||||
|
||||
init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
|
||||
{
|
||||
o.onmousedown = Drag.start;
|
||||
o.onmouseover = Drag.cursorchange;
|
||||
|
||||
o.hmode = bSwapHorzRef ? false : true ;
|
||||
o.vmode = bSwapVertRef ? false : true ;
|
||||
|
||||
o.root = oRoot && oRoot != null ? oRoot : o ;
|
||||
|
||||
if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px";
|
||||
if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px";
|
||||
if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px";
|
||||
if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
|
||||
|
||||
o.minX = typeof minX != 'undefined' ? minX : null;
|
||||
o.minY = typeof minY != 'undefined' ? minY : null;
|
||||
o.maxX = typeof maxX != 'undefined' ? maxX : null;
|
||||
o.maxY = typeof maxY != 'undefined' ? maxY : null;
|
||||
|
||||
o.xMapper = fXMapper ? fXMapper : null;
|
||||
o.yMapper = fYMapper ? fYMapper : null;
|
||||
|
||||
//----------------------------------
|
||||
// Figure width and height
|
||||
//----------------------------------
|
||||
|
||||
if ( Drag.keeponscreen )
|
||||
{
|
||||
Drag.my_width = 0;
|
||||
Drag.my_height = 0;
|
||||
|
||||
if ( typeof( window.innerWidth ) == 'number' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Non IE
|
||||
//----------------------------------
|
||||
|
||||
Drag.my_width = window.innerWidth;
|
||||
Drag.my_height = window.innerHeight;
|
||||
}
|
||||
else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// IE 6+
|
||||
//----------------------------------
|
||||
|
||||
Drag.my_width = document.documentElement.clientWidth;
|
||||
Drag.my_height = document.documentElement.clientHeight;
|
||||
}
|
||||
else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// Old IE
|
||||
//----------------------------------
|
||||
|
||||
Drag.my_width = document.body.clientWidth;
|
||||
Drag.my_height = document.body.clientHeight;
|
||||
}
|
||||
}
|
||||
|
||||
o.root.onDragStart = new Function();
|
||||
o.root.onDragEnd = new Function();
|
||||
o.root.onDrag = new Function();
|
||||
},
|
||||
|
||||
cursorchange : function(e)
|
||||
{
|
||||
var o = Drag.obj = this;
|
||||
o.style.cursor = 'move';
|
||||
},
|
||||
|
||||
start : function(e)
|
||||
{
|
||||
var o = Drag.obj = this;
|
||||
e = Drag.fixE(e);
|
||||
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
|
||||
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
|
||||
o.root.onDragStart(x, y);
|
||||
|
||||
o.lastMouseX = e.clientX;
|
||||
o.lastMouseY = e.clientY;
|
||||
|
||||
if (o.hmode) {
|
||||
if (o.minX != null) o.minMouseX = e.clientX - x + o.minX;
|
||||
if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX;
|
||||
} else {
|
||||
if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
|
||||
if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
|
||||
}
|
||||
|
||||
if (o.vmode) {
|
||||
if (o.minY != null) o.minMouseY = e.clientY - y + o.minY;
|
||||
if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY;
|
||||
} else {
|
||||
if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
|
||||
if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
|
||||
}
|
||||
|
||||
document.onmousemove = Drag.drag;
|
||||
document.onmouseup = Drag.end;
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
drag : function(e)
|
||||
{
|
||||
e = Drag.fixE(e);
|
||||
var o = Drag.obj;
|
||||
|
||||
var ey = e.clientY;
|
||||
var ex = e.clientX;
|
||||
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
|
||||
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
|
||||
var nx, ny;
|
||||
|
||||
if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
|
||||
if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
|
||||
if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
|
||||
if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
|
||||
|
||||
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
|
||||
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
|
||||
|
||||
if (o.xMapper) nx = o.xMapper(y)
|
||||
else if (o.yMapper) ny = o.yMapper(x)
|
||||
|
||||
//----------------------------------
|
||||
// Keep on screen?
|
||||
//----------------------------------
|
||||
|
||||
if ( Drag.keeponscreen )
|
||||
{
|
||||
ny = ny < 0 ? 0 : ny;
|
||||
nx = nx < 0 ? 0 : nx;
|
||||
|
||||
if ( Drag.my_width )
|
||||
{
|
||||
nx = nx > Drag.my_width - parseInt(o.root.style.width) ? Drag.my_width - parseInt(o.root.style.width) : nx;
|
||||
}
|
||||
}
|
||||
|
||||
Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
|
||||
Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
|
||||
Drag.obj.lastMouseX = ex;
|
||||
Drag.obj.lastMouseY = ey;
|
||||
|
||||
Drag.obj.root.onDrag(nx, ny);
|
||||
return false;
|
||||
},
|
||||
|
||||
end : function()
|
||||
{
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),
|
||||
parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
|
||||
|
||||
var o = Drag.obj;
|
||||
|
||||
fy = parseInt( o.root.style.top );
|
||||
fx = parseInt( o.root.style.left );
|
||||
|
||||
//----------------------------------
|
||||
// Store in a cookie?
|
||||
//----------------------------------
|
||||
|
||||
if ( Drag.cookiename )
|
||||
{
|
||||
try
|
||||
{
|
||||
my_setcookie( Drag.cookiename, fx+','+fy, 1 );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Drag.obj = null;
|
||||
|
||||
},
|
||||
|
||||
fixE : function(e)
|
||||
{
|
||||
if (typeof e == 'undefined') e = window.event;
|
||||
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
|
||||
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
|
||||
return e;
|
||||
}
|
||||
};
|
||||
var Drag={obj:null,fx:null,fy:null,cookiename:null,keeponscreen:true,init:function(o,oRoot,minX,maxX,minY,maxY,bSwapHorzRef,bSwapVertRef,fXMapper,fYMapper){o.onmousedown=Drag.start;o.onmouseover=Drag.cursorchange;o.hmode=bSwapHorzRef?false:true;o.vmode=bSwapVertRef?false:true;o.root=oRoot&&oRoot!=null?oRoot:o;if(o.hmode&&isNaN(parseInt(o.root.style.left)))o.root.style.left="0px";if(o.vmode&&isNaN(parseInt(o.root.style.top)))o.root.style.top="0px";if(!o.hmode&&isNaN(parseInt(o.root.style.right)))o.root.style.right="0px";if(!o.vmode&&isNaN(parseInt(o.root.style.bottom)))o.root.style.bottom="0px";o.minX=typeof minX!='undefined'?minX:null;o.minY=typeof minY!='undefined'?minY:null;o.maxX=typeof maxX!='undefined'?maxX:null;o.maxY=typeof maxY!='undefined'?maxY:null;o.xMapper=fXMapper?fXMapper:null;o.yMapper=fYMapper?fYMapper:null;if(Drag.keeponscreen){Drag.my_width=0;Drag.my_height=0;if(typeof(window.innerWidth)=='number'){Drag.my_width=window.innerWidth;Drag.my_height=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){Drag.my_width=document.documentElement.clientWidth;Drag.my_height=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){Drag.my_width=document.body.clientWidth;Drag.my_height=document.body.clientHeight;}}o.root.onDragStart=new Function();o.root.onDragEnd=new Function();o.root.onDrag=new Function();},cursorchange:function(e){var o=Drag.obj=this;o.style.cursor='move';},start:function(e){var o=Drag.obj=this;e=Drag.fixE(e);var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);o.root.onDragStart(x,y);o.lastMouseX=e.clientX;o.lastMouseY=e.clientY;if(o.hmode){if(o.minX!=null)o.minMouseX=e.clientX-x+o.minX;if(o.maxX!=null)o.maxMouseX=o.minMouseX+o.maxX-o.minX;}else{if(o.minX!=null)o.maxMouseX=-o.minX+e.clientX+x;if(o.maxX!=null)o.minMouseX=-o.maxX+e.clientX+x;}if(o.vmode){if(o.minY!=null)o.minMouseY=e.clientY-y+o.minY;if(o.maxY!=null)o.maxMouseY=o.minMouseY+o.maxY-o.minY;}else{if(o.minY!=null)o.maxMouseY=-o.minY+e.clientY+y;if(o.maxY!=null)o.minMouseY=-o.maxY+e.clientY+y;}document.onmousemove=Drag.drag;document.onmouseup=Drag.end;return false;},drag:function(e){e=Drag.fixE(e);var o=Drag.obj;var ey=e.clientY;var ex=e.clientX;var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);var nx,ny;if(o.minX!=null)ex=o.hmode?Math.max(ex,o.minMouseX):Math.min(ex,o.maxMouseX);if(o.maxX!=null)ex=o.hmode?Math.min(ex,o.maxMouseX):Math.max(ex,o.minMouseX);if(o.minY!=null)ey=o.vmode?Math.max(ey,o.minMouseY):Math.min(ey,o.maxMouseY);if(o.maxY!=null)ey=o.vmode?Math.min(ey,o.maxMouseY):Math.max(ey,o.minMouseY);nx=x+((ex-o.lastMouseX)*(o.hmode?1:-1));ny=y+((ey-o.lastMouseY)*(o.vmode?1:-1));if(o.xMapper)nx=o.xMapper(y);else if(o.yMapper)ny=o.yMapper(x);if(Drag.keeponscreen){ny=ny<0?0:ny;nx=nx<0?0:nx;if(Drag.my_width){nx=nx>Drag.my_width-parseInt(o.root.style.width)?Drag.my_width-parseInt(o.root.style.width):nx;}}Drag.obj.root.style[o.hmode?"left":"right"]=nx+"px";Drag.obj.root.style[o.vmode?"top":"bottom"]=ny+"px";Drag.obj.lastMouseX=ex;Drag.obj.lastMouseY=ey;Drag.obj.root.onDrag(nx,ny);return false;},end:function(){document.onmousemove=null;document.onmouseup=null;Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode?"left":"right"]),parseInt(Drag.obj.root.style[Drag.obj.vmode?"top":"bottom"]));var o=Drag.obj;fy=parseInt(o.root.style.top);fx=parseInt(o.root.style.left);if(Drag.cookiename){try{ipsclass.my_setcookie(Drag.cookiename,fx+','+fy,1);}catch(e){}}Drag.obj=null;},addEvent:function(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent('on'+evType,fn);return r;}else{elm['on'+evType]=fn;}},fixE:function(e){if(typeof e=='undefined')e=window.event;if(typeof e.layerX=='undefined')e.layerX=e.offsetX;if(typeof e.layerY=='undefined')e.layerY=e.offsetY;return e;}};
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,237 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Custom BBCode</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim($_REQUEST['editorid']).'";'; ?>
|
||||
var bbcode_id = <?php print '"'.trim($_REQUEST['id']).'";'; ?>
|
||||
var this_module = 'bbcodeloader';
|
||||
var this_height = 400;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
var bbcode = parent.ips_bbcode_items[ bbcode_id ];
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.ipsclass.un_htmlspecialchars( parent.IPS_editor[ editor_id ].get_selection() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_content_text").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_content_text").value = current_selection;
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in data
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("_title").innerHTML += ' ' + bbcode['title'];
|
||||
document.getElementById("_example").innerHTML += ' ' + bbcode['example'];
|
||||
document.getElementById("_option").innerHTML += ' ' + bbcode['text_option'];
|
||||
document.getElementById("_content").innerHTML += ' ' + bbcode['text_content'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Using option?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( parseInt( bbcode['use_option'] ) == 1 )
|
||||
{
|
||||
document.getElementById( 'use-option' ).style.display = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_content_text").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_option_text", "f_content_text" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_option_text" : "You must enter option text",
|
||||
"f_content_text": "You must enter content text"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( i == 'f_option_text' )
|
||||
{
|
||||
if ( parseInt( bbcode['use_option'] ) != 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert( required[i] );
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var _html = '';
|
||||
var _content = document.getElementById( 'f_content_text' ).value;
|
||||
var _option = document.getElementById( 'f_option_text' ).value;
|
||||
|
||||
if ( parseInt( bbcode['use_option'] ) == 1 )
|
||||
{
|
||||
if ( parseInt( bbcode['switch_option'] ) == 1 )
|
||||
{
|
||||
_html = '[' + bbcode['tag'] + '="' + _content + '"]' + _option + '[/' + bbcode['tag'] + ']';
|
||||
}
|
||||
else
|
||||
{
|
||||
_html = '[' + bbcode['tag'] + '="' + _option + '"]' + _content + '[/' + bbcode['tag'] + ']';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_html = '[' + bbcode['tag'] + ']' + _content + '[/' + bbcode['tag'] + ']';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( _html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title" id="_title">Insert</div>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Example</strong></legend>
|
||||
<div id="_example" style='font-family:"Courier New", Monaco, Courier;font-size:12px'></div>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<div id='use-option' style='display:none'>
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Option Text</strong></legend>
|
||||
<div id='_option' style='padding:2px;color:#555;'></div>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="text" id="f_option_text" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Content Text</trong></legend>
|
||||
<div id='_content' style='padding:2px;color:#555;'></div>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="href" id="f_content_text" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,264 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim($_REQUEST['editorid']).'";'; ?>
|
||||
var this_module = 'div';
|
||||
var this_height = 400;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_type").focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_type" , "f_fontfamily" , "f_fontsize", "f_color" , "f_backgroundimage", "f_backgroundrepeat",
|
||||
"f_backgroundcolor", "f_border" , "f_padding", "f_margin" , "f_other" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var doc = parent.IPS_editor[ editor_id ].editor_document;
|
||||
|
||||
//-------------------------------
|
||||
// Build remap array
|
||||
//-------------------------------
|
||||
|
||||
var remap_elements = {
|
||||
"f_fontfamily" : "font-family" ,
|
||||
"f_fontsize" : "font-size" ,
|
||||
"f_color" : "color" ,
|
||||
"f_backgroundimage" : "background-image" ,
|
||||
"f_backgroundrepeat" : "background-repeat",
|
||||
"f_backgroundcolor" : "background-color" ,
|
||||
"f_border" : "border" ,
|
||||
"f_padding" : "padding" ,
|
||||
"f_margin" : "margin"
|
||||
};
|
||||
|
||||
//-------------------------------
|
||||
// Get tag type
|
||||
//-------------------------------
|
||||
|
||||
var tagtype = param["f_type"];
|
||||
var style = "";
|
||||
|
||||
//-------------------------------
|
||||
// Start building style
|
||||
//-------------------------------
|
||||
|
||||
style += "style='";
|
||||
|
||||
for (var field in param)
|
||||
{
|
||||
var value = param[field];
|
||||
|
||||
if ( ! value || value == 'undefined' || field == 'undefined' || ! remap_elements[ field ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( remap_elements[ field ] && value )
|
||||
{
|
||||
style += remap_elements[ field ] + ":" + value + ";";
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Finish style
|
||||
//-------------------------------
|
||||
|
||||
style += param["f_other"]+"'";
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
if ( style )
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].wrap_tags_lite( '<' + tagtype + ' ' + style + '>', '</' + tagtype + '>' );
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].wrap_tags_lite( '<' + tagtype + '>', '</' + tagtype + '>' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert DIV/SPAN</div>
|
||||
|
||||
<form action="" method="get">
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="1%" nowrap="nowrap">Type:</td>
|
||||
<td width="99%"><select size="1" name="type" id="f_type" title="Div or Span?">
|
||||
<option value="div" selected="1" >DIV</option>
|
||||
<option value="span" >SPAN</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Font</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Family:</td>
|
||||
<td><input type="text" name="fontfamily" id="f_fontfamily" size="20" value="Verdana" title="Enter name of font-family" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Size:</td>
|
||||
<td><input type="text" name="fontsize" id="f_fontsize" size="7" value="10px" title="Enter size and unit" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Color:</td>
|
||||
<td><input type="text" name="color" id="f_color" size="7" value="#000" title="Enter color" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Background</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Image:</td>
|
||||
<td><input type="text" name="backgroundimage" id="f_backgroundimage" size="15" value="" title="Leave blank for no image" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Repeat:</td>
|
||||
<td><input type="text" name="backgroundrepeat" id="f_backgroundrepeat" size="15" value="" title="Leave blank for no repeat" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Color:</td>
|
||||
<td><input type="text" name="backgroundcolor" id="f_backgroundcolor" size="7" value="" title="Leave blank for no color" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Box Model</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Border:</td>
|
||||
<td><input type="text" name="border" id="f_border" size="20" value="" title="Enter border values" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Padding:</td>
|
||||
<td><input type="text" name="padding" id="f_padding" size="20" value="4px" title="Enter size and unit" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Margin:</td>
|
||||
<td><input type="text" name="margin" id="f_margin" size="20" value="" title="Enter size and unit" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Custom Elements</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="other" id="f_other" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,208 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim($_REQUEST['editorid']).'";'; ?>
|
||||
var this_module = 'email';
|
||||
var this_height = 300;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.IPS_editor[ editor_id ].get_selection();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_email").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
var link_regex = '';
|
||||
var link_text = '';
|
||||
var link_href = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_regex = new RegExp( "\[email=([^\]]+?)\]([^\[]+?)\[/email\]", "i" );
|
||||
}
|
||||
else
|
||||
{
|
||||
link_regex = new RegExp( "<a href=['\"]mailto\:([^\"']+?)['\"]([^>]+?)?>(.+?)</a>", "i" );
|
||||
}
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_href = current_selection.replace( link_regex, "$1" );
|
||||
link_text = current_selection.replace( link_regex, "$3" );
|
||||
}
|
||||
|
||||
if ( link_text )
|
||||
{
|
||||
current_selection = link_text;
|
||||
}
|
||||
|
||||
if ( link_href )
|
||||
{
|
||||
document.getElementById("f_email").value = link_href;
|
||||
}
|
||||
|
||||
document.getElementById("f_text").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_email", "f_text" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_email": "You must enter an email address",
|
||||
"f_text": "You must enter some text for the email body"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var link_html = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_html = '[email=' + param['f_email'] + ']' + param['f_text'] + '[/email]';
|
||||
}
|
||||
else
|
||||
{
|
||||
link_html = '<a href="mailto:' + param['f_email'] + '">' + param['f_text'] + '</a>';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( link_html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Email</div>
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Email Address</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="email" id="f_email" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'>user@domain.com</textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Email Text</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="text" id="f_text" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,231 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim($_REQUEST['editorid']).'";'; ?>
|
||||
var this_module = 'image';
|
||||
var this_height = 400;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.IPS_editor[ editor_id ].get_selection();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_src").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Show advanced options?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( allow_advanced )
|
||||
{
|
||||
document.getElementById("advanced-options").style.display = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
var link_regex = '';
|
||||
var link_src = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_regex = new RegExp( "\[img\]([^\[]+?)\[/img\]", "i" );
|
||||
}
|
||||
else
|
||||
{
|
||||
link_regex = new RegExp( "<img src=['\"]([^\"']+?)['\"]([^>]+?)?/>", "i" );
|
||||
}
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_src = current_selection.replace( link_regex, "$1" );
|
||||
}
|
||||
|
||||
if ( link_src )
|
||||
{
|
||||
current_selection = link_src;
|
||||
}
|
||||
|
||||
document.getElementById("f_src").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_src", "f_ad_title", "f_ad_alt" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_src": "You must enter an image location"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var link_title = allow_advanced && param['f_ad_title'] != '' ? ' title="' + param['f_ad_title'] + '"' : '';
|
||||
var link_alt = allow_advanced && param['f_ad_alt'] != '' ? ' alt="' + param['f_ad_alt'] + '"' : '';
|
||||
var link_border = allow_advanced && param['f_ad_border'] != '' ? ' border="' + param['f_ad_border'] + '"' : '';
|
||||
var link_html = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_html = '[img]' + param['f_src'] + '[/img]';
|
||||
}
|
||||
else
|
||||
{
|
||||
link_html = '<img src="' + param['f_src'] + '"' + link_title + link_alt + link_border + ' />';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( link_html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Image</div>
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Image Location</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="src" id="f_src" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'>http://</textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<div id='advanced-options' style='display:none'>
|
||||
<br />
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Advanced Options</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Border:</td>
|
||||
<td><input type="text" name="border" id="f_ad_border" size="4" value="0" title="Image Border" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Title:</td>
|
||||
<td><input type="text" name="title" id="f_ad_title" size="20" value="" title="Image Title" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alt Text:</td>
|
||||
<td><input type="text" name="fontsize" id="f_ad_alt" size="20" value="" title="Image ALT" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,260 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim($_REQUEST['editorid']).'";'; ?>
|
||||
var this_module = 'link';
|
||||
var this_height = 400;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.ipsclass.un_htmlspecialchars( parent.IPS_editor[ editor_id ].get_selection() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_href").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_text").value = current_selection;
|
||||
|
||||
//-----------------------------------------
|
||||
// Show advanced options?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( allow_advanced )
|
||||
{
|
||||
document.getElementById("advanced-options").style.display = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
var link_regex = '';
|
||||
var link_text = '';
|
||||
var link_href = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_regex = /\[url=([^\]]+?)\]([^\[]+?)\[\/url\]/ig;
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_href = current_selection.replace( link_regex, "$1" );
|
||||
link_text = current_selection.replace( link_regex, "$2" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
link_regex = /<a href=['"]([^"']+?)['"]([^>]+?)?>(.+?)<\/a>/ig;
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_href = current_selection.replace( link_regex, "$1" );
|
||||
link_text = current_selection.replace( link_regex, "$3" );
|
||||
}
|
||||
}
|
||||
|
||||
if ( link_text )
|
||||
{
|
||||
current_selection = link_text;
|
||||
}
|
||||
|
||||
if ( link_href )
|
||||
{
|
||||
document.getElementById("f_href").value = link_href;
|
||||
}
|
||||
|
||||
current_selection = current_selection.replace( /<br \/>|<br>|\n|\r/g, "");
|
||||
|
||||
document.getElementById("f_text").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_href", "f_text", "f_ad_title", "f_ad_target" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_href": "You must enter a link location",
|
||||
"f_text": "You must enter some text for the link body"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var link_title = allow_advanced && param['f_ad_title'] ? ' title="' + param['f_ad_title'] + '" ' : '';
|
||||
var link_target = allow_advanced && param['f_ad_target'] ? ' target="' + param['f_ad_target'] + '"' : '';
|
||||
var link_html = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_html = '[url=' + param['f_href'] + ']' + param['f_text'] + '[/url]';
|
||||
}
|
||||
else
|
||||
{
|
||||
link_html = '<a href="' + param['f_href'] + '"' + link_title + link_target + '>' + param['f_text'] + '</a>';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( link_html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Link</div>
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Link Location</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="href" id="f_href" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'>http://</textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Link Text</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="text" id="f_text" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<div id='advanced-options' style='display:none'>
|
||||
<br />
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Advanced Options</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Title:</td>
|
||||
<td><input type="text" name="title" id="f_ad_title" size="20" value="" title="Link Title" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target:</td>
|
||||
<td><input type="text" name="fontsize" id="f_ad_target" size="20" value="" title="Link Target" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,299 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
|
||||
<meta HTTP-EQUIV="Expires" CONTENT="Mon, 06 May 1996 04:57:00 GMT">
|
||||
<title>Insert Table</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim($_REQUEST['editorid']).'";'; ?>
|
||||
var this_module = 'table';
|
||||
var this_height = 350;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_rows").focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Fail safe
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! editor_id )
|
||||
{
|
||||
alert("Could not locate the editor ID");
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_rows": "You must enter a number of rows",
|
||||
"f_cols": "You must enter a number of columns"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var fields = ["f_rows" , "f_cols" , "f_width" , "f_unit",
|
||||
"f_align", "f_border", "f_spacing", "f_padding"];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var doc = parent.IPS_editor[ editor_id ].editor_document;
|
||||
|
||||
//-----------------------------------------
|
||||
// create the table element inside a wrapper
|
||||
// div that we can use innerHTML on
|
||||
//-----------------------------------------
|
||||
|
||||
var wrap_div = document.createElement("DIV");
|
||||
var table = document.createElement("table");
|
||||
|
||||
wrap_div.appendChild( table );
|
||||
|
||||
//-----------------------------------------
|
||||
// assign the given arguments
|
||||
//-----------------------------------------
|
||||
|
||||
for (var field in param)
|
||||
{
|
||||
var value = param[field];
|
||||
|
||||
if ( ! value )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (field)
|
||||
{
|
||||
case "f_width" : table.style.width = value + param["f_unit"]; break;
|
||||
case "f_align" : table.align = value; break;
|
||||
case "f_border" : table.border = parseInt(value); break;
|
||||
case "f_spacing" : table.cellspacing = parseInt(value); break;
|
||||
case "f_padding" : table.cellpadding = parseInt(value); break;
|
||||
}
|
||||
}
|
||||
|
||||
var tbody = document.createElement("tbody");
|
||||
|
||||
table.appendChild(tbody);
|
||||
|
||||
for (var i = 0; i < param["f_rows"]; ++i)
|
||||
{
|
||||
var tr = document.createElement("tr");
|
||||
|
||||
tbody.appendChild(tr);
|
||||
|
||||
for (var j = 0; j < param["f_cols"]; ++j)
|
||||
{
|
||||
var td = document.createElement("td");
|
||||
|
||||
tr.appendChild(td);
|
||||
|
||||
//-------------------------------
|
||||
// Mozilla likes to see something
|
||||
// inside the cell.
|
||||
//-------------------------------
|
||||
|
||||
( ! parent.IPS_editor[ editor_id ].is_ie )
|
||||
{
|
||||
td.appendChild( document.createElement("br") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Clean up
|
||||
//-----------------------------------------
|
||||
|
||||
wrap_div.innerHTML = parent.IPS_editor[ editor_id ].clean_html( wrap_div.innerHTML );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( wrap_div.innerHTML );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill node
|
||||
//-----------------------------------------
|
||||
|
||||
//doc.removeChild( wrap_div );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Table</div>
|
||||
|
||||
<form action="" method="get">
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Basics</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Rows:</td>
|
||||
<td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cols:</td>
|
||||
<td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Width:</td>
|
||||
<td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" />
|
||||
<select size="1" name="unit" id="f_unit" title="Width unit">
|
||||
<option value="%" selected="1" >Percent</option>
|
||||
<option value="px" >Pixels</option>
|
||||
<option value="em" >Em</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Layout</legend>
|
||||
<table border="0" width='100%' >
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Alignment:</td>
|
||||
<td>
|
||||
<select size="1" name="align" id="f_align"
|
||||
title="Positioning of this image">
|
||||
<option value="" selected="1" >Not set</option>
|
||||
<option value="left" >Left</option>
|
||||
<option value="right" >Right</option>
|
||||
<option value="texttop" >Texttop</option>
|
||||
<option value="absmiddle" >Absmiddle</option>
|
||||
<option value="baseline" >Baseline</option>
|
||||
<option value="absbottom" >Absbottom</option>
|
||||
<option value="bottom" >Bottom</option>
|
||||
<option value="middle" >Middle</option>
|
||||
<option value="top" >Top</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Spacing</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Cell Spacing:</td>
|
||||
<td><input type="text" name="cols" id="f_spacing" size="5" title="Cell Spacing" value="0" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cell Padding:</td>
|
||||
<td><input type="text" name="cols" id="f_padding" size="5" title="Cell Padding" value="0" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Border thickness:</td>
|
||||
<td><input type="text" name="border" id="f_border" size="5" value="1" title="Leave empty for no border" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<hr />
|
||||
<div align='center'>
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,143 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS Cross-Browser Global Text Editor HTML
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports all "v5" browsers (inc. Opera, Safari, etc)
|
||||
// Used for non RTE applications.
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Rich Text Editor HTML Functions
|
||||
*/
|
||||
function rte_html_functions()
|
||||
{
|
||||
/**
|
||||
* Main control bar object
|
||||
* @var object Main control bar object
|
||||
*/
|
||||
this.control_obj = false;
|
||||
/**
|
||||
* Editor ID
|
||||
*/
|
||||
this.editor_id = false;
|
||||
/**
|
||||
* Current open bar object
|
||||
*/
|
||||
this.current_bar_object = null;
|
||||
|
||||
/**
|
||||
* Main init function
|
||||
* Nothing much to do
|
||||
*/
|
||||
this.init = function()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show new control bar
|
||||
*
|
||||
* @param type Type of control bar (must be same as function key)
|
||||
*/
|
||||
this.show_control_bar = function( type )
|
||||
{
|
||||
if ( ! this.control_obj )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already open? Kill it
|
||||
//-----------------------------------------
|
||||
|
||||
if ( this.current_bar_object )
|
||||
{
|
||||
this.remove_control_bar();
|
||||
}
|
||||
|
||||
var mainbar = document.getElementById( 'rte-main-bar');
|
||||
var addtobar = document.getElementById( 'rte-hidden-items' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Spawn new DIV object
|
||||
//-----------------------------------------
|
||||
|
||||
var newdiv = document.createElement('div');
|
||||
|
||||
newdiv.id = this.editor_id + '_htmlblock_' + type + '_menu';
|
||||
newdiv.style.display = '';
|
||||
newdiv.className = 'rte-buttonbar';
|
||||
newdiv.style.zIndex = parseInt( this.control_obj.style.zIndex ) + 1;
|
||||
newdiv.style.position = 'absolute';
|
||||
newdiv.style.width = '220px';
|
||||
newdiv.style.height = '400px';
|
||||
newdiv.style.top = ipsclass.get_obj_toppos( mainbar ) + 'px';
|
||||
newdiv.style.left = ipsclass.get_obj_leftpos( mainbar ) - ( parseInt(newdiv.style.width) + 10 ) + 'px';
|
||||
|
||||
var tmpheight = parseInt(newdiv.style.height) - 15;
|
||||
newdiv.innerHTML = this.wrap_html_panel( "<iframe id='"+ this.editor_id + '_iframeblock_' + type + '_menu' + "' src='"+global_rte_includes_url + "insert_" + type + ".php?editorid="+this.editor_id+"' style='background-color:transparent;border:0px;overflow:auto;width:99%;height:" + tmpheight + "px'></iframe>" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Add and show
|
||||
//-----------------------------------------
|
||||
|
||||
addtobar.appendChild(newdiv);
|
||||
|
||||
ipsclass.set_unselectable( newdiv );
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT Drag
|
||||
//-----------------------------------------
|
||||
|
||||
var phdl = document.getElementById('rte-pallete-handle');
|
||||
|
||||
Drag.init( phdl, newdiv );
|
||||
|
||||
this.current_bar_object = newdiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove control bar
|
||||
* Removes the control bar.
|
||||
*/
|
||||
this.remove_control_bar = function()
|
||||
{
|
||||
if ( ! this.current_bar_object )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var addtobar = document.getElementById( 'rte-hidden-items' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill old bar
|
||||
//-----------------------------------------
|
||||
|
||||
addtobar.removeChild( this.current_bar_object );
|
||||
|
||||
//-----------------------------------------
|
||||
// Reset bar object
|
||||
//-----------------------------------------
|
||||
|
||||
this.current_bar_object = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap HTML block with basic control panel stuff
|
||||
*/
|
||||
this.wrap_html_panel = function( html )
|
||||
{
|
||||
var newhtml = "";
|
||||
newhtml += " <div id='rte-pallete-wrap'>";
|
||||
newhtml += " <div id='rte-pallete-main'>";
|
||||
newhtml += " <div class='rte-cb-bg' id='rte-pallete-handle'>";
|
||||
newhtml += " <div align='left'><img id='rte-cb-close-window' src='"+global_rte_images_url+"rte-cb-close.gif' alt='' class='ipd' border='0' /></div>";
|
||||
newhtml += " </div>";
|
||||
newhtml += " <div>" + html + "</div>";
|
||||
newhtml += " </div>";
|
||||
newhtml += " </div>";
|
||||
|
||||
return newhtml;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
html, body
|
||||
{
|
||||
color: #000;
|
||||
font: 10px Verdana,sans-serif;
|
||||
background-color: transparent;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
body
|
||||
{
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
table
|
||||
{
|
||||
font: 10px Verdana,sans-serif;
|
||||
}
|
||||
|
||||
.tblbutton
|
||||
{
|
||||
border:1px solid #999;
|
||||
background-color: #CCC;
|
||||
font-family:Verdana, Arial;
|
||||
font-size:10px;
|
||||
font-weight:bold;
|
||||
padding:2px;
|
||||
}
|
||||
|
||||
form p
|
||||
{
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.fl
|
||||
{
|
||||
width: 9em; float: left; padding: 2px 5px; text-align: right;
|
||||
}
|
||||
|
||||
.fr
|
||||
{
|
||||
width: 7em; float: left; padding: 2px 5px; text-align: right;
|
||||
}
|
||||
|
||||
.frlarge
|
||||
{
|
||||
width: 10em; float: left; padding: 2px 5px; text-align: right;
|
||||
}
|
||||
|
||||
fieldset
|
||||
{
|
||||
padding: 0px 10px 5px 5px;
|
||||
}
|
||||
|
||||
select, input, button
|
||||
{
|
||||
font: 10px Verdana,sans-serif;
|
||||
}
|
||||
|
||||
button
|
||||
{
|
||||
width: 70px;
|
||||
}
|
||||
.space
|
||||
{
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.title
|
||||
{
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
font-size: 120%;
|
||||
padding: 3px 10px;
|
||||
margin-bottom: 10px;
|
||||
border-bottom: 1px solid black;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
form
|
||||
{
|
||||
padding: 0px; margin: 0px;
|
||||
}
|
||||
@@ -1,15 +1 @@
|
||||
<html>
|
||||
<head><title>Ошибка < Русская версия Invision Power Board</title></head>
|
||||
<body>
|
||||
<h1>Ошибка < Русская версия Invision Power Board</h1>
|
||||
<hr>
|
||||
Вы попали на несуществующую страницу!<br>Пожалуйста нажмите на кнопочку «<b>Назад</b>»
|
||||
в вашем браузере для возвращения на предыдущую страницу.
|
||||
<hr>
|
||||
<b>Invision Power Board:</b>
|
||||
<ul>
|
||||
<li><a href="http://www.bestwarez.ru" title="BestWarez.Ru - Только лучший Варез!">Русская версия</a></li>
|
||||
<li><a href="http://www.invisionboard.com" title="Official Site">English version</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
<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://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>␍
|
||||
@@ -1,443 +1 @@
|
||||
//--------------------------------------------
|
||||
// Set up our simple tag open values
|
||||
//--------------------------------------------
|
||||
|
||||
var B_open = 0;
|
||||
var I_open = 0;
|
||||
var U_open = 0;
|
||||
var QUOTE_open = 0;
|
||||
var CODE_open = 0;
|
||||
var SQL_open = 0;
|
||||
var HTML_open = 0;
|
||||
|
||||
var bbtags = new Array();
|
||||
|
||||
var fombj = document.REPLIER;
|
||||
|
||||
//==========================================
|
||||
// prep and set up
|
||||
//==========================================
|
||||
|
||||
prep_mode();
|
||||
|
||||
function prep_mode()
|
||||
{
|
||||
cvalue = my_getcookie( "bbmode" );
|
||||
|
||||
if (cvalue == 'ezmode')
|
||||
{
|
||||
fombj.bbmode[0].checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fombj.bbmode[1].checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Set BBCode mode
|
||||
//==========================================
|
||||
|
||||
function setmode(mVal)
|
||||
{
|
||||
my_setcookie( 'bbmode', mVal, 1 );
|
||||
}
|
||||
|
||||
|
||||
function get_easy_mode_state()
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Returns true if we've chosen easy mode
|
||||
//--------------------------------------------
|
||||
|
||||
if ( fombj.bbmode[0].checked )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Set the help bar status
|
||||
//==========================================
|
||||
|
||||
function hstat(msg)
|
||||
{
|
||||
fombj.helpbox.value = eval( "help_" + msg );
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Set the number of tags open box
|
||||
//==========================================
|
||||
|
||||
function cstat()
|
||||
{
|
||||
var c = stacksize(bbtags);
|
||||
|
||||
if ( (c < 1) || (c == null) ) {
|
||||
c = 0;
|
||||
}
|
||||
|
||||
if ( ! bbtags[0] ) {
|
||||
c = 0;
|
||||
}
|
||||
|
||||
fombj.tagcount.value = c;
|
||||
}
|
||||
|
||||
|
||||
//==========================================
|
||||
// Close all tags
|
||||
//==========================================
|
||||
|
||||
function closeall()
|
||||
{
|
||||
if (bbtags[0])
|
||||
{
|
||||
while (bbtags[0])
|
||||
{
|
||||
tagRemove = popstack(bbtags)
|
||||
fombj.Post.value += "[/" + tagRemove + "]";
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
// Ensure we're not looking for FONT, SIZE or COLOR as these
|
||||
// buttons don't exist, they are select lists instead.
|
||||
//--------------------------------------------
|
||||
|
||||
if ( (tagRemove != 'FONT') && (tagRemove != 'SIZE') && (tagRemove != 'COLOR') )
|
||||
{
|
||||
eval("fombj." + tagRemove + ".value = ' " + tagRemove + " '");
|
||||
eval(tagRemove + "_open = 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Ensure we got them all
|
||||
//--------------------------------------------
|
||||
|
||||
fombj.tagcount.value = 0;
|
||||
bbtags = new Array();
|
||||
fombj.Post.focus();
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// EMOTICONS
|
||||
//==========================================
|
||||
|
||||
function emoticon(theSmilie)
|
||||
{
|
||||
doInsert(" " + theSmilie + " ", "", false);
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// ADD CODE
|
||||
//==========================================
|
||||
|
||||
function add_code(NewCode)
|
||||
{
|
||||
fombj.Post.value += NewCode;
|
||||
fombj.Post.focus();
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// ALTER FONT
|
||||
//==========================================
|
||||
|
||||
function alterfont(theval, thetag)
|
||||
{
|
||||
if (theval == 0)
|
||||
return;
|
||||
|
||||
if(doInsert("[" + thetag + "=" + theval + "]", "[/" + thetag + "]", true))
|
||||
pushstack(bbtags, thetag);
|
||||
|
||||
fombj.ffont.selectedIndex = 0;
|
||||
fombj.fsize.selectedIndex = 0;
|
||||
fombj.fcolor.selectedIndex = 0;
|
||||
|
||||
cstat();
|
||||
|
||||
}
|
||||
|
||||
|
||||
//==========================================
|
||||
// SIMPLE TAGS (such as B, I U, etc)
|
||||
//==========================================
|
||||
|
||||
function simpletag(thetag)
|
||||
{
|
||||
var tagOpen = eval(thetag + "_open");
|
||||
|
||||
if ( get_easy_mode_state() )
|
||||
{
|
||||
inserttext = prompt(prompt_start + "\n[" + thetag + "]xxx[/" + thetag + "]");
|
||||
if ( (inserttext != null) && (inserttext != "") )
|
||||
{
|
||||
doInsert("[" + thetag + "]" + inserttext + "[/" + thetag + "] ", "", false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tagOpen == 0)
|
||||
{
|
||||
if(doInsert("[" + thetag + "]", "[/" + thetag + "]", true))
|
||||
{
|
||||
eval(thetag + "_open = 1");
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
//--------------------------------------------
|
||||
|
||||
eval("fombj." + thetag + ".value += '*'");
|
||||
|
||||
pushstack(bbtags, thetag);
|
||||
cstat();
|
||||
hstat('click_close');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Find the last occurance of the opened tag
|
||||
//--------------------------------------------
|
||||
lastindex = 0;
|
||||
|
||||
for (i = 0 ; i < bbtags.length; i++ )
|
||||
{
|
||||
if ( bbtags[i] == thetag )
|
||||
{
|
||||
lastindex = i;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Close all tags opened up to that tag was opened
|
||||
//--------------------------------------------
|
||||
|
||||
while (bbtags[lastindex])
|
||||
{
|
||||
tagRemove = popstack(bbtags);
|
||||
doInsert("[/" + tagRemove + "]", "", false)
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
//--------------------------------------------
|
||||
|
||||
if ( (tagRemove != 'FONT') && (tagRemove != 'SIZE') && (tagRemove != 'COLOR') )
|
||||
{
|
||||
eval("fombj." + tagRemove + ".value = ' " + tagRemove + " '");
|
||||
eval(tagRemove + "_open = 0");
|
||||
}
|
||||
}
|
||||
|
||||
cstat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// List tag
|
||||
//==========================================
|
||||
|
||||
function tag_list()
|
||||
{
|
||||
var listvalue = "init";
|
||||
var thelist = "";
|
||||
|
||||
while ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
listvalue = prompt(list_prompt, "");
|
||||
if ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
thelist = thelist+"[*]"+listvalue+"\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ( thelist != "" )
|
||||
{
|
||||
doInsert( "[LIST]\n" + thelist + "[/LIST]\n", "", false);
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// URL tag
|
||||
//==========================================
|
||||
|
||||
function tag_url()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
var enterURL = prompt(text_enter_url, "http://");
|
||||
var enterTITLE = prompt(text_enter_url_name, jsfile_myweb_lang);
|
||||
|
||||
if (!enterURL) {
|
||||
FoundErrors += " " + error_no_url;
|
||||
}
|
||||
if (!enterTITLE) {
|
||||
FoundErrors += " " + error_no_title;
|
||||
}
|
||||
|
||||
if (FoundErrors) {
|
||||
alert(jsfile_error_lang + FoundErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
doInsert("[URL="+enterURL+"]"+enterTITLE+"[/URL]", "", false);
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Insert attachment tag
|
||||
//==========================================
|
||||
|
||||
function insert_attach_to_textarea(aid)
|
||||
{
|
||||
doInsert( "[attachmentid="+aid+"]" );
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Image tag
|
||||
//==========================================
|
||||
|
||||
function tag_image()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
var enterURL = prompt(text_enter_image, "http://");
|
||||
|
||||
if (!enterURL) {
|
||||
FoundErrors += " " + error_no_url;
|
||||
}
|
||||
|
||||
if (FoundErrors) {
|
||||
alert(jsfile_error_lang + FoundErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
doInsert("[IMG]"+enterURL+"[/IMG]", "", false);
|
||||
}
|
||||
|
||||
function tag_email()
|
||||
{
|
||||
var emailAddress = prompt(text_enter_email, "");
|
||||
|
||||
if (!emailAddress) {
|
||||
alert(error_no_email);
|
||||
return;
|
||||
}
|
||||
|
||||
doInsert("[EMAIL]"+emailAddress+"[/EMAIL]", "", false);
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// GENERAL INSERT FUNCTION
|
||||
//--------------------------------------------
|
||||
// ibTag: opening tag
|
||||
// ibClsTag: closing tag, used if we have selected text
|
||||
// isSingle: true if we do not close the tag right now
|
||||
// return value: true if the tag needs to be closed later
|
||||
|
||||
//
|
||||
|
||||
function doInsert(ibTag, ibClsTag, isSingle)
|
||||
{
|
||||
var isClose = false;
|
||||
var obj_ta = fombj.Post;
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
if ( (ua_vers >= 4) && is_ie && is_win)
|
||||
{
|
||||
if (obj_ta.isTextEdit)
|
||||
{
|
||||
obj_ta.focus();
|
||||
var sel = document.selection;
|
||||
var rng = sel.createRange();
|
||||
rng.colapse;
|
||||
if((sel.type == "Text" || sel.type == "None") && rng != null)
|
||||
{
|
||||
if(ibClsTag != "" && rng.text.length > 0)
|
||||
ibTag += rng.text + ibClsTag;
|
||||
else if(isSingle)
|
||||
isClose = true;
|
||||
|
||||
rng.text = ibTag;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( obj_ta.selectionEnd )
|
||||
{
|
||||
var ss = obj_ta.selectionStart;
|
||||
var st = obj_ta.scrollTop;
|
||||
var es = obj_ta.selectionEnd;
|
||||
|
||||
if (es <= 2)
|
||||
{
|
||||
es = obj_ta.textLength;
|
||||
}
|
||||
|
||||
var start = (obj_ta.value).substring(0, ss);
|
||||
var middle = (obj_ta.value).substring(ss, es);
|
||||
var end = (obj_ta.value).substring(es, obj_ta.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
|
||||
{
|
||||
middle = ibTag + middle + ibClsTag;
|
||||
}
|
||||
else
|
||||
{
|
||||
middle = ibTag + middle;
|
||||
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
}
|
||||
|
||||
obj_ta.value = start + middle + end;
|
||||
|
||||
var cpos = ss + (middle.length);
|
||||
|
||||
obj_ta.selectionStart = cpos;
|
||||
obj_ta.selectionEnd = cpos;
|
||||
obj_ta.scrollTop = st;
|
||||
|
||||
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's CRAPPY!
|
||||
//----------------------------------------
|
||||
else
|
||||
{
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
|
||||
obj_ta.focus();
|
||||
|
||||
return isClose;
|
||||
}
|
||||
var B_open=0;var I_open=0;var U_open=0;var QUOTE_open=0;var CODE_open=0;var SQL_open=0;var HTML_open=0;var bbtags=new Array();var fombj=document.REPLIER;prep_mode();function prep_mode(){cvalue=my_getcookie("bbmode");if(cvalue=='ezmode'){fombj.bbmode[0].checked=true;}else{fombj.bbmode[1].checked=true;}}function setmode(mVal){my_setcookie('bbmode',mVal,1);}function get_easy_mode_state(){if(fombj.bbmode[0].checked){return true;}else{return false;}}function hstat(msg){fombj.helpbox.value=eval("help_"+msg);}function cstat(){var c=stacksize(bbtags);if((c<1)||(c==null)){c=0;}if(!bbtags[0]){c=0;}fombj.tagcount.value=c;}function closeall(){if(bbtags[0]){while(bbtags[0]){tagRemove=popstack(bbtags)fombj.Post.value+="[/"+tagRemove+"]";if((tagRemove!='FONT')&&(tagRemove!='SIZE')&&(tagRemove!='COLOR')){eval("fombj."+tagRemove+".value = ' "+tagRemove+" '");eval(tagRemove+"_open = 0");}}}fombj.tagcount.value=0;bbtags=new Array();fombj.Post.focus();}function emoticon(theSmilie){doInsert(" "+theSmilie+" ","",false);}function add_code(NewCode){fombj.Post.value+=NewCode;fombj.Post.focus();}function alterfont(theval,thetag){if(theval==0)return;if(doInsert("["+thetag+"="+theval+"]","[/"+thetag+"]",true))pushstack(bbtags,thetag);fombj.ffont.selectedIndex=0;fombj.fsize.selectedIndex=0;fombj.fcolor.selectedIndex=0;cstat();}function simpletag(thetag){var tagOpen=eval(thetag+"_open");if(get_easy_mode_state()){inserttext=prompt(prompt_start+"\n["+thetag+"]xxx[/"+thetag+"]");if((inserttext!=null)&&(inserttext!="")){doInsert("["+thetag+"]"+inserttext+"[/"+thetag+"] ","",false);}}else{if(tagOpen==0){if(doInsert("["+thetag+"]","[/"+thetag+"]",true)){eval(thetag+"_open = 1");eval("fombj."+thetag+".value += '*'");pushstack(bbtags,thetag);cstat();hstat('click_close');}}else{lastindex=0;for(i=0;i<bbtags.length;i++){if(bbtags[i]==thetag){lastindex=i;}}while(bbtags[lastindex]){tagRemove=popstack(bbtags);doInsert("[/"+tagRemove+"]","",false)if((tagRemove!='FONT')&&(tagRemove!='SIZE')&&(tagRemove!='COLOR')){eval("fombj."+tagRemove+".value = ' "+tagRemove+" '");eval(tagRemove+"_open = 0");}}cstat();}}}function tag_list(){var listvalue="init";var thelist="";while((listvalue!="")&&(listvalue!=null)){listvalue=prompt(list_prompt,"");if((listvalue!="")&&(listvalue!=null)){thelist=thelist+"[*]"+listvalue+"\n";}}if(thelist!=""){doInsert("[LIST]\n"+thelist+"[/LIST]\n","",false);}}function tag_url(){var FoundErrors='';var enterURL=prompt(text_enter_url,"http://");var enterTITLE=prompt(text_enter_url_name,jsfile_myweb_lang);if(!enterURL){FoundErrors+=" "+error_no_url;}if(!enterTITLE){FoundErrors+=" "+error_no_title;}if(FoundErrors){alert(jsfile_error_lang+FoundErrors);return;}doInsert("[URL="+enterURL+"]"+enterTITLE+"[/URL]","",false);}function insert_attach_to_textarea(aid){doInsert("[attachmentid="+aid+"]");}function tag_image(){var FoundErrors='';var enterURL=prompt(text_enter_image,"http://");if(!enterURL){FoundErrors+=" "+error_no_url;}if(FoundErrors){alert(jsfile_error_lang+FoundErrors);return;}doInsert("[IMG]"+enterURL+"[/IMG]","",false);}function tag_email(){var emailAddress=prompt(text_enter_email,"");if(!emailAddress){alert(error_no_email);return;}doInsert("[EMAIL]"+emailAddress+"[/EMAIL]","",false);}function doInsert(ibTag,ibClsTag,isSingle){var isClose=false;var obj_ta=fombj.Post;if((ua_vers>=4)&&is_ie&&is_win){if(obj_ta.isTextEdit){obj_ta.focus();var sel=document.selection;var rng=sel.createRange();rng.colapse;if((sel.type=="Text"||sel.type=="None")&&rng!=null){if(ibClsTag!=""&&rng.text.length>0)ibTag+=rng.text+ibClsTag;else if(isSingle)isClose=true;rng.text=ibTag;}}else{if(isSingle){isClose=true;}obj_ta.value+=ibTag;}}else if(obj_ta.selectionEnd){var ss=obj_ta.selectionStart;var st=obj_ta.scrollTop;var es=obj_ta.selectionEnd;if(es<=2){es=obj_ta.textLength;}var start=(obj_ta.value).substring(0,ss);var middle=(obj_ta.value).substring(ss,es);var end=(obj_ta.value).substring(es,obj_ta.textLength);if(obj_ta.selectionEnd-obj_ta.selectionStart>0){middle=ibTag+middle+ibClsTag;}else{middle=ibTag+middle;if(isSingle){isClose=true;}}obj_ta.value=start+middle+end;var cpos=ss+(middle.length);obj_ta.selectionStart=cpos;obj_ta.selectionEnd=cpos;obj_ta.scrollTop=st;}else{if(isSingle){isClose=true;}obj_ta.value+=ibTag;}obj_ta.focus();return isClose;}
|
||||
@@ -1,80 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// Boards JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Send request to update marker
|
||||
// NO LONGER USED
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function boards_send_marker_update( fid, is_subforum )
|
||||
{
|
||||
//----------------------------------
|
||||
// Get current image...
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
var imgsrc = document.getElementById( 'f-'+fid ).innerHTML;
|
||||
|
||||
if ( imgsrc )
|
||||
{
|
||||
//----------------------------------
|
||||
// Find out what img its using...
|
||||
//----------------------------------
|
||||
|
||||
var regex = new RegExp( "src=['\"](.*/)("+regex_markers+")['\"]" );
|
||||
|
||||
var results = imgsrc.match( regex );
|
||||
|
||||
//----------------------------------
|
||||
// Got a replacement?
|
||||
//----------------------------------
|
||||
|
||||
if ( img_markers[ results[2] ] )
|
||||
{
|
||||
imgsrc = imgsrc.replace( regex, "src='$1"+img_markers[ results[2] ]+"'" );
|
||||
|
||||
document.getElementById( 'f-'+fid ).innerHTML = imgsrc;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
|
||||
//----------------------------------
|
||||
// Get new xhttp obj
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new xmlrequest();
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
xmlrequest.do_request_functon = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Do nothing
|
||||
//----------------------------------
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlrequest.load_xml_document( ipb_var_base_url + 'act=xmlout&do=mark-forum&fid='+fid+'&sf='+is_subforum );
|
||||
|
||||
if ( ! xmlrequest.allow_use )
|
||||
{
|
||||
window.location = document.getElementById( 'f-'+fid ).url;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1,328 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// Text Editor Global Functions
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
var dontpassgo = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Keep an array of open tags
|
||||
//-------------------------------
|
||||
|
||||
var bbtags = new Array();
|
||||
|
||||
//-------------------------------
|
||||
// Define font faces
|
||||
//-------------------------------
|
||||
|
||||
var ips_primary_fonts = new Array(
|
||||
"arial",
|
||||
"arial black",
|
||||
"arial narrow",
|
||||
"book antiqua",
|
||||
"century gothic",
|
||||
"comic sans ms",
|
||||
"courier new",
|
||||
"fixedsys",
|
||||
"franklin gothic medium",
|
||||
"garamond",
|
||||
"georgia",
|
||||
"impact",
|
||||
"lucida console",
|
||||
"lucida sans unicode",
|
||||
"microsoft sans serif",
|
||||
"palatino linotype",
|
||||
"system",
|
||||
"tahoma",
|
||||
"times new roman",
|
||||
"trebuchet ms",
|
||||
"verdana"
|
||||
);
|
||||
|
||||
//-------------------------------
|
||||
// Remap font sizes
|
||||
//-------------------------------
|
||||
|
||||
var ips_fontsizes =
|
||||
{
|
||||
'8px' : 1,
|
||||
'10pt' : 2,
|
||||
'12pt' : 3,
|
||||
'14pt' : 4,
|
||||
'18pt' : 5,
|
||||
'24pt' : 6,
|
||||
'36pt' : 7
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Define sizes
|
||||
//-------------------------------
|
||||
|
||||
var ips_font_sizes = new Array( 1, 2, 3, 4, 5, 6, 7 );
|
||||
|
||||
//-------------------------------
|
||||
// Reverse them so we can look up
|
||||
// by ID
|
||||
//-------------------------------
|
||||
|
||||
var ips_reverse_primary_fonts = new Array();
|
||||
var ips_reverse_font_sizes = new Array();
|
||||
var ips_reverse_fontsizes = new Array();
|
||||
|
||||
for( var i in ips_primary_fonts )
|
||||
{
|
||||
ips_reverse_primary_fonts[ ips_primary_fonts[i] ] = i;
|
||||
}
|
||||
|
||||
for( var i in ips_font_sizes )
|
||||
{
|
||||
ips_reverse_font_sizes[ ips_font_sizes[i] ] = i;
|
||||
}
|
||||
|
||||
for( var i in ips_fontsizes )
|
||||
{
|
||||
ips_reverse_fontsizes[ ips_fontsizes[i] ] = i;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Close all tags
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function closeall()
|
||||
{
|
||||
if ( bbtags[0] )
|
||||
{
|
||||
while ( bbtags[0] )
|
||||
{
|
||||
tagRemove = popstack( bbtags )
|
||||
postformobj.Post.value += "[/" + tagRemove + "]";
|
||||
|
||||
if ( i_am == 'std' )
|
||||
{
|
||||
toggle_button( tagRemove );
|
||||
}
|
||||
else
|
||||
{
|
||||
rte_button_update( tagRemove );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Ensure we got them all
|
||||
//--------------------------------------------
|
||||
|
||||
bbtags = new Array();
|
||||
postformobj.Post.focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Close all nested tags
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function smart_close_tags( thetag )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Find the last occurance of the opened tag
|
||||
//--------------------------------------------
|
||||
|
||||
lastindex = 0;
|
||||
|
||||
for (i = 0 ; i < bbtags.length; i++ )
|
||||
{
|
||||
if ( bbtags[i] == thetag )
|
||||
{
|
||||
lastindex = i;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Close all tags opened up to that tag was opened
|
||||
//--------------------------------------------
|
||||
|
||||
while ( bbtags[lastindex] )
|
||||
{
|
||||
tagRemove = popstack(bbtags);
|
||||
|
||||
wrap_tags("[/" + tagRemove + "]", "")
|
||||
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
//--------------------------------------------
|
||||
|
||||
if ( i_am == 'std' )
|
||||
{
|
||||
toggle_button( tagRemove );
|
||||
}
|
||||
else
|
||||
{
|
||||
rte_button_update( tagRemove );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Write font face box
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function write_fontface_box()
|
||||
{
|
||||
html = "";
|
||||
|
||||
for( var i in ips_primary_fonts )
|
||||
{
|
||||
option = ips_primary_fonts[i];
|
||||
display = ips_primary_fonts[i];
|
||||
|
||||
//-------------------------------
|
||||
// Tidy up show name
|
||||
// Make "courier new" "Courier New"
|
||||
//-------------------------------
|
||||
|
||||
var tmp = display.split( " " );
|
||||
var rtn = new Array;
|
||||
|
||||
for ( var id in tmp )
|
||||
{
|
||||
rtn[id] = tmp[id].substr(0, 1).toUpperCase() + tmp[id].substr(1);
|
||||
}
|
||||
|
||||
display = rtn.join( " " );
|
||||
|
||||
html += "\n<option style='font-family:" + display + "' value='" + display + "'>" + display + "</option>";
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Write font size box
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function write_fontsize_box()
|
||||
{
|
||||
html = "";
|
||||
|
||||
for( var i in ips_font_sizes )
|
||||
{
|
||||
option = ips_font_sizes[i];
|
||||
display = ips_font_sizes[i];
|
||||
|
||||
html += "\n<option value='" + display + "'>" + display + "</option>";
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Editor
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function init_editor()
|
||||
{
|
||||
if ( ! postformid )
|
||||
{
|
||||
postformid = 'postingform';
|
||||
}
|
||||
|
||||
if ( ! postfieldid )
|
||||
{
|
||||
postfieldid = 'postcontent';
|
||||
}
|
||||
|
||||
postformobj = document.getElementById( postformid );
|
||||
postfieldobj = document.getElementById( postfieldid );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Remove an attachment
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function removeattach(id)
|
||||
{
|
||||
if ( id != "" )
|
||||
{
|
||||
Override = 1;
|
||||
postformobj.removeattachid.value = id;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Insert attachment tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function insert_attach_to_textarea(aid)
|
||||
{
|
||||
rtewindow.focus();
|
||||
|
||||
wrap_tags( "[attachmentid="+aid+"]", "" );
|
||||
|
||||
rtewindow.focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Open emoticon window
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
var emowindow = '';
|
||||
|
||||
function emo_pop()
|
||||
{
|
||||
emowindow = window.open( ipb_var_base_url + "act=legends&CODE=emoticons","Legends","width=250,height=500,resizable=yes,scrollbars=yes");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// BBCode window
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function bbc_pop()
|
||||
{
|
||||
window.open( ipb_var_base_url + "act=legends&CODE=bbcode","Legends","width=700,height=500,resizable=yes,scrollbars=yes");
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Fix the amount of digging parents up.
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function getOffsetTop(elm)
|
||||
{
|
||||
var mOffsetTop = elm.offsetTop;
|
||||
var mOffsetParent = elm.offsetParent;
|
||||
var parents_up = 2;
|
||||
|
||||
while(parents_up > 0)
|
||||
{
|
||||
mOffsetTop += mOffsetParent.offsetTop;
|
||||
mOffsetParent = mOffsetParent.offsetParent;
|
||||
parents_up--;
|
||||
}
|
||||
|
||||
return mOffsetTop;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Fix the amount of digging parents up.
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function getOffsetLeft(elm)
|
||||
{
|
||||
var mOffsetLeft = elm.offsetLeft;
|
||||
var mOffsetParent = elm.offsetParent;
|
||||
var parents_up = 2;
|
||||
|
||||
while(parents_up > 0)
|
||||
{
|
||||
mOffsetLeft += mOffsetParent.offsetLeft;
|
||||
mOffsetParent = mOffsetParent.offsetParent;
|
||||
parents_up--;
|
||||
}
|
||||
|
||||
return mOffsetLeft;
|
||||
}
|
||||
var dontpassgo=0;var bbtags=new Array();var ips_primary_fonts=new Array("arial","arial black","arial narrow","book antiqua","century gothic","comic sans ms","courier new","fixedsys","franklin gothic medium","garamond","georgia","impact","lucida console","lucida sans unicode","microsoft sans serif","palatino linotype","system","tahoma","times new roman","trebuchet ms","verdana");var ips_fontsizes={'8px':1,'10pt':2,'12pt':3,'14pt':4,'18pt':5,'24pt':6,'36pt':7}var ips_font_sizes=new Array(1,2,3,4,5,6,7);var ips_reverse_primary_fonts=new Array();var ips_reverse_font_sizes=new Array();var ips_reverse_fontsizes=new Array();for(var i in ips_primary_fonts){ips_reverse_primary_fonts[ips_primary_fonts[i]]=i;}for(var i in ips_font_sizes){ips_reverse_font_sizes[ips_font_sizes[i]]=i;}for(var i in ips_fontsizes){ips_reverse_fontsizes[ips_fontsizes[i]]=i;}function closeall(){if(bbtags[0]){while(bbtags[0]){tagRemove=popstack(bbtags)postformobj.Post.value+="[/"+tagRemove+"]";if(i_am=='std'){toggle_button(tagRemove);}else{rte_button_update(tagRemove);}}}bbtags=new Array();postformobj.Post.focus();}function smart_close_tags(thetag){lastindex=0;for(i=0;i<bbtags.length;i++){if(bbtags[i]==thetag){lastindex=i;}}while(bbtags[lastindex]){tagRemove=popstack(bbtags);wrap_tags("[/"+tagRemove+"]","")if(i_am=='std'){toggle_button(tagRemove);}else{rte_button_update(tagRemove);}}}function write_fontface_box(){html="";for(var i in ips_primary_fonts){option=ips_primary_fonts[i];display=ips_primary_fonts[i];var tmp=display.split(" ");var rtn=new Array;for(var id in tmp){rtn[id]=tmp[id].substr(0,1).toUpperCase()+tmp[id].substr(1);}display=rtn.join(" ");html+="\n<option style='font-family:"+display+"' value='"+display+"'>"+display+"</option>";}return html;}function write_fontsize_box(){html="";for(var i in ips_font_sizes){option=ips_font_sizes[i];display=ips_font_sizes[i];html+="\n<option value='"+display+"'>"+display+"</option>";}return html;}function init_editor(){if(!postformid){postformid='postingform';}if(!postfieldid){postfieldid='postcontent';}postformobj=document.getElementById(postformid);postfieldobj=document.getElementById(postfieldid);}function removeattach(id){if(id!=""){Override=1;postformobj.removeattachid.value=id;}}function insert_attach_to_textarea(aid){rtewindow.focus();wrap_tags("[attachmentid="+aid+"]","");rtewindow.focus();}var emowindow='';function emo_pop(){emowindow=window.open(ipb_var_base_url+"act=legends&CODE=emoticons","Legends","width=250,height=500,resizable=yes,scrollbars=yes");}function bbc_pop(){window.open(ipb_var_base_url+"act=legends&CODE=bbcode","Legends","width=700,height=500,resizable=yes,scrollbars=yes");}function getOffsetTop(elm){var mOffsetTop=elm.offsetTop;var mOffsetParent=elm.offsetParent;var parents_up=2;while(parents_up>0){mOffsetTop+=mOffsetParent.offsetTop;mOffsetParent=mOffsetParent.offsetParent;parents_up--;}return mOffsetTop;}function getOffsetLeft(elm){var mOffsetLeft=elm.offsetLeft;var mOffsetParent=elm.offsetParent;var parents_up=2;while(parents_up>0){mOffsetLeft+=mOffsetParent.offsetLeft;mOffsetParent=mOffsetParent.offsetParent;parents_up--;}return mOffsetLeft;}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,923 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// STD Editor Functions
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
// SHOULD BE CALLED AFTER ipb_editor.js
|
||||
//------------------------------------------
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
var i_am = 'std';
|
||||
var rtewindow;
|
||||
var buttonbar;
|
||||
|
||||
var opentags =
|
||||
{
|
||||
'b' : 0,
|
||||
'i' : 0,
|
||||
's' : 0,
|
||||
'u' : 0,
|
||||
'img' : 0,
|
||||
'quote' : 0,
|
||||
'left' : 0,
|
||||
'center' : 0,
|
||||
'right' : 0,
|
||||
'color' : 0,
|
||||
'background' : 0,
|
||||
'indent' : 0,
|
||||
'code' : 0
|
||||
};
|
||||
|
||||
var tags_to_div =
|
||||
{
|
||||
'b' : 'do_bold',
|
||||
'i' : 'do_italic',
|
||||
's' : 'do_strikethrough',
|
||||
'u' : 'do_underline',
|
||||
'quote' : 'do_quote',
|
||||
'left' : 'do_justifyleft',
|
||||
'center' : 'do_justifycenter',
|
||||
'right' : 'do_justifyright',
|
||||
'color' : 'forecolor',
|
||||
'background' : 'hilitecolor',
|
||||
'indent' : 'do_indent',
|
||||
'code' : 'do_code'
|
||||
};
|
||||
|
||||
var rte_to_std =
|
||||
{
|
||||
'forecolor' : 'color',
|
||||
'hilitecolor' : 'background'
|
||||
};
|
||||
|
||||
var easymode = 0;
|
||||
|
||||
// IE bug fix
|
||||
var ie_range_cache = '';
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function init_std_editor()
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Pull in width of textarea
|
||||
//--------------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
rtewindow = document.getElementById( 'postcontent' );
|
||||
oldwidth = parseInt(document.getElementById( 'postcontent' ).style.width);
|
||||
buttonbar = document.getElementById( 'std-table-buttons' );
|
||||
widthunit = document.getElementById( 'postcontent' ).style.width.match( /%/ ) ? '%' : 'px';
|
||||
|
||||
if ( widthunit == 'px' )
|
||||
{
|
||||
if ( is_opera )
|
||||
{
|
||||
document.getElementById( 'postcontent' ).style.width = oldwidth - 4 + widthunit;
|
||||
buttonbar.style.width = parseInt( buttonbar.style.width ) - 4 + widthunit;
|
||||
}
|
||||
else if ( is_safari )
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( 'postcontent' ).style.width = oldwidth - 6 + widthunit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_ie || is_moz )
|
||||
{
|
||||
document.getElementById( 'postcontent' ).style.width = oldwidth - 1 + widthunit;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{}
|
||||
|
||||
cvalue = my_getcookie( "bbmode" );
|
||||
|
||||
if ( cvalue == 1 )
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_on;
|
||||
easymode = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_off;
|
||||
easymode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Toggle button highlighting (used when clicked on)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function toggle_button( tag )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Change the button status
|
||||
// Ensure we're not looking for FONT, SIZE or COLOR as these
|
||||
// buttons don't exist, they are select lists instead.
|
||||
//--------------------------------------------
|
||||
|
||||
if ( (tag == 'font') || (tag == 'size') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( opentags[ tag ] )
|
||||
{
|
||||
document.getElementById( tags_to_div[ tag ] ).className = 'rteimage';
|
||||
|
||||
// Turn off
|
||||
opentags[ tag ] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( tags_to_div[ tag ] ).className = 'rteImageRaised';
|
||||
|
||||
// Turn on
|
||||
opentags[ tag ] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Set BBCode mode
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function toggle_bbmode(mVal)
|
||||
{
|
||||
if ( easymode )
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_off;
|
||||
easymode = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('togglebbmode').value = js_bbeasy_on;
|
||||
easymode = 1;
|
||||
}
|
||||
|
||||
my_setcookie( 'bbmode', easymode, 1 );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get easy mode state
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function get_easy_mode_state()
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Returns true if we've chosen easy mode
|
||||
//--------------------------------------------
|
||||
|
||||
if ( easymode )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Pop open and set up the color palette
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function popcolor( command )
|
||||
{
|
||||
//-------------------------------
|
||||
// Already open?
|
||||
//-------------------------------
|
||||
|
||||
if ( opentags[ rte_to_std[ command ] ] )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Smart close tags
|
||||
//--------------------------------------------
|
||||
|
||||
smart_close_tags( rte_to_std[ command ] );
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//-------------------------------
|
||||
// Save current values
|
||||
//-------------------------------
|
||||
|
||||
parent.command = command;
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
postfieldobj.focus();
|
||||
ie_range_cache = document.selection.createRange();
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Position and show color palette
|
||||
//-------------------------------
|
||||
|
||||
buttonElement = document.getElementById(command);
|
||||
|
||||
var iLeftPos = getOffsetLeft(buttonElement);
|
||||
var iTopPos = getOffsetTop(buttonElement) + (buttonElement.offsetHeight + 30);
|
||||
|
||||
document.getElementById('cp').style.left = (iLeftPos) + "px";
|
||||
document.getElementById('cp').style.top = (iTopPos) + "px";
|
||||
|
||||
if (document.getElementById('cp').style.visibility == "hidden")
|
||||
{
|
||||
document.getElementById('cp').style.visibility = "visible";
|
||||
document.getElementById('cp').style.display = "inline";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('cp').style.visibility = "hidden";
|
||||
document.getElementById('cp').style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Write the color
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function setColor(color)
|
||||
{
|
||||
var parentCommand = parent.command;
|
||||
|
||||
if ( parentCommand == "hilitecolor" )
|
||||
{
|
||||
if ( wrap_tags("[background=" +color+ "]", "[/background]", true ) )
|
||||
{
|
||||
toggle_button( "background" );
|
||||
pushstack(bbtags, "background");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( wrap_tags("[color=" +color+ "]", "[/color]", true ) )
|
||||
{
|
||||
toggle_button( "color" );
|
||||
pushstack(bbtags, "color");
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('cp').style.visibility = "hidden";
|
||||
document.getElementById('cp').style.display = "none";
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EMOTICONS
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function emoticon(theSmilie)
|
||||
{
|
||||
doInsert(" " + theSmilie + " ", "", false);
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win && emowindow != 'undefined' )
|
||||
{
|
||||
emowindow.focus();
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ALTER FONT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function alterfont(theval, thetag)
|
||||
{
|
||||
if (theval == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( wrap_tags("[" + thetag + "=" + theval + "]", "[/" + thetag + "]", true ) )
|
||||
{
|
||||
pushstack(bbtags, thetag);
|
||||
}
|
||||
|
||||
postformobj.ffont.selectedIndex = 0;
|
||||
postformobj.fsize.selectedIndex = 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// SIMPLE TAGS (such as B, I S U, etc)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function simpletag(thetag)
|
||||
{
|
||||
var tagOpen = opentags[ thetag ];
|
||||
|
||||
if ( get_easy_mode_state() )
|
||||
{
|
||||
inserttext = prompt(prompt_start + "\n[" + thetag + "]xxx[/" + thetag + "]");
|
||||
|
||||
if ( (inserttext != null) && (inserttext != "") )
|
||||
{
|
||||
wrap_tags("[" + thetag + "]" + inserttext + "[/" + thetag + "] ", "", false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( tagOpen == 0 )
|
||||
{
|
||||
if ( wrap_tags("[" + thetag + "]", "[/" + thetag + "]", true ) )
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Toggle
|
||||
//--------------------------------------------
|
||||
|
||||
toggle_button( thetag );
|
||||
|
||||
pushstack(bbtags, thetag);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//--------------------------------------------
|
||||
// Smart close tags
|
||||
//--------------------------------------------
|
||||
|
||||
smart_close_tags( thetag );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// List tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_list( type )
|
||||
{
|
||||
var listvalue = "init";
|
||||
var thelist = "";
|
||||
|
||||
opentag = ( type == 'ordered' ) ? '[list=1]' : '[list]';
|
||||
|
||||
while ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
listvalue = prompt(list_prompt, "");
|
||||
|
||||
if ( (listvalue != "") && (listvalue != null) )
|
||||
{
|
||||
thelist = thelist+"[*]"+listvalue+"\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ( thelist != "" )
|
||||
{
|
||||
wrap_tags( opentag + "\n" + thelist + "[/list]\n", "");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// URL tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_url()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
|
||||
//----------------------------------------
|
||||
// Do we have ranged text?
|
||||
//----------------------------------------
|
||||
|
||||
if ( check_range() )
|
||||
{
|
||||
//----------------------------------------
|
||||
// Yes, just ask for the URL and wrap
|
||||
//----------------------------------------
|
||||
|
||||
var enterURL = prompt(text_enter_url, "http://");
|
||||
|
||||
if ( ! enterURL)
|
||||
{
|
||||
alert(error_no_url);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags( "[url="+enterURL+"]", "[/url]", "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
var enterURL = prompt(text_enter_url, "http://");
|
||||
var enterTITLE = prompt(text_enter_url_name, jsfile_myweb_lang );
|
||||
|
||||
if ( ! enterURL)
|
||||
{
|
||||
FoundErrors += " " + error_no_url;
|
||||
}
|
||||
if ( ! enterTITLE)
|
||||
{
|
||||
FoundErrors += " " + error_no_title;
|
||||
}
|
||||
|
||||
if ( FoundErrors )
|
||||
{
|
||||
alert( jsfile_error_lang +FoundErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags("[url="+enterURL+"]"+enterTITLE+"[/url]", "");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Image tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_image()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
|
||||
//----------------------------------------
|
||||
// Do we have ranged text?
|
||||
//----------------------------------------
|
||||
|
||||
if ( check_range() )
|
||||
{
|
||||
//----------------------------------------
|
||||
// Yes, just wrap text
|
||||
//----------------------------------------
|
||||
|
||||
wrap_tags( "[img]", "[/img]", "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
var enterURL = prompt(text_enter_image, "http://");
|
||||
|
||||
if ( ! enterURL )
|
||||
{
|
||||
alert(error_no_url);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags("[img]"+enterURL+"[/img]", "");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Email tag
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tag_email()
|
||||
{
|
||||
//----------------------------------------
|
||||
// Do we have ranged text?
|
||||
//----------------------------------------
|
||||
|
||||
if ( check_range() )
|
||||
{
|
||||
//----------------------------------------
|
||||
// Yes, just wrap text
|
||||
//----------------------------------------
|
||||
|
||||
wrap_tags( "[email]", "[/email]", "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
var emailAddress = prompt(text_enter_email, "");
|
||||
|
||||
if ( ! emailAddress )
|
||||
{
|
||||
alert(error_no_email);
|
||||
return;
|
||||
}
|
||||
|
||||
wrap_tags( "[email]"+emailAddress+"[/email]", "" );
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do we have ranged text?
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_range()
|
||||
{
|
||||
var has_range = false;
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win )
|
||||
{
|
||||
var sel = document.selection;
|
||||
var rng = sel.createRange();
|
||||
rng.colapse;
|
||||
|
||||
if ( (sel.type == "Text" || sel.type == "None") && rng != null )
|
||||
{
|
||||
if ( rng.text.length > 0)
|
||||
{
|
||||
has_range = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( postfieldobj.selectionEnd )
|
||||
{
|
||||
var ss = postfieldobj.selectionStart;
|
||||
var st = postfieldobj.scrollTop;
|
||||
var es = postfieldobj.selectionEnd;
|
||||
|
||||
if (es <= 2)
|
||||
{
|
||||
es = postfieldobj.textLength;
|
||||
}
|
||||
|
||||
var start = (postfieldobj.value).substring(0, ss);
|
||||
var middle = (postfieldobj.value).substring(ss, es);
|
||||
var end = (postfieldobj.value).substring(es, postfieldobj.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if (postfieldobj.selectionEnd - postfieldobj.selectionStart > 0)
|
||||
{
|
||||
has_range = true;
|
||||
}
|
||||
}
|
||||
|
||||
return has_range;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check message length
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_length()
|
||||
{
|
||||
MessageLength = postfieldobj.value.length;
|
||||
message = "";
|
||||
|
||||
if (MessageMax > 0)
|
||||
{
|
||||
message = js_post + ": " + js_max_length + " " + MessageMax + " " + js_characters +".";
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "";
|
||||
}
|
||||
|
||||
alert(message + " " + js_used + " " + MessageLength + " " + js_characters + ".");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// GENERAL INSERT FUNCTION
|
||||
// opentext : opening tag
|
||||
// closetext: closing tag, used if we have selected text
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function wrap_tags(opentext, closetext, issingle)
|
||||
{
|
||||
var has_closed = false;
|
||||
|
||||
if ( ! issingle )
|
||||
{
|
||||
issingle = false;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win )
|
||||
{
|
||||
if ( postfieldobj.isTextEdit )
|
||||
{
|
||||
postfieldobj.focus();
|
||||
|
||||
var sel = document.selection;
|
||||
|
||||
var rng = ie_range_cache ? ie_range_cache : sel.createRange();
|
||||
|
||||
var stored_range = rng.duplicate()
|
||||
stored_range.moveToElementText( postfieldobj );
|
||||
stored_range.setEndPoint( 'EndToEnd', rng );
|
||||
|
||||
// Stores start position of text selection
|
||||
postfieldobj.selectionStart = stored_range.text.length - rng.text.length;
|
||||
// Stores end position of text selection
|
||||
postfieldobj.selectionEnd = postfieldobj.selectionStart + rng.text.length;
|
||||
|
||||
rng.colapse;
|
||||
|
||||
if ( (sel.type == "Text" || sel.type == "None") && rng != null)
|
||||
{
|
||||
if (closetext != "" && rng.text && rng.text.length > 0)
|
||||
{
|
||||
opentext += rng.text + closetext;
|
||||
}
|
||||
else if ( issingle )
|
||||
{
|
||||
has_closed = true;
|
||||
}
|
||||
|
||||
rng.text = rng.text.charAt(rng.text.length - 1) == ' ' ? opentext + ' ' : opentext;
|
||||
}
|
||||
else
|
||||
{
|
||||
postfieldobj.value += opentext;
|
||||
has_closed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
postfieldobj.value += opentext;
|
||||
has_closed = true;
|
||||
}
|
||||
|
||||
ie_range_cache = null;
|
||||
|
||||
rng.select();
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( postfieldobj.selectionEnd )
|
||||
{
|
||||
var ss = postfieldobj.selectionStart;
|
||||
var st = postfieldobj.scrollTop;
|
||||
var es = postfieldobj.selectionEnd;
|
||||
|
||||
if (es <= 0)
|
||||
{
|
||||
es = postfieldobj.textLength;
|
||||
}
|
||||
|
||||
var start = (postfieldobj.value).substring(0, ss);
|
||||
var middle = (postfieldobj.value).substring(ss, es);
|
||||
var end = (postfieldobj.value).substring(es, postfieldobj.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if ( postfieldobj.selectionEnd - postfieldobj.selectionStart > 0 )
|
||||
{
|
||||
middle = opentext + middle + closetext;
|
||||
}
|
||||
else
|
||||
{
|
||||
middle = opentext + middle;
|
||||
|
||||
if ( issingle )
|
||||
{
|
||||
has_closed = true;
|
||||
}
|
||||
}
|
||||
|
||||
postfieldobj.value = start + middle + end;
|
||||
|
||||
var cpos = ss + (middle.length);
|
||||
|
||||
postfieldobj.selectionStart = cpos;
|
||||
postfieldobj.selectionEnd = cpos;
|
||||
postfieldobj.scrollTop = st;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// It's CRAPPY!
|
||||
//----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
if ( issingle )
|
||||
{
|
||||
has_closed = false;
|
||||
}
|
||||
|
||||
postfieldobj.value += opentext + ' ' + closetext;
|
||||
}
|
||||
|
||||
postfieldobj.focus();
|
||||
|
||||
return has_closed;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Make current STD window (n)px bigger
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function std_window_resize( pix )
|
||||
{
|
||||
var box = postfieldobj;
|
||||
var cur_height = parseInt( box.style.height ) ? parseInt( box.style.height ) : 300;
|
||||
var new_height = cur_height + pix;
|
||||
|
||||
if ( new_height > 0 )
|
||||
{
|
||||
box.style.height = new_height + "px";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Validate form (must always have this method defined!)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ValidateForm( isMsg )
|
||||
{
|
||||
MessageLength = postfieldobj.value.length;
|
||||
errors = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// Check for remove attachments
|
||||
//-----------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
if ( postformobj.removeattachid.value > 0 )
|
||||
{
|
||||
okdelete = confirm( js_remove_attach );
|
||||
|
||||
if ( okdelete == true )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
postformobj.removeattachid.value = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
if ( isMsg == 1)
|
||||
{
|
||||
if ( postformobj.msg_title.value.length < 2 )
|
||||
{
|
||||
errors = js_msg_no_title;
|
||||
}
|
||||
}
|
||||
|
||||
if ( MessageLength < 2 )
|
||||
{
|
||||
errors = js_no_message;
|
||||
}
|
||||
|
||||
if ( MessageMax !=0 )
|
||||
{
|
||||
if (MessageLength > MessageMax)
|
||||
{
|
||||
errors = js_max_length + " " + MessageMax + " " + js_characters + ". " + js_current + ": " + MessageLength;
|
||||
}
|
||||
}
|
||||
|
||||
if ( errors != "" && ! Override )
|
||||
{
|
||||
alert(errors);
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
postformobj.submit.disabled = true;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
try
|
||||
{
|
||||
postformobj.dosubmit.disabled = true;
|
||||
}
|
||||
catch(e) { }
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function doInsert(ibTag, ibClsTag, isSingle)
|
||||
{
|
||||
var isClose = false;
|
||||
var obj_ta = fombj.Post;
|
||||
|
||||
//----------------------------------------
|
||||
// It's IE!
|
||||
//----------------------------------------
|
||||
if ( (ua_vers >= 4) && is_ie && is_win)
|
||||
{
|
||||
if (obj_ta.isTextEdit)
|
||||
{
|
||||
obj_ta.focus();
|
||||
var sel = document.selection;
|
||||
var rng = sel.createRange();
|
||||
rng.colapse;
|
||||
if((sel.type == "Text" || sel.type == "None") && rng != null)
|
||||
{
|
||||
if(ibClsTag != "" && rng.text.length > 0)
|
||||
ibTag += rng.text + ibClsTag;
|
||||
else if(isSingle)
|
||||
isClose = true;
|
||||
|
||||
rng.text = ibTag;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( obj_ta.selectionEnd )
|
||||
{
|
||||
var ss = obj_ta.selectionStart;
|
||||
var st = obj_ta.scrollTop;
|
||||
var es = obj_ta.selectionEnd;
|
||||
|
||||
if (es <= 2)
|
||||
{
|
||||
es = obj_ta.textLength;
|
||||
}
|
||||
|
||||
var start = (obj_ta.value).substring(0, ss);
|
||||
var middle = (obj_ta.value).substring(ss, es);
|
||||
var end = (obj_ta.value).substring(es, obj_ta.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
|
||||
{
|
||||
middle = ibTag + middle + ibClsTag;
|
||||
}
|
||||
else
|
||||
{
|
||||
middle = ibTag + middle;
|
||||
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
}
|
||||
|
||||
obj_ta.value = start + middle + end;
|
||||
|
||||
var cpos = ss + (middle.length);
|
||||
|
||||
obj_ta.selectionStart = cpos;
|
||||
obj_ta.selectionEnd = cpos;
|
||||
obj_ta.scrollTop = st;
|
||||
|
||||
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's CRAPPY!
|
||||
//----------------------------------------
|
||||
else
|
||||
{
|
||||
if (isSingle)
|
||||
{
|
||||
isClose = true;
|
||||
}
|
||||
|
||||
obj_ta.value += ibTag;
|
||||
}
|
||||
|
||||
obj_ta.focus();
|
||||
|
||||
return isClose;
|
||||
}
|
||||
var bbtags = new Array();
|
||||
|
||||
var fombj = document.REPLIER;
|
||||
|
||||
|
||||
|
||||
var i_am='std';var rtewindow;var buttonbar;var opentags={'b':0,'i':0,'s':0,'u':0,'img':0,'quote':0,'left':0,'center':0,'right':0,'color':0,'background':0,'indent':0,'code':0};var tags_to_div={'b':'do_bold','i':'do_italic','s':'do_strikethrough','u':'do_underline','quote':'do_quote','left':'do_justifyleft','center':'do_justifycenter','right':'do_justifyright','color':'forecolor','background':'hilitecolor','indent':'do_indent','code':'do_code'};var rte_to_std={'forecolor':'color','hilitecolor':'background'};var easymode=0;var ie_range_cache='';function init_std_editor(){try{rtewindow=document.getElementById('postcontent');oldwidth=parseInt(document.getElementById('postcontent').style.width);buttonbar=document.getElementById('std-table-buttons');widthunit=document.getElementById('postcontent').style.width.match( /%/)?'%':'px';if(widthunit=='px'){if(is_opera){document.getElementById('postcontent').style.width=oldwidth-4+widthunit;buttonbar.style.width=parseInt(buttonbar.style.width)-4+widthunit;}else if(is_safari){}else{document.getElementById('postcontent').style.width=oldwidth-6+widthunit;}}else{if(is_ie||is_moz){document.getElementById('postcontent').style.width=oldwidth-1+widthunit;}}}catch(e){}cvalue=my_getcookie("bbmode");if(cvalue==1){document.getElementById('togglebbmode').value=js_bbeasy_on;easymode=1;}else{document.getElementById('togglebbmode').value=js_bbeasy_off;easymode=0;}faceobj=document.getElementById('fontface');faceregex= /\<\!--FONTFACE--\>/gi;facecontent=faceobj.innerHTML.replace(faceregex,write_fontface_box());faceobj.innerHTML=facecontent;sizeobj=document.getElementById('fontsize');sizeregex= /\<\!--FONTSIZE--\>/gi;sizecontent=sizeobj.innerHTML.replace(sizeregex,write_fontsize_box());sizeobj.innerHTML=sizecontent;}function toggle_button(tag){if((tag=='font')||(tag=='size')){return;}if(opentags[tag]){document.getElementById(tags_to_div[tag]).className='rteimage';opentags[tag]=0;}else{document.getElementById(tags_to_div[tag]).className='rteImageRaised';opentags[tag]=1;}}function toggle_bbmode(mVal){if(easymode){document.getElementById('togglebbmode').value=js_bbeasy_off;easymode=0;}else{document.getElementById('togglebbmode').value=js_bbeasy_on;easymode=1;}my_setcookie('bbmode',easymode,1);}function get_easy_mode_state(){if(easymode){return true;}else{return false;}}function popcolor(command){if(opentags[rte_to_std[command]]){smart_close_tags(rte_to_std[command]);return false;}else{parent.command=command;if(is_ie){postfieldobj.focus();ie_range_cache=document.selection.createRange();}buttonElement=document.getElementById(command);var iLeftPos=getOffsetLeft(buttonElement);var iTopPos=getOffsetTop(buttonElement)+(buttonElement.offsetHeight+30);document.getElementById('cp').style.left=(iLeftPos)+"px";document.getElementById('cp').style.top=(iTopPos)+"px";if(document.getElementById('cp').style.visibility=="hidden"){document.getElementById('cp').style.visibility="visible";document.getElementById('cp').style.display="inline";}else{document.getElementById('cp').style.visibility="hidden";document.getElementById('cp').style.display="none";}}}function setColor(color){var parentCommand=parent.command;if(parentCommand=="hilitecolor"){if(wrap_tags("[background="+color+"]","[/background]",true)){toggle_button("background");pushstack(bbtags,"background");}}else{if(wrap_tags("[color="+color+"]","[/color]",true)){toggle_button("color");pushstack(bbtags,"color");}}document.getElementById('cp').style.visibility="hidden";document.getElementById('cp').style.display="none";}function emoticon(theSmilie){doInsert(" "+theSmilie+" ","",false);if((ua_vers>=4)&&is_ie&&is_win&&emowindow!=''&&emowindow!='undefined'){emowindow.focus();}}function alterfont(theval,thetag){if(theval==0){return;}if(wrap_tags("["+thetag+"="+theval+"]","[/"+thetag+"]",true)){pushstack(bbtags,thetag);}postformobj.ffont.selectedIndex=0;postformobj.fsize.selectedIndex=0;}function simpletag(thetag){var tagOpen=opentags[thetag];if(get_easy_mode_state()){inserttext=prompt(prompt_start+"\n["+thetag+"]xxx[/"+thetag+"]");if((inserttext!=null)&&(inserttext!="")){wrap_tags("["+thetag+"]"+inserttext+"[/"+thetag+"] ","",false);}}else{if(tagOpen==0){if(wrap_tags("["+thetag+"]","[/"+thetag+"]",true)){toggle_button(thetag);pushstack(bbtags,thetag);}}else{smart_close_tags(thetag);}}}function tag_list(type){var listvalue="init";var thelist="";opentag=(type=='ordered')?'[list=1]':'[list]';while((listvalue!="")&&(listvalue!=null)){listvalue=prompt(list_prompt,"");if((listvalue!="")&&(listvalue!=null)){thelist=thelist+"[*]"+listvalue+"\n";}}if(thelist!=""){wrap_tags(opentag+"\n"+thelist+"[/list]\n","");}}function tag_url(){var FoundErrors='';if(check_range()){var enterURL=prompt(text_enter_url,"http://");if(!enterURL){alert(error_no_url);return;}wrap_tags("[url="+enterURL+"]","[/url]","");}else{var enterURL=prompt(text_enter_url,"http://");var enterTITLE=prompt(text_enter_url_name,jsfile_myweb_lang);if(!enterURL){FoundErrors+=" "+error_no_url;}if(!enterTITLE){FounLine truncated
|
||||
@@ -1,75 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// Find User JS File
|
||||
// (c) 2004 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
|
||||
|
||||
function add_to_form()
|
||||
{
|
||||
var name = document.finduser.username.options[document.finduser.username.selectedIndex].value;
|
||||
|
||||
if (separator == 'line')
|
||||
{
|
||||
separator = '\n';
|
||||
}
|
||||
|
||||
if (separator == 'none')
|
||||
{
|
||||
separator = '';
|
||||
}
|
||||
|
||||
if (entry == 'textarea')
|
||||
{
|
||||
// Where shall we put the separator?
|
||||
|
||||
var tbox = eval('opener.document.REPLIER.'+in_name+'.value');
|
||||
var tboxSize = eval('opener.document.REPLIER.'+in_name+'.value.length');
|
||||
|
||||
// Remove leading spaces...
|
||||
|
||||
while ( tbox.slice(0,1) == " " )
|
||||
{
|
||||
tbox = tbox.substr(1, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// Remove trailing spaces...
|
||||
|
||||
while ( tbox.slice(tboxSize - 1, tboxSize) == " " )
|
||||
{
|
||||
tbox = tbox.substr(0, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// Do we have a leading comma?
|
||||
|
||||
while ( tbox.slice(0,1) == "\n" )
|
||||
{
|
||||
tbox = tbox.substr(1, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// Do we have a trailing comma?...
|
||||
|
||||
while ( tbox.slice(tboxSize - 1, tboxSize) == "\n" )
|
||||
{
|
||||
tbox = tbox.substr(0, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// First in box?
|
||||
|
||||
if ( tboxSize == 0)
|
||||
{
|
||||
eval('opener.document.REPLIER.'+in_name+'.value += name');
|
||||
}
|
||||
else
|
||||
{
|
||||
eval('opener.document.REPLIER.'+in_name+'.value += separator + name');
|
||||
}
|
||||
}
|
||||
}
|
||||
function add_to_form(){var name=document.finduser.username.options[document.finduser.username.selectedIndex].value;if(separator=='line'){separator='\n';}if(separator=='none'){separator='';}if(entry=='textarea'){var tbox=eval('opener.document.REPLIER.'+in_name+'.value');var tboxSize=eval('opener.document.REPLIER.'+in_name+'.value.length');while(tbox.slice(0,1)==" "){tbox=tbox.substr(1,tboxSize-1);tboxSize=tboxSize;}while(tbox.slice(tboxSize-1,tboxSize)==" "){tbox=tbox.substr(0,tboxSize-1);tboxSize=tboxSize;}while(tbox.slice(0,1)=="\n"){tbox=tbox.substr(1,tboxSize-1);tboxSize=tboxSize;}while(tbox.slice(tboxSize-1,tboxSize)=="\n"){tbox=tbox.substr(0,tboxSize-1);tboxSize=tboxSize;}if(tboxSize==0){eval('opener.document.REPLIER.'+in_name+'.value += name');}else{eval('opener.document.REPLIER.'+in_name+'.value += separator + name');}}}
|
||||
+356
-723
File diff suppressed because it is too large.
Load diff
@@ -1,745 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// Global JS File
|
||||
// (c) 2003 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
//==========================================
|
||||
// Set up
|
||||
//==========================================
|
||||
|
||||
var input_red = 'input-warn';
|
||||
var input_green = 'input-ok';
|
||||
var input_ok_box = 'input-ok-content';
|
||||
var input_warn_box = 'input-warn-content';
|
||||
|
||||
var img_blank = 'blank.gif';
|
||||
var img_tick = 'aff_tick.gif';
|
||||
var img_cross = 'aff_cross.gif';
|
||||
|
||||
// Sniffer based on http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
|
||||
|
||||
var uagent = navigator.userAgent.toLowerCase();
|
||||
var is_safari = ( (uagent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc.") );
|
||||
var is_opera = (uagent.indexOf('opera') != -1);
|
||||
var is_webtv = (uagent.indexOf('webtv') != -1);
|
||||
var is_ie = ( (uagent.indexOf('msie') != -1) && (!is_opera) && (!is_safari) && (!is_webtv) );
|
||||
var is_ie4 = ( (is_ie) && (uagent.indexOf("msie 4.") != -1) );
|
||||
var is_moz = ( (navigator.product == 'Gecko') && (!is_opera) && (!is_webtv) && (!is_safari) );
|
||||
var is_ns = ( (uagent.indexOf('compatible') == -1) && (uagent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_safari) );
|
||||
var is_ns4 = ( (is_ns) && (parseInt(navigator.appVersion) == 4) );
|
||||
var is_kon = (uagent.indexOf('konqueror') != -1);
|
||||
|
||||
var is_win = ( (uagent.indexOf("win") != -1) || (uagent.indexOf("16bit") !=- 1) );
|
||||
var is_mac = ( (uagent.indexOf("mac") != -1) || (navigator.vendor == "Apple Computer, Inc.") );
|
||||
var ua_vers = parseInt(navigator.appVersion);
|
||||
|
||||
var ipb_pages_shown = 0;
|
||||
var ipb_pages_array = new Array();
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// DST Auto correction
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function global_dst_check( tzo, dst )
|
||||
{
|
||||
var thisoffset = tzo + dst;
|
||||
var dstoffset = new Date().getTimezoneOffset() / 60;
|
||||
var dstset = 0;
|
||||
var url = ipb_var_base_url + 'act=xmlout&do=dst-autocorrection&md5check=' + ipb_md5_check;
|
||||
|
||||
if ( Math.abs( thisoffset + dstoffset ) == 1 )
|
||||
{
|
||||
try
|
||||
{
|
||||
//----------------------------------
|
||||
// Fancy first...
|
||||
//----------------------------------
|
||||
|
||||
xml_dst_set( url + '&xml=1' );
|
||||
dstset = 1;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
dstset = 0;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// No fancy?
|
||||
//----------------------------------
|
||||
|
||||
if ( dstset == 0 )
|
||||
{
|
||||
window.location = url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get cookie
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function my_getcookie( name )
|
||||
{
|
||||
cname = ipb_var_cookieid + name + '=';
|
||||
cpos = document.cookie.indexOf( cname );
|
||||
|
||||
if ( cpos != -1 )
|
||||
{
|
||||
cstart = cpos + cname.length;
|
||||
cend = document.cookie.indexOf(";", cstart);
|
||||
|
||||
if (cend == -1)
|
||||
{
|
||||
cend = document.cookie.length;
|
||||
}
|
||||
|
||||
return unescape( document.cookie.substring(cstart, cend) );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Set cookie
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function my_setcookie( name, value, sticky )
|
||||
{
|
||||
expire = "";
|
||||
domain = "";
|
||||
path = "/";
|
||||
|
||||
if ( sticky )
|
||||
{
|
||||
expire = "; expires=Wed, 1 Jan 2020 00:00:00 GMT";
|
||||
}
|
||||
|
||||
if ( ipb_var_cookie_domain != "" )
|
||||
{
|
||||
domain = '; domain=' + ipb_var_cookie_domain;
|
||||
}
|
||||
|
||||
if ( ipb_var_cookie_path != "" )
|
||||
{
|
||||
path = ipb_var_cookie_path;
|
||||
}
|
||||
|
||||
document.cookie = ipb_var_cookieid + name + "=" + value + "; path=" + path + expire + domain + ';';
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Lang replace
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function lang_build_string()
|
||||
{
|
||||
if ( ! arguments.length || ! arguments )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var string = arguments[0];
|
||||
|
||||
for( var i = 1 ; i < arguments.length ; i++ )
|
||||
{
|
||||
var match = new RegExp('<%' + i + '>', 'gi');
|
||||
string = string.replace( match, arguments[i] );
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Pop up MyAssistant window
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function buddy_pop()
|
||||
{
|
||||
var not_loaded_yet = 0;
|
||||
|
||||
if ( use_enhanced_js )
|
||||
{
|
||||
try
|
||||
{
|
||||
xml_myassistant_init();
|
||||
not_loaded_yet = 1;
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
//alert(e);
|
||||
not_loaded_yet = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! not_loaded_yet )
|
||||
{
|
||||
ipb_var_base_url = ipb_var_base_url.replace( '&', '&' );
|
||||
window.open( ipb_var_base_url + 'act=buddy','BrowserBuddy','width=250,height=500,resizable=yes,scrollbars=yes');
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Multi Page jumps
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_multi_page_jump( pages_id )
|
||||
{
|
||||
var pages = 1;
|
||||
var cur_st = ipb_var_st;
|
||||
var cur_page = 1;
|
||||
var total_posts = ipb_pages_array[ pages_id ][2];
|
||||
var per_page = ipb_pages_array[ pages_id ][1];
|
||||
var url_bit = ipb_pages_array[ pages_id ][0];
|
||||
var userPage = parseInt( document.getElementById( 'st-'+pages_id ).value );
|
||||
|
||||
//-----------------------------------
|
||||
// Fix up URL BIT
|
||||
//-----------------------------------
|
||||
|
||||
url_bit = url_bit.replace( new RegExp( "&", "g" ) , '&' );
|
||||
|
||||
//-----------------------------------
|
||||
// Work out pages
|
||||
//-----------------------------------
|
||||
|
||||
if ( total_posts % per_page == 0 )
|
||||
{
|
||||
pages = total_posts / per_page;
|
||||
}
|
||||
else
|
||||
{
|
||||
pages = Math.ceil( total_posts / per_page );
|
||||
}
|
||||
|
||||
if ( cur_st > 0 )
|
||||
{
|
||||
cur_page = cur_st / per_page; cur_page = cur_page -1;
|
||||
}
|
||||
|
||||
if ( userPage > 0 )
|
||||
{
|
||||
if ( userPage < 1 ) { userPage = 1; }
|
||||
if ( userPage > pages ) { userPage = pages; }
|
||||
if ( userPage == 1 ) { start = 0; }
|
||||
else { start = (userPage - 1) * per_page; }
|
||||
|
||||
window.location = url_bit + "&st=" + start;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Hide / Unhide menu elements
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function pages_st_focus( pages_id )
|
||||
{
|
||||
document.getElementById( 'st-'+pages_id ).focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Hide / Unhide menu elements
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ShowHide(id1, id2)
|
||||
{
|
||||
if (id1 != '') toggleview(id1);
|
||||
if (id2 != '') toggleview(id2);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get element by id
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function my_getbyid(id)
|
||||
{
|
||||
itm = null;
|
||||
|
||||
if (document.getElementById)
|
||||
{
|
||||
itm = document.getElementById(id);
|
||||
}
|
||||
else if (document.all)
|
||||
{
|
||||
itm = document.all[id];
|
||||
}
|
||||
else if (document.layers)
|
||||
{
|
||||
itm = document.layers[id];
|
||||
}
|
||||
|
||||
return itm;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Show/hide toggle
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function toggleview(id)
|
||||
{
|
||||
if ( ! id ) return;
|
||||
|
||||
if ( itm = my_getbyid(id) )
|
||||
{
|
||||
if (itm.style.display == "none")
|
||||
{
|
||||
my_show_div(itm);
|
||||
}
|
||||
else
|
||||
{
|
||||
my_hide_div(itm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Set DIV ID to hide
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function my_hide_div(itm)
|
||||
{
|
||||
if ( ! itm ) return;
|
||||
|
||||
itm.style.display = "none";
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Set DIV ID to show
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function my_show_div(itm)
|
||||
{
|
||||
if ( ! itm ) return;
|
||||
|
||||
itm.style.display = "";
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Change cell colour
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function change_cell_color( id, cl )
|
||||
{
|
||||
itm = my_getbyid(id);
|
||||
|
||||
if ( itm )
|
||||
{
|
||||
itm.className = cl;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Toggle category
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function togglecategory( fid, add )
|
||||
{
|
||||
saved = new Array();
|
||||
clean = new Array();
|
||||
|
||||
//-----------------------------------
|
||||
// Get any saved info
|
||||
//-----------------------------------
|
||||
|
||||
if ( tmp = my_getcookie('collapseprefs') )
|
||||
{
|
||||
saved = tmp.split(",");
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Remove bit if exists
|
||||
//-----------------------------------
|
||||
|
||||
for( i = 0 ; i < saved.length; i++ )
|
||||
{
|
||||
if ( saved[i] != fid && saved[i] != "" )
|
||||
{
|
||||
clean[clean.length] = saved[i];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Add?
|
||||
//-----------------------------------
|
||||
|
||||
if ( add )
|
||||
{
|
||||
clean[ clean.length ] = fid;
|
||||
my_show_div( my_getbyid( 'fc_'+fid ) );
|
||||
my_hide_div( my_getbyid( 'fo_'+fid ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
my_show_div( my_getbyid( 'fo_'+fid ) );
|
||||
my_hide_div( my_getbyid( 'fc_'+fid ) );
|
||||
}
|
||||
|
||||
my_setcookie( 'collapseprefs', clean.join(','), 1 );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// locationjump
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function locationjump(url)
|
||||
{
|
||||
window.location = ipb_var_base_url + url;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CHOOSE SKIN
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function chooseskin(obj)
|
||||
{
|
||||
choosebox = obj.options[obj.selectedIndex].value;
|
||||
extravars = '';
|
||||
|
||||
if ( choosebox != -1 && ! isNaN( choosebox ) )
|
||||
{
|
||||
if ( document.skinselectorbox.skinurlbits.value )
|
||||
{
|
||||
extravars = '&' + document.skinselectorbox.skinurlbits.value;
|
||||
|
||||
//----------------------------------
|
||||
// Strip out old skin change stuff
|
||||
// setskin=1&skinid=2
|
||||
//----------------------------------
|
||||
|
||||
extravars = extravars.replace( /setskin=\d{1,}/g, '' );
|
||||
extravars = extravars.replace( /skinid=\d{1,}/g , '' );
|
||||
extravars = extravars.replace( /&{1,}/g , '&' );
|
||||
extravars = extravars.replace( /s=&/g , '' );
|
||||
}
|
||||
|
||||
locationjump( 'setskin=1&skinid=' + choosebox + extravars );
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CHOOSE LANG
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function chooselang(obj)
|
||||
{
|
||||
choosebox = obj.options[obj.selectedIndex].value;
|
||||
extravars = '';
|
||||
|
||||
if ( document.langselectorbox.langurlbits.value )
|
||||
{
|
||||
extravars = '&' + document.langselectorbox.langurlbits.value;
|
||||
|
||||
//----------------------------------
|
||||
// Strip out old skin change stuff
|
||||
// setskin=1&skinid=2
|
||||
//----------------------------------
|
||||
|
||||
extravars = extravars.replace( /setlanguage=\d{1,}/g, '' );
|
||||
extravars = extravars.replace( /cal_id=&/g, '' );
|
||||
extravars = extravars.replace( /langid=\w{1,}/g , '' );
|
||||
extravars = extravars.replace( /&{1,}/g , '&' );
|
||||
extravars = extravars.replace( /s=&/g , '' );
|
||||
}
|
||||
|
||||
locationjump( 'setlanguage=1&langid=' + choosebox + extravars );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// pop up window
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function PopUp(url, name, width,height,center,resize,scroll,posleft,postop)
|
||||
{
|
||||
showx = "";
|
||||
showy = "";
|
||||
|
||||
if (posleft != 0) { X = posleft }
|
||||
if (postop != 0) { Y = postop }
|
||||
|
||||
if (!scroll) { scroll = 1 }
|
||||
if (!resize) { resize = 1 }
|
||||
|
||||
if ((parseInt (navigator.appVersion) >= 4 ) && (center))
|
||||
{
|
||||
X = (screen.width - width ) / 2;
|
||||
Y = (screen.height - height) / 2;
|
||||
}
|
||||
|
||||
if ( X > 0 )
|
||||
{
|
||||
showx = ',left='+X;
|
||||
}
|
||||
|
||||
if ( Y > 0 )
|
||||
{
|
||||
showy = ',top='+Y;
|
||||
}
|
||||
|
||||
if (scroll != 0) { scroll = 1 }
|
||||
|
||||
var Win = window.open( url, name, 'width='+width+',height='+height+ showx + showy + ',resizable='+resize+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no');
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Array: Get stack size
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function stacksize(thearray)
|
||||
{
|
||||
for (i = 0 ; i < thearray.length; i++ )
|
||||
{
|
||||
if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return thearray.length;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Array: Push stack
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function pushstack(thearray, newval)
|
||||
{
|
||||
arraysize = stacksize(thearray);
|
||||
thearray[arraysize] = newval;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Array: Pop stack
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function popstack(thearray)
|
||||
{
|
||||
arraysize = stacksize(thearray);
|
||||
theval = thearray[arraysize - 1];
|
||||
delete thearray[arraysize - 1];
|
||||
return theval;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Converts "safe" innerHTML back to normal template
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function innerhtml_template_to_html( t )
|
||||
{
|
||||
t = t.replace( /<%(\d+?)>/ig, "<%$1>" );
|
||||
t = t.replace( /%3C%(\d+?)%3E/ig , "<%$1>" );
|
||||
return t;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Global freeze events
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function global_cancel_bubble(obj, extra)
|
||||
{
|
||||
if ( ! obj || is_ie)
|
||||
{
|
||||
if ( extra )
|
||||
{
|
||||
window.event.returnValue = false;
|
||||
}
|
||||
|
||||
window.event.cancelBubble = true;
|
||||
|
||||
return window.event;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.stopPropagation();
|
||||
|
||||
if ( extra )
|
||||
{
|
||||
obj.preventDefault();
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get left posititon of object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _get_obj_leftpos(obj)
|
||||
{
|
||||
var left = obj.offsetLeft;
|
||||
|
||||
while( (obj = obj.offsetParent) != null )
|
||||
{
|
||||
left += obj.offsetLeft;
|
||||
}
|
||||
|
||||
return left;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get top position of object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _get_obj_toppos(obj)
|
||||
{
|
||||
var top = obj.offsetTop;
|
||||
|
||||
while( (obj = obj.offsetParent) != null )
|
||||
{
|
||||
top += obj.offsetTop;
|
||||
}
|
||||
|
||||
return top;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Center a div on the screen
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function center_div()
|
||||
{
|
||||
this.divname = '';
|
||||
this.divobj = '';
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Main run function
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
center_div.prototype.move_div = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.divobj = document.getElementById( this.divname );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Figure width and height
|
||||
//----------------------------------
|
||||
|
||||
var my_width = 0;
|
||||
var my_height = 0;
|
||||
|
||||
if ( typeof( window.innerWidth ) == 'number' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Non IE
|
||||
//----------------------------------
|
||||
|
||||
my_width = window.innerWidth;
|
||||
my_height = window.innerHeight;
|
||||
}
|
||||
else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// IE 6+
|
||||
//----------------------------------
|
||||
|
||||
my_width = document.documentElement.clientWidth;
|
||||
my_height = document.documentElement.clientHeight;
|
||||
}
|
||||
else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// Old IE
|
||||
//----------------------------------
|
||||
|
||||
my_width = document.body.clientWidth;
|
||||
my_height = document.body.clientHeight;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Show...
|
||||
//----------------------------------
|
||||
|
||||
this.divobj.style.position = 'absolute';
|
||||
this.divobj.style.display = 'block';
|
||||
this.divobj.style.zIndex = 99;
|
||||
|
||||
//----------------------------------
|
||||
// Get div height && width
|
||||
//----------------------------------
|
||||
|
||||
var divheight = parseInt( this.divobj.style.Height );
|
||||
var divwidth = parseInt( this.divobj.style.Width );
|
||||
|
||||
divheight = divheight ? divheight : 200;
|
||||
divwidth = divwidth ? divwidth : 400;
|
||||
|
||||
//----------------------------------
|
||||
// Get current scroll offset
|
||||
//----------------------------------
|
||||
|
||||
var scrolly = this.getYscroll();
|
||||
|
||||
//----------------------------------
|
||||
// Finalize...
|
||||
//----------------------------------
|
||||
|
||||
var setX = ( my_width - divwidth ) / 2;
|
||||
var setY = ( my_height - divheight ) / 2 + scrolly;
|
||||
|
||||
setX = ( setX < 0 ) ? 0 : setX;
|
||||
setY = ( setY < 0 ) ? 0 : setY;
|
||||
|
||||
this.divobj.style.left = setX + "px";
|
||||
this.divobj.style.top = setY + "px";
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Hide div
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
center_div.prototype.hide_div = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! this.divobj )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.divobj.style.display = 'none';
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get YScroll
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
center_div.prototype.getYscroll = function()
|
||||
{
|
||||
var scrollY = 0;
|
||||
|
||||
if ( document.documentElement && document.documentElement.scrollTop )
|
||||
{
|
||||
scrollY = document.documentElement.scrollTop;
|
||||
}
|
||||
else if ( document.body && document.body.scrollTop )
|
||||
{
|
||||
scrollY = document.body.scrollTop;
|
||||
}
|
||||
else if ( window.pageYOffset )
|
||||
{
|
||||
scrollY = window.pageYOffset;
|
||||
}
|
||||
else if ( window.scrollY )
|
||||
{
|
||||
scrollY = window.scrollY;
|
||||
}
|
||||
|
||||
return scrollY;
|
||||
}
|
||||
var input_red='input-warn';var input_green='input-ok';var input_ok_box='input-ok-content';var input_warn_box='input-warn-content';var img_blank='blank.gif';var img_tick='aff_tick.gif';var img_cross='aff_cross.gif';var uagent=navigator.userAgent.toLowerCase();var is_safari=((uagent.indexOf('safari')!=-1)||(navigator.vendor=="Apple Computer, Inc."));var is_opera=(uagent.indexOf('opera')!=-1);var is_webtv=(uagent.indexOf('webtv')!=-1);var is_ie=((uagent.indexOf('msie')!=-1)&&(!is_opera)&&(!is_safari)&&(!is_webtv));var is_ie4=((is_ie)&&(uagent.indexOf("msie 4.")!=-1));var is_ie7=((is_ie)&&(uagent.indexOf("msie 7.")!=-1));var is_moz=(navigator.product=='Gecko');var is_ns=((uagent.indexOf('compatible')==-1)&&(uagent.indexOf('mozilla')!=-1)&&(!is_opera)&&(!is_webtv)&&(!is_safari));var is_ns4=((is_ns)&&(parseInt(navigator.appVersion)==4));var is_kon=(uagent.indexOf('konqueror')!=-1);var is_win=((uagent.indexOf("win")!=-1)||(uagent.indexOf("16bit")!=-1));var is_mac=((uagent.indexOf("mac")!=-1)||(navigator.vendor=="Apple Computer, Inc."));var ua_vers=parseInt(navigator.appVersion);var ipb_pages_shown=0;var ipb_pages_array=new Array();var ipb_skin_url=ipb_skin_url?ipb_skin_url:ipb_var_image_url;function gbl_check_search_box(){try{var _cb=document.getElementById('gbl-search-checkbox');var _fd=document.getElementById('gbl-search-forums');if(_cb.checked&&ipb_input_f){_fd.value=ipb_input_f;}else{_fd.value='all';}}catch(error){}};function show_inline_messages(){var _string=window.location.toString();var _msg_box=null;if(_string.indexOf('?___msg=')!=-1||_string.indexOf(';___msg=')!=-1||_string.indexOf('&___msg=')!=-1){try{if(parent.document.getElementById('ipd-msg-text')){_msg_box=parent.document.getElementById('ipd-msg-text');}else{_msg_box=document.getElementById('ipd-msg-text');}}catch(error){alert(error);}var message=_string.replace( /^.*[\?;&]___msg=(.+?)(&.*$|$)/,"$1");message=unescape(message);if(message_pop_up_lang[message]){try{_msg_box.innerHTML=message_pop_up_lang[message];centerdiv=new center_div();centerdiv.divname='ipd-msg-wrapper';centerdiv.move_div();var _this_to=setTimeout("hide_inline_messages_instant()",2000);}catch(anerror){alert(message_pop_up_lang[message]);}}}};function show_inline_messages_instant(msg){_msg_box=document.getElementById('ipd-msg-text');_msg_box.innerHTML=message_pop_up_lang[msg];centerdiv=new center_div();centerdiv.divname='ipd-msg-wrapper';centerdiv.move_div();var _this_to=setTimeout("hide_inline_messages_instant()",2000);};function hide_inline_messages_instant(){try{document.getElementById('ipd-msg-wrapper').style.display='none';parent.document.getElementById('ipd-msg-wrapper').style.display='none';}catch(acold){}};function iframe_include(){this.iframe_id=null;this.iframe_obj=null;this.iframe_add_to_div=null;this.iframe_add_to_div_obj=null;this.iframe_main_wrapper=null;this.iframe_classname='GBL-component-iframe';this.ok_to_go=1;this.iframe_height=300;this.ajax='';};iframe_include.prototype.init=function(){try{this.iframe_add_to_div_obj=document.getElementById(this.iframe_add_to_div);}catch(error){this.ok_to_go=0;}};iframe_include.prototype.include=function(url){if(!this.ok_to_go){return false;}var iheight=parseInt(this.iframe_add_to_div_obj.style.height);var iwidth=this.iframe_add_to_div_obj.style.width;if(this.iframe_obj){this.iframe_add_to_div_obj.removeChild(this.iframe_obj);}this.iframe_obj=document.createElement('IFRAME');this.iframe_obj.src=url;this.iframe_obj.id=this.iframe_id;this.iframe_obj.name=this.iframe_id;this.iframe_obj.scrolling='no';this.iframe_obj.frameBorder='no';this.iframe_obj.border='0';this.iframe_obj.className=this.iframe_classname;this.iframe_obj.style.width=iwidth?iwidth:'100%';this.iframe_obj.style.height=iheight?iheight-5+'px':this.iframe_height+'px';this.iframe_obj.style.overflow='hidden';this.iframe_obj.style.padding='0px';this.iframe_obj.style.margin='0px';this.ajax=new ajax_request();this.iframe_add_to_div_obj.style.padding='0px';this.iframe_add_to_div_obj.style.margin='0px';this.iframe_obj.iframe_loaded=0;this.iframe_obj.iframe_init=0;this.iframe_obj._this=this;this.iframe_add_to_div_obj.style.overflow='';this.iframe_add_to_div_obj.appendChild(this.iframe_obj);this.ajax.show_loading("Loading content...");if(is_ie){this.iframe_obj.allowTransparency=true;this.iframe_obj.onreadystatechange=this.iframe_on_load_ie;}else{this.iframe_obj.onload=this.iframe_onload;}};iframe_include.prototype.iframe_onload=function(e){var _document=this._this.iframe_obj.contentDocument;if(is_safari){_document=window.frames[this.id].document;}if(!this.iframe_init){this.iframe_init=1;this.iframe_loaded=1;_document.onmousedown=menu_action_close;}else{this.iframe_loaded=1;_document.onmousedown=menu_action_close;}this._this.ajax.hide_loading();try{_document.getElementsByTagName('body')[0].style.padding='0px';_document.getElementsByTagName('body')[0].style.margin='0px';}catch(error){}var _new_height=parseInt(_document.getElementById(this._this.iframe_main_wrapper).offsetHeight);ifLine truncated
|
||||
@@ -1,369 +1 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS XML HTTP REQUEST:: GET NEW POSTS
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports Safari, Mozilla 1.3+ (Firefox, etc) and IE 5.5+
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT VARS
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var gnp_div = 'get-new-posts_menu';
|
||||
var msg_div = 'get-new-msgs_menu';
|
||||
var mem_div = 'get-members';
|
||||
var divobj;
|
||||
var divopen = 0;
|
||||
var xmlobj;
|
||||
|
||||
var myass_main;
|
||||
var myass_loaded = 0;
|
||||
var pm_cycle_count = 0;
|
||||
var search_cache = {};
|
||||
var posts_st = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get NEXT posts link
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_show_new_posts( st )
|
||||
{
|
||||
posts_st = st;
|
||||
xml_myassistant_init( 'posts' );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Load MyASSISTANT!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_myassistant_init( tab )
|
||||
{
|
||||
myass_main = document.getElementById( 'get-myassistant' );
|
||||
myass_drag = document.getElementById( 'myass-drag' );
|
||||
myass_content = document.getElementById( 'myass-content' );
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// 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() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
//----------------------------------
|
||||
// Stop IE showing select boxes over
|
||||
// floating div [ 1 ]
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
html = "<iframe id='myass-shim' src='javascript;' class='iframshim' scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; right:0px; display: none;'></iframe>" + html;
|
||||
}
|
||||
|
||||
myass_content.innerHTML = html;
|
||||
|
||||
//----------------------------------
|
||||
// Stop IE showing select boxes over
|
||||
// floating div [ 2 ]
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
myass_shim = document.getElementById('myass-shim');
|
||||
myass_shim.style.width = myass_content.offsetWidth;
|
||||
myass_shim.style.height = myass_content.offsetHeight;
|
||||
myass_shim.style.zIndex = myass_content.style.zIndex - 1;
|
||||
myass_shim.style.top = myass_content.style.top;
|
||||
myass_shim.style.left = myass_content.style.left;
|
||||
myass_shim.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
if ( ! tab )
|
||||
{
|
||||
xmlobj.process( ipb_var_base_url + 'act=buddy&xml=1' );
|
||||
}
|
||||
else if ( tab == 'newpms' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Figure out where we are..
|
||||
//----------------------------------
|
||||
|
||||
var limit_a = 0;
|
||||
|
||||
pm_cycle_count++;
|
||||
|
||||
if ( pm_cycle_count <= ipb_new_msgs )
|
||||
{
|
||||
limit_a = pm_cycle_count - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
pm_cycle_count = 1;
|
||||
}
|
||||
|
||||
xmlobj.process( ipb_var_base_url + 'act=buddy&xml=1&tab=' + tab + '&limit=' + limit_a );
|
||||
|
||||
myass_content.style.width = '399px';
|
||||
myass_content.style.overflow = 'auto';
|
||||
}
|
||||
else if ( tab == 'posts' )
|
||||
{
|
||||
xmlobj.process( ipb_var_base_url + 'act=buddy&xml=1&tab=' + tab + '&st=' + posts_st );
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlobj.process( ipb_var_base_url + 'act=buddy&xml=1&tab=' + tab);
|
||||
}
|
||||
|
||||
myass_main.style.position = 'absolute';
|
||||
myass_main.style.display = 'block';
|
||||
myass_main.style.zIndex = 99;
|
||||
|
||||
//----------------------------------
|
||||
// Not loaded? INIT
|
||||
//----------------------------------
|
||||
|
||||
if ( ! myass_loaded )
|
||||
{
|
||||
//----------------------------------
|
||||
// Figure width and height
|
||||
//----------------------------------
|
||||
|
||||
var my_width = 0;
|
||||
var my_height = 0;
|
||||
|
||||
if ( typeof( window.innerWidth ) == 'number' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Non IE
|
||||
//----------------------------------
|
||||
|
||||
my_width = window.innerWidth;
|
||||
my_height = window.innerHeight;
|
||||
}
|
||||
else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// IE 6+
|
||||
//----------------------------------
|
||||
|
||||
my_width = document.documentElement.clientWidth;
|
||||
my_height = document.documentElement.clientHeight;
|
||||
}
|
||||
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// Old IE
|
||||
//----------------------------------
|
||||
|
||||
my_width = document.body.clientWidth;
|
||||
my_height = document.body.clientHeight;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Get div height && width
|
||||
//----------------------------------
|
||||
|
||||
var divheight = parseInt( myass_main.style.Height );
|
||||
var divwidth = parseInt( myass_main.style.Width );
|
||||
|
||||
divheight = divheight ? divheight : 400;
|
||||
divwidth = divwidth ? divwidth : 400;
|
||||
|
||||
//----------------------------------
|
||||
// Got it stored in a cookie?
|
||||
//----------------------------------
|
||||
|
||||
var divxy = my_getcookie( 'ipb-myass-div' );
|
||||
var co_ords;
|
||||
|
||||
if ( divxy && divxy != null )
|
||||
{
|
||||
co_ords = divxy.split( ',' );
|
||||
|
||||
//----------------------------------
|
||||
// Got co-ords?
|
||||
//----------------------------------
|
||||
|
||||
if ( co_ords.length )
|
||||
{
|
||||
var final_width = co_ords[0];
|
||||
var final_height = co_ords[1];
|
||||
|
||||
if ( co_ords[0] > my_width )
|
||||
{
|
||||
//----------------------------------
|
||||
// Keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
final_width = my_width - divwidth;
|
||||
}
|
||||
|
||||
if ( co_ords[1] > my_height )
|
||||
{
|
||||
//----------------------------------
|
||||
// Keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
final_height = my_height - divheight;
|
||||
}
|
||||
|
||||
myass_main.style.left = final_width + 'px';
|
||||
myass_main.style.top = final_height + 'px';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// Reposition DIV roughly centered
|
||||
//----------------------------------
|
||||
|
||||
myass_main.style.left = my_width / 2 - (divwidth / 2) + 'px';
|
||||
myass_main.style.top = my_height / 2 - (divheight / 2 ) + 'px';
|
||||
}
|
||||
|
||||
Drag.cookiename = 'ipb-myass-div';
|
||||
Drag.init( myass_drag, myass_main );
|
||||
|
||||
myass_loaded = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Alter DST Retrieve XML document
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_myassistant_search( url )
|
||||
{
|
||||
var keywords = document.getElementById('myass-search-input').value;
|
||||
var msg_field = document.getElementById('myass-search-message');
|
||||
var url = ipb_var_base_url+'act=Search&CODE=01&forums=all&cat_forum=forum&joinname=1&search_in=posts&result_type=topics&xml=1&keywords='+escape(keywords);
|
||||
|
||||
if ( keywords.length < 4 )
|
||||
{
|
||||
msg_field.innerHTML = ipb_myass_chars_lang;
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Already cached?
|
||||
//----------------------------------
|
||||
|
||||
if ( search_cache[ keywords ] )
|
||||
{
|
||||
msg_field.innerHTML = search_cache[ keywords ];
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// 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();
|
||||
return;
|
||||
}
|
||||
|
||||
xmlobj.hide_loading();
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
msg_field.innerHTML = html;
|
||||
search_cache[ keywords ] = html;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( url );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Alter DST Retrieve XML document
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_dst_set( url )
|
||||
{
|
||||
/*--------------------------------------------*/
|
||||
// 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() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'error' )
|
||||
{
|
||||
window.location = url.replace( '&xml=1', '&xml=0');
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( url );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var gnp_div='get-new-posts_menu';var msg_div='get-new-msgs_menu';var mem_div='get-members';var divobj;var divopen=0;var xmlobj;var reg_img='';var myass_main;var myass_loaded=0;var pm_cycle_count=0;var search_cache={};var posts_st=0;function xml_show_new_posts(st){posts_st=st;xml_myassistant_init('posts');}function xml_myassistant_init(tab){myass_main=document.getElementById('get-myassistant');myass_drag=document.getElementById('myass-drag');myass_content=document.getElementById('myass-content');do_request_function=function(){if(!xmlobj_myass.readystate_ready_and_ok()){return;}var html=xmlobj_myass.xmlhandler.responseText;if(is_ie){html="<iframe id='myass-shim' src='"+ipb_var_image_url+"/iframe.html' class='iframshim' scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; right:0px; display: none;'></iframe>"+html;}myass_content.innerHTML=html;if(is_ie){drag_html=myass_drag.innerHTML;main_drag_html="<iframe id='myass-shim-two' src='"+ipb_var_image_url+"/iframe.html' class='iframshim' scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; right:0px; display: none;'></iframe>"+drag_html;myass_drag.innerHTML=main_drag_html;}if(is_ie){myass_shim=document.getElementById('myass-shim');myass_shim.style.width=myass_content.offsetWidth;myass_shim.style.height=myass_content.offsetHeight;myass_shim.style.zIndex=myass_content.style.zIndex-1;myass_shim.style.top=myass_content.style.top;myass_shim.style.left=myass_content.style.left;myass_shim.style.display="block";myass_shim_d=document.getElementById('myass-shim-two');myass_shim_d.style.width=myass_drag.offsetWidth;myass_shim_d.style.height=myass_drag.offsetHeight;myass_shim_d.style.zIndex=myass_drag.style.zIndex-1;myass_shim_d.style.top=myass_drag.style.top;myass_shim_d.style.left=myass_drag.style.left;myass_shim_d.style.display="block";}};xmlobj_myass=new ajax_request();xmlobj_myass.onreadystatechange(do_request_function);if(!tab){xmlobj_myass.process(ipb_var_base_url+'act=buddy&xml=1');}else if(tab=='newpms'){var limit_a=0;pm_cycle_count++;if(pm_cycle_count<=ipb_new_msgs){limit_a=pm_cycle_count-1;}else{pm_cycle_count=1;}xmlobj_myass.process(ipb_var_base_url+'act=buddy&xml=1&tab='+tab+'&limit='+limit_a);myass_content.style.width='398px';myass_content.style.overflow='auto';myass_content.style.overflowX='hidden';}else if(tab=='posts'){xmlobj_myass.process(ipb_var_base_url+'act=buddy&xml=1&tab='+tab+'&st='+posts_st);}else{xmlobj_myass.process(ipb_var_base_url+'act=buddy&xml=1&tab='+tab);}myass_main.style.position='absolute';myass_main.style.display='block';myass_main.style.zIndex=99;if(!myass_loaded){var my_width=0;var my_height=0;if(typeof(window.innerWidth)=='number'){my_width=window.innerWidth;my_height=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){my_width=document.documentElement.clientWidth;my_height=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){my_width=document.body.clientWidth;my_height=document.body.clientHeight;}var divheight=parseInt(myass_main.style.Height);var divwidth=parseInt(myass_main.style.Width);divheight=divheight?divheight:400;divwidth=divwidth?divwidth:400;var divxy=my_getcookie('ipb-myass-div');var co_ords;if(divxy&&divxy!=null){co_ords=divxy.split(',');if(co_ords.length){var final_width=co_ords[0];var final_height=co_ords[1];if(co_ords[0]>my_width){final_width=my_width-divwidth;}if(co_ords[1]>my_height){final_height=my_height-divheight;}myass_main.style.left=final_width+'px';myass_main.style.top=final_height+'px';}}else{myass_main.style.left=my_width/2-(divwidth/2)+'px';myass_main.style.top=my_height/2-(divheight/2)+'px';}Drag.cookiename='ipb-myass-div';Drag.init(myass_drag,myass_main);myass_loaded=1;}};function xml_myassistant_search(url){var keywords=document.getElementById('myass-search-input').value;var msg_field=document.getElementById('myass-search-message');var url=ipb_var_base_url+'act=Search&CODE=01&forums=all&cat_forum=forum&joinname=1&search_in=posts&result_type=topics&xml=1&keywords='+escape(keywords);if(keywords.length<4){msg_field.innerHTML=ipb_myass_chars_lang;return false;}if(search_cache[keywords]){msg_field.innerHTML=search_cache[keywords];return;}do_request_function=function(){if(!xmlobj.readystate_ready_and_ok()){xmlobj.show_loading();return;}xmlobj.hide_loading();var html=xmlobj.xmlhandler.responseText;msg_field.innerHTML=html;search_cache[keywords]=html;};xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(url);};function xml_dst_set(url){do_request_function=function(){if(!xmlobj.readystate_ready_and_ok()){return;}var html=xmlobj.xmlhandler.responseText;if(html=='error'){window.location=url.replace('&xml=1','&xml=0');}};xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(url);};function init_gd_image(){reg_img=document.getElementById('gd-antispam');try{regLine truncated
|
||||
+1
-178
@@ -1,178 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// PM JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
//==========================================
|
||||
// Check All boxes
|
||||
//==========================================
|
||||
|
||||
function CheckAll(fmobj)
|
||||
{
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled))
|
||||
{
|
||||
e.checked = fmobj.allbox.checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Check all or uncheck all?
|
||||
//==========================================
|
||||
|
||||
function CheckCheckAll(fmobj)
|
||||
{
|
||||
var TotalBoxes = 0;
|
||||
var TotalOn = 0;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.name != 'allbox') && (e.type=='checkbox'))
|
||||
{
|
||||
TotalBoxes++;
|
||||
if (e.checked)
|
||||
{
|
||||
TotalOn++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TotalBoxes==TotalOn)
|
||||
{
|
||||
fmobj.allbox.checked=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fmobj.allbox.checked=false;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// INBOX FUNCTIONS
|
||||
//==========================================
|
||||
|
||||
var ie = document.all ? 1 : 0;
|
||||
//var ns4 = document.layers ? 1 : 0;
|
||||
|
||||
//==========================================
|
||||
// highlite
|
||||
//==========================================
|
||||
|
||||
function hl(cb)
|
||||
{
|
||||
if (ie)
|
||||
{
|
||||
while (cb.tagName != "TR")
|
||||
{
|
||||
cb = cb.parentElement;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (cb.tagName != "TD")
|
||||
{
|
||||
cb = cb.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
cb.className = 'row1';
|
||||
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// down-lite
|
||||
//==========================================
|
||||
|
||||
function dl(cb)
|
||||
{
|
||||
if (ie)
|
||||
{
|
||||
while (cb.tagName != "TR")
|
||||
{
|
||||
cb = cb.parentElement;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (cb.tagName != "TD")
|
||||
{
|
||||
cb = cb.parentNode;
|
||||
}
|
||||
}
|
||||
cb.className = 'row2';
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Boxes checked?
|
||||
//==========================================
|
||||
|
||||
function cca(cb)
|
||||
{
|
||||
if (cb.checked)
|
||||
{
|
||||
hl(cb);
|
||||
}
|
||||
else
|
||||
{
|
||||
dl(cb);
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Inbox check all
|
||||
//==========================================
|
||||
|
||||
function InboxCheckAll(cb)
|
||||
{
|
||||
var fmobj = document.mutliact;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled))
|
||||
{
|
||||
e.checked = fmobj.allbox.checked;
|
||||
if (fmobj.allbox.checked)
|
||||
{
|
||||
hl(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
dl(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function select_read()
|
||||
{
|
||||
var fmobj = document.mutliact;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.type=='hidden') && (e.value == 1) && (! isNaN(e.name) ))
|
||||
{
|
||||
eval("fmobj.msgid_" + e.name + ".checked=true;");
|
||||
hl(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unselect_all()
|
||||
{
|
||||
var fmobj = document.mutliact;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if (e.type=='checkbox')
|
||||
{
|
||||
e.checked=false;
|
||||
dl(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
function CheckAll(fmobj){for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.name!='allbox')&&(e.type=='checkbox')&&(!e.disabled)){e.checked=fmobj.allbox.checked;}}}function CheckCheckAll(fmobj){var TotalBoxes=0;var TotalOn=0;for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.name!='allbox')&&(e.type=='checkbox')){TotalBoxes++;if(e.checked){TotalOn++;}}}if(TotalBoxes==TotalOn){fmobj.allbox.checked=true;}else{fmobj.allbox.checked=false;}}var ie=document.all?1:0;function hl(cb){if(ie){while(cb.tagName!="TR"){cb=cb.parentElement;}}else{while(cb.tagName!="TD"){cb=cb.parentNode;}}cb.className='row1';}function dl(cb){if(ie){while(cb.tagName!="TR"){cb=cb.parentElement;}}else{while(cb.tagName!="TD"){cb=cb.parentNode;}}cb.className='row2';}function cca(cb){if(cb.checked){hl(cb);}else{dl(cb);}}function InboxCheckAll(cb){var fmobj=document.mutliact;for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.name!='allbox')&&(e.type=='checkbox')&&(!e.disabled)){e.checked=fmobj.allbox.checked;if(fmobj.allbox.checked){hl(e);}else{dl(e);}}}}function select_read(){var fmobj=document.mutliact;for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.type=='hidden')&&(e.value==1)&&(!isNaN(e.name))){eval("fmobj.msgid_"+e.name+".checked=true;");hl(e);}}}function unselect_all(){var fmobj=document.mutliact;for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.name!='allbox')&&(e.type=='checkbox')&&(!e.disabled)){e.checked=false;dl(e);}}}
|
||||
+1
-409
@@ -1,409 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// POLL JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
// ASSUMES 'ipb_global.php' as been loaded
|
||||
//------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT
|
||||
/*--------------------------------------------*/
|
||||
|
||||
//-------------------------------
|
||||
// DIV & FORM id names
|
||||
//-------------------------------
|
||||
|
||||
var open_div = 'poll-box-open';
|
||||
var closed_div = 'poll-box-closed';
|
||||
var stat_div = 'poll-box-stat';
|
||||
var main_div = 'poll-box-main';
|
||||
var form_id = 'postingform';
|
||||
|
||||
//-------------------------------
|
||||
// DIV AND FORM objects
|
||||
//-------------------------------
|
||||
|
||||
var openobj;
|
||||
var closedobj;
|
||||
var formobj;
|
||||
var statobj;
|
||||
var mainobj;
|
||||
|
||||
//-------------------------------
|
||||
// Counters
|
||||
//-------------------------------
|
||||
|
||||
var used_questions = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT STATE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_init_state()
|
||||
{
|
||||
//-------------------------------
|
||||
// Get objects
|
||||
//-------------------------------
|
||||
|
||||
openobj = document.getElementById( open_div );
|
||||
closedobj = document.getElementById( closed_div );
|
||||
formobj = document.getElementById( form_id );
|
||||
statobj = document.getElementById( stat_div );
|
||||
mainobj = document.getElementById( main_div );
|
||||
|
||||
//-------------------------------
|
||||
// Open and close divs
|
||||
//-------------------------------
|
||||
|
||||
if ( showfullonload )
|
||||
{
|
||||
my_show_div( openobj );
|
||||
my_hide_div( closedobj );
|
||||
}
|
||||
else
|
||||
{
|
||||
my_show_div( closedobj );
|
||||
my_hide_div( openobj );
|
||||
}
|
||||
|
||||
poll_draw_main_box();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// DRAW MAIN BOX
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_draw_main_box()
|
||||
{
|
||||
var html = '';
|
||||
used_questions = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Draw all current questions
|
||||
//-------------------------------
|
||||
|
||||
for( var i in poll_questions )
|
||||
{
|
||||
var qhtml = '';
|
||||
used_questions++;
|
||||
|
||||
//-------------------------------
|
||||
// Show question box
|
||||
//-------------------------------
|
||||
|
||||
var question = poll_questions[i];
|
||||
var inputhtml = lang_build_string( html_question_box, i, _poll_make_form_safe( question ) );
|
||||
|
||||
qhtml += "\n" + inputhtml + "\n";
|
||||
|
||||
//-------------------------------
|
||||
// Now, to add the poll choices..
|
||||
//-------------------------------
|
||||
|
||||
var choices = '';
|
||||
var choices_count = 0;
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
var votes_box;
|
||||
|
||||
//-------------------------------
|
||||
// Is this a choice for this q?
|
||||
//-------------------------------
|
||||
|
||||
var id = c.replace( new RegExp( "^" + i + "_(\\d+)$" ), "$1" );
|
||||
|
||||
if ( ! isNaN( id ) )
|
||||
{
|
||||
if ( is_mod )
|
||||
{
|
||||
votes_box = lang_build_string( html_votes_box, i, id, poll_votes[c]);
|
||||
}
|
||||
else
|
||||
{
|
||||
votes_box = '';
|
||||
}
|
||||
|
||||
choices_count++;
|
||||
|
||||
choices += "\n" + lang_build_string( html_choice_box, i, id, _poll_make_form_safe( poll_choices[c] ), votes_box );
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Not used max questions?
|
||||
//-------------------------------
|
||||
|
||||
if ( choices_count < max_poll_choices )
|
||||
{
|
||||
choices += lang_build_string( html_add_choice, i );
|
||||
}
|
||||
|
||||
if ( choices != '' )
|
||||
{
|
||||
qhtml += "\n" + lang_build_string( html_choice_wrap, choices ) + "\n";
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Add wrapped question w/choice
|
||||
//-------------------------------
|
||||
|
||||
html += lang_build_string(html_question_wrap, qhtml );
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Add a question link?
|
||||
//-------------------------------
|
||||
|
||||
if ( used_questions < max_poll_questions )
|
||||
{
|
||||
html += lang_build_string( html_question_wrap, html_add_question );
|
||||
}
|
||||
|
||||
mainobj.innerHTML = html;
|
||||
|
||||
poll_update_state();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// WRITE FORM TO ARRAY
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_write_form_to_array()
|
||||
{
|
||||
//-------------------------------
|
||||
// Update question array with form
|
||||
//-------------------------------
|
||||
|
||||
var tmp_poll_questions = {};
|
||||
var tmp_poll_choices = {};
|
||||
|
||||
for ( var i in poll_questions )
|
||||
{
|
||||
//-------------------------------
|
||||
// Get form value...
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
tmp_poll_questions[ i ] = document.getElementById( 'question_' + i ).value;
|
||||
}
|
||||
catch(e) { }
|
||||
}
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
//-------------------------------
|
||||
// Get form value...
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
tmp_poll_choices[ c ] = document.getElementById( 'choice_' + c ).value;
|
||||
}
|
||||
catch(e) { }
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Update
|
||||
//-------------------------------
|
||||
|
||||
poll_questions = tmp_poll_questions;
|
||||
poll_choices = tmp_poll_choices;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// ADD POLL QUESTION
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_add_question()
|
||||
{
|
||||
var maxid = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Get max choice ID
|
||||
//-------------------------------
|
||||
|
||||
for ( var i in poll_questions )
|
||||
{
|
||||
if ( i > maxid )
|
||||
{
|
||||
maxid = parseInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
maxid = maxid + 1;
|
||||
|
||||
poll_write_form_to_array();
|
||||
|
||||
poll_questions[ maxid ] = '';
|
||||
|
||||
poll_draw_main_box();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// ADD POLL CHOICE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_add_choice( qid )
|
||||
{
|
||||
var maxid = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Get max choice ID
|
||||
//-------------------------------
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
//-------------------------------
|
||||
// Is this a choice for this q?
|
||||
//-------------------------------
|
||||
|
||||
var id = c.replace( new RegExp( "^" + qid + "_(\\d+)$" ), "$1" );
|
||||
|
||||
if ( ! isNaN( id ) )
|
||||
{
|
||||
if ( id > maxid )
|
||||
{
|
||||
maxid = parseInt(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
maxid = maxid + 1;
|
||||
|
||||
poll_write_form_to_array();
|
||||
|
||||
poll_choices[ qid +'_'+maxid ] = '';
|
||||
|
||||
if ( is_mod )
|
||||
{
|
||||
poll_votes[ qid +'_'+maxid ] = 0;
|
||||
}
|
||||
|
||||
poll_draw_main_box();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// REMOVE POLL CHOICE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_remove_choice( mainid )
|
||||
{
|
||||
if ( confirm( js_lang_confirm ) )
|
||||
{
|
||||
delete( poll_choices[ mainid ] );
|
||||
|
||||
if ( is_mod )
|
||||
{
|
||||
delete( poll_votes[ mainid ] );
|
||||
}
|
||||
|
||||
poll_write_form_to_array();
|
||||
poll_draw_main_box();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// REMOVE POLL QUESTION
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_remove_question( mainid )
|
||||
{
|
||||
if ( confirm( js_lang_confirm ) )
|
||||
{
|
||||
//-------------------------------
|
||||
// Delete question
|
||||
//-------------------------------
|
||||
|
||||
delete( poll_questions[ mainid ] );
|
||||
|
||||
//-------------------------------
|
||||
// Delete choices
|
||||
//-------------------------------
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
//-------------------------------
|
||||
// Is this a choice for this q?
|
||||
//-------------------------------
|
||||
|
||||
var id = c.replace( new RegExp( "^" + mainid + "_(\\d+)$" ), "$1" );
|
||||
|
||||
if ( ! isNaN( id ) )
|
||||
{
|
||||
delete( poll_choices[ c ] );
|
||||
|
||||
if ( is_mod )
|
||||
{
|
||||
delete( poll_votes[ c ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
poll_write_form_to_array();
|
||||
poll_draw_main_box();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// UPDATE POLL STATE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_update_state()
|
||||
{
|
||||
used = max_poll_questions - used_questions;
|
||||
|
||||
var tmp_lang = lang_build_string( poll_stat_lang, used, max_poll_choices );
|
||||
statobj.innerHTML = lang_build_string( html_stat_wrap, tmp_lang );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// SHOW POLL FORM
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function show_poll_form()
|
||||
{
|
||||
my_show_div( openobj );
|
||||
my_hide_div( closedobj );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// CLOSE POLL FORM
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function close_poll_form()
|
||||
{
|
||||
my_show_div( closedobj );
|
||||
my_hide_div( openobj );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// FORM MAKE SAFE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function _poll_make_form_safe( t )
|
||||
{
|
||||
t = t.replace( /'/g, ''' );
|
||||
t = t.replace( /"/g, '"' );
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var open_div='poll-box-open';var closed_div='poll-box-closed';var stat_div='poll-box-stat';var main_div='poll-box-main';var form_id='postingform';var openobj;var closedobj;var formobj;var statobj;var mainobj;var used_questions=0;function poll_init_state(){openobj=document.getElementById(open_div);closedobj=document.getElementById(closed_div);formobj=document.getElementById(form_id);statobj=document.getElementById(stat_div);mainobj=document.getElementById(main_div);if(showfullonload){my_show_div(openobj);my_hide_div(closedobj);}else{my_show_div(closedobj);my_hide_div(openobj);}poll_draw_main_box();}function poll_draw_main_box(){var html='';used_questions=0;for(var i in poll_questions){var qhtml='';used_questions++;var question=poll_questions[i];var this_poll_multi='';for(var x in poll_multi){if(x==i){if(poll_multi[x]==1){this_poll_multi="checked='checked'";}}}var inputhtml=lang_build_string(html_question_box,i,_poll_make_form_safe(question),this_poll_multi);qhtml+="\n"+inputhtml+"\n";var choices='';var choices_count=0;for(var c in poll_choices){var votes_box;var id=c.replace(new RegExp("^"+i+"_(\\d+)$"),"$1");if(!isNaN(id)){if(is_mod){votes_box=lang_build_string(html_votes_box,i,id,poll_votes[c]);}else{votes_box='';}choices_count++;choices+="\n"+lang_build_string(html_choice_box,i,id,_poll_make_form_safe(poll_choices[c]),votes_box);}}if(choices_count<max_poll_choices){choices+=lang_build_string(html_add_choice,i);}if(choices!=''){qhtml+="\n"+lang_build_string(html_choice_wrap,choices)+"\n";}html+=lang_build_string(html_question_wrap,qhtml);}if(used_questions<max_poll_questions){html+=lang_build_string(html_question_wrap,html_add_question);}mainobj.innerHTML=html;poll_update_state();}function poll_write_form_to_array(){var tmp_poll_questions={};var tmp_poll_choices={};var tmp_poll_multi={};for(var i in poll_questions){try{tmp_poll_questions[i]=document.getElementById('question_'+i).value;}catch(e){}}for(var x in poll_multi){try{tmp_poll_multi[x]=document.getElementById('multi_'+x).checked?1:0;}catch(e){}}for(var c in poll_choices){try{tmp_poll_choices[c]=document.getElementById('choice_'+c).value;}catch(e){}}poll_questions=tmp_poll_questions;poll_choices=tmp_poll_choices;poll_multi=tmp_poll_multi;}function poll_add_question(){var maxid=0;for(var i in poll_questions){if(i>maxid){maxid=parseInt(i);}}maxid=maxid+1;poll_write_form_to_array();poll_questions[maxid]='';poll_multi[maxid]='';poll_draw_main_box();return false;}function poll_add_choice(qid){var maxid=0;for(var c in poll_choices){var id=c.replace(new RegExp("^"+qid+"_(\\d+)$"),"$1");if(!isNaN(id)){if(id>maxid){maxid=parseInt(id);}}}maxid=maxid+1;poll_write_form_to_array();poll_choices[qid+'_'+maxid]='';if(is_mod){poll_votes[qid+'_'+maxid]=0;}poll_draw_main_box();return false;}function poll_remove_choice(mainid){if(confirm(js_lang_confirm)){delete(poll_choices[mainid]);if(is_mod){delete(poll_votes[mainid]);}poll_write_form_to_array();poll_draw_main_box();}return false;}function poll_remove_question(mainid){if(confirm(js_lang_confirm)){delete(poll_questions[mainid]);for(var c in poll_choices){var id=c.replace(new RegExp("^"+mainid+"_(\\d+)$"),"$1");if(!isNaN(id)){delete(poll_choices[c]);if(is_mod){delete(poll_votes[c]);}}}poll_write_form_to_array();poll_draw_main_box();}return false;}function poll_update_state(){used=max_poll_questions-used_questions;var tmp_lang=lang_build_string(poll_stat_lang,used,max_poll_choices);statobj.innerHTML=lang_build_string(html_stat_wrap,tmp_lang);}function show_poll_form(){my_show_div(openobj);my_hide_div(closedobj);}function close_poll_form(){my_show_div(closedobj);my_hide_div(openobj);}function _poll_make_form_safe(t){t=t.replace( /'/g,''');t=t.replace( /"/g,'"');return t;}
|
||||
@@ -1,36 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// Profile JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Profile: Open pop-up window
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function profile_dname_history( mid )
|
||||
{
|
||||
//----------------------------------
|
||||
// Attempt to close the menu
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
menu_action_close();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Launch Pop Up
|
||||
//----------------------------------
|
||||
|
||||
PopUp( ipb_var_base_url + 'act=profile&CODE=show-display-names&id=' + mid, 'DNAMETITLE', 400, 300 );
|
||||
|
||||
return false;
|
||||
}
|
||||
function profile_dname_history(mid){try{menu_action_close();}catch(e){}PopUp(ipb_var_base_url+'act=profile&CODE=show-display-names&id='+mid,'DNAMETITLE',400,300);return false;}
|
||||
+909
-863
File diff suppressed because it is too large.
Load diff
@@ -1,616 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// Topics JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
var mystored_selection = '';
|
||||
var post_cache = new Array();
|
||||
var ajax_loaded = 1;
|
||||
var ignore_cache = new Array();
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Fast reply stuff
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function emoticon( ecode, eobj, eurl )
|
||||
{
|
||||
ecode = ' ' + ecode + ' ';
|
||||
var obj_ta = document.getElementById( 'fastreplyarea' );
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win)
|
||||
{
|
||||
if (obj_ta.isTextEdit)
|
||||
{
|
||||
obj_ta.focus();
|
||||
var sel = document.selection;
|
||||
var rng = sel.createRange();
|
||||
rng.colapse;
|
||||
if((sel.type == "Text" || sel.type == "None") && rng != null)
|
||||
{
|
||||
if(ecode != "" && rng.text.length > 0)
|
||||
ecode = rng.text + ecode ;
|
||||
|
||||
rng.text = ecode;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
obj_ta.value += ecode;
|
||||
}
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's MOZZY!
|
||||
//----------------------------------------
|
||||
|
||||
else if ( obj_ta.selectionEnd )
|
||||
{
|
||||
var ss = obj_ta.selectionStart;
|
||||
var st = obj_ta.scrollTop;
|
||||
var es = obj_ta.selectionEnd;
|
||||
|
||||
if (es <= 2)
|
||||
{
|
||||
es = obj_ta.textLength;
|
||||
}
|
||||
|
||||
var start = (obj_ta.value).substring(0, ss);
|
||||
var middle = (obj_ta.value).substring(ss, es);
|
||||
var end = (obj_ta.value).substring(es, obj_ta.textLength);
|
||||
|
||||
//-----------------------------------
|
||||
// text range?
|
||||
//-----------------------------------
|
||||
|
||||
if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
|
||||
{
|
||||
middle = ecode + middle;
|
||||
}
|
||||
else
|
||||
{
|
||||
middle = ecode + middle;
|
||||
|
||||
}
|
||||
|
||||
obj_ta.value = start + middle + end;
|
||||
|
||||
var cpos = ss + (middle.length);
|
||||
|
||||
obj_ta.selectionStart = cpos;
|
||||
obj_ta.selectionEnd = cpos;
|
||||
obj_ta.scrollTop = st;
|
||||
}
|
||||
//----------------------------------------
|
||||
// It's CRAPPY!
|
||||
//----------------------------------------
|
||||
else
|
||||
{
|
||||
obj_ta.value += ecode;
|
||||
}
|
||||
|
||||
obj_ta.focus();
|
||||
|
||||
if ( (ua_vers >= 4) && is_ie && is_win && emowindow != 'undefined' )
|
||||
{
|
||||
emowindow.focus();
|
||||
}
|
||||
|
||||
//document.getElementById( 'fastreplyarea' ).value += ' ' + ecode + ' ';
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Topic: Scroll to post: IE fix
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function topic_scroll_to_post( post_id )
|
||||
{
|
||||
//----------------------------------
|
||||
// Check for PID
|
||||
//----------------------------------
|
||||
|
||||
if ( ! post_id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var post_main_obj = document.getElementById( 'post-main-' + post_id );
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
var post_main_obj;
|
||||
}
|
||||
|
||||
if ( post_main_obj )
|
||||
{
|
||||
var post_box_top = _get_obj_toppos( post_main_obj );
|
||||
|
||||
if ( post_box_top )
|
||||
{
|
||||
scroll( 0, post_box_top - 30 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Show hidden post
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function topic_show_ignored_post( pid )
|
||||
{
|
||||
try
|
||||
{
|
||||
// Set up
|
||||
var post_main = document.getElementById( 'post-main-' + pid );
|
||||
var post_ignore = document.getElementById( 'post-ignore-' + pid );
|
||||
|
||||
// Show it
|
||||
post_main.innerHTML = ignore_cache[ pid ];
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
//alert( e );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Initiate topic hide
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function topic_init_ignored_post( pid )
|
||||
{
|
||||
try
|
||||
{
|
||||
// Set up
|
||||
var post_main = document.getElementById( 'post-main-' + pid );
|
||||
var post_ignore = document.getElementById( 'post-ignore-' + pid );
|
||||
|
||||
// Cache it...
|
||||
ignore_cache[ pid ] = post_main.innerHTML;
|
||||
|
||||
// Display "ignored" msg
|
||||
post_main.innerHTML = post_ignore.innerHTML;
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
//alert( e );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Window Resize
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function ajax_std_window_resize( pix, pid )
|
||||
{
|
||||
var box = document.getElementById( 'post-edit-'+pid );
|
||||
var cur_height = parseInt( box.style.height ) ? parseInt( box.style.height ) : 300;
|
||||
var new_height = cur_height + pix;
|
||||
|
||||
if ( new_height > 0 )
|
||||
{
|
||||
box.style.height = new_height + "px";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Ajax: Cancel for edit
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function ajax_cancel_for_edit( post_id )
|
||||
{
|
||||
if ( post_cache[ post_id ] != "" )
|
||||
{
|
||||
document.getElementById( 'post-'+post_id ).innerHTML = post_cache[ post_id ];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Ajax: Save for edit
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function ajax_save_for_edit( post_id )
|
||||
{
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var url = ipb_var_base_url+'act=xmlout&do=post-edit-save&p='+post_id+'&t='+ipb_input_t+'&f='+ipb_input_f;
|
||||
var fields = new Array();
|
||||
|
||||
//----------------------------------
|
||||
// Populate fields
|
||||
//----------------------------------
|
||||
|
||||
fields['md5check'] = ipb_md5_check;
|
||||
fields['t'] = ipb_input_t;
|
||||
fields['f'] = ipb_input_f;
|
||||
fields['p'] = post_id;
|
||||
fields['act'] = 'xmlout';
|
||||
fields['do'] = 'post-edit-save';
|
||||
fields['Post'] = document.getElementById( 'post-edit-'+post_id ).value;
|
||||
fields['std_used'] = 1; // Make sure STD BBCode parser is used
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// 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();
|
||||
return;
|
||||
}
|
||||
|
||||
xmlobj.hide_loading();
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html != 'error' )
|
||||
{
|
||||
document.getElementById( 'post-'+post_id ).innerHTML = html;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
var xmlreturn = xmlobj.process( url, 'POST', xmlobj.format_for_post(fields) );
|
||||
|
||||
post_cache[ post_id ] = '';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Ajax: Prep for edit
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function ajax_prep_for_edit( post_id, event )
|
||||
{
|
||||
//----------------------------------
|
||||
// Cancel bubble (Prevent IE scroll...)
|
||||
//----------------------------------
|
||||
|
||||
global_cancel_bubble( event, true );
|
||||
|
||||
var post_main_obj = document.getElementById( 'post-main-' + post_id );
|
||||
var post_box_top = _get_obj_toppos( post_main_obj );
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var url = ipb_var_base_url+'act=xmlout&do=post-edit-show&p='+post_id+'&t='+ipb_input_t+'&f='+ipb_input_f;
|
||||
|
||||
if ( ! post_cache[ post_id ] || post_cache[ post_id ] == '' )
|
||||
{
|
||||
post_cache[ post_id ] = document.getElementById( 'post-'+post_id ).innerHTML;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Attempt to close open menus
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
menu_action_close();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
//alert( e );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// 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();
|
||||
return;
|
||||
}
|
||||
|
||||
xmlobj.hide_loading();
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'nopermission' )
|
||||
{
|
||||
alert( js_error_no_permission );
|
||||
}
|
||||
else if ( html != 'error' )
|
||||
{
|
||||
if ( post_box_top )
|
||||
{
|
||||
scroll( 0, post_box_top - 30 );
|
||||
}
|
||||
|
||||
document.getElementById( 'post-'+post_id ).innerHTML = html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( url );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// check selection
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function checkselection()
|
||||
{
|
||||
var myselection = '';
|
||||
|
||||
if ( window.getSelection )
|
||||
{
|
||||
myselection = window.getSelection();
|
||||
}
|
||||
else if ( document.selection )
|
||||
{
|
||||
myselection = document.selection.createRange().text;
|
||||
}
|
||||
else if ( document.getSelection )
|
||||
{
|
||||
myselection = document.getSelection();
|
||||
}
|
||||
|
||||
if ( myselection != '' && myselection != null )
|
||||
{
|
||||
if ( myselection != mystored_selection )
|
||||
{
|
||||
document.getElementById('fastreply-pastesel').style.display = '';
|
||||
mystored_selection = (myselection.toString() != '') ? myselection.toString() : null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mystored_selection = null;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Paste selection
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function pasteselection()
|
||||
{
|
||||
if ( mystored_selection != '' && mystored_selection != null )
|
||||
{
|
||||
var fr = document.getElementById('fastreplyarea');
|
||||
if (fr)
|
||||
{
|
||||
fr.value += '[quote]'+mystored_selection+'[/quote]\n';
|
||||
fr.focus();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Link to a post
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function link_to_post(pid)
|
||||
{
|
||||
temp = prompt( ipb_lang_tt_prompt, ipb_var_base_url + "showtopic=" + ipb_input_t + "&view=findpost&p=" + pid );
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Delete post
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function delete_post(theURL)
|
||||
{
|
||||
if (confirm( ipb_lang_js_del_1 ))
|
||||
{
|
||||
window.location.href=theURL;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert ( ipb_lang_js_del_2 );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Multi quote
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function multiquote_add(id)
|
||||
{
|
||||
saved = new Array();
|
||||
clean = new Array();
|
||||
add = 1;
|
||||
|
||||
//-----------------------------------
|
||||
// Get any saved info
|
||||
//-----------------------------------
|
||||
|
||||
if ( tmp = my_getcookie('mqtids') )
|
||||
{
|
||||
saved = tmp.split(",");
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Remove bit if exists
|
||||
//-----------------------------------
|
||||
|
||||
for( i = 0 ; i < saved.length; i++ )
|
||||
{
|
||||
if ( saved[i] != "" )
|
||||
{
|
||||
if ( saved[i] == id )
|
||||
{
|
||||
add = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
clean[clean.length] = saved[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Add?
|
||||
//-----------------------------------
|
||||
|
||||
if ( add )
|
||||
{
|
||||
clean[ clean.length ] = id;
|
||||
eval("document.mad_"+id+".src=removequotebutton");
|
||||
}
|
||||
else
|
||||
{
|
||||
eval(" document.mad_"+id+".src=addquotebutton");
|
||||
}
|
||||
|
||||
my_setcookie( 'mqtids', clean.join(','), 0 );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Check delete
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function checkdelete()
|
||||
{
|
||||
if ( ! document.modform.selectedpids.value )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
isDelete = document.modform.tact.options[document.modform.tact.selectedIndex].value;
|
||||
|
||||
if (isDelete == 'delete')
|
||||
{
|
||||
formCheck = confirm( lang_suredelete );
|
||||
|
||||
if (formCheck == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Toggle selection
|
||||
//*--------------------------------------------*/
|
||||
|
||||
function topic_toggle_pid( pid )
|
||||
{
|
||||
//-----------------------------------
|
||||
// Got a number?
|
||||
//-----------------------------------
|
||||
|
||||
if ( isNaN( pid ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
saved = new Array();
|
||||
clean = new Array();
|
||||
add = 1;
|
||||
|
||||
//-----------------------------------
|
||||
// Get form info
|
||||
//-----------------------------------
|
||||
|
||||
tmp = document.modform.selectedpids.value;
|
||||
|
||||
saved = tmp.split(",");
|
||||
|
||||
//-----------------------------------
|
||||
// Remove bit if exists
|
||||
//-----------------------------------
|
||||
|
||||
for( i = 0 ; i < saved.length; i++ )
|
||||
{
|
||||
if ( saved[i] != "" )
|
||||
{
|
||||
if ( saved[i] == pid )
|
||||
{
|
||||
add = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
clean[clean.length] = saved[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Add?
|
||||
//-----------------------------------
|
||||
|
||||
if ( add )
|
||||
{
|
||||
clean[ clean.length ] = pid;
|
||||
eval("document.img"+pid+".src=selectedbutton");
|
||||
}
|
||||
else
|
||||
{
|
||||
eval(" document.img"+pid+".src=unselectedbutton");
|
||||
}
|
||||
|
||||
newvalue = clean.join(',');
|
||||
|
||||
my_setcookie( 'modpids', newvalue, 0 );
|
||||
|
||||
document.modform.selectedpids.value = newvalue;
|
||||
|
||||
newcount = stacksize(clean);
|
||||
|
||||
document.modform.gobutton.value = lang_gobutton + ' (' + newcount + ')';
|
||||
|
||||
return false;
|
||||
}
|
||||
var mystored_selection='';var post_cache=new Array();var ajax_loaded=1;var ignore_cache=new Array();var rate_value=0;add_onload_event(fix_linked_image_sizes);function fix_linked_image_sizes_attach_thumb(attach_id,width,height,file_size){var _img='<img src="'+ipb_var_image_url+'/img-resized.png" style="vertical-align:middle" border="0" alt="" />';var img_obj=document.getElementById('ipb-attach-img-'+attach_id);var div_obj=document.getElementById('ipb-attach-div-'+attach_id);var ct_obj=document.getElementById('ipb-attach-ct-'+attach_id);var cb_obj=document.getElementById('ipb-attach-cb-'+attach_id);var url_obj=document.getElementById('ipb-attach-url-'+attach_id);var tbl_obj=document.getElementById('ipb-attach-table-'+attach_id);var _width=parseInt(img_obj.width)?parseInt(img_obj.width):parseInt(img_obj.style.width);var _height=parseInt(img_obj.height)?parseInt(img_obj.height):parseInt(img_obj.style.height);var _padding=5;var _percent=0;if(is_ie){_width=parseInt(img_obj.currentStyle['width']);_height=parseInt(img_obj.currentStyle['height']);}if(is_safari){tbl_obj.style.display='inline-block';}if(width&&height){_percent=Math.ceil(100-parseInt(_width/width*100));}img_obj.className='ipb';img_obj.title=ipb_global_lang['click_to_view'];img_obj.onmouseover=fix_attach_images_mouseover;img_obj.onclick=function(event){ipsclass.pop_up_window(url_obj.href,width+20,height+20);ipsclass.cancel_bubble(event);};div_obj.style.width=(_width>140?_width:140)+'px';div_obj.style.height=_height+(_padding*2)+28+'px';div_obj.className='resized-linked-image';div_obj.style.paddingTop=_padding+"px";div_obj.style.paddingBottom=_padding+"px";div_obj.style.paddingLeft=_padding+3+"px";div_obj.style.paddingRight=_padding+3+"px";div_obj.style.textAlign='center';div_obj.title=ipb_global_lang['click_to_view'];ct_obj.style.fontSize='9px';cb_obj.style.fontSize='9px';cb_obj.style.textAlign='center';if(_percent>0){ct_obj.innerHTML=_img+' '+ipsclass.lang_build_string(ipb_global_lang['image_attach_percent'],_percent);}else{ct_obj.innerHTML=_img+' '+ipb_global_lang['image_attach_no_percent'];}cb_obj.innerHTML="";if(width&&height){cb_obj.innerHTML=ipsclass.lang_build_string(ipb_global_lang['image_attach_dims'],width,height);}cb_obj.innerHTML+=ipsclass.lang_build_string(ipb_global_lang['image_attach_size'],file_size);}function fix_linked_image_sizes(){if(ipsclass.settings['do_linked_resize']!=1){return true;}var images=document.getElementsByTagName('IMG');var _padding=4;var _count=0;var _img='<img src="'+ipb_var_image_url+'/img-resized.png" style="vertical-align:middle" border="0" alt="" />';var _img2='<img src="'+ipb_var_image_url+'/folder_attach_images/attach_zoom_in.png" style="vertical-align:middle" border="0" alt="" />';var _sw=screen.width*(parseInt(ipsclass.settings['resize_percent'])/100);for(var i=0;i<images.length;i++){if(images[i].className=='linked-image'){_count++;if(images[i].width>_sw){var _width=images[i].width;var _height=images[i].height;var _percent=0;images[i].width=_sw;if(images[i].width<_width&&_width>0&&images[i].width>0){_percent=Math.ceil(parseInt(images[i].width/_width*100));}images[i].id='--ipb-img-resizer-'+_count;images[i]._resized=1;images[i]._width=_width;var div=document.createElement('div');div.innerHTML=_img+' '+ipsclass.lang_build_string(ipb_global_lang['image_resized'],_percent,_width,_height);div.style.width=images[i].width-(_padding*2)+'px';div.className='resized-linked-image';div.style.paddingTop=_padding+"px";div.style.paddingBottom=_padding+"px";div.style.paddingLeft=_padding+"px";div.style.paddingRight=_padding+"px";div._is_div=1;div._resize_id=_count;var _top=ipsclass.get_obj_toppos(images[i]);var _left=ipsclass.get_obj_leftpos(images[i]);var __height=parseInt(images[i].height);var __width=parseInt(images[i].width);var _div=document.createElement("DIV");_div.className='resized-linked-image-zoom';_div.onclick=fix_linked_images_onclick;_div._over=0;_div.style.display='block';images[i].parentNode.parentNode.appendChild(_div);var _w=_div.style.width?parseInt(_div.style.width):200;var _h=_div.style.height?parseInt(_div.style.height):30;var _l=(__width-_w)-5;var _t=(__height-_h)+27;if(is_safari){_t+=19;}_div.style.top=_top+_t+'px';_div.style.left=_left+_l+'px';_div.style.zIndex=100;_div.innerHTML=_img2+"View full size image";_div.onclick=fix_linked_images_onclick;_div.onmouseover=fix_linked_images_mouseover;_div.title=ipb_global_lang['click_to_view'];_div._src=images[i].src;if(is_ie&&!is_ie7){images[i].outerHTML=div.outerHTML+images[i].outerHTML;}else{images[i].parentNode.insertBefore(div,images[i]);}}}}}function fix_linked_images_onclick(e){PopUp(this._src,'popup',screen.width,screen.height,1,1,1);e=ipsclass.cancel_bubble_all(e);return false;};function fix_attach_images_mouseover(e){try{this.style.cursor='pointer';}catch(acold){}}function fix_linked_images_mouseover(e){try{this.style.cursor='pointer';}catch(acold){}}function emoticon(ecode,eobj,eurl){ecode=' '+ecode+' ';var obj_ta=document.getElementBLine truncated
|
||||
@@ -1,213 +1 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board 2.1.7
|
||||
// User CP JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
var ucp_dname_name;
|
||||
var ucp_dname_pass;
|
||||
var ucp_dname_name_img;
|
||||
var ucp_dname_pass_img;
|
||||
var ucp_dname_form;
|
||||
var ucp_dname_warn;
|
||||
var ucp_dname_warn_content;
|
||||
|
||||
var ucp_dname_ok_to_go = 0;
|
||||
var ucp_dname_illegal_chars = new Array( '[', ']', '|', ',', ';' );
|
||||
var ucp_dname_illegal_regex = '';
|
||||
|
||||
for ( var i in ucp_dname_illegal_chars )
|
||||
{
|
||||
ucp_dname_illegal_regex += '\\' + ucp_dname_illegal_chars[i];
|
||||
}
|
||||
|
||||
var error_found = '';
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Display name change stuff
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ucp_dname_init( name, pass, form, wbox )
|
||||
{
|
||||
ucp_dname_name = document.getElementById( name );
|
||||
ucp_dname_pass = document.getElementById( pass );
|
||||
ucp_dname_form = document.getElementById( form );
|
||||
ucp_dname_warn = document.getElementById( wbox );
|
||||
|
||||
ucp_dname_warn_content = document.getElementById( wbox+'-content' );
|
||||
ucp_dname_name_img = document.getElementById( name+'-img' );
|
||||
ucp_dname_pass_img = document.getElementById( pass+'-img' );
|
||||
|
||||
ucp_dname_name.onblur = ucp_dname_check;
|
||||
ucp_dname_form.onsubmit = ucp_dname_form_check;
|
||||
|
||||
if ( ucp_dname_warn_content.innerHTML )
|
||||
{
|
||||
ucp_dname_warn.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EVENT: Check display name
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ucp_dname_check( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
//----------------------------------
|
||||
// Make sure we have sommat
|
||||
//----------------------------------
|
||||
|
||||
if ( ! ucp_dname_name.value || ucp_dname_name.value.length < 3 || ucp_dname_name.value.length > 32 )
|
||||
{
|
||||
error_found += dname_error_no_name + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check for illegal chars
|
||||
//----------------------------------
|
||||
|
||||
if ( ucp_dname_name.value.match( new RegExp( "[" + ucp_dname_illegal_regex + "]" ) ) )
|
||||
{
|
||||
error_found += dname_error_chars + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Ajax: check for existing member name
|
||||
//----------------------------------
|
||||
|
||||
if ( use_enhanced_js && ucp_dname_name.value )
|
||||
{
|
||||
var url = ipb_var_base_url+'act=xmlout&do=check-display-name&name='+escape( ucp_dname_name.value );
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// 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() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'found' )
|
||||
{
|
||||
error_found += dname_error_taken + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
ucp_dname_name.className = input_red;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_cross;
|
||||
ucp_dname_warn_content.innerHTML = error_found;
|
||||
ucp_dname_warn.style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
ucp_dname_name.className = input_green;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_tick;
|
||||
ucp_dname_warn.style.display = 'none';
|
||||
ucp_dname_warn_content.innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( url );
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
ucp_dname_name.className = input_red;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_cross;
|
||||
ucp_dname_warn_content.innerHTML = error_found;
|
||||
ucp_dname_warn.style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
ucp_dname_name.className = input_green;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_tick;
|
||||
ucp_dname_warn.style.display = 'none';
|
||||
ucp_dname_warn_content.innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EVENT: Check display name
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ucp_dname_form_check( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// DO pass fields
|
||||
//----------------------------------
|
||||
|
||||
if ( ! ucp_dname_pass.value )
|
||||
{
|
||||
error_found += dname_error_no_pass + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check name
|
||||
//----------------------------------
|
||||
|
||||
ucp_dname_check( event );
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
ucp_dname_ok_to_go = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ucp_dname_ok_to_go = 1;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Return
|
||||
//----------------------------------
|
||||
|
||||
if ( ucp_dname_ok_to_go )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var ucp_dname_name;var ucp_dname_pass;var ucp_dname_name_img;var ucp_dname_pass_img;var ucp_dname_form;var ucp_dname_warn;var ucp_dname_warn_content;var dname_max_length=26;var ucp_dname_ok_to_go=0;var ucp_dname_illegal_chars=new Array('[',']','|',',',';','$');var ucp_dname_illegal_regex='';for(var i in ucp_dname_illegal_chars){ucp_dname_illegal_regex+='\\'+ucp_dname_illegal_chars[i];}var error_found='';function ucp_dname_init(name,pass,form,wbox){ucp_dname_name=document.getElementById(name);ucp_dname_pass=document.getElementById(pass);ucp_dname_form=document.getElementById(form);ucp_dname_warn=document.getElementById(wbox);ucp_dname_warn_content=document.getElementById(wbox+'-content');ucp_dname_name_img=document.getElementById(name+'-img');ucp_dname_pass_img=document.getElementById(pass+'-img');ucp_dname_name.onblur=ucp_dname_check;ucp_dname_form.onsubmit=ucp_dname_form_check;if(ucp_dname_warn_content.innerHTML){ucp_dname_warn.style.display='block';}}function ucp_dname_check(event){if(!ucp_dname_name.value||ucp_dname_name.value.length<3||ucp_dname_name.value.length>dname_max_length){error_found+=dname_error_no_name+"<br />";}if(ucp_dname_name.value.match(new RegExp("["+ucp_dname_illegal_regex+"]"))){error_found+=dname_error_chars+"<br />";}if(use_enhanced_js&&ucp_dname_name.value){var url=ipb_var_base_url+'act=xmlout&do=check-display-name&name='+escape(ucp_dname_name.value);do_request_function=function(){if(!xmlobj.readystate_ready_and_ok()){return;}var html=xmlobj.xmlhandler.responseText;if(html=='found'){error_found+=dname_error_taken+"<br />";}if(error_found){ucp_dname_name.className=input_red;ucp_dname_name_img.src=ipb_var_image_url+'/'+img_cross;ucp_dname_warn_content.innerHTML=error_found;ucp_dname_warn.style.display='block';}else{ucp_dname_name.className=input_green;ucp_dname_name_img.src=ipb_var_image_url+'/'+img_tick;ucp_dname_warn.style.display='none';ucp_dname_warn_content.innerHTML='';}error_found='';};xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(url);}else{if(error_found){ucp_dname_name.className=input_red;ucp_dname_name_img.src=ipb_var_image_url+'/'+img_cross;ucp_dname_warn_content.innerHTML=error_found;ucp_dname_warn.style.display='block';}else{ucp_dname_name.className=input_green;ucp_dname_name_img.src=ipb_var_image_url+'/'+img_tick;ucp_dname_warn.style.display='none';ucp_dname_warn_content.innerHTML='';}error_found='';}}function ucp_dname_form_check(event){if(!ucp_dname_pass.value){error_found+=dname_error_no_pass+"<br />";}ucp_dname_check(event);if(error_found){ucp_dname_ok_to_go=0;}else{ucp_dname_ok_to_go=1;}if(ucp_dname_ok_to_go){return true;}else{return false;}}
|
||||
@@ -1,720 +1 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS XML HTTP REQUEST:: GET NEW POSTS
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports Safari, Mozilla 1.3+ (Firefox, etc) and IE 5.5+
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT VARS
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var mem_div = 'ipb-get-members';
|
||||
var divobj;
|
||||
var iframeobj;
|
||||
var formobj;
|
||||
var xmlobj;
|
||||
var _result_cache = new Array();
|
||||
var _div_rows = 0;
|
||||
var _cur_updown_pressed = 0;
|
||||
var _last_key_code = 0;
|
||||
var _event_key_code = 0;
|
||||
var _cur_input_val = '';
|
||||
var _old_input_val = '';
|
||||
var _hiliteindex = -1;
|
||||
var _hilite_sug_div;
|
||||
var _complete_div_list;
|
||||
var delay_action = false;
|
||||
var _allow_update = true;
|
||||
var _form_onsubmit_saved;
|
||||
var _urllookup;
|
||||
var _timemout_main = 0;
|
||||
var _timeout_blur = 0;
|
||||
var _in_focus = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// SHOW POSSIBLE MEMBER NAME MATCHES
|
||||
/*--------------------------------------------*/
|
||||
|
||||
main_loop = function()
|
||||
{
|
||||
if ( ( _old_input_val != _cur_input_val ) && ( _cur_input_val.length >= 3 ) && ( _in_focus == 1 ) )
|
||||
{
|
||||
if ( ! delay_action && _allow_update )
|
||||
{
|
||||
//----------------------------------
|
||||
// Try cache
|
||||
//----------------------------------
|
||||
|
||||
var cached = _result_cache[ _cur_input_val ];
|
||||
|
||||
if ( cached )
|
||||
{
|
||||
returnSearch( _cur_input_val, cached[0], cached[1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
/*--------------------------------------------*/
|
||||
// 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() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var returned = xmlobj.xmlhandler.responseText;
|
||||
|
||||
//----------------------------------
|
||||
// Did we get something?
|
||||
//----------------------------------
|
||||
|
||||
if ( returned.charAt(0) == '<' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
eval( returned );
|
||||
}
|
||||
}
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( ipb_var_base_url + 'act=xmlout&do='+_urllookup+'&name='+escape(inobj.value) );
|
||||
|
||||
inobj.focus();
|
||||
}
|
||||
}
|
||||
|
||||
delay_action = false;
|
||||
}
|
||||
|
||||
_old_input_val = _cur_input_val;
|
||||
|
||||
_timemout_main = setTimeout( 'main_loop()', 10 );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Initalize...
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function init_js( formobjname, fieldobjname, urllookup )
|
||||
{
|
||||
//----------------------------------
|
||||
// Set up
|
||||
//----------------------------------
|
||||
|
||||
if ( ! urllookup )
|
||||
{
|
||||
_urllookup = 'get-member-names';
|
||||
}
|
||||
else
|
||||
{
|
||||
_urllookup = urllookup;
|
||||
}
|
||||
|
||||
formobj = document.getElementById( formobjname );
|
||||
inobj = document.getElementById( fieldobjname );
|
||||
divobj = document.getElementById( mem_div );
|
||||
|
||||
inobj.autocomplete = "off";
|
||||
inobj.onfocus = function () { _in_focus = 1; }
|
||||
inobj.onblur = onblurhandler;
|
||||
inobj.onsubmit = submit_handler;
|
||||
|
||||
//----------------------------------
|
||||
// Already got a submit handler?
|
||||
//----------------------------------
|
||||
|
||||
if ( formobj.onsubmit )
|
||||
{
|
||||
_form_onsubmit_saved = formobj.onsubmit;
|
||||
}
|
||||
|
||||
formobj.onsubmit = submit_handler;
|
||||
|
||||
if ( inobj.createTextRange )
|
||||
{
|
||||
inobj.onkeyup = new Function( "return onkeyuphandler(event);" );
|
||||
}
|
||||
else
|
||||
{
|
||||
inobj.onkeyup = onkeyuphandler;
|
||||
}
|
||||
|
||||
cache_name_results("",new Array(),new Array());
|
||||
|
||||
_cur_input_val = inobj.value;
|
||||
|
||||
document.onkeydown = keydownhandler;
|
||||
|
||||
set_up_key_down();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Set up key down
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_up_key_down()
|
||||
{
|
||||
if ( document.createEventObject )
|
||||
{
|
||||
var y = document.createEventObject();
|
||||
y.ctrlKey = true;
|
||||
y.keyCode = 70;
|
||||
document.fireEvent( "onkeydown", y )
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Key down handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function keydownhandler( event )
|
||||
{
|
||||
if( ! event && window.event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
if ( event )
|
||||
{
|
||||
_last_key_code = event.keyCode;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On blur handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function onblurhandler( event )
|
||||
{
|
||||
if ( ! event && window.event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
if ( ! _cur_updown_pressed )
|
||||
{
|
||||
_in_focus = 0;
|
||||
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
|
||||
// Tab?
|
||||
|
||||
if ( _last_key_code == 9 )
|
||||
{
|
||||
_last_key_code = -1;
|
||||
}
|
||||
}
|
||||
|
||||
_cur_updown_pressed = false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On key up handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function key_handler_function()
|
||||
{
|
||||
//----------------------------------
|
||||
// trap up/down cursor
|
||||
//----------------------------------
|
||||
|
||||
if ( _event_key_code == 40 || _event_key_code == 38 )
|
||||
{
|
||||
_allow_update = false;
|
||||
blur_then_focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
_cur_updown_pressed = false;
|
||||
_allow_update = true;
|
||||
}
|
||||
|
||||
_cur_input_val = inobj.value;
|
||||
|
||||
handle_cursor_press( _event_key_code );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Handle cursor press
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function handle_cursor_press( eventcode )
|
||||
{
|
||||
if ( eventcode == 40 )
|
||||
{
|
||||
hilite_new_value( _hiliteindex + 1 );
|
||||
}
|
||||
else if ( eventcode == 38 )
|
||||
{
|
||||
hilite_new_value( _hiliteindex - 1 );
|
||||
}
|
||||
else if ( eventcode == 13 || eventcode == 3 )
|
||||
{
|
||||
//----------------------------------
|
||||
// Are we looking through the divs?
|
||||
//----------------------------------
|
||||
|
||||
if ( _hiliteindex != -1 )
|
||||
{
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Highlight new value (cursor keys pressed)
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function hilite_new_value( index )
|
||||
{
|
||||
if ( _div_rows <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
my_show_div( divobj );
|
||||
|
||||
if ( index > _div_rows )
|
||||
{
|
||||
index = _div_rows - 1;
|
||||
}
|
||||
|
||||
if ( _hiliteindex != -1 && index != _hiliteindex )
|
||||
{
|
||||
set_style_for_element( _hilite_sug_div, 'wrapdiv' );
|
||||
}
|
||||
|
||||
if ( index < 0 )
|
||||
{
|
||||
_hiliteindex = -1;
|
||||
inobj.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
_hiliteindex = index;
|
||||
_hilite_sug_div = divobj.getElementsByTagName('DIV').item( index );
|
||||
|
||||
set_style_for_element( _hilite_sug_div, 'spanhilite' );
|
||||
|
||||
newval = find_span_value_for_class( _hilite_sug_div, 'namespan' );
|
||||
|
||||
if ( newval && typeof(newval) != 'undefined' )
|
||||
{
|
||||
inobj.value = find_span_value_for_class( _hilite_sug_div, 'namespan' );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Blur then focus
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function blur_then_focus()
|
||||
{
|
||||
_cur_updown_pressed = true;
|
||||
|
||||
inobj.blur();
|
||||
|
||||
_timemout_blur = setTimeout( "set_input_field_focus();", 10 );
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Set input field focus
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_input_field_focus()
|
||||
{
|
||||
inobj.focus();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Styles element
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_style_for_element( c, name )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! c )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
c.className = name;
|
||||
|
||||
switch( name )
|
||||
{
|
||||
case 'wrapdiv':
|
||||
c.style.backgroundColor = "white";
|
||||
c.style.color = "black";
|
||||
|
||||
if ( c.displaySpan )
|
||||
{
|
||||
c.displaySpan.style.color = "green";
|
||||
}
|
||||
|
||||
break;
|
||||
case 'wrapspan':
|
||||
c.style.display = "block";
|
||||
c.style.paddingLeft = "3";
|
||||
c.style.paddingRight = "3";
|
||||
c.style.height = "16px";
|
||||
c.style.overflow = "hidden";
|
||||
break;
|
||||
case 'namespan':
|
||||
c.style.cssFloat = "left";
|
||||
c.style.width = '100%';
|
||||
break;
|
||||
case 'idspan':
|
||||
c.style.cssFloat = "right";
|
||||
c.style.display = 'none';
|
||||
break;
|
||||
case 'spanhilite':
|
||||
c.style.backgroundColor = "#3366cc";
|
||||
c.style.color = "white";
|
||||
|
||||
if ( c.displaySpan )
|
||||
{
|
||||
c.displaySpan.style.color = "white";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get value of named span
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function find_span_value_for_class( i, dc )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! i )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ga = i.getElementsByTagName('span');
|
||||
|
||||
if ( ga )
|
||||
{
|
||||
for( var f=0; f < ga.length; ++f )
|
||||
{
|
||||
if ( ga[f].className == dc )
|
||||
{
|
||||
var value = ga[f].innerHTML;
|
||||
|
||||
if ( value == " " )
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Displays the actual list
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function display_suggested_list( na, ia )
|
||||
{
|
||||
//----------------------------------
|
||||
// Clear div
|
||||
//----------------------------------
|
||||
|
||||
while( divobj.childNodes.length > 0 )
|
||||
{
|
||||
divobj.removeChild( divobj.childNodes[0] );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Write Div
|
||||
//----------------------------------
|
||||
|
||||
_div_rows = 0;
|
||||
|
||||
for( var f = 0 ; f < na.length; ++f )
|
||||
{
|
||||
_div_rows++;
|
||||
var od = document.createElement("DIV");
|
||||
set_style_for_element( od, 'wrapdiv' );
|
||||
od.onmousedown = sb_mdown;
|
||||
od.onmouseover = sb_mover;
|
||||
od.onmouseout = sb_mout;
|
||||
|
||||
var span_wrap = document.createElement("SPAN");
|
||||
set_style_for_element( span_wrap, 'wrapspan' );
|
||||
|
||||
var span_name = document.createElement("SPAN");
|
||||
span_name.innerHTML = na[f];
|
||||
|
||||
var span_id = document.createElement("SPAN");
|
||||
|
||||
set_style_for_element( span_name, 'namespan' );
|
||||
set_style_for_element( span_id, 'idspan' );
|
||||
|
||||
od.displaySpan = span_id;
|
||||
|
||||
span_id.innerHTML = ia[f];
|
||||
|
||||
span_wrap.appendChild( span_name );
|
||||
span_wrap.appendChild( span_id );
|
||||
od.appendChild( span_wrap );
|
||||
divobj.appendChild( od );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Calc pos.
|
||||
//----------------------------------
|
||||
|
||||
var mid = inobj;
|
||||
var left_px = _get_obj_leftpos(mid);
|
||||
var top_px = _get_obj_toppos(mid) + mid.offsetHeight;
|
||||
var width = parseInt( divobj.style.width );
|
||||
var height = parseInt( divobj.style.height );
|
||||
|
||||
//----------------------------------
|
||||
// Show menu DIV
|
||||
//----------------------------------
|
||||
|
||||
divobj.style.position = "absolute";
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
if ( (left_px + width) >= document.body.clientWidth )
|
||||
{
|
||||
left_px = left_px + mid.offsetWidth - width;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
if ( (top_px + height) >= document.body.clientHeight )
|
||||
{
|
||||
top_px = top_px - height;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Finalize menu position
|
||||
//----------------------------------
|
||||
|
||||
divobj.style.left = left_px + "px";
|
||||
divobj.style.top = top_px + "px";
|
||||
divobj.style.display = "block";
|
||||
|
||||
_hiliteindex= -1;
|
||||
|
||||
//----------------------------------
|
||||
// Workaround for IE bug which shows
|
||||
// select boxes and other windows GUI
|
||||
// over divs. SHOW IFRAME
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! document.getElementById( 'if_xhr_' + mem_div ) )
|
||||
{
|
||||
iframeobj = document.createElement('iframe');
|
||||
|
||||
iframeobj.src = 'javascript:;';
|
||||
iframeobj.id = 'if_xhr_' + mem_div
|
||||
|
||||
document.getElementsByTagName('body')[0].appendChild( iframeobj );
|
||||
}
|
||||
else
|
||||
{
|
||||
iframeobj = document.getElementById( 'if_xhr_' + mem_div );
|
||||
}
|
||||
|
||||
iframeobj.scrolling = 'no';
|
||||
iframeobj.frameborder = 'no';
|
||||
iframeobj.className = 'iframeshim';
|
||||
iframeobj.style.position = 'absolute';
|
||||
|
||||
iframeobj.style.width = parseInt(divobj.offsetWidth) + 'px';
|
||||
iframeobj.style.height = parseInt(divobj.offsetHeight) + 'px';
|
||||
iframeobj.style.top = divobj.style.top;
|
||||
iframeobj.style.left = divobj.style.left;
|
||||
iframeobj.style.zIndex = divobj.style.zIndex - 1;
|
||||
iframeobj.style.display = "block";
|
||||
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
//alert(error); // Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Caches the results
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cache_name_results( mstring, na, ia )
|
||||
{
|
||||
_result_cache[mstring] = new Array( na, ia );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// This is the function the response XML text gives
|
||||
/*--------------------------------------------*/
|
||||
|
||||
returnSearch = function( mstring, namearray, idarray )
|
||||
{
|
||||
//----------------------------------
|
||||
// Cache..
|
||||
//----------------------------------
|
||||
|
||||
cache_name_results( mstring, namearray, idarray );
|
||||
|
||||
if ( _in_focus != 1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Display
|
||||
//----------------------------------
|
||||
|
||||
display_suggested_list( namearray, idarray );
|
||||
|
||||
//----------------------------------
|
||||
// Resize or hide?
|
||||
//----------------------------------
|
||||
|
||||
if ( _div_rows > 0 )
|
||||
{
|
||||
divobj.style.height = 16 * _div_rows + 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Submit handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
submit_handler = function ( event )
|
||||
{
|
||||
delay_action = true;
|
||||
var retval = true;
|
||||
|
||||
if ( _hiliteindex != -1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( _form_onsubmit_saved )
|
||||
{
|
||||
eval( 'tmpsubmit = ' + _form_onsubmit_saved );
|
||||
retval = tmpsubmit();
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On key up handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
onkeyuphandler = function( event )
|
||||
{
|
||||
_event_key_code = event.keyCode;
|
||||
key_handler_function();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Div mouse events
|
||||
/*--------------------------------------------*/
|
||||
|
||||
sb_mdown = function()
|
||||
{
|
||||
delay_action = true;
|
||||
inobj.value = find_span_value_for_class( this, 'namespan' );
|
||||
}
|
||||
|
||||
sb_mover = function()
|
||||
{
|
||||
set_style_for_element( this, 'spanhilite' );
|
||||
}
|
||||
|
||||
sb_mout = function()
|
||||
{
|
||||
set_style_for_element( this, 'wrapdiv' );
|
||||
}
|
||||
|
||||
function my_xr_hide_div ( dobj )
|
||||
{
|
||||
dobj.style.display = "none";
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
document.getElementById( 'if_xhr_' + mem_div ).style.display = "none";
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
//alert(e);// Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var mem_div='ipb-get-members';var divobj;var iframeobj;var formobj;var xmlobj;var _result_cache=new Array();var _div_rows=0;var _cur_updown_pressed=0;var _last_key_code=0;var _event_key_code=0;var _cur_input_val='';var _old_input_val='';var _hiliteindex=-1;var _hilite_sug_div;var _complete_div_list;var delay_action=false;var _allow_update=true;var _form_onsubmit_saved;var _urllookup;var _timemout_main=0;var _timeout_blur=0;var _in_focus=0;main_loop=function(){if((_old_input_val!=_cur_input_val)&&(_cur_input_val.length>=3)&&(_in_focus==1)){if(!delay_action&&_allow_update){var cached=_result_cache[_cur_input_val];if(cached){returnSearch(_cur_input_val,cached[0],cached[1]);}else{do_request_function=function(){if(!xmlobj.readystate_ready_and_ok()){return;}var returned=xmlobj.xmlhandler.responseText;if(returned.charAt(0)=='<'){return false;}else{eval(returned);}};xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(ipb_var_base_url+'&act=xmlout&do='+_urllookup+'&name='+escape(inobj.value));inobj.focus();}}delay_action=false;}_old_input_val=_cur_input_val;_timemout_main=setTimeout('main_loop()',10);return false;};function init_js(formobjname,fieldobjname,urllookup){if(!urllookup){_urllookup='get-member-names';}else{_urllookup=urllookup;}formobj=document.getElementById(formobjname);inobj=document.getElementById(fieldobjname);divobj=document.getElementById(mem_div);inobj.autocomplete="off";inobj.onfocus=function(){_in_focus=1;};inobj.onblur=onblurhandler;inobj.onsubmit=submit_handler;if(formobj.onsubmit){_form_onsubmit_saved=formobj.onsubmit;}formobj.onsubmit=submit_handler;if(inobj.createTextRange){inobj.onkeyup=new Function("return onkeyuphandler(event);");}else{inobj.onkeyup=onkeyuphandler;}cache_name_results("",new Array(),new Array());_cur_input_val=inobj.value;document.onkeydown=keydownhandler;set_up_key_down();}function set_up_key_down(){if(document.createEventObject){var y=document.createEventObject();y.ctrlKey=true;y.keyCode=70;document.fireEvent("onkeydown",y)}}function keydownhandler(event){if(!event&&window.event){event=window.event;}if(event){_last_key_code=event.keyCode;}}function onblurhandler(event){if(!event&&window.event){event=window.event;}if(!_cur_updown_pressed){_in_focus=0;my_xr_hide_div(divobj);_hiliteindex=-1;if(_last_key_code==9){_last_key_code=-1;}}_cur_updown_pressed=false;}function key_handler_function(){if(_event_key_code==40||_event_key_code==38){_allow_update=false;blur_then_focus();}else{_cur_updown_pressed=false;_allow_update=true;}_cur_input_val=inobj.value;handle_cursor_press(_event_key_code);}function handle_cursor_press(eventcode){if(eventcode==40){hilite_new_value(_hiliteindex+1);}else if(eventcode==38){hilite_new_value(_hiliteindex-1);}else if(eventcode==13||eventcode==3){if(_hiliteindex!=-1){my_xr_hide_div(divobj);_hiliteindex=-1;}return false;}return true;}function hilite_new_value(index){if(_div_rows<=0){return;}my_show_div(divobj);if(index>_div_rows){index=_div_rows-1;}if(_hiliteindex!=-1&&index!=_hiliteindex){set_style_for_element(_hilite_sug_div,'wrapdiv');}if(index<0){_hiliteindex=-1;inobj.focus();return;}_hiliteindex=index;_hilite_sug_div=divobj.getElementsByTagName('DIV').item(index);set_style_for_element(_hilite_sug_div,'spanhilite');newval=find_span_value_for_class(_hilite_sug_div,'namespan');if(newval&&typeof(newval)!='undefined'){inobj.value=find_span_value_for_class(_hilite_sug_div,'namespan');}}function blur_then_focus(){_cur_updown_pressed=true;inobj.blur();_timemout_blur=setTimeout("set_input_field_focus();",10);return;}function set_input_field_focus(){inobj.focus();}function set_style_for_element(c,name){try{if(!c){return;}}catch(e){return;}c.className=name;switch(name){case 'wrapdiv':c.style.backgroundColor="white";c.style.color="black";if(c.displaySpan){c.displaySpan.style.color="green";}break;case 'wrapspan':c.style.display="block";c.style.paddingLeft="3";c.style.paddingRight="3";c.style.height="16px";c.style.overflow="hidden";break;case 'namespan':c.style.cssFloat="left";c.style.width='100%';break;case 'idspan':c.style.cssFloat="right";c.style.display='none';break;case 'spanhilite':c.style.backgroundColor="#3366cc";c.style.color="white";if(c.displaySpan){c.displaySpan.style.color="white";}break;}}function find_span_value_for_class(i,dc){try{if(!i){return;}}catch(e){return;}var ga=i.getElementsByTagName('span');if(ga){for(var f=0;f<ga.length;++f){if(ga[f].className==dc){var value=ga[f].innerHTML;if(value==" "){return "";}else{return value;}}}}else{return "";}}function display_suggested_list(na,ia){while(divobj.childNodes.length>0){divobj.removeChild(divobj.childNodes[0]);}_div_rows=0;for(var f=0;f<na.length;++f){_div_rows++;var od=document.createElement("DIV");set_style_for_element(od,'wrapdiv');od.onmousedown=sb_mdown;od.onmouseover=sb_mover;od.onmouseout=sb_mout;var span_wrap=document.createElement("SPAN");set_style_for_element(span_wrap,'wrapspan');var span_name=document.createElement("SPAN");span_name.innerHTMLLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
var ipsattach=new ips_attach();function ips_attach(){this.iframe_id='ips--iframe-obj-attach';this.iframe_obj=null;this.iframe_init_url='';this.iframe_remove_url='';this.iframe_add_to_div='ips-attach-div-iframe';this.iframe_add_to_div_obj=null;this.iframe_parent_div='ips-attach-div-parent';this.iframe_parent_div_obj=null;this.status_div='ips-attach-div-status';this.status_div_obj=null;this.dropdown_text='ips-attach-menu-text';this.dropdown_text_obj=null;this.iframe_height=300;this.iframe_classname='attach-iframe';this.message_div_id='ips-attach-message';this.message_div_obj=null;this.message_span_id='ips-attach-message-span';this.message_span_obj=null;this.status_msg='';this.status_is_error='';this.current_items=new Array();this.current_item_menu='ips-attach-menu';this.current_item_menu_obj=null;this.images_url=null;this.lang=new Array();this.css_menu_row='attach-menu-row';this.css_menu_row_over='attach-menu-row-over';this.show_attach_menu=1;this.onload_function='';this.has_upload_pending=0;this.init=function(){this.iframe_add_to_div_obj=document.getElementById(this.iframe_add_to_div);this.iframe_parent_div_obj=document.getElementById(this.iframe_parent_div);this.message_div_obj=document.getElementById(this.message_div_id);this.message_span_obj=document.getElementById(this.message_span_id);this.status_div_obj=document.getElementById(this.status_div);this.dropdown_text_obj=document.getElementById(this.dropdown_text);if(this.show_attach_menu){this.current_item_menu_obj=document.getElementById(this.current_item_menu);ipsmenu.register(this.current_item_menu);this.current_item_menu_obj._onclick=this.current_item_menu_obj.onclick;this.current_item_menu_obj.onmouseover=this.current_item_menu_obj.onmouseout=this.current_item_menu_obj.onclick=this.current_menu_mouseover;ipsmenu.menu_registered[this.current_item_menu]._open=ipsmenu.menu_registered[this.current_item_menu].open;ipsmenu.menu_registered[this.current_item_menu].open=this.current_menu_button_show;}};this.init_current_menu=function(obj){var menu='';try{menu=document.getElementById(ipsattach.current_item_menu+'_menu');menu.innerHTML='';}catch(error){menu=document.createElement('div');}var _items=0;menu.id=ipsattach.current_item_menu+'_menu';menu.className='attach-popupmenu';menu.style.display='none';menu.style.cursor='default';menu.style.padding='3px';menu.style.width='auto';menu.style.overflow='auto';for(var i in ipsattach.current_items){var option=document.createElement('div');option.innerHTML=ipsattach.current_items[i];option.style.width=ipsattach.current_item_menu_obj.style.width;option.className='attach-menu-row';option.onmouseover=option.onmouseout=ipsattach.menu_onmouse_event;menu.appendChild(option);_items++;}if(!_items){var option=document.createElement('div');option.innerHTML=ipsattach.lang['no_items'];option.style.width=ipsattach.current_item_menu_obj.style.width;option.className='attach-menu-row';option.onmouseover=option.onmouseout=ipsattach.menu_onmouse_event;menu.appendChild(option);}ipsattach.set_attach_count_status(_items);ipsattach.iframe_parent_div_obj.appendChild(menu);ipsclass.set_unselectable(menu);};this.set_attach_count_status=function(_items){if(!ipsattach.show_attach_menu){return;}if(typeof(_items)=='undefined'){_items=0;for(var i in ipsattach.current_items){_items++;}}try{ipsattach.dropdown_text_obj.innerHTML=" ("+_items+")";}catch(error){}};this.add_current_item=function(attach_id,attach_name,attach_size,attach_image){if(attach_name.length>22){var _ext=attach_name.replace( /^.*\.(\S+?)$/,"$1");var _main=attach_name.replace( /^(.*)\.\S+?$/,"$1");var _a=_main.substr(0,8);var _b=_main.substr(_main.length-8,_main.length);attach_name=_a+'...'+_b+'.'+_ext;}var html='';html+='<img onclick="ipsattach.add_attachment_into_editor('+attach_id+', \''+attach_name+'\')" src="'+this.images_url+'/folder_attach_images/attach_add.png" title="'+this.lang['attach_insert']+'" style="vertical-align:middle" border="0" alt="" /> ';html+='<img onclick="ipsattach.remove_attachment('+attach_id+');" src="'+this.images_url+'/folder_attach_images/attach_remove.png" title="'+this.lang['attach_remove']+': ['+attach_id+']'+'" style="vertical-align:middle" border="0" alt="" /> ';html+='<img src="'+this.images_url+'/'+attach_image+'" style="vertical-align:middle" border="0" alt="" /> ';html+='<span style="font-weight:bold" onclick="ipsattach.add_attachment_into_editor('+attach_id+', \''+attach_name+'\')">'+attach_name+'</span>';html+=' <span class="desctext"> ('+attach_size+')</span>';this.current_items[this.current_items.length]=html;};this.add_attachment_into_editor=function(id,name){var tag="[attachment="+id+":"+name+"]";ipsclass.add_editor_contents(tag);};this.remove_attachment=function(id){menu_action_close();if(confirm(ipsattach.lang['remove_warn']+' ['+id+']')){ipsattach.iframe_obj.src=ipsattach.iframe_remove_url+"&attach_id="+id;ipsattach.iframe_on_un_load('attach_removal');}};this.show_attach_box=function(){var iheight=parseInt(this.ifLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
function ipsclass(){this.cookies=new Array();this.ignore_cookies=new Array(ipb_var_cookieid+'ipb_stronghold',ipb_var_cookieid+'session_id',ipb_var_cookieid+'ipb_admin_session_id',ipb_var_cookieid+'member_id',ipb_var_cookieid+'pass_hash');this.settings={'do_linked_resize':0,'resize_percent':50};this.init=function(){var _tmp=document.cookie.split(';');if(_tmp.length){for(i=0;i<_tmp.length;i++){if(_tmp[i].match(new RegExp(ipb_var_cookieid+".*$"))){var _data=_tmp[i].split('=');var _key=this.trim(_data[0]);var _value=unescape(this.trim(_data[1]));if(_key&&(!this.in_array(_key,this.ignore_cookies))){this.cookies[_key.replace(ipb_var_cookieid,'')]=_value;}}}}if(is_moz&&!is_safari){HTMLDocument.prototype.__defineGetter__("cookie",function(){return null;});window.addEventListener('load',function(){var _a=document.body;var _x=_a.innerHTML;var _y=new RegExp("HTMLDocument\\.prototype",'ig');if(_x.match(_y)){_x=_x.replace(_y,'HTMLDocument_prototype');_a.innerHTML=_x;}},false);}_tmp=null;};this.trim=function(text){if(typeof(text)=='undefined'){return '';}text=text.replace(/^\s+/,'');return text.replace(/\s+$/,'');};this.in_array=function(needle,haystack){if(!haystack.length){return false;}for(var i=0;i<haystack.length;i++){if(haystack[i]===needle){return true;}}return false;};this.htmlspecialchars=function(text){text=text.replace( /</g,'<');text=text.replace( />/g,'>');text=text.replace( /"/g,'"');return text;};this.un_htmlspecialchars=function(text){text=text.replace( /</g,'<');text=text.replace( />/g,'>');text=text.replace( /"/g,'"');return text;};this.get_editor_contents=function(editor_id,editor_array){var aIPS_editor=editor_array?editor_array:IPS_editor;if(!editor_id){for(var i in aIPS_editor){editor_id=i;break;}}return aIPS_editor[editor_id].editor_get_contents;};this.add_editor_contents=function(text,editor_id,editor_array){var aIPS_editor=editor_array?editor_array:IPS_editor;if(!editor_id){for(var i in aIPS_editor){editor_id=i;break;}}return aIPS_editor[editor_id].insert_text(text);};this.convert_saved_tags_to_display_tags=function(text){text=text.replace( /(<|<|<)!--/,"{");text=text.replace( /--(>|>|>)/,"}");return text;};this.fade_in_element=function(div){var hash='#';var color_items="0123456789abcdef";var start_color='#ffff66';var orig_color=document.getElementById(div).style.backgroundColor;var temp_end='#ffffff';var iter=20;var time=80;var rbeg=color_items.indexOf(start_color.substr(1,1))*16+color_items.indexOf(start_color.substr(2,1));var gbeg=color_items.indexOf(start_color.substr(3,1))*16+color_items.indexOf(start_color.substr(4,1));var bbeg=color_items.indexOf(start_color.substr(5,1))*16+color_items.indexOf(start_color.substr(6,1));var rend=color_items.indexOf(temp_end.substr(1,1))*16+color_items.indexOf(temp_end.substr(2,1));var gend=color_items.indexOf(temp_end.substr(3,1))*16+color_items.indexOf(temp_end.substr(4,1));var bend=color_items.indexOf(temp_end.substr(5,1))*16+color_items.indexOf(temp_end.substr(6,1));for(i=1,r=rbeg,g=gbeg,b=bbeg;i<=iter;r=Math.round(rbeg+i*((rend-rbeg)/(iter-1))),g=Math.round(gbeg+i*((gend-gbeg)/(iter-1))),b=Math.round(bbeg+i*((bend-bbeg)/(iter-1))),i++){hstr='#'+color_items.charAt(Math.floor(r/16))+color_items.charAt(r%16)+color_items.charAt(Math.floor(g/16))+color_items.charAt(g%16)+color_items.charAt(Math.floor(b/16))+color_items.charAt(b%16);setTimeout('var div = document.getElementById("'+div+'"); div.style.backgroundColor = "'+hstr+'";',i*time);}setTimeout('var div = document.getElementById("'+div+'"); div.style.backgroundColor = "'+orig_color+'";',(i+1)*time);};this.lang_build_string=function(){if(!arguments.length||!arguments){return;}var string=arguments[0];for(var i=1;i<arguments.length;i++){var match=new RegExp('<%'+i+'>','gi');string=string.replace(match,arguments[i]);}return string;};this.get_id_from_text=function(id){return id.replace( /.*(\-|_)(\S+)/,"$2");};this.get_name_from_text=function(id){return id.replace( /(.*)(\-|_)(\S+)/,"$1");};this.location_jump=function(url,full){url=url.replace( /&/g,'&');if(full){window.location.href=url;}else{window.location.href=ipb_var_base_url+url;}};this.confirm_action=function(url,msg){if(!msg){msg='PLEASE CONFIRM:\nOK to proceed?';}if(url){url=url.replace('&','&');}else{url='';}if(confirm(msg)){window.location.href=url;}else{alert('OK, action cancelled!');return false;}};this.pop_up_window=function(url,width,height,name){if(!name){var mydate=new Date();name=mydate.getTime();}var Win=window.open(url.replace('&','&'),name,'width='+width+',height='+height+',resizable=1,scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no');return false;};this.set_unselectable=function(obj){if(!is_ie4&&typeof(obj.tagName)!='undefined'){if(obj.hasChildNodes()){for(var i=0;i<obj.childNodes.length;i++){this.set_unselectable(obj.childNodes[i]);}}obj.unselectable='on';}};this.get_obj_leftpos=function(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offLine truncated
|
||||
+1
-447
@@ -1,447 +1 @@
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// IPS BASIC MENU CLASS
|
||||
// (c) 2005 Invision Power Services, Inc
|
||||
// ASSUMES "ips_global.js" has been loaded
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
var menu_registered = new Array();
|
||||
var menu_openfuncs = new Array();
|
||||
var menu_built = new Array();
|
||||
var menu_open_menus = new Array();
|
||||
var menu_cur_open = false;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// menu_do_global_init: Initiate all registered menus in HTML
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_do_global_init()
|
||||
{
|
||||
if ( menu_registered.length > 0 )
|
||||
{
|
||||
for( var i in menu_registered )
|
||||
{
|
||||
menu_init( menu_registered[i] );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Close all menus on click
|
||||
//----------------------------------
|
||||
|
||||
document.onclick = menu_action_close;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// menu_init: Initiate a single menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_init(cid)
|
||||
{
|
||||
var mid = _menu_get_base_name(cid) + "_menu";
|
||||
var mobj = my_getbyid(mid);
|
||||
|
||||
if ( document.getElementsByTagName && mobj )
|
||||
{
|
||||
//----------------------------------
|
||||
// Control object (link / img, etc)
|
||||
//----------------------------------
|
||||
|
||||
var cobj = my_getbyid(cid);
|
||||
|
||||
// Change cursor to show link
|
||||
try
|
||||
{
|
||||
cobj.style.cursor = "pointer";
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
cobj.style.cursor = "hand";
|
||||
}
|
||||
|
||||
cobj.unselectable = true;
|
||||
cobj.onclick = _event_menu_click;
|
||||
cobj.onmouseover = _event_menu_mouseover;
|
||||
|
||||
//----------------------------------
|
||||
// Save CPU - already init?
|
||||
//----------------------------------
|
||||
|
||||
if ( typeof( menu_built[mid]) != "undefined" )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Pop-up menu obj (hidden div)
|
||||
//----------------------------------
|
||||
|
||||
var pobj = my_getbyid(mid);
|
||||
|
||||
// Set up style defaults
|
||||
pobj.style.display = "none";
|
||||
pobj.style.position = "absolute";
|
||||
pobj.style.left = "0px";
|
||||
pobj.style.top = "0px";
|
||||
pobj.onclick = _cancel_bubble;
|
||||
pobj.zIndex = 1000;
|
||||
|
||||
menu_built[mid] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Register menu control ID (add to array)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_register(cid, callback)
|
||||
{
|
||||
if ( document.getElementsByTagName )
|
||||
{
|
||||
var cobj = my_getbyid(cid);
|
||||
|
||||
if (cobj)
|
||||
{
|
||||
menu_registered[menu_registered.length] = cid;
|
||||
|
||||
if ( callback )
|
||||
{
|
||||
menu_openfuncs[ cobj ] = callback;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ACTION: If registered control ID clicked, open menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_action_open(e)
|
||||
{
|
||||
var openmenu = menu_cur_open;
|
||||
var negpad = true;
|
||||
|
||||
//----------------------------------
|
||||
// Close current menu(s)
|
||||
//----------------------------------
|
||||
|
||||
menu_action_close();
|
||||
|
||||
//----------------------------------
|
||||
// Save CPU - cur open clicked?
|
||||
//----------------------------------
|
||||
|
||||
if ( openmenu == e.id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Get ID of menu DIV to show
|
||||
//----------------------------------
|
||||
|
||||
var mid = _menu_get_base_name(e.id) + "_menu";
|
||||
var mobj = my_getbyid(mid);
|
||||
var left_px = _get_obj_leftpos(e);
|
||||
var top_px = _get_obj_toppos(e) + e.offsetHeight;
|
||||
var callbackobj = my_getbyid( e.id );
|
||||
var ifid = e.id;
|
||||
|
||||
menu_open_menus[e.id] = true;
|
||||
menu_cur_open = e.id;
|
||||
|
||||
//----------------------------------
|
||||
// Show menu DIV
|
||||
//----------------------------------
|
||||
|
||||
mobj.style.display = "";
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
var width = parseInt( mobj.style.width ) ? parseInt( mobj.style.width ) : mobj.offsetWidth;
|
||||
|
||||
if ( (left_px + width) >= document.body.clientWidth )
|
||||
{
|
||||
left_px = left_px + e.offsetWidth - width;
|
||||
negpad = false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// IE needs a tweak...
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
left_px += ( negpad ) ? -2 : 2;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Finalize menu position
|
||||
//----------------------------------
|
||||
|
||||
mobj.style.left = left_px + "px";
|
||||
mobj.style.top = top_px + "px";
|
||||
mobj.style.zIndex = 100;
|
||||
|
||||
//----------------------------------
|
||||
// Run a custom function?
|
||||
//----------------------------------
|
||||
|
||||
if ( menu_openfuncs[ callbackobj ] )
|
||||
{
|
||||
eval( menu_openfuncs[ callbackobj ] );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Workaround for IE bug which shows
|
||||
// select boxes and other windows GUI
|
||||
// over divs. SHOW IFRAME
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! document.getElementById( 'if_' + e.id ) )
|
||||
{
|
||||
var iframeobj = document.createElement('iframe');
|
||||
|
||||
iframeobj.src = 'javascript;';
|
||||
iframeobj.id = 'if_' + e.id;
|
||||
|
||||
document.getElementsByTagName('body').appendChild( iframeobj );
|
||||
}
|
||||
else
|
||||
{
|
||||
var iframeobj = document.getElementById( 'if_' + e.id );
|
||||
}
|
||||
|
||||
iframeobj.scrolling = 'no';
|
||||
iframeobj.frameborder = 'no';
|
||||
iframeobj.className = 'iframeshim';
|
||||
iframeobj.style.position = 'absolute';
|
||||
|
||||
iframeobj.style.width = parseInt(mobj.offsetWidth) + 'px';
|
||||
iframeobj.style.height = parseInt(mobj.offsetHeight) + 'px';
|
||||
iframeobj.style.top = mobj.style.top;
|
||||
iframeobj.style.left = mobj.style.left;
|
||||
iframeobj.style.zIndex = 99;
|
||||
iframeobj.style.display = "block";
|
||||
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
//alert(e); // Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Work around for safari which doesnt
|
||||
// allow a hrefs top be clickable in
|
||||
// a pop up div
|
||||
//----------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
try
|
||||
{
|
||||
mlinks = mobj.getElementsByTagName('a');
|
||||
|
||||
for ( var i = 0 ; i <= mlinks.length ; i++ )
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore non links and links that end with #
|
||||
// As safari likes to do that with href='#' links
|
||||
//----------------------------------
|
||||
|
||||
if ( mlinks[i].href && ( mlinks[i].href.indexOf( '#', 0 ) != (mlinks[i].href.length - 1) ) )
|
||||
{
|
||||
mlinks[i].onmousedown = _safari_onclick_handler;
|
||||
mlinks[i].id = 'saf-link-' + mid + i;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
//alert( e );
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Safari: bug fix
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _safari_onclick_handler()
|
||||
{
|
||||
if ( this.id )
|
||||
{
|
||||
window.location = document.getElementById( this.id ).href;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ACTION: Close all open menus
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_action_close()
|
||||
{
|
||||
if ( menu_cur_open )
|
||||
{
|
||||
for ( i in menu_open_menus )
|
||||
{
|
||||
my_getbyid(_menu_get_base_name(i) + "_menu").style.display = "none";
|
||||
|
||||
//----------------------------------
|
||||
// Workaround for IE bug which shows
|
||||
// select boxes and other windows GUI
|
||||
// over divs. Hide IFRAME
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
document.getElementById( 'if_' + i ).style.display = "none";
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
//alert(e);// Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
|
||||
menu_open_menus[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
menu_cur_open = false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ACTION: If menu open and hover over another cid, close cur open new
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_action_hover(e)
|
||||
{
|
||||
for ( i in menu_open_menus )
|
||||
{
|
||||
if (menu_open_menus[i] == true && i != e.id)
|
||||
{
|
||||
menu_action_open(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Prevent browser bubblin'
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _cancel_bubble(obj, extra)
|
||||
{
|
||||
if ( ! obj || is_ie)
|
||||
{
|
||||
if ( extra )
|
||||
{
|
||||
window.event.returnValue = false;
|
||||
}
|
||||
|
||||
window.event.cancelBubble = true;
|
||||
|
||||
return window.event;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (obj.target.type == 'submit')
|
||||
{
|
||||
obj.target.form.submit();
|
||||
}
|
||||
|
||||
obj.stopPropagation();
|
||||
|
||||
if ( extra )
|
||||
{
|
||||
obj.preventDefault();
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EVENT : Mouse over menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _event_menu_mouseover(e)
|
||||
{
|
||||
e = _cancel_bubble(e, true);
|
||||
menu_action_hover(this);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EVENT: Menu click
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _event_menu_click(e)
|
||||
{
|
||||
e = _cancel_bubble(e, true);
|
||||
menu_action_open(this);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get menu basename
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _menu_get_base_name(cid)
|
||||
{
|
||||
var endpos = cid.indexOf(".");
|
||||
|
||||
if (endpos != -1)
|
||||
{
|
||||
return cid.substr(0, endpos);
|
||||
}
|
||||
else
|
||||
{
|
||||
return cid;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get left posititon of object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _get_obj_leftpos(obj)
|
||||
{
|
||||
var left = obj.offsetLeft;
|
||||
|
||||
while( (obj = obj.offsetParent) != null )
|
||||
{
|
||||
left += obj.offsetLeft;
|
||||
}
|
||||
|
||||
return left;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get top position of object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _get_obj_toppos(obj)
|
||||
{
|
||||
var top = obj.offsetTop;
|
||||
|
||||
while( (obj = obj.offsetParent) != null )
|
||||
{
|
||||
top += obj.offsetTop;
|
||||
}
|
||||
|
||||
return top;
|
||||
}
|
||||
ipsmenu=new ips_menu();function ips_menu(){this.menu_registered=new Array();this.menu_openfuncs=new Array();this.menu_over_css=new Array();this.menu_out_css=new Array();this.dynamic_register=new Array();this.menu_cur_open=null;this.dynamic_html=null;}ips_menu.prototype.register=function(cid,callback,menu_over_css,menu_out_css){this.menu_registered[cid]=new ips_menu_class(cid);if(callback){this.menu_openfuncs[cid]=callback;}if(menu_over_css&&menu_out_css){this.menu_over_css[cid]=menu_over_css;this.menu_out_css[cid]=menu_out_css;}return this.menu_registered[cid];};ips_menu.prototype.close=function(){if(this.menu_cur_open){this.menu_registered[this.menu_cur_open].close();}};function ips_menu_class(cid){this.cid=cid;this.initialized=false;this.init_control_object();this.init_menu();};ips_menu_class.prototype.init_control_object=function(){this.cid_obj=document.getElementById(this.cid);try{this.cid_obj.style.cursor="pointer";}catch(e){this.cid_obj.style.cursor="hand";}this.cid_obj.unselectable=true;this.cid_obj.onclick=ips_menu_events.prototype.event_onclick;this.cid_obj.onmouseover=ips_menu_events.prototype.event_onmouseover;this.cid_obj.onmouseout=ips_menu_events.prototype.event_onmouseout;};ips_menu_class.prototype.init_menu=function(){this.cid_menu_obj=document.getElementById(this.cid+'_menu');if(this.cid_menu_obj){if(this.initialized){return;}this.cid_menu_obj.style.display="none";this.cid_menu_obj.style.position="absolute";this.cid_menu_obj.style.left="0px";this.cid_menu_obj.style.top="0px";this.cid_menu_obj.onclick=ipsclass.cancel_bubble_low;this.cid_menu_obj.zIndex=50;this.initialized=true;}};ips_menu_class.prototype.open=function(obj){if(!this.cid_menu_obj){this.initialized=false;this.init_menu();}if(ipsmenu.menu_cur_open!=null){ipsmenu.menu_registered[ipsmenu.menu_cur_open].close();}if(ipsmenu.menu_cur_open==obj.id){return false;}ipsmenu.menu_cur_open=obj.id;var left_px=ipsclass.get_obj_leftpos(obj);var top_px=ipsclass.get_obj_toppos(obj)+obj.offsetHeight;var ifid=obj.id;if(is_safari){top_px+=20;}this.cid_menu_obj.style.zIndex=-1;this.cid_menu_obj.style.display="";var width=parseInt(this.cid_menu_obj.style.width)?parseInt(this.cid_menu_obj.style.width):this.cid_menu_obj.offsetWidth;if((left_px+width)>=document.body.clientWidth){left_px=left_px+obj.offsetWidth-width;}if(is_moz){top_px-=1;}this.cid_menu_obj.style.left=left_px+"px";this.cid_menu_obj.style.top=top_px+"px";this.cid_menu_obj.style.zIndex=100;if(ipsmenu.menu_openfuncs[obj.id]){eval(ipsmenu.menu_openfuncs[obj.id]);}if(is_ie){try{if(!document.getElementById('if_'+obj.id)){var iframeobj=document.createElement('iframe');iframeobj.src='javascript:;';iframeobj.id='if_'+obj.id;document.getElementsByTagName('body').appendChild(iframeobj);}else{var iframeobj=document.getElementById('if_'+obj.id);}iframeobj.scrolling='no';iframeobj.frameborder='no';iframeobj.className='iframeshim';iframeobj.style.position='absolute';iframeobj.style.width=parseInt(this.cid_menu_obj.offsetWidth)+'px';iframeobj.style.height=parseInt(this.cid_menu_obj.offsetHeight)+'px';iframeobj.style.top=this.cid_menu_obj.style.top;iframeobj.style.left=this.cid_menu_obj.style.left;iframeobj.style.zIndex=99;iframeobj.style.display="block";}catch(error){}}if(is_safari){try{mlinks=this.cid_menu_obj.getElementsByTagName('a');for(var i=0;i<=mlinks.length;i++){if(mlinks[i]!=null&&mlinks[i].href!=null&&mlinks[i].href&&(mlinks[i].href.indexOf('#',0)!=(mlinks[i].href.length-1))){mlinks[i].onmousedown=ips_menu_events.prototype.event_safari_onclick_handler;mlinks[i].id='saf-link-'+this.cid+i;}}}catch(error){}}if(this.cid_obj.editor_id){this.cid_obj.state=true;IPS_editor[this.cid_obj.editor_id].set_menu_context(this.cid_obj,'mousedown');}return false;};ips_menu_class.prototype.close=function(){if(this.cid_menu_obj!=null){this.cid_menu_obj.style.display="none";}else if(ipsmenu.menu_cur_open!=null){ipsmenu.menu_registered[ipsmenu.menu_cur_open].cid_menu_obj.style.display='none';}ipsmenu.menu_cur_open=null;if(this.cid_obj){if(ipsmenu.menu_out_css[this.cid_obj.id]){this.cid_obj.className=ipsmenu.menu_out_css[this.cid_obj.id];}}if(is_ie){try{document.getElementById('if_'+this.cid).style.display="none";}catch(error){}}if(this.cid_obj.editor_id){this.cid_obj.state=false;IPS_editor[this.cid_obj.editor_id].set_menu_context(this.cid_obj,'mouseout');}};ips_menu_class.prototype.hover=function(e){if(ipsmenu.menu_cur_open!=null){if(ipsmenu.menu_registered[ipsmenu.menu_cur_open].cid!=this.id){this.open(e);}}};function ips_menu_events(){};ips_menu_events.prototype.event_safari_onclick_handler=function(){if(this.id){window.location=document.getElementById(this.id).href;}};ips_menu_events.prototype.event_onmouseover=function(e){e=ipsclass.cancel_bubble(e,true);ipsmenu.menu_registered[this.id].hover(this);if(ipsmenu.menu_over_css[this.id]){this.className=ipsmenu.menu_over_css[this.id];}};ips_menu_events.prototype.event_onmouseout=function(e){e=ipsclass.cancel_bubble(e,true);if(ipsmenu.menu_out_css[this.id]&&ipsmenu.mLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
var ips_personal_portal=new ips_personal_portal();function ips_personal_portal(){this.div_rating_wrapper='pp-rating-wrapper';this.text_rating_image='pp-rating-img-';this.css_classes={'pp-tabon':'pp-tabon','pp-taboff':'pp-taboff','pp-tabshaded':'pp-tabshaded','pp-contentbox-back':'pp-contentbox-back','pp-contentbox-entry-noheight':'pp-contentbox-entry-noheight','pp-contentbox-entry-noheight-mod':'pp-contentbox-entry-noheight-mod','pp-contentbox-entry-noheight-sel':'pp-contentbox-entry-noheight-sel'};this.contact_types={'aim':'aim','msn':'msn','icq':'icq','yahoo':'yahoo'};this.content_tabs={};this.stored_tabs={};this.stored_div_classes={};this.iframe_tabs={'comments':ipb_var_base_url+'act=profile&CODE=personal_iframe_comments','settings':ipb_var_base_url+'act=profile&CODE=personal_iframe_settings','friends':ipb_var_base_url+'act=profile&CODE=personal_iframe_friends'};this.stored_tabs_css={};this.div_names={'pp-entry-gender-wrap':'pp-entry-gender-wrap','pp-entry-gender-text':'pp-entry-gender-text','pp-entry-gender-img':'pp-entry-gender-img','pp-entry-gender-imgwrap':'pp-entry-gender-imgwrap','pp-entry-location-wrap':'pp-entry-location-wrap','pp-entry-location-text':'pp-entry-location-text','pp-entry-born-wrap':'pp-entry-born-wrap','pp-entry-born-text':'pp-entry-born-text','pp-entry-age-wrap':'pp-entry-age-wrap','pp-entry-age-text':'pp-entry-age-text','pp-main-tab-content':'pp-main-tab-content','pp-content-tab':'pp-content-tab','pp-comment-textarea':'pp-comment-textarea','pp-comments-wrap':'pp-comments-wrap','pp-comment-entry':'pp-comment-entry','pp-comment-entry-main':'pp-comment-entry-main','pp-iframe-wrap':'pp-iframe-wrap','pp-entry-contact-wrap':'pp-entry-contact-wrap','pp-entry-contact-entry':'pp-entry-contact-entry','pp-main-photo':'pp-main-photo','pp-personal_statement':'pp-personal_statement','pp-checked':'pp-checked','pp-friend-img':'pp-friend-img','pp-friend-text':'pp-friend-text','pp-friend-wrap':'pp-friend-wrap'};this.settings={'allow_rating':0,'default_rating':3,'member_id':0,'viewer_id':0,'img_star_on':'star_filled.gif','img_star_selected':'star_selected.gif','img_star_off':'star_empty.gif','img_gender_male':'gender_male.png','img_gender_female':'gender_female.png','img_gender_mystery':'gender_mystery.png','img_base_url':'','img_menu_icon':'','default_tab':'','photo_def_width':'150','photo_def_height':'150','photo_def_src':ipb_var_image_url+'/folder_profile_portal/pp-blank-large.png','img_friend_remove':ipb_var_image_url+'/folder_profile_portal/friend_remove_small.png','img_friend_add':ipb_var_image_url+'/folder_profile_portal/friend_add_small.png'};this.languages={'rate_me':'Rate Me','img_alt_rate':'Rate this member, click on desired star to send rating','gender_male':'Male','gender_female':'Female','gender_mystery':'Gender Not Set','saving_comment':'Saving Comment...','loading_tab':'Loading Content...','deleting_comment':'Deleting Comment...','friend_add':'Add as Friend','friend_remove':'Remove Friend'};var loaded_tab=null;this.init=function(){var divs=document.getElementsByTagName('DIV');var divcount=0;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(divs[i].id);var divnum=ipsclass.get_id_from_text(divs[i].id);if(divname==this.div_names['pp-content-tab']){var _highlight=0;this.stored_tabs[divnum]=divs[i];this.stored_tabs_css[divnum]=divs[i].className;divs[i].style.cursor='pointer';divs[i].onclick=this.tab_onclick;if(this.settings['default_tab']!=""){if(this.settings['default_tab']==divnum){_highlight=1;}}else if(divcount==0){_highlight=1;}if(_highlight==1){divs[i].className=this.css_classes['pp-tabon'];divs[i].style.display='block';}else{if(divs[i].className!=this.css_classes['pp-tabshaded']){divs[i].className=this.css_classes['pp-taboff'];}divs[i].style.display='block';}divcount++;}}this.init_rating_images();this.show_dropdown_boxes();};this.show_friend_add_or_remove=function(add_friend){try{var _div=document.getElementById(this.div_names['pp-friend-wrap']);var _html='';if(_div.id){if(add_friend){_html="<img src='"+this.settings['img_friend_add']+"' id='"+this.div_names['pp-friend-img']+"' alt='' border='0' /> ";_html+="<a href='#' onclick='friends_pop(\"&do=add&member_id="+this.settings['member_id']+"&md5check="+ipb_md5_check+"\"); ips_personal_portal.show_friend_add_or_remove(0); return false;' id='"+this.div_names['pp-friend-text']+"'>"+this.languages['friend_add']+"</a>";}else{_html="<img src='"+this.settings['img_friend_remove']+"' id='"+this.div_names['pp-friend-img']+"' alt='' border='0' /> ";_html+="<a href='#' onclick='friends_pop(\"&do=remove&member_id="+this.settings['member_id']+"&md5check="+ipb_md5_check+"\"); ips_personal_portal.show_friend_add_or_remove(1); return false;' id='"+this.div_names['pp-friend-text']+"'>"+this.languages['friend_remove']+"</a>";}_div.innerHTML=_html;}}catch(error){}};this.toggle_comment_box=function(comment_id,from_iframe){comment_iLine truncated
|
||||
@@ -0,0 +1,103 @@
|
||||
var ie_ptags_to_newlines=true;var IPS_editor=new Array();var buttons_update=new Array("bold","italic","underline","justifyleft","justifycenter","justifyright","insertorderedlist","insertunorderedlist");var ips_primary_colors=new Array('#000000','#A0522D','#556B2F','#006400','#483D8B','#000080','#4B0082','#2F4F4F','#8B0000','#FF8C00','#808000','#008000','#008080','#0000FF','#708090','#696969','#FF0000','#F4A460','#9ACD32','#2E8B57','#48D1CC','#4169E1','#800080','#808080','#FF00FF','#FFA500','#FFFF00','#00FF00','#00FFFF','#00BFFF','#9932CC','#C0C0C0','#FFC0CB','#F5DEB3','#FFFACD','#98FB98','#AFEEEE','#ADD8E6','#DDA0DD','#FFFFFF');var ips_primary_fonts=new Array("Arial","Arial Black","Arial Narrow","Book Antiqua","Century Gothic","Comic Sans MS","Courier New","Franklin Gothic Medium","Garamond","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Microsoft Sans Serif","Palatino Linotype","Tahoma","Times New Roman","Trebuchet MS","Verdana");var ips_primary_sizes=new Array(1,2,3,4,5,6,7);var ips_format_items={'cmd_subscript':'Sub-script','cmd_superscript':'Super-script','cmd_strikethrough':'Strikethrough'};var ips_format_item_images={'cmd_subscript':'rte-subscript.gif','cmd_superscript':'rte-superscript.gif','cmd_strikethrough':'rte-strike.gif'};ips_language_array={};function ips_text_editor(editor_id,mode,use_bbcode,file_path,initial_text){this.editor_id=editor_id;this.is_rte=mode;this.initialized=false;this.buttons=new Array();this.fonts=new Array();this.state=new Array();this.text_obj=document.getElementById(this.editor_id+'_textarea');this.control_obj=document.getElementById(this.editor_id+'_controls');this.font_obj=document.getElementById(this.editor_id+'_out_fontname');this.size_obj=document.getElementById(this.editor_id+'_out_fontsize');this.special_obj=document.getElementById(this.editor_id+'_out_special');this.format_obj=document.getElementById(this.editor_id+'_out_format');this.mainbar=document.getElementById(this.editor_id+'_main-bar');this.use_menus=(typeof(ipsmenu)=='undefined'?false:true);this.is_ie=is_ie;this.is_moz=is_moz;this.is_opera=is_opera;this.is_safari=is_safari;this.file_path=file_path?file_path:global_rte_includes_url;this.font_state=null;this.size_state=null;this.use_bbcode=use_bbcode;this.open_brace=this.use_bbcode?'[':'<';this.close_brace=this.use_bbcode?']':'>';this.allow_advanced=this.use_bbcode?0:1;this.ips_frame_html='';this.popups=new Array();this.char_set=global_rte_char_set?global_rte_char_set:'UTF-8';this.forum_fix_ie_newlines=0;this.emoticon_window_id='';this.is_loading=0;this.hidden_objects=new Array();this.history_pointer=-1;this.history_recordings=new Array();this._showing_html=0;this._ie_cache=null;this.current_bar_object=null;this.ips_special_items={};ips_format_items['cmd_subscript']=ips_language_array['js_rte_sub']?ips_language_array['js_rte_sub']:'Sub-script';ips_format_items['cmd_superscript']=ips_language_array['js_rte_sup']?ips_language_array['js_rte_sup']:'Super-script';ips_format_items['cmd_strikethrough']=ips_language_array['js_rte_strike']?ips_language_array['js_rte_strike']:'Strikethrough';this.init=function(){if(this.initialized){return;}this.control_obj.style.display='';try{document.getElementById(this.editor_id+'_wysiwyg_used').value=parseInt(this.is_rte);}catch(err){}this.ips_frame_html=this.get_frame_html();this.editor_set_content(initial_text);this.editor_set_functions();this.editor_set_controls();this.initialized=true;};this.get_frame_html=function(){var ips_frame_html="";ips_frame_html+="<html id=\""+this.editor_id+"_html\">\n";ips_frame_html+="<head>\n";ips_frame_html+="<meta http-equiv=\"content-type\" content=\"text/html; charset="+this.char_set+"\" />";ips_frame_html+="<style type='text/css' media='all'>\n";ips_frame_html+="body {\n";ips_frame_html+=" background: #FFFFFF;\n";ips_frame_html+=" margin: 0px;\n";ips_frame_html+=" padding: 4px;\n";ips_frame_html+=" font-family: Verdana, arial, sans-serif;\n";ips_frame_html+=" font-size: 10pt;\n";ips_frame_html+="}\n";ips_frame_html+="</style>\n";ips_frame_html+="</head>\n";ips_frame_html+="<body>\n";ips_frame_html+="{:content:}\n";ips_frame_html+="</body>\n";ips_frame_html+="</html>";return ips_frame_html;};this.editor_check_focus=function(){if(!this.editor_window.has_focus){if(this.is_opera){this.editor_window.focus();}this.editor_window.focus();}};this.editor_set_controls=function(){var controls=new Array();var _c=0;if(!this.control_obj){return;}var items=this.control_obj.getElementsByTagName("DIV");for(var i=0;i<items.length;i++){if((items[i].className=='rte-normal'||items[i].className=='rte-menu-button'||items[i].className=='rte-normal-menubutton')&&items[i].id){controls[controls.length]=items[i].id;}}for(var i=0;i<controls.length;i++){var control=document.getElementById(controls[i]);if(control.className=='rte-normal'){this.init_editor_button(control);}else if(control.className=='rte-menu-button'||control.className=='rte-normal-menubutton'){this.init_editor_popup_button(control);}}ipsclass.seLine truncated
|
||||
{
|
||||
this.editor_document.selectionStart = open;
|
||||
this.editor_document.selectionEnd = open + text.length;
|
||||
this.editor_document.scrollTop = st;
|
||||
}
|
||||
}
|
||||
else if ( ( document.selection && document.selection.createRange ) || this._ie_cache )
|
||||
{
|
||||
var sel = this._ie_cache ? this._ie_cache : document.selection.createRange();
|
||||
sel.text = text.replace(/\r?\n/g, '\r\n');
|
||||
sel.select();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.editor_document.value += text;
|
||||
}
|
||||
this._ie_cache = null;
|
||||
};
|
||||
this.insert_emoticon = function( emo_id, emo_image, emo_code, event )
|
||||
{
|
||||
emo_code = this.unhtmlspecialchars( emo_code );
|
||||
this.wrap_tags_lite( " " + emo_code, " ");
|
||||
if ( this.is_ie )
|
||||
{
|
||||
if ( IPS_editor[ this.editor_id ].emoticon_window_id != '' && typeof( IPS_editor[ this.editor_id ].emoticon_window_id ) != 'undefined' )
|
||||
{
|
||||
IPS_editor[ this.editor_id ].emoticon_window_id.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.insertorderedlist = function(e)
|
||||
{
|
||||
this.insertlist( 'ol');
|
||||
};
|
||||
this.insertunorderedlist = function(e)
|
||||
{
|
||||
this.insertlist( 'ul');
|
||||
};
|
||||
this.insertlist = function( list_type )
|
||||
{
|
||||
var open_tag;
|
||||
var close_tag;
|
||||
var item_open_tag = '<li>';
|
||||
var item_close_tag = '</li>';
|
||||
var regex = '';
|
||||
var all_add = '';
|
||||
if ( this.use_bbcode )
|
||||
{
|
||||
regex = new RegExp('([\r\n]+|^[\r\n]*)(?!\\[\\*\\]|\\[\\/?list)(?=[^\r\n])', 'gi');
|
||||
open_tag = list_type == 'ol' ? '[list=1]\n' : '[list]\n';
|
||||
close_tag = '[/list]';
|
||||
item_open_tag = '[*]';
|
||||
item_close_tag = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
regex = new RegExp('([\r\n]+|^[\r\n]*)(?!<li>|<\\/?ol|ul)(?=[^\r\n])', 'gi');
|
||||
open_tag = list_type == 'ol' ? '<ol>\n' : '<ul>\n';
|
||||
close_tag = list_type == 'ol' ? '</ol>\n' : '</ul>\n';
|
||||
}
|
||||
if ( text = this.get_selection() )
|
||||
{
|
||||
text = open_tag + text.replace( regex, "\n" + item_open_tag + '$1' + item_close_tag ) + '\n' + close_tag;
|
||||
if ( this.use_bbcode )
|
||||
{
|
||||
text = text.replace( new RegExp( '\\[\\*\\][\r\n]', 'gi' ), item_open_tag );
|
||||
}
|
||||
this.insert_text( text );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( this.is_moz )
|
||||
{
|
||||
this.insert_text( open_tag + close_tag );
|
||||
while ( val = prompt( ipb_global_lang['editor_enter_list'], '') )
|
||||
{
|
||||
this.insert_text( open_tag + all_add + item_open_tag + val + item_close_tag + '\n' + close_tag );
|
||||
all_add += item_open_tag + val + item_close_tag + '\n';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.insert_text( open_tag );
|
||||
while ( val = prompt( ipb_global_lang['editor_enter_list'], '') )
|
||||
{
|
||||
this.insert_text( item_open_tag + val + item_close_tag + '\n' );
|
||||
}
|
||||
this.insert_text( close_tag );
|
||||
}
|
||||
}
|
||||
};
|
||||
this.unlink = function()
|
||||
{
|
||||
var text = this.get_selection();
|
||||
var link_regex = '';
|
||||
var link_text = '';
|
||||
if ( text !== false )
|
||||
{
|
||||
if ( text.match( link_regex ) )
|
||||
{
|
||||
text = ( this.use_bbcode ) ? text.replace( /\[url=([^\]]+?)\]([^\[]+?)\[\/url\]/ig, "$2" )
|
||||
: text.replace( /<a href=['\"]([^\"']+?)['\"]([^>]+?)?>(.+?)<\/a>/ig,"$3");}this.insert_text(text);}};this.undo=function(){this.history_record_state(this.editor_get_contents());this.history_time_shift(-1);if((text=this.history_fetch_recording())!==false){this.editor_document.value=text;}};this.redo=function(){this.history_time_shift(1);if((text=this.history_fetch_recording())!==false){this.editor_document.value=text;}};this.update_for_form_submit=function(subjecttext,minchars){return true;};}this.___SAFARI_FUNCTIONS=function(){};if(this.is_safari){try{document.getElementById(this.editor_id+'_cmd_switcheditor').style.display='none';}catch(error){}}this.___IPB_FUNCTIONS=function(){};this.createlink=function(e){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[url)/ig)){this.format_text(e,"unlink",false);}else{var _url=prompt(ipb_global_lang['editor_enter_url'],'http://');if(!_url||_url==null||_url=='http://'){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_enter_title']);if(!_text||_text==null){return false;}this.wrap_tags('url',_url,_text);}};this.insertemail=function(e){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[email)/ig)){this.format_text(e,"unlink",false);}else{var _url=prompt(ipb_global_lang['editor_enter_email'],'');if(!_url||_url==null){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_enter_title']);if(!_text||_text==null){return false;}this.wrap_tags('email',_url,_text);}};this.insertimage=function(){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');var _url=prompt(ipb_global_lang['editor_enter_image'],_text?_text:"http://");if(!_url||_url==null||_url=='http://'){return false;}if(!this.is_rte){this.wrap_tags('img',false,_url);}else{this.wrap_tags('img',_url,'');}};this.ipb_quote=function(){this.wrap_tags_lite('[quote]','[/quote]',0)};this.ipb_code=function(){this.wrap_tags_lite('[code]','[/code]',0)};this.init();}function ips_editor_events(){}ips_editor_events.prototype.button_onmouse_event=function(e){if(is_ie){e=ipsclass.cancel_bubble(e,true);}if(e.type=='click'){IPS_editor[this.editor_id].format_text(e,this.cmd,false,true);}IPS_editor[this.editor_id].set_button_context(this,e.type);};ips_editor_events.prototype.special_onmouse_event=function(e){e=ipsclass.cancel_bubble(e,true);if(e.type=='click'){if(!this.loader_key){IPS_editor[this.editor_id].format_text(e,this.cmd,false,true);ipsmenu.close();}else{IPS_editor[this.editor_id].module_load(this,e,this.loader_key);}}IPS_editor[this.editor_id].set_button_context(this,e.type,'menu');};ips_editor_events.prototype.editor_window_onfocus=function(e){this.has_focus=true;};ips_editor_events.prototype.editor_window_onblur=function(e){this.has_focus=false;};ips_editor_events.prototype.editor_document_onmouseup=function(e){try{if(typeof(this.editor_id=='undefined')&&is_moz){this.editor_id=e.view.editor_id;}}catch(me){}IPS_editor[this.editor_id].set_context();menu_action_close();};ips_editor_events.prototype.editor_document_onkeyup=function(e){IPS_editor[this.editor_id].set_context();};ips_editor_events.prototype.editor_document_onkeypress=function(e){if(e.ctrlKey){switch(String.fromCharCode(e.charCode).toLowerCase()){case 'b':cmd='bold';break;case 'i':cmd='italic';break;case 'u':cmd='underline';break;default:return;}e.preventDefault();IPS_editor[this.editor_id].apply_formatting(cmd,false,null);return false;}};ips_editor_events.prototype.popup_button_onmouseevent=function(e){e=ipsclass.cancel_bubble(e,true);if(e.type=='click'){this._onclick(e);IPS_editor[this.editor_id].set_menu_context(this,'mouseover');}else{IPS_editor[this.editor_id].set_menu_context(this,e.type);}};ips_editor_events.prototype.popup_button_show=function(obj){if(typeof IPS_editor[obj.editor_id].popups[obj.cmd]=='undefined'||IPS_editor[obj.editor_id].popups[obj.cmd]==null){IPS_editor[obj.editor_id].init_editor_menu(obj);}this._open(obj);};ips_editor_events.prototype.menu_option_onmouseevent=function(e){e=ipsclass.cancel_bubble(e,true);IPS_editor[this.editor_id].set_button_context(this,e.type,'menu');};ips_editor_events.prototype.font_format_option_onclick=function(e){IPS_editor[this.editor_id].format_text(e,this.cmd,this.firstChild.innerHTML);ipsmenu.close();};ips_editor_events.prototype.emoticon_onclick=function(e){e=ipsclass.cancel_bubble(e,true);IPS_editor[this.editor_id].insert_emoticon(this.emo_id,this.emo_image,this.emo_code,e);ipsmenu.close();};ips_editor_events.prototype.color_cell_onclick=function(e){IPS_editor[this.editor_id].format_text(e,this.cmd,this.colorname);ipsmenu.close();};ips_editor_events.prototype.editor_document_onkeydown=function(e){};
|
||||
@@ -0,0 +1 @@
|
||||
function check_side_panel(editor_id){if(global_rte_remove_side_panel){document.getElementById('rte-toggle-side-panel-button').style.display='none';return true;}var _open=global_rte_side_panel_open;var _cookie=ipsclass.my_getcookie('rte-sidepanel');if(_cookie=='open'||_cookie=='close'){_open=(_cookie=='open')?1:0;}if(_open){show_options_panel(editor_id,_open);}}function show_options_panel(editor_id,force,start_emo){if(global_rte_remove_side_panel){document.getElementById('rte-toggle-side-panel-button').style.display='none';return true;}if(typeof(start_emo)=='undefined'){start_emo=0;}var _editor=document.getElementById(editor_id+'_main-bar');var _options=document.getElementById(editor_id+'_options-bar');var _height=parseInt(_editor.offsetHeight);var _mode='open';var _more_less='';_options.innerHTML='';if(typeof(force)!='undefined'){_mode=(force==1)?'open':'close';}else{if(_options._panel_open){_mode='close';}}ipsclass.my_setcookie('rte-sidepanel',_mode,1);if(_mode=='open'){_editor.style.width='82%';_editor.parentNode.align='right';_options.style.width='17%';_options.style.height=_height?_height-2+'px':'auto';_options.style.display='block';_options._panel_open=1;var _main_div=document.createElement('div');_main_div.className='rte-option-emo-box';_main_div.style.width='90%';_main_div.innerHTML+='<div class="rte-menu-emo-header"><a href="#" style="text-decoration:none" onclick="return show_all_emoticons(\''+editor_id+'\')">'+ips_language_array['emos_show_all']+'</a></div>';var _div=document.createElement('div');_div.style.width='100%';_div.style.height='120px';_div.style.overflowY='auto';_div.style.overflowX='auto';var table=document.createElement('table');table.cellPadding=0;table.cellSpacing=0;table.border=0;table.width='99%';table.nowrap='nowrap';if(is_ie){table.style.paddingRight='15px';}var i=0;var perrow=3;var show_emos=12;var show_rows=show_emos/perrow;var max_emos=0;var _previous=0;var _next=0;for(var emo in ips_smilie_items){max_emos++;}for(var emo in ips_smilie_items){var _tmp=ips_smilie_items[emo].split(",");var _id=_tmp[0]-1;if(_id<start_emo||_id>=(show_emos+start_emo)){continue;}if(i%perrow==0){var tr=table.insertRow(-1);}i++;var div=document.createElement('div');var img='<img src="'+global_rte_emoticons_url+'/'+_tmp[1]+'" style="vertical-align:middle" border="0" id="smid_'+_tmp[0]+'" /> ';div.innerHTML=img;var td=tr.insertCell(-1);td.width='33%';td.align='center';td.className='rte-menu-emo-box';td.appendChild(div);td.cmd='emoticons';td.editor_id=editor_id;td.id=editor_id+'_emoticon_'+_tmp[0];td.emo_id=_tmp[0];td.emo_image=_tmp[1];td.emo_code=emo;td.onclick=ips_editor_events.prototype.emoticon_onclick;}_div.appendChild(table);_main_div.appendChild(_div);if(start_emo>0){if(start_emo+i<max_emos){_previous=start_emo-show_emos;}else{_previous=start_emo-show_emos;}_more_less='<div style="float:left"><a href="#" style="text-decoration:none" onclick="return show_options_panel(\''+editor_id+'\', '+'1'+','+_previous+')">'+ips_language_array['emos_show_prev']+'</a></div>';}if(show_emos+start_emo<max_emos){if(start_emo<1){_next=start_emo+show_emos;}else{_next=start_emo+show_emos;}_more_less+='<div style="float:right"><a href="#" style="text-decoration:none" onclick="return show_options_panel(\''+editor_id+'\', '+'1'+','+_next+');">'+ips_language_array['emos_show_next']+'</a></div>';}if(_more_less){var _div=document.createElement('div');_div.className="rte-menu-emo-header";_div.style.height='17px';_div.innerHTML=_more_less;_main_div.appendChild(_div);}_options.appendChild(_main_div);var table=document.createElement('table');table.cellPadding=0;table.cellSpacing=0;table.border=0;table.width='90%';table.className='rte-option-emo-box';var i=0;var perrow=3;var tr=table.insertRow(-1);var td=tr.insertCell(-1);td.colSpan=perrow;td.align='center';td.cellPadding=0;td.innerHTML='<div class="rte-menu-emo-header">Quick Access</div>';for(var i in IPS_editor[editor_id].ips_special_items){var tr=table.insertRow(-1);var option=tr.insertCell(-1);var img=(typeof IPS_editor[editor_id].ips_special_items[i][1]!='undefined')?'<img src="'+global_rte_images_url+IPS_editor[editor_id].ips_special_items[i][1]+'" style="vertical-align:middle" border="" /> ':'';option.innerHTML=img+IPS_editor[editor_id].ips_special_items[i][0];option.className='rte-menu-face';option.style.textAlign='left';option.style.paddingLeft='2px';option.cmd='module_load',option.loader_key=i.replace('cmd_loader_','');option.editor_id=editor_id;option.onmouseover=option.onclick=option.onmouseout=option.onmouseup=option.onmousedown=ips_editor_events.prototype.special_onmouse_event;}_options.appendChild(table);ipsclass.set_unselectable(_options);}else{_editor.style.width='100%';_editor.parentNode.align='center';_options.style.width='0%';_options.style.height=_height?_height-2+'px':'150px';_options.style.display='none';_options._panel_open=0;_options.innerHTML='';}return false;}function switch_editor_mode(editor_id){var url=ipb_var_base_url+'act=xmlout&do=post-editorswitLine truncated
|
||||
@@ -0,0 +1,102 @@
|
||||
var IPS_Lite_Editor=new Array();function ips_text_editor_lite(editor_id){this.editor_id=editor_id;this.control_obj=document.getElementById(editor_id+'-controls');this.initialized=false;this.buttons=new Array();this.fonts=new Array();this.state=new Array();this.text_obj=document.getElementById(this.editor_id+'_textarea');this.open_brace='[';this.close_brace=']';this.editor_document=this.text_obj;this.editor_window=this.editor_document;this._ie_cache=null;this.is_ie=is_ie;this.is_moz=is_moz;this.is_opera=is_opera;this.has_focus=false;this.emoticon_window_id=null;this.init=function(){var controls=new Array();if(!this.control_obj){return;}var items=this.control_obj.getElementsByTagName("DIV");for(var i=0;i<items.length;i++){if((items[i].className=='rte-normal'||items[i].className=='rte-menu-button'||items[i].className=='rte-normal-menubutton')&&items[i].id){controls[controls.length]=items[i].id;}}for(var i=0;i<controls.length;i++){var control=document.getElementById(controls[i]);if(control.className=='rte-normal'){this.init_editor_button(control);}else if(control.className=='rte-menu-button'||control.className=='rte-normal-menubutton'){this.init_editor_popup_button(control);}}this.text_obj.onfocus=ips_editor_events.prototype.editor_window_onfocus;this.text_obj.onblur=ips_editor_events.prototype.editor_window_onblur;if(this.editor_document.addEventListener){this.editor_document.addEventListener('keypress',ips_editor_events.prototype.editor_document_onkeypress,false);}};this.editor_check_focus=function(){if(!this.text_obj.has_focus){if(this.is_opera){this.text_obj.focus();}try{this.text_obj.focus();}catch(err){}}};this.init_editor_button=function(obj){obj.cmd=obj.id.replace(new RegExp('^'+this.editor_id+'_cmd_(.+?)$'),'$1');obj.editor_id=this.editor_id;this.buttons[obj.cmd]=obj;obj.state=false;obj.mode='normal';obj.real_type='button';obj.onclick=ips_editor_events.prototype.button_onmouse_event;obj.onmousedown=ips_editor_events.prototype.button_onmouse_event;obj.onmouseover=ips_editor_events.prototype.button_onmouse_event;obj.onmouseout=ips_editor_events.prototype.button_onmouse_event;};this.set_button_context=function(obj,state,type){if(typeof type=='undefined'){type='button';}switch(obj.state){case true:{switch(state){case 'mouseout':{this.editor_set_ctl_style(obj,'button','selected');break;}case 'mouseover':case 'mousedown':case 'mouseup':{this.editor_set_ctl_style(obj,type,'down');break;}}break;}default:{switch(state){case 'mouseout':{this.editor_set_ctl_style(obj,type,'normal');break;}case 'mousedown':{this.editor_set_ctl_style(obj,type,'down');break;}case 'mouseover':case 'mouseup':{this.editor_set_ctl_style(obj,type,'hover');break;}}break;}}};this.editor_set_ctl_style=function(obj,type,mode){if(obj.mode!=mode){var extra='';if(type=='menu'){extra='-menu';}else if(type=='menubutton'){extra='-menubutton';}extra+=obj.colorname?'-color':'';extra+=obj.emo_id?'-emo':'';obj.mode=mode;try{switch(mode){case "normal":{obj.className='rte-normal'+extra;}break;case "hover":{obj.className='rte-hover'+extra;}break;case "selected":case "down":{obj.className='rte-selected'+extra;}break;}}catch(e){}}};this.format_text=function(e,command,arg){e=ipsclass.cancel_bubble(e,true);if(command.match( /resize_/)){this.resize_editorbox(command.replace( /.+?resize_(up|down)/,"$1"));}if(command.match( /emoticon/)){this.show_all_emoticons();}this.editor_check_focus();if(this[command]){var return_val=this[command](e);}else{try{var return_val=this.apply_formatting(command,false,(typeof arg=='undefined'?true:arg));}catch(e){var return_val=false;}}this.editor_check_focus();return return_val;};this.createlink=function(){var _url=prompt(ipb_global_lang['editor_enter_url'],'http://');if(!_url||_url==null||_url=='http://'){return false;}var _text=this.get_selection();_text=_text?_text:prompt(ipb_global_lang['editor_enter_title']);if(!_text||_text==null){return false;}this.wrap_tags('url',_url,_text);};this.insertimage=function(){var _text=this.get_selection();var _url=prompt(ipb_global_lang['editor_enter_image'],_text?_text:"http://");if(!_url||_url==null||_url=='http://'){return false;}this.wrap_tags('img',false,_url);};this.ipb_quote=function(){var _text=this.get_selection();this.wrap_tags('quote',false,_text);};this.ipb_code=function(){var _text=this.get_selection();this.wrap_tags('code',false,_text);};this.apply_formatting=function(cmd,dialog,argument){switch(cmd){case 'bold':case 'italic':case 'underline':{this.wrap_tags(cmd.substr(0,1),false);return;}case 'justifyleft':case 'justifycenter':case 'justifyright':{this.wrap_tags(cmd.substr(7),false);return;}case 'indent':{this.wrap_tags(cmd,false);return;}case 'createlink':{var sel=this.get_selection();if(sel){this.wrap_tags('url',argument);}else{this.wrap_tags('url',argument,argument);}return;}case 'fontname':{this.wrap_tags('font',argument);return;}case 'fontsize':{this.wrap_tags('size',argument);return;}case 'forecolor':{this.wrap_tags('color',argument);return;}case 'backcolor':{this.wrap_taLine truncated
|
||||
{
|
||||
this.editor_document.selectionStart = open;
|
||||
this.editor_document.selectionEnd = open + text.length;
|
||||
this.editor_document.scrollTop = st;
|
||||
}
|
||||
}
|
||||
else if ( ( document.selection && document.selection.createRange ) || this._ie_cache )
|
||||
{
|
||||
var sel = this._ie_cache ? this._ie_cache : document.selection.createRange();
|
||||
sel.text = text.replace(/\r?\n/g, '\r\n');
|
||||
sel.select();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.editor_document.value += text;
|
||||
}
|
||||
this._ie_cache = null;
|
||||
};
|
||||
this.show_all_emoticons = function()
|
||||
{
|
||||
if ( typeof( this.emoticon_window_id ) != null )
|
||||
{
|
||||
this.emoticon_window_id = window.open( ipb_var_base_url + "act=legends&CODE=emoticons&_lite=1&editor_id=" + editor_id,"Legends","width=250,height=500,resizable=yes,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.emoticon_window_id.focus();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
this.insert_emoticon = function( emo_id, emo_image, emo_code, event )
|
||||
{
|
||||
emo_code = ipsclass.un_htmlspecialchars( emo_code );
|
||||
this.wrap_tags_lite( " " + emo_code, " ");
|
||||
if ( this.is_ie )
|
||||
{
|
||||
if ( IPS_Lite_Editor[ this.editor_id ].emoticon_window_id != '' && typeof( IPS_Lite_Editor[ this.editor_id ].emoticon_window_id ) != 'undefined' )
|
||||
{
|
||||
IPS_Lite_Editor[ this.editor_id ].emoticon_window_id.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.resize_editorbox = function( direction )
|
||||
{
|
||||
var inc_value = 100;
|
||||
var current_height = parseInt( this.text_obj.style.height );
|
||||
var new_height = 0;
|
||||
current_height = current_height ? current_height : 200;
|
||||
if ( current_height >= 50 )
|
||||
{
|
||||
if ( direction == 'up' )
|
||||
{
|
||||
new_height = current_height - inc_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_height = current_height + inc_value;
|
||||
}
|
||||
if ( new_height > 149 )
|
||||
{
|
||||
this.text_obj.style.height = new_height + 'px';
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function ips_editor_events()
|
||||
{
|
||||
}
|
||||
ips_editor_events.prototype.button_onmouse_event = function(e)
|
||||
{
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
if ( e.type == 'click' )
|
||||
{
|
||||
IPS_Lite_Editor[this.editor_id].format_text(e, this.cmd, false, true);
|
||||
}
|
||||
IPS_Lite_Editor[this.editor_id].set_button_context(this, e.type);
|
||||
};
|
||||
ips_editor_events.prototype.editor_window_onfocus = function(e)
|
||||
{
|
||||
this.has_focus = true;
|
||||
};
|
||||
ips_editor_events.prototype.editor_window_onblur = function(e)
|
||||
{
|
||||
this.has_focus = false;
|
||||
};
|
||||
ips_editor_events.prototype.editor_document_onkeypress = function(e)
|
||||
{
|
||||
if ( e.ctrlKey )
|
||||
{
|
||||
switch (String.fromCharCode(e.charCode).toLowerCase())
|
||||
{
|
||||
case 'b': cmd = 'bold'; break;
|
||||
case 'i': cmd = 'italic'; break;
|
||||
case 'u': cmd = 'underline'; break;
|
||||
default: return;
|
||||
}
|
||||
e.preventDefault();
|
||||
IPS_Lite_Editor[this.editor_id].apply_formatting(cmd, false, null);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -1,342 +1 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS XML HTTP REQUEST
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports Safari, Mozilla 1.3+ (Firefox, etc) and IE 5.5+
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
if ( ! use_charset )
|
||||
{
|
||||
var use_charset = '';
|
||||
}
|
||||
}
|
||||
catch( e ) { }
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// New object
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function ajax_request()
|
||||
{
|
||||
this.isIE = false;
|
||||
this.allow_use = use_enhanced_js ? true : false;
|
||||
this.xmlhandler = null;
|
||||
this.error_string = '';
|
||||
this.nocache = true;
|
||||
this.do_request_functon = function() {}
|
||||
this.loading_fired = 0;
|
||||
this.centerdiv = null;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Initiate
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.xml_init = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
//------------------------------------------------
|
||||
// Moz, Safari, Opera
|
||||
//------------------------------------------------
|
||||
|
||||
this.xmlhandler = new XMLHttpRequest();
|
||||
this.ie = false;
|
||||
this.allow_use = true;
|
||||
return true;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
try
|
||||
{
|
||||
//------------------------------------------------
|
||||
// IE
|
||||
//------------------------------------------------
|
||||
|
||||
this.xmlhandler = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
this.ie = true;
|
||||
this.allow_use = true;
|
||||
return true;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
this.ie = true;
|
||||
this.allow_use = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Actually send data
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.process = function( url, type, post )
|
||||
{
|
||||
//------------------------------------------------
|
||||
// The 'post' variable needs to be in the following format:
|
||||
//
|
||||
// var=content&var2=content&var3=content
|
||||
//
|
||||
// All values need to be escaped with encodeURIComponent();
|
||||
//------------------------------------------------
|
||||
|
||||
type = type == "POST" ? "POST" : "GET";
|
||||
|
||||
//------------------------------------------------
|
||||
// Use nocache where possible...
|
||||
//------------------------------------------------
|
||||
|
||||
if ( this.nocache == true && type == 'GET' )
|
||||
{
|
||||
url = this.nocache_url( url );
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// Make sure we're initialized
|
||||
//------------------------------------------------
|
||||
|
||||
if ( ! this.xmlhandler )
|
||||
{
|
||||
this.xml_init();
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// Only go when ready
|
||||
//------------------------------------------------
|
||||
|
||||
if ( ! this.readystate_not_ready() )
|
||||
{
|
||||
this.xmlhandler.open(type, url, true);
|
||||
|
||||
if ( type == "GET" )
|
||||
{
|
||||
this.xmlhandler.send(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( typeof( this.xmlhandler.setRequestHeader ) != "undefined" )
|
||||
{
|
||||
this.xmlhandler.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=' + use_charset);
|
||||
}
|
||||
|
||||
this.xmlhandler.send( post );
|
||||
}
|
||||
|
||||
if ( this.xmlhandler.readyState == 4 && this.xmlhandler.status == 200 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// retrieve text of an XML document element, including
|
||||
// elements using namespaces
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.get_element_text_ns = function(prefix, local, parentElem, index)
|
||||
{
|
||||
var result = "";
|
||||
|
||||
if ( prefix && this.isIE )
|
||||
{
|
||||
//-------------------------------
|
||||
// IE
|
||||
//-------------------------------
|
||||
|
||||
result = parentElem.getElementsByTagName(prefix + ":" + local)[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
//-------------------------------
|
||||
// Safari, Gecko
|
||||
//-------------------------------
|
||||
|
||||
result = parentElem.getElementsByTagName(local)[index];
|
||||
}
|
||||
|
||||
if ( result )
|
||||
{
|
||||
if (result.childNodes.length > 1)
|
||||
{
|
||||
return result.childNodes[1].nodeValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
return result.firstChild.nodeValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "n/a";
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Make sure URL is not cached
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.nocache_url = function (url)
|
||||
{
|
||||
var sep = ( -1 < url.indexOf("?") ) ? "&" : "?";
|
||||
var mydate = new Date();
|
||||
var newurl = url + sep + "__=" + mydate.getTime();
|
||||
return newurl;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Takes an array of:
|
||||
// array[ field ] = value
|
||||
// and returns a nice encoded POST string
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.format_for_post = function( arrayfields )
|
||||
{
|
||||
var str = '';
|
||||
|
||||
try
|
||||
{
|
||||
for( var i in arrayfields )
|
||||
{
|
||||
str += i + '=' + this.encodeurl(arrayfields[i]) + '&';
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Hand roll encode URL to UTF-8
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.encodeurl = function( url )
|
||||
{
|
||||
//-------------------------------
|
||||
// Ensure we have a string
|
||||
//-------------------------------
|
||||
|
||||
url = url.toString();
|
||||
|
||||
var regcheck = url.match(/[\x90-\xFF]/g);
|
||||
|
||||
if ( regcheck )
|
||||
{
|
||||
for (var i = 0; i < i.length; i++)
|
||||
{
|
||||
url = url.replace(regcheck[i], '%u00' + (regcheck[i].charCodeAt(0) & 0xFF).toString(16).toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
return escape(url).replace(/\+/g, "%2B");
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Check to ensure ready state-ness
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.readystate_not_ready = function()
|
||||
{
|
||||
return ( this.xmlhandler.readyState && ( this.xmlhandler.readyState < 4 ) );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Check to ensure ready state-ness
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.readystate_ready_and_ok = function()
|
||||
{
|
||||
return ( this.xmlhandler.readyState == 4 && this.xmlhandler.status == 200 ) ? true : false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Onready state change event handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.onreadystatechange = function( event )
|
||||
{
|
||||
//------------------------------------------------
|
||||
// Make sure we're initialized
|
||||
//------------------------------------------------
|
||||
|
||||
if ( ! this.xmlhandler )
|
||||
{
|
||||
this.xml_init();
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// Make sure its a function event
|
||||
//------------------------------------------------
|
||||
|
||||
if ( typeof(event) == 'function' )
|
||||
{
|
||||
this.xmlhandler.onreadystatechange = event;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Show loading layer
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.show_loading = function( message )
|
||||
{
|
||||
if ( ! this.loading_fired )
|
||||
{
|
||||
this.loading_fired = 1;
|
||||
|
||||
//------------------------------------------------
|
||||
// Change text?
|
||||
//------------------------------------------------
|
||||
|
||||
if ( message )
|
||||
{
|
||||
document.getElementById( 'loading-layer-text' ).innerHTML = message;
|
||||
}
|
||||
|
||||
this.centerdiv = new center_div();
|
||||
this.centerdiv.divname = 'loading-layer';
|
||||
this.centerdiv.move_div();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Hide loading layer
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.hide_loading = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( this.centerdiv && this.centerdiv.divobj )
|
||||
{
|
||||
this.centerdiv.hide_div();
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
this.loading_fired = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// IPB thinks we can use fancy JS, lets see...
|
||||
/*--------------------------------------------*/
|
||||
|
||||
if ( use_enhanced_js )
|
||||
{
|
||||
use_enhanced_js = ajax_request.prototype.xml_init() ? 1 : 0;
|
||||
}
|
||||
function ajax_request(){this.isIE=false;this.allow_use=use_enhanced_js?true:false;this.xmlhandler=null;this.error_string='';this.nocache=true;this.do_request_functon=function(){};this.loading_fired=0;this.centerdiv=null;}ajax_request.prototype.xml_init=function(){try{this.xmlhandler=new XMLHttpRequest();this.ie=false;this.allow_use=true;return true;}catch(e){try{this.xmlhandler=new ActiveXObject('Microsoft.XMLHTTP');this.ie=true;this.allow_use=true;return true;}catch(e){this.ie=true;this.allow_use=false;return false;}}};ajax_request.prototype.process=function(url,type,post){type=type=="POST"?"POST":"GET";if(this.nocache==true&&type=='GET'){url=this.nocache_url(url);}if(!this.xmlhandler){this.xml_init();}if(!this.readystate_not_ready()){this.xmlhandler.open(type,url,true);if(type=="GET"){this.xmlhandler.send(null);}else{if(typeof(this.xmlhandler.setRequestHeader)!="undefined"){this.xmlhandler.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}this.xmlhandler.send(post);}if(this.xmlhandler.readyState==4&&this.xmlhandler.status==200){return true;}}return false;};ajax_request.prototype.get_element_text_ns=function(prefix,local,parentElem,index){var result="";if(prefix&&this.isIE){result=parentElem.getElementsByTagName(prefix+":"+local)[index];}else{result=parentElem.getElementsByTagName(local)[index];}if(result){if(result.childNodes.length>1){return result.childNodes[1].nodeValue;}else{return result.firstChild.nodeValue;}}else{return "n/a";}};ajax_request.prototype.nocache_url=function(url){var sep=(-1<url.indexOf("?"))?"&":"?";var mydate=new Date();var newurl=url+sep+"__="+mydate.getTime();return newurl;};ajax_request.prototype.format_for_post=function(arrayfields){var str='';try{for(var i in arrayfields){str+=i+'='+this.encodeurl(arrayfields[i])+'&';}}catch(e){}return str;};ajax_request.prototype.encodeurl=function(url){url=url.toString();var regcheck=url.match(/[\x90-\xFF]/g);if(regcheck){for(var i=0;i<i.length;i++){url=url.replace(regcheck[i],'%u00'+(regcheck[i].charCodeAt(0)&0xFF).toString(16).toUpperCase());}}return escape(url).replace(/\+/g,"%2B");};ajax_request.prototype.readystate_not_ready=function(){return(this.xmlhandler.readyState&&(this.xmlhandler.readyState<4));};ajax_request.prototype.readystate_ready_and_ok=function(){return(this.xmlhandler.readyState==4&&this.xmlhandler.status==200)?true:false;};ajax_request.prototype.onreadystatechange=function(event){if(!this.xmlhandler){this.xml_init();}if(typeof(event)=='function'){this.xmlhandler.onreadystatechange=event;}};ajax_request.prototype.show_loading=function(message){if(!this.loading_fired){this.loading_fired=1;if(message){document.getElementById('loading-layer-text').innerHTML=message;}this.centerdiv=new center_div();this.centerdiv.divname='loading-layer';this.centerdiv.move_div();add_shadow('loading-layer-shadow','loading-layer-inner');}return;};ajax_request.prototype.hide_loading=function(){try{if(this.centerdiv&&this.centerdiv.divobj){this.centerdiv.hide_div();}}catch(e){}this.loading_fired=0;return;};ajax_request.prototype.execute_javascript=function(source_code){var text_blocks=new Array();var max_iteration=50;var i=0;while(_match=source_code.match(new RegExp("<script\\s+?type=['\"]text/javascript['\"]>([^`]+?)</script>","i"))){i++;if(i>=max_iteration){break;}else{text_blocks[text_blocks.length]=_match[1];source_code=source_code.replace(_match[0],'');}}try{if(text_blocks.length){for(i=0;i<text_blocks.length;i++){eval(text_blocks[i]);}}}catch(error){}};try{if(use_enhanced_js){use_enhanced_js=ajax_request.prototype.xml_init()?1:0;}}catch(error){var use_enhanced_js=0;}
|
||||
Reference in new issue
Block a user