'; cBasic2[4] = ''; cBasic3[4] = '';
cBasic1[5] = '
'; cBasic3[5] = 'Enter a color name or hexadecimal value preceded by a # sign';
cBasic1[6] = ''; cBasic3[6] = 'Enter the Background file location';
cBasic1[7] = ''; cBasic2[7] = ''; cBasic3[7] = '';
cBasic1[8] = ''; cBasic2[8] = ' '; cBasic3[8] = 'Enter the Title';
cBasic1[9] = ''; cBasic3[9] = 'Enter the location this anchor will link to';
cBasic1[10] = ' '; cBasic2[10] = ''; cBasic3[10] = '';
cBasic1[11] = ''; cBasic3[11] = 'Enter the comment';
cText1[0] = ''; cText2[0] = ' '; cText3[0] = 'Enter the text to be made bold';
cText1[1] = ''; cText2[1] = ' '; cText3[1] = 'Enter the text to be italicized';
cText1[2] = ''; cText2[2] = ' '; cText3[2] = 'Enter the text to be underlined';
cText1[3] = ' '; cText2[3] = ''; cText3[3] = '';
cText1[4] = ''; cText2[4] = ''; cText3[4] = '';
cText1[5] = ' '; cText2[5] = ''; cText3[5] = '';
cText1[6] = ''; cText2[6] = ''; cText3[6] = '';
cText1[7] = ' '; cText2[7] = ''; cText3[7] = '';
cText1[8] = ''; cText2[8] = ' '; cText3[8] = 'Enter the text for the list item';
cText1[9] = ''; cText2[9] = ''; cText3[9] = '';
cText1[10] = ' '; cText2[10] = ''; cText3[10] = '';
cText1[11] = ''; cText2[11] = ''; cText3[11] = '';
cText1[12] = ' '; cText2[12] = ''; cText3[12] = '';
cText1[13] = ''; cText2[13] = ''; cText3[13] = '';
cText1[14] = ' '; cText2[14] = ''; cText3[14] = '';
cText1[15] = ''; cText2[15] = ' '; cText3[15] = 'Enter the definition term';
cText1[16] = ''; cText2[16] = ' '; cText3[16] = 'Enter the definition';
cText1[17] = ''; cText3[17] = 'Enter the paragraph alignment parameter';
cText1[18] = '
'; cText2[18] = ''; cText3[18] = '';
cText1[19] = ''; cText2[19] = ''; cText3[19] = '';
cText1[20] = ' '; cText2[20] = ''; cText3[20] = '';
cText1[21] = ''; cText2[21] = ''; cText3[21] = '';
cText1[22] = ' '; cText2[22] = ''; cText3[22] = '';
cText1[23] = ''; cText2[23] = ' '; cText3[23] = 'Enter the heading text';
cText1[24] = ''; cText2[24] = ' '; cText3[24] = 'Enter the heading text';
cText1[25] = ''; cText2[25] = ' '; cText3[25] = 'Enter the heading text';
cText1[26] = ''; cText2[26] = ' '; cText3[26] = 'Enter the heading text';
cText1[27] = ''; cText2[27] = ' '; cText3[27] = 'Enter the heading text';
cText1[28] = ''; cText2[28] = ' '; cText3[28] = 'Enter the heading text';
cImage1[0] = ''; cImage3[0] = 'Enter the image location';
cTable1[0] = ''; cTable2[0] = ''; cTable3[0] = '';
cTable1[1] = '
'; cTable2[1] = ''; cTable3[1] = '';
cTable1[2] = ''; cTable2[2] = ''; cTable3[2] = '';
cTable1[3] = ' '; cTable2[3] = ''; cTable3[3] = '';
cTable1[4] = ''; cTable2[4] = ''; cTable3[4] = '';
cTable1[5] = ' '; cTable2[5] = ''; cTable3[5] = '';
cTable1[6] = ''; cTable2[6] = ''; cTable3[6] = '';
cTable1[7] = ' '; cTable2[7] = ''; cTable3[7] = '';
cTable1[8] = ''; cTable2[8] = ''; cTable3[8] = '';
cTable1[9] = ' '; cTable2[9] = ''; cTable3[9] = '';
cForm1[0] = ''; cForm2[1] = ''; cForm3[1] = '';
cForm1[2] = ' '; cForm3[2] = 'Enter a value';
cForm1[3] = ' '; cForm3[3] = 'Enter a value';
cForm1[4] = ' '; cForm3[4] = 'Enter a value';
cForm1[5] = ' '; cForm3[5] = 'Enter a value';
cForm1[6] = ' '; cForm3[6] = 'Enter the image source';
cOther1[0] = ' '; cOther2[0] = ''; cOther3[0] = '';
cOther1[1] = ' '; cOther2[1] = ''; cOther3[1] = '';
cOther1[2] = ''; cOther2[2] = ''; cOther3[2] = '';
cOther1[3] = ' '; cOther3[3] = 'Enter the Page Source';
//################################################
//# END DEFINE TAGS ##############################
//################################################
radioSelected = gBasic;
var maxLength = 10;
tagOption = new Array;
tagOption[0] = new Option("Begin HTML");
tagOption[1] = new Option("End HTML");
tagOption[2] = new Option("Begin HEAD");
tagOption[3] = new Option("End HEAD");
tagOption[4] = new Option("BODY");
tagOption[5] = new Option("BODY w/Background Color");
tagOption[6] = new Option("BODY w/Background Image");
tagOption[7] = new Option("End BODY");
tagOption[8] = new Option("TITLE");
tagOption[9] = new Option("Begin Anchor");
tagOption[10] = new Option("End Anchor");
tagOption[11] = new Option("Comment");
var trueLength = tagOption.length;
var lst = tagOption.length;
////////////////////////////////////////////////////////////
//??????????????????????????????????????????????????????????
editCommand = new Array;
editCommand[0] = tBHTML;
editCommand[1] = tEHTML;
editCommand[2] = tBHead;
editCommand[3] = tEHead;
editCommand[4] = tBBody;
editCommand[5] = tBBodyBGColor;
editCommand[6] = tBBodyBackground;
editCommand[7] = tEBody;
editCommand[8] = tTitle;
editCommand[9] = tBAnchor;
editCommand[10] = tEAnchor;
editCommand[11] = tComment;
//??????????????????????????????????????????????????????????
////////////////////////////////////////////////////////////
function insertTag() {
tag = document.EditMenu.SelectTag.selectedIndex;
if(generationType == 0) {
if(radioSelected == gBasic) {
document.EditMenu.EditBox.value += (cBasic1[tag] + cBasic2[tag]);
}
else if(radioSelected == gText) {
document.EditMenu.EditBox.value += (cText1[tag] + cText2[tag]);
}
else if(radioSelected == gImage) {
document.EditMenu.EditBox.value += (cImage1[tag] + cImage2[tag]);
}
else if(radioSelected == gTable) {
document.EditMenu.EditBox.value += (cTable1[tag] + cTable2[tag]);
}
else if(radioSelected == gForm) {
document.EditMenu.EditBox.value += (cForm1[tag] + cForm2[tag]);
}
else if(radioSelected == gOther) {
document.EditMenu.EditBox.value += (cOther1[tag] + cOther2[tag]);
}
}
else {
if(radioSelected == gBasic) {
if(cBasic2[tag] != '') {
textToAdd = prompt(cBasic3[tag], "");
document.EditMenu.EditBox.value += (cBasic1[tag] + textToAdd + cBasic2[tag]);
}
else {
document.EditMenu.EditBox.value += cBasic1[tag];
}
}
else if(radioSelected == gText) {
if(cText2[tag] != '') {
textToAdd = prompt(cText3[tag], "");
document.EditMenu.EditBox.value += (cText1[tag] + textToAdd + cText2[tag]);
}
else {
document.EditMenu.EditBox.value += cText1[tag];
}
}
else if(radioSelected == gImage) {
if(cImage2[tag] != '') {
textToAdd = prompt(cImage3[tag], "");
document.EditMenu.EditBox.Value += (cImage1[tag] + textToAdd + cImage2[tag]);
}
else {
document.EditMenu.EditBox.value += cImage1[tag];
}
}
else if(radioSelected == gTable) {
if(cTable2[tag] != '') {
textToAdd = prompt(cTable3[tag], "");
document.EditMenu.EditBox.value += (cTable1[tag] + textToAdd + cTable2[tag]);
}
else {
document.EditMenu.EditBox.value += cTable1[tag];
}
}
else if(radioSelected == gForm) {
if(cForm2[tag] != '') {
textToAdd = prompt(cForm3[tag], "");
document.EditMenu.EditBox.value += (cForm1[tag] + textToAdd + cForm2[tag]);
}
else {
document.EditMenu.EditBox.value += cForm1[tag];
}
}
else if(radioSelected == gOther) {
if(cOther2[tag] != '') {
textToAdd = prompt(cOther3[tag], "");
document.EditMenu.EditBox.value += (cOther1[tag] + textToAdd + cOther2[tag]);
}
else {
document.EditMenu.EditBox.value += cOther1[tag];
}
}
}
}
function viewPage() {
var previewWindow = window.open('','preview');
with(previewWindow.document)
{
open("text/html");
write(document.EditMenu.EditBox.value);
close();
}
previewWindow.focus();
// userPage = window.open("","pageView","width=500,height=400");
// userPage.document.write(document.EditMenu.EditBox.value);
}
function clearPage()
{
daValue = prompt("Clear the page? Y/N", "");
if((daValue == "y") ||
(daValue == "Y") ||
(daValue == "yes") ||
(daValue == "Yes") ||
(daValue == "YES") ||
(daValue == "yeah") ||
(daValue == "Yeah") ||
(daValue == "C'mon"))
{
document.EditMenu.EditBox.value = "";
}
}
function changeMenu(selectedGroup) {
tagOption.length = 0;
if(selectedGroup == gBasic) {
tagOption = new Array;
tagOption[0] = new Option("Begin HTML");
tagOption[1] = new Option("End HTML");
tagOption[2] = new Option("Begin HEAD");
tagOption[3] = new Option("End HEAD");
tagOption[4] = new Option("BODY");
tagOption[5] = new Option("BODY w/Background Color");
tagOption[6] = new Option("BODY w/Background Image");
tagOption[7] = new Option("End BODY");
tagOption[8] = new Option("TITLE");
tagOption[9] = new Option("Begin Anchor");
tagOption[10] = new Option("End Anchor");
tagOption[11] = new Option("Comment");
editCommand = new Array;
editCommand[0] = tBHTML;
editCommand[1] = tEHTML;
editCommand[2] = tBHead;
editCommand[3] = tEHead;
editCommand[4] = tBBody;
editCommand[5] = tBBodyBGColor;
editCommand[6] = tBBodyBackground;
editCommand[7] = tEBody;
editCommand[8] = tTitle;
editCommand[9] = tBAnchor;
editCommand[10] = tEAnchor;
editCommand[11] = tComment;
}
else if(selectedGroup == gText) {
tagOption = new Array;
tagOption[0] = new Option("Bold");
tagOption[1] = new Option("Italics");
tagOption[2] = new Option("Underline");
tagOption[3] = new Option("Line Break");
tagOption[4] = new Option("Begin Unordered List");
tagOption[5] = new Option("End Unordered List");
tagOption[6] = new Option("Begin Ordered List");
tagOption[7] = new Option("End Ordered List");
tagOption[8] = new Option("List Item");
tagOption[9] = new Option("Begin Directory");
tagOption[10] = new Option("End Directory");
tagOption[11] = new Option("Begin Menu");
tagOption[12] = new Option("End Menu");
tagOption[13] = new Option("Begin Definition List");
tagOption[14] = new Option("End Definition List");
tagOption[15] = new Option("Definition Term");
tagOption[16] = new Option("Definition");
tagOption[17] = new Option("Begin Paragraph");
tagOption[18] = new Option("End Paragraph");
tagOption[19] = new Option("Begin Font");
tagOption[20] = new Option("End Font");
tagOption[21] = new Option("Begin Center");
tagOption[22] = new Option("End Center");
tagOption[23] = new Option("Heading 1");
tagOption[24] = new Option("Heading 2");
tagOption[25] = new Option("Heading 3");
tagOption[26] = new Option("Heading 4");
tagOption[27] = new Option("Heading 5");
tagOption[28] = new Option("Heading 6");
editCommand = new Array;
editCommand[0] = tBold;
editCommand[1] = tItalic;
editCommand[2] = tUnderline;
editCommand[3] = tLineBreak;
editCommand[4] = tBUnorderedList;
editCommand[5] = tEUnorderedList;
editCommand[6] = tBOrderedList;
editCommand[7] = tEOrderedList;
editCommand[8] = tListItem;
editCommand[9] = tBDirectory;
editCommand[10] = tEDirectory;
editCommand[11] = tBMenu;
editCommand[12] = tEMenu;
editCommand[13] = tBDefinitionList;
editCommand[14] = tEDefinitionList;
editCommand[15] = tDefinitionTerm;
editCommand[16] = tDefinitionDefinition;
editCommand[17] = tBParagraph;
editCommand[18] = tEParagraph;
editCommand[19] = tBFont;
editCommand[20] = tEFont;
editCommand[21] = tBCenter;
editCommand[22] = tECenter;
editCommand[23] = tHeading1;
editCommand[24] = tHeading2;
editCommand[25] = tHeading3;
editCommand[26] = tHeading4;
editCommand[27] = tHeading5;
editCommand[28] = tHeading6;
}
else if(selectedGroup == gImage) {
tagOption = new Array;
tagOption[0] = new Option("Image");
editCommand = new Array;
editCommand[0] = tImage;
}
else if(selectedGroup == gTable) {
tagOption = new Array;
tagOption[0] = new Option("Begin Table");
tagOption[1] = new Option("End Table");
tagOption[2] = new Option("Begin Table Row");
tagOption[3] = new Option("End Table Row");
tagOption[4] = new Option("Begin Table Column");
tagOption[5] = new Option("End Table Column");
tagOption[6] = new Option("Begin Caption");
tagOption[7] = new Option("End Caption");
tagOption[8] = new Option("Begin Table Heading");
tagOption[9] = new Option("End Table Heading");
editCommand = new Array;
editCommand[0] = tBTable;
editCommand[1] = tETable;
editCommand[2] = tBTableRow;
editCommand[3] = tETableRow;
editCommand[4] = tBTableColumn;
editCommand[5] = tETableColumn;
editCommand[6] = tBCaption;
editCommand[7] = tECaption;
editCommand[8] = tBTableHeading;
editCommand[9] = tETableHeading;
}
else if(selectedGroup == gForm) {
tagOption = new Array;
tagOption[0] = new Option("Begin Form");
tagOption[1] = new Option("End Form");
tagOption[2] = new Option("Input Text");
tagOption[3] = new Option("Input Submit");
tagOption[4] = new Option("Input Reset");
tagOption[5] = new Option("Input Hidden");
tagOption[6] = new Option("Input Image");
editCommand = new Array;
editCommand[0] = tBForm;
editCommand[1] = tEForm;
editCommand[2] = tInputText;
editCommand[3] = tInputSubmit;
editCommand[4] = tInputReset;
editCommand[5] = tInputHidden;
editCommand[6] = tInputImage;
}
else if(selectedGroup == gOther) {
tagOption = new Array;
tagOption[0] = new Option("Begin Frameset w/Rows");
tagOption[1] = new Option("Begin Frameset w/Columns");
tagOption[2] = new Option("End Frameset");
tagOption[3] = new Option("Frame");
editCommand = new Array;
editCommand[0] = tBFrameSetWRow;
editCommand[1] = tBFrameSetWCol;
editCommand[2] = tEFrameSet;
editCommand[3] = tFrame;
}
tot = tagOption.length;
for(i = lst; i > 0; i--)
document.EditMenu.SelectTag.options[i] = null;
for(i = 0; i < tot; i++)
document.EditMenu.SelectTag.options[i] = tagOption[i];
document.EditMenu.SelectTag.options[0].selected = true;
lst = tagOption.length;
}
//################################################
//# DEFINE BUTTONS ###############################
//################################################
button0on = new Image();
button0on.src = "button_basic_on.gif";
button0off = new Image();
button0off.src = "button_basic_off.gif";
button1on = new Image();
button1on.src = "button_text_on.gif";
button1off = new Image();
button1off.src = "button_text_off.gif";
button2on = new Image();
button2on.src = "button_image_on.gif";
button2off = new Image();
button2off.src = "button_image_off.gif";
button3on = new Image();
button3on.src = "button_table_on.gif";
button3off = new Image();
button3off.src = "button_table_off.gif";
button4on = new Image();
button4on.src = "button_form_on.gif";
button4off = new Image();
button4off.src = "button_form_off.gif";
button5on = new Image();
button5on.src = "button_other_on.gif";
button5off = new Image();
button5off.src = "button_other_off.gif";
button6State = 0;
button6on = new Image();
button6on.src = "button_generation_on.gif";
button6off = new Image();
button6off.src = "button_generation_off.gif";
totalImage = 6;
function clearAll() {
for(i = 0; i < totalImage; i++) {
clearingImage = eval("button" + i + "off.src");
buttonToClear = "button" + i;
document.EditMenu[buttonToClear].src = clearingImage;
}
}
function begin(imageName, whichImage) {
clearAll();
radioSelected = whichImage;
changeMenu(whichImage);
lightingImage = eval(imageName + "on.src");
document.EditMenu[imageName].src = lightingImage;
}
function toggleGenerationType()
{
if(generationType == 0) generationType = 1;
else generationType = 0;
if(button6State == 0) {
button6State = 1;
document.EditMenu.button6.src = button6on.src;
}
else {
button6State = 0;
document.EditMenu.button6.src = button6off.src;
}
}
//################################################
//# END DEFINE BUTTONS ###########################
//################################################
// -->
Copyright
1997 Web Developer's Workshop