Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+447
View File
@@ -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;
}
+328
View File
@@ -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;