Upgrade TinyMCE to v3.4.5
[citadel.git] / webcit / tiny_mce / plugins / style / js / props.js
index cafd6b1cf7ead1fd5b2851edc4c9d5f714af2671..6800a9a9aa67dff1d750e9f10f0f337bc821f649 100644 (file)
@@ -10,9 +10,9 @@ var defaultFonts = "" +
        "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";\r
 \r
 var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";\r
-var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%";\r
-var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";\r
-var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";\r
+var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
+var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%";\r
+var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
 var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";\r
 var defaultTextStyle = "normal;italic;oblique";\r
 var defaultVariant = "normal;small-caps";\r
@@ -177,11 +177,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
@@ -247,12 +243,12 @@ function setupFormData() {
 }\r
 \r
 function getMeasurement(s) {\r
-       return s.replace(/^([0-9]+)(.*)$/, "$2");\r
+       return s.replace(/^([0-9.]+)(.*)$/, "$2");\r
 }\r
 \r
 function getNum(s) {\r
-       if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))\r
-               return s.replace(/[^0-9]/g, '');\r
+       if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s))\r
+               return s.replace(/[^0-9.]/g, '');\r
 \r
        return s;\r
 }\r
@@ -376,7 +372,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 +436,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
@@ -478,7 +472,7 @@ function generateCSS() {
                ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");\r
                ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");\r
        } else\r
-               ce.style.borderWidth = f.border_width_top.value;\r
+               ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");\r
 \r
        if (!f.border_color_same.checked) {\r
                ce.style.borderTopColor = f.border_color_top.value;\r