]> code.citadel.org Git - citadel.git/blobdiff - webcit/tiny_mce/plugins/style/js/props.js
Updated tiny-mce to most recent 3.4 version
[citadel.git] / webcit / tiny_mce / plugins / style / js / props.js
index a8dd93dec5945263bb0faa5caef3f7696e5e2400..07a4c3ef4e832626f8b5905b6a01a9f7f8c8cab1 100644 (file)
@@ -144,6 +144,8 @@ function setupFormData() {
        f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');\r
        f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');\r
        f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');\r
+       f.text_none.checked = inStr(ce.style.textDecoration, 'none');\r
+       updateTextDecorations();\r
 \r
        // Setup background fields\r
 \r
@@ -177,11 +179,7 @@ function setupFormData() {
 \r
        f.box_height.value = getNum(ce.style.height);\r
        selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));\r
-\r
-       if (tinymce.isGecko)\r
-               selectByValue(f, 'box_float', ce.style.cssFloat, true, true);\r
-       else\r
-               selectByValue(f, 'box_float', ce.style.styleFloat, true, true);\r
+       selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true);\r
 \r
        selectByValue(f, 'box_clear', ce.style.clear, true, true);\r
 \r
@@ -376,7 +374,7 @@ function applyAction() {
        generateCSS();\r
 \r
        tinyMCEPopup.restoreSelection();\r
-       ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));\r
+       ed.dom.setAttrib(ed.selection.getSelectedBlocks(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));\r
 }\r
 \r
 function updateAction() {\r
@@ -440,9 +438,7 @@ function generateCSS() {
        ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");\r
        ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");\r
        ce.style.styleFloat = f.box_float.value;\r
-\r
-       if (tinymce.isGecko)\r
-               ce.style.cssFloat = f.box_float.value;\r
+       ce.style.cssFloat = f.box_float.value;\r
 \r
        ce.style.clear = f.box_clear.value;\r
 \r
@@ -638,4 +634,17 @@ function synch(fr, to) {
                selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);\r
 }\r
 \r
+function updateTextDecorations(){\r
+       var el = document.forms[0].elements;\r
+\r
+       var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"];\r
+       var noneChecked = el["text_none"].checked;\r
+       tinymce.each(textDecorations, function(id) {\r
+               el[id].disabled = noneChecked;\r
+               if (noneChecked) {\r
+                       el[id].checked = false;\r
+               }\r
+       });\r
+}\r
+\r
 tinyMCEPopup.onInit.add(init);\r