⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webboard.js

📁 论坛BBS
💻 JS
字号:
/*
##############################################
#     BigMole Dynamic Discussion Board 2.0     #
#     By Emil A Eklund (http://BigMole.5188.org/contact.html#emil)      #
#    and Erik Arvidson (http://BigMole.5188.org/contact.html#erik)     #
#              April 24, 1999                #
##############################################
# Feel free to use this script for personal  #
# and non-profit organisation's websites,    #
# as long as you're giving us credits for it #
# in other words, not removing nur modifying #
# this notice in any of the files it apperes #
##############################################
#   For comercial use contact Emil or Erik   #
##############################################

This is the main js file. All pages loads this so
keep it as small as possible

All constants are kept in this file so that all (all js at least)
you really need to edit is right here at the top.
*/

var webBoardTitle = "BigMole Webboard";

var cgiFile = "index.aspx";
var jsPath = "js/";
var adminPath = "admin/";

var webBoardDomain = "bigmole.5188.org";
var messageDomain = "cranesnet.com";

var errorString = "Error!\n";

// For the colorcoded editor
var codeStyle = "font-family: courier new; font-size: 12px;";
var elementCodeStyle = "color: navy;";

// For the tree
var minusString = '<img class="icon" src="images/minusicon.gif">';
var plusString  = '<img class="icon" src="images/plusicon.gif">';
var replysStartTag = " <span style='color: blue'>(";	// This is for the number of replys in the tree
var replysEndTag   = ")</span>";
var expandedTree = false;
var showNumberOfReplys = true;

// For message viewer
var waitForViewerError = errorString + "The message viewer has not finished loading.\nPlease wait for it to finish.";
var timeBeforeRead = 3000;
var startMessageURL = 'startMessage.html';
var extLinkTitle = "Drag or copy this link to create an external link to this message.";
var extLinkAlert = "This link has been disabled!\\nDrag or copy this link to create an external link to this message.";

// For the editor
var defaultEmptyText	= "<Click here to edit this field>";
var activeCSS			= "border: 1 solid buttonface; color: windowtext; cursor: text;";
var inactiveCSS			= "border: 1 solid window; cursor: hand; color: red;";
var validTextColor		= "windowtext";
var invalidTextColor	= "buttonshadow";

var editContactError = errorString + "This window needs to communicate with the main window and this wasn't found.\nPress OK to close this window";
var emptySubjectText = "<Click here to enter the subject>";
var emptyNameText = "<Click here to enter your name>";
var emptyEmailText ="<Click here to enter your email>";
var newMessageTitle = "New Message"
var months = new Array('January','Feburary','March','April','May','June','July','August','September','October','November','December');

var quotedStyle = 'border-left: 2px solid black; margin-left: 15px; padding-left: 5px;';

var fromWord = "From";
var subjectWord = "Subject";
var sentWord = "Sent";

var allowSendFromHtml = true;
var htmlModeError = "You can't send from HTML mode due to possible errors in the HTML structure.\nSwitch to WYSIWYG mode before posting the message.\n";
var emptyNameError = "You must enter a name!\n";
var emptySubjectError = "You must enter a subject!\n";
var emptyMessageError = "The message is empty!\n";
var invalidEmailAdressError = "Invalid Email adress! (You don't have to enter an email adress.)\n";

var sourceCodeModeLabel = "Source Code Mode";
var wysiwygModeLabel = "WYSIWYG Mode"

///////////////////////////////////////////////////////////////////////////////

function ieVersion() {
	var ua = window.navigator.userAgent;
	var msieIndex = ua.indexOf("MSIE")
	if (msieIndex == -1) return 0;
	return ua.substring(msieIndex+5,msieIndex+6);
}


function include(fileName) {
	document.write('<script type="text/javascript" src="' + jsPath + fileName + '"></script>');
}

