This commit is contained in:
brade%netscape.com 1999-08-25 14:36:13 +00:00
Родитель 277bc1f584
Коммит e5f28a2c97
7 изменённых файлов: 40 добавлений и 34 удалений

Просмотреть файл

@ -33,6 +33,8 @@ function Startup()
if (!InitEditorShell())
return;
doSetOKCancel(onOK, null);
// Get the selected horizontal line
hLineElement = editorShell.GetSelectedElement(tagName);
@ -171,11 +173,8 @@ function ValidateData(setAttributes)
function onOK()
{
dump("************* onOK for HLine props\n");
// Since we only edit existing HLines,
// ValidateData will set the new attributes
// so there's nothing else to do
if (ValidateData(true)) {
window.close();
}
return (ValidateData(true));
}

Просмотреть файл

@ -36,7 +36,8 @@ function Startup()
{
if (!InitEditorShell())
return;
dump("EditoreditorShell found for Image Properties dialog\n");
doSetOKCancel(onOK, null);
// Create dialog object to store controls for easy access
@ -328,12 +329,13 @@ function doOverallEnabling()
wasEnableAll = canEnableAll;
btn = document.getElementById("OK");
btn = document.getElementById("ok");
if ( btn )
{
dump("ok button found!\n")
btn.disabled = (!canEnableAll && hasAnyChanged);
}
else dump("ok button not found\n");
fieldset = document.getElementById("imagedimensionsFieldset");
if ( fieldset )
@ -494,11 +496,9 @@ function onOK()
{
if ( !imageType ) {
dump("alert *** please choose an image of typ gif, jpg or png.\n\n");
return;
return false;
}
else {
imageElement.setAttribute("src",dialog.srcInput.value);
// We must convert to "file:///" format else image doesn't load!
@ -553,20 +553,17 @@ function onOK()
// handle insertion of new image
if (insertNew) {
dump("src="+imageElement.getAttribute("src")+" alt="+imageElement.getAttribute("alt")+"\n");
if (insertNew)
{
// 'true' means delete the selection before inserting
editorShell.InsertElement(imageElement, true);
}
// dismiss dialog
window.close();
}
return true;
}
// setDimensions()
// sets height and width attributes to inserted image
// Brian King - XML Workshop

Просмотреть файл

@ -25,6 +25,8 @@ function Startup()
{
if (!InitEditorShell())
return;
doSetOKCancel(onOK, null);
// Create dialog object to store controls for easy access
dialog = new Object;
@ -49,8 +51,11 @@ function onOK()
{
if (dialog.srcInput.value != "")
editorShell.InsertSource(dialog.srcInput.value);
else dump("Null value -- not inserting\n");
window.close();
else {
dump("Null value -- not inserting\n");
return false;
}
return true;
}

Просмотреть файл

@ -35,7 +35,8 @@ function Startup()
{
if (!InitEditorShell())
return;
dump("EditoreditorShell found for Insert Table dialog\n");
doSetOKCancel(onOK, null);
dump(tagName+" = InsertTable tagName\n");
tableElement = editorShell.CreateElementWithDefaults(tagName);
@ -71,14 +72,14 @@ function onOK()
if (rows == "") {
// Set focus to the offending control
dialog.rowsInput.focus();
return;
return false;
}
columns = ValidateNumberString(dialog.columnsInput.value, 1, maxColumns);
if (columns == "") {
// Set focus to the offending control
dialog.columnsInput.focus();
return;
return false;
}
dump("Rows = "+rows+" Columns = "+columns+"\n");
for (i = 0; i < rows; i++)
@ -126,5 +127,5 @@ function onOK()
// Don't delete selected text when inserting
editorShell.InsertElement(tableElement, false);
window.close();
return true;
}

Просмотреть файл

@ -38,7 +38,8 @@ function Startup()
{
if (!InitEditorShell())
return;
dump("Starting Link Properties Dialog\n");
doSetOKCancel(onOK, null);
// Message was wrapped in a <label> or <div>, so actual text is a child text node
linkCaption = (document.getElementById("linkTextCaption")).firstChild;
@ -206,7 +207,7 @@ function onOK()
if (newText.length == 0) {
ShowInputErrorMessage("You must enter some text for this link.");
linkTextInput.focus();
return;
return false;
}
textNode = editorShell.editorDocument.createTextNode(newText);
if (textNode) {
@ -227,6 +228,6 @@ function onOK()
}
// Note: if HREF is empty and we were inserting a new link, do nothing
window.close();
return true;
}

Просмотреть файл

@ -30,7 +30,9 @@ function Startup()
{
if (!InitEditorShell())
return;
dump("EditorShell found for NamedAnchor Properties dialog\n");
doSetOKCancel(onOK, null);
nameInput = document.getElementById("nameInput");
dump("tagName = "+tagName+"\n");
@ -93,20 +95,20 @@ function onOK()
if (name.length == 0) {
ShowInputErrorMessage("You must enter a name for this anchor.");
nameInput.focus();
return;
return false;
} else {
// Replace spaces with "_" else it causes trouble in URL parsing
name = ReplaceWhitespace(name, "_");
if (AnchorNameExists(name)) {
ShowInputErrorMessage("\""+name+"\" already exists in this page.\nPlease enter a different name.");
nameInput.focus();
return;
return false;
}
anchorElement.setAttribute("name",name);
if (insertNew) {
// Don't delete selected text when inserting
editorShell.InsertElement(anchorElement, false);
}
window.close();
}
return true;
}

Просмотреть файл

@ -29,7 +29,8 @@ function Startup()
{
if (!InitEditorShell())
return;
dump("EditoreditorShell found for dialog Table Properties\n");
doSetOKCancel(onOK, null);
// Create dialog object to store controls for easy access
dialog = new Object;
@ -61,5 +62,5 @@ function onOK()
{
// Set attribute example:
// imageElement.setAttribute("src",dialog.srcInput.value);
window.close();
return true;
}