diff --git a/editor/ui/dialogs/content/EdAEHTMLAttributes.js b/editor/ui/dialogs/content/EdAEHTMLAttributes.js
index 24b39727c20b..5ebf457e8248 100644
--- a/editor/ui/dialogs/content/EdAEHTMLAttributes.js
+++ b/editor/ui/dialogs/content/EdAEHTMLAttributes.js
@@ -358,10 +358,7 @@ function UpdateHTMLAttributes()
{
var name = HTMLRAttrs[i];
- // We can't use getAttribute to figure out if attribute already
- // exists for attributes that don't require a value
- // This gets the attribute NODE from the attributes NamedNodeMap
- if (gElement.attributes.getNamedItem(name))
+ if (gElement.hasAttribute(name))
doRemoveAttribute(name);
}
diff --git a/editor/ui/dialogs/content/EdColorPicker.js b/editor/ui/dialogs/content/EdColorPicker.js
index ac1bd85fcae0..0eb9bdeca7ea 100644
--- a/editor/ui/dialogs/content/EdColorPicker.js
+++ b/editor/ui/dialogs/content/EdColorPicker.js
@@ -217,6 +217,8 @@ function SelectLastPickedColor()
if ( onAccept() )
//window.close();
return true;
+
+ return false;
}
function SetCurrentColor(color)
diff --git a/editor/ui/dialogs/content/EdDialogCommon.js b/editor/ui/dialogs/content/EdDialogCommon.js
index 60fdaf9a1bba..cea3f2dea208 100644
--- a/editor/ui/dialogs/content/EdDialogCommon.js
+++ b/editor/ui/dialogs/content/EdDialogCommon.js
@@ -659,7 +659,6 @@ function onMoreFewer()
gDialog.MoreFewerButton.setAttribute("more","0");
gDialog.MoreFewerButton.setAttribute("label",GetString("MoreProperties"));
SeeMore = false;
-// window.sizeToContent();
}
else
{
diff --git a/editor/ui/dialogs/content/EdFieldSetProps.js b/editor/ui/dialogs/content/EdFieldSetProps.js
index 2ee8774f85f6..c7557d33e426 100644
--- a/editor/ui/dialogs/content/EdFieldSetProps.js
+++ b/editor/ui/dialogs/content/EdFieldSetProps.js
@@ -86,7 +86,7 @@ function Startup()
newLegend = false;
editorShell.SelectElement(legendElement);
gDialog.legendText.value = GetSelectionAsText();
- if (legendElement.innerHTML.match(/))
+ if (/s needed
RemoveElementKeepingChildren(fieldsetElement);
} finally {
editorShell.EndBatchChanges();
@@ -160,16 +161,11 @@ function ValidateData()
function onAccept()
{
// All values are valid - copy to actual element in doc
- // ValidateData();
+ ValidateData();
editorShell.BeginBatchChanges();
try {
- editorShell.CloneAttributes(legendElement, globalElement);
-
- if (insertNew)
- InsertElementAroundSelection(fieldsetElement);
-
if (gDialog.editText.checked)
{
if (gDialog.legendText.value)
@@ -179,11 +175,18 @@ function onAccept()
editorShell.InsertElement(legendElement, fieldsetElement, 0, true);
else while (legendElement.firstChild)
editor.DeleteNode(legendElement.firstChild);
- editor.InsertNode(document.createTextNode(gDialog.legendText.value), legendElement, 0);
+ editor.InsertNode(editorShell.editorDocument.createTextNode(gDialog.legendText.value), legendElement, 0);
}
else if (!newLegend)
editorShell.DeleteElement(legendElement);
}
+
+ if (insertNew)
+ InsertElementAroundSelection(fieldsetElement);
+ else
+ editorShell.SelectElement(fieldsetElement);
+
+ editorShell.CloneAttributes(legendElement, globalElement);
}
finally {
editorShell.EndBatchChanges();
diff --git a/editor/ui/dialogs/content/EdHLineProps.js b/editor/ui/dialogs/content/EdHLineProps.js
index 66a4f10b5c08..e58a4e5a3625 100644
--- a/editor/ui/dialogs/content/EdHLineProps.js
+++ b/editor/ui/dialogs/content/EdHLineProps.js
@@ -103,14 +103,7 @@ function InitDialog()
gDialog.alignGroup.selectedItem = gDialog.leftAlign;
}
- // This is tricky! Since the "noshade" attribute doesn't always have a value,
- // we can't use getAttribute to figure out if it's set!
- // This gets the attribute NODE from the attributes NamedNodeMap
- if (globalElement.attributes.getNamedItem("noshade"))
- gDialog.shading.checked = false;
- else
- gDialog.shading.checked = true;
-
+ gDialog.shading.checked = globalElement.hasAttribute("noshade");
}
function onSaveDefault()
diff --git a/editor/ui/dialogs/content/EdImageProps.xul b/editor/ui/dialogs/content/EdImageProps.xul
index 21e7323b323f..2ecd84dcdd04 100644
--- a/editor/ui/dialogs/content/EdImageProps.xul
+++ b/editor/ui/dialogs/content/EdImageProps.xul
@@ -61,8 +61,8 @@
-
-
+
+
diff --git a/editor/ui/dialogs/content/EdInputImage.xul b/editor/ui/dialogs/content/EdInputImage.xul
index f117a9cddc8e..8918d0b6cb70 100644
--- a/editor/ui/dialogs/content/EdInputImage.xul
+++ b/editor/ui/dialogs/content/EdInputImage.xul
@@ -88,8 +88,8 @@
-
-
+
+
diff --git a/editor/ui/dialogs/content/EdInputProps.js b/editor/ui/dialogs/content/EdInputProps.js
index b87d509e96e1..c0317b4ab5a1 100644
--- a/editor/ui/dialogs/content/EdInputProps.js
+++ b/editor/ui/dialogs/content/EdInputProps.js
@@ -243,32 +243,6 @@ function doImageProperties()
function ValidateData()
{
- var index = gDialog.inputType.selectedIndex;
- switch (index)
- {
- case 4:
- case 5:
- break;
- case 8:
- if (!globalElement.hasAttribute("src"))
- {
- doImageProperties();
- if (!globalElement.hasAttribute("src"))
- return false;
- }
- break;
- case 3:
- default:
- if (!gDialog.inputName.value || !gDialog.inputValue.value)
- {
- AlertWithTitle(GetString("Alert"), GetString("FormInputError"));
- if (!gDialog.inputName.value)
- gDialog.inputName.focus();
- else
- gDialog.inputValue.focus();
- return false;
- }
- }
var attributes = {
type: "",
name: gDialog.inputName.value,
@@ -279,6 +253,7 @@ function ValidateData()
maxlength: "",
accept: ""
};
+ var index = gDialog.inputType.selectedIndex;
var flags = {
checked: false,
readonly: false,
diff --git a/editor/ui/dialogs/content/EdInputProps.xul b/editor/ui/dialogs/content/EdInputProps.xul
index d697bbb09be6..c263ae5b65e2 100644
--- a/editor/ui/dialogs/content/EdInputProps.xul
+++ b/editor/ui/dialogs/content/EdInputProps.xul
@@ -99,43 +99,46 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/editor/ui/dialogs/content/EdLabelProps.js b/editor/ui/dialogs/content/EdLabelProps.js
index 1f590365b40f..7c62fabdb399 100644
--- a/editor/ui/dialogs/content/EdLabelProps.js
+++ b/editor/ui/dialogs/content/EdLabelProps.js
@@ -119,8 +119,11 @@ function onAccept()
var editor = editorShell.editor;
while (labelElement.firstChild)
editor.DeleteNode(labelElement.firstChild);
- if (gDialog.labelText.value)
- editor.InsertNode(document.createTextNode(gDialog.labelText.value), labelElement, 0);
+ if (gDialog.labelText.value) {
+ var textNode = editorShell.editorDocument.createTextNode(gDialog.labelText.value);
+ editor.InsertNode(textNode, labelElement, 0);
+ editorShell.SelectElement(labelElement);
+ }
}
editorShell.EndBatchChanges();
diff --git a/editor/ui/dialogs/content/EdTextAreaProps.js b/editor/ui/dialogs/content/EdTextAreaProps.js
index 22bd6a2edc20..01b5914ad3a7 100644
--- a/editor/ui/dialogs/content/EdTextAreaProps.js
+++ b/editor/ui/dialogs/content/EdTextAreaProps.js
@@ -63,9 +63,12 @@ function Startup()
var tagName = "textarea";
textareaElement = editorShell.GetSelectedElement(tagName);
- if (textareaElement)
+ if (textareaElement) {
// We found an element and don't need to insert one
insertNew = false;
+
+ gDialog.textareaValue.value = textareaElement.value;
+ }
else
{
insertNew = true;
@@ -81,7 +84,7 @@ function Startup()
return;
}
else
- textareaElement.value = GetSelectionAsText();
+ gDialog.textareaValue.value = GetSelectionAsText();
}
// Make a copy to use for AdvancedEdit
@@ -91,13 +94,6 @@ function Startup()
InitMoreFewer();
- if ("@mozilla.org/preferences;1" in Components.classes) try {
- var pref = Components.classes["@mozilla.org/preferences;1"];
- pref = pref.getService(Components.interfaces.nsIPref);
- var wrap = document.getElementById("wrap");
- wrap.setAttribute("collapsed", pref.GetBoolPref("editor.dtd.strict"));
- } catch (e) {}
-
SetTextboxFocus(gDialog.textareaName);
SetWindowLocation();
@@ -108,12 +104,11 @@ function InitDialog()
gDialog.textareaName.value = globalElement.getAttribute("name");
gDialog.textareaRows.value = globalElement.getAttribute("rows");
gDialog.textareaCols.value = globalElement.getAttribute("cols");
- gDialog.textareaWrap.value = globalElement.getAttribute("wrap");
+ gDialog.textareaWrap.value = GetHTMLOrCSSStyleValue(globalElement, "wrap", "white-space");
gDialog.textareaReadOnly.checked = globalElement.hasAttribute("readonly");
gDialog.textareaDisabled.checked = globalElement.hasAttribute("disabled");
gDialog.textareaTabIndex.value = globalElement.getAttribute("tabindex");
gDialog.textareaAccessKey.value = globalElement.getAttribute("accesskey");
- gDialog.textareaValue.value = globalElement.value;
onInput();
}
@@ -152,32 +147,38 @@ function ValidateData()
else
globalElement.removeAttribute(f);
}
- globalElement.value = gDialog.textareaValue.value;
return true;
}
function onAccept()
{
- editorShell.BeginBatchChanges();
-
- if (insertNew)
- {
- try {
- // 'true' means delete the selection before inserting
- // in case were are converting text to a text area
- editorShell.InsertElementAtSelection(textareaElement, true);
- } catch (e) {
- dump(e);
- }
- }
-
// All values are valid - copy to actual element in doc or
// element created to insert
ValidateData();
- editorShell.CloneAttributes(textareaElement, globalElement);
+ editorShell.BeginBatchChanges();
- editorShell.EndBatchChanges();
+ try {
+ // undoably set value
+ var initialText = gDialog.textareaValue.value;
+ if (initialText != textareaElement.value) {
+ while (textareaElement.hasChildNodes())
+ editorShell.editor.DeleteNode(textareaElement.firstChild);
+ if (initialText) {
+ var textNode = editorShell.editorDocument.createTextNode(initialText);
+ editorShell.editor.InsertNode(textNode, textareaElement, 0);
+ }
+ }
+
+ if (insertNew)
+ editorShell.InsertElementAtSelection(textareaElement, true);
+ else
+ editorShell.SelectElement(textareaElement);
+
+ editorShell.CloneAttributes(textareaElement, globalElement);
+ } finally {
+ editorShell.EndBatchChanges();
+ }
SaveWindowLocation();
diff --git a/editor/ui/dialogs/content/EdTextAreaProps.xul b/editor/ui/dialogs/content/EdTextAreaProps.xul
index 853a348837b6..8f6beece2bc9 100644
--- a/editor/ui/dialogs/content/EdTextAreaProps.xul
+++ b/editor/ui/dialogs/content/EdTextAreaProps.xul
@@ -88,50 +88,56 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/editor/ui/dialogs/content/EditorPublish.js b/editor/ui/dialogs/content/EditorPublish.js
index f83daf4d763c..eaf0cb92c500 100644
--- a/editor/ui/dialogs/content/EditorPublish.js
+++ b/editor/ui/dialogs/content/EditorPublish.js
@@ -531,6 +531,10 @@ dump(" *** Current directory list length = "+dirListLen+"\n");
return true;
}
+function ChooseDir()
+{
+}
+
function ValidateData()
{
var result = true;;