function replaceSpecial(str) {
	return str.replace(/\&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}

include("error.js");

function initToolBar() {
	include("about.js");
	include("coolbuttons.js");
	include("toolbar.js");
//	initCoolButtons();
//	window.onload = initToolBarPrime;
}

var adminMode = false;

function initAdminToolBar() {
	adminMode = true;
	include("coolbuttons.js");
	include("about.js");
	include("toolbar.js");
//	initCoolButtons();
//	window.onload = initToolBarPrime;
}

///////////////////////////////////////////////////////////////////////////////
// end toolbar.js
///////////////////////////////////////////////////////////////////////////////


function getReal(el, type, value) {
	temp = el;
	while ((temp != null) && (temp.tagName != "BODY")) {
		if (eval("temp." + type) == value) {
			el = temp;
			return el;
		}
		temp = temp.parentElement;
	}
	return el;
}


///////////////////////////////////////////////////////////////////////////////
// index.html
///////////////////////////////////////////////////////////////////////////////

function switchLayout() {
	if (oeBarLayout.cols == "0,*")
		oeBarLayout.cols = "100,*";
	else
		oeBarLayout.cols = "0,*";
}

/*
var oebarcols = 150;

function switchLayout(){
  if (oeBarLayout.cols=="0,*") {
   maximizeLayout()
  } else {
   minimizeLayout()
  }
}

function minimizeLayout(){
  oebarcols-=50;
  oeBarLayout.cols=oebarcols+",*";
  if (oebarcols>0) { window.setTimeout('minimizeLayout()',10) }
}

function maximizeLayout(){
  oebarcols+=50;
  oeBarLayout.cols=oebarcols+",*";
  if (oebarcols<150) { window.setTimeout('maximizeLayout()',10) }
}

*/

function toggleTree() {
         if (layout.cols == "*") {
            if (layout.rows == "0, *")
               layout.rows = "50%, *";
            else
               layout.rows = "0, *";
         }
         else {
            if (layout.cols == "0, *")
               layout.cols = "50%, *";
            else
               layout.cols = "0, *";
         }
}

var mLoaded = false;
var tLoaded = false;
var xLoaded = false;
var trLoaded = false;

function setXLoaded() {
	xLoaded = true;
}

function messageLoaded() {
	mLoaded = true;
	if (tLoaded)
		window.frames("toolFrame").checkMessage();
	else
		window.setTimeout("messageLoaded()", 100);
}

function toolbarLoaded() {
	tLoaded = true;
}

function treeLoaded() {
	trLoaded = true;
}

///////////////////////////////////////////////////////////////////////////////
// end index.html
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
// preload.js
///////////////////////////////////////////////////////////////////////////////

function preload(sourceArray, pre, pro) {
   imageArray = new Array();
   if (pre == null) pre = "";
   if (pro == null) pro = "";
   for (i in sourceArray) {
      imageArray[i] = new Image();
      imageArray[i].src = pre + sourceArray[i] + pro;
   }
}

// Moved to toolbar. Now all images are preloaded
//preload(new Array("minusicon"), "images/", ".gif");

///////////////////////////////////////////////////////////////////////////////
// end preload.js
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
// msgtree.js
///////////////////////////////////////////////////////////////////////////////

function initMessageTree() {
	include("msgtree.js");
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// messageViewer.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
function initMessageViewer() {
	include("msgviewer.js");
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// end messageViewer.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// replyMessage.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////////



function fixEditorSize() {
	document.all.edit1.style.height = Math.max(document.body.clientHeight - document.all.edit1.offsetTop - switchDiv.offsetHeight, 0);
}

function initReplyEditorPrime() {
	fixEditorSize();
	loadCookies();
	loadReplyToMessage();
}


function initEditor() {
	include("coolbuttons.js");
//	include("edit.js");		// was added to the HTML instead
	fixEditorSize();
	window.onresize = fixEditorSize;
	
	document.all.editbar._editor = window.frames[document.all.edit1.id];
}

function initReplyEditor() {
	initEditor();
	window.onload = initReplyEditorPrime;
}

function initNewEditor() {
	initEditor();
	window.onload = initNewEditorPrime;
}


function initNewEditorPrime() {
	fixEditorSize();
	loadCookies();
	document.all.group.value = opener.parent.treeframe.document.body.group;
	updateToField();
}

function initEditEditor() {
	document.all.pwd.value = opener.parent.treeframe.document.body.password;
	initEditor();
	window.onload = initEditEditorPrime;
}

function initEditEditorPrime() {
	fixEditorSize();
	loadOriginalMessage();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// end replyMessage.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// writeMessage.js
///////////////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// end writeMessage.js
///////////////////////////////////////////////////////////////////////////////////////////////////////////////



function initRichTextEditor() {
	include("richedit.js");
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// start oebar.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
var scrollTimer;
var paddingOrg = 2;
var scrollInterval = 200;	// the time between the repeating of the scroll
var scrollAmount = 49;		// The amount of pixels to scroll every scrollInterval ms

function initOeBar() {
	include("oebar.js");
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -