Upgrade TinyMCE to v3.4.5
[citadel.git] / webcit / tiny_mce / plugins / xhtmlxtras / js / attributes.js
index 23c7fa4c277c3fb52c8bb9076c825476ac714b03..9c99995adb90306124d406cad6e78e310459acdd 100644 (file)
@@ -1,8 +1,11 @@
- /**\r
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $\r
+/**\r
+ * attributes.js\r
  *\r
- * @author Moxiecode - based on work by Andrew Tetlaw\r
- * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
  */\r
 \r
 function init() {\r
@@ -50,7 +53,6 @@ function insertAction() {
        var inst = tinyMCEPopup.editor;\r
        var elm = inst.selection.getNode();\r
 \r
-       tinyMCEPopup.execCommand("mceBeginUndoLevel");  \r
        setAllAttribs(elm);\r
        tinyMCEPopup.execCommand("mceEndUndoLevel");\r
        tinyMCEPopup.close();\r
@@ -69,21 +71,7 @@ function setAttrib(elm, attrib, value) {
                        value = valueElm.value;\r
        }\r
 \r
-       if (value != "") {\r
-               dom.setAttrib(elm, attrib.toLowerCase(), value);\r
-\r
-               if (attrib == "style")\r
-                       attrib = "style.cssText";\r
-\r
-               if (attrib.substring(0, 2) == 'on')\r
-                       value = 'return true;' + value;\r
-\r
-               if (attrib == "class")\r
-                       attrib = "className";\r
-\r
-               elm[attrib]=value;\r
-       } else\r
-               elm.removeAttribute(attrib);\r
+       dom.setAttrib(elm, attrib.toLowerCase(), value);\r
 }\r
 \r
 function setAllAttribs(elm) {\r