\r
}\r
\r
+#rng-visualEditor-sidebar,\r
#rng-visualEditor-sidebar p,\r
#rng-visualEditor-sidebar td,\r
#rng-visualEditor-sidebar label,\r
margin-bottom: 0px;\r
}\r
\r
-.rng-visualEditor-editPaneNodeForm label {\r
+.rng-visualEditor-editPaneNodeForm label ,\r
+.rng-visualEditor-editPaneSelectionForm label\r
+{\r
width: 50px;\r
display: inline-block;\r
}\r
\r
-.rng-visualEditor-editPaneNodeForm select {\r
+.rng-visualEditor-editPaneNodeForm select,\r
+.rng-visualEditor-editPaneSelectionForm select\r
+ {\r
width: 100px;\r
}\r
\r
+\r
+\r
+.rng-visualEditor-sidebarContentItem fieldset {\r
+ margin-bottom: 10px;\r
+}\r
+\r
+.rng-visualEditor-sidebarContentItem legend {\r
+ font-size:11px;\r
+ height:30px;\r
+}\r
+\r
#rng-visualEditor-meta table {\r
margin-bottom:10px;\r
}\r
mediator.getCurrentNode().attr('wlxml-'+attr, target.val());\r
isDirty = true;\r
});\r
+ \r
+ view.node.on('change', '.rng-visualEditor-editPaneSelectionForm select', function(e) {\r
+ var target = $(e.target);\r
+ var selection = window.getSelection();\r
+ if(selection.anchorNode.isSameNode(selection.focusNode) && selection.anchorNode.nodeType === Node.TEXT_NODE) { \r
+ var startOffset = selection.anchorOffset;\r
+ var endOffset = selection.focusOffset;\r
+ if(startOffset > endOffset) {\r
+ var tmp = startOffset;\r
+ startOffset = endOffset;\r
+ endOffset = tmp;\r
+ }\r
+ var node = selection.anchorNode;\r
+ var prefix = node.data.substr(0, startOffset);\r
+ var suffix = node.data.substr(endOffset);\r
+ var core = node.data.substr(startOffset, endOffset - startOffset);\r
+ $(node).replaceWith(prefix + '<span wlxml-tag="' + target.val() + '">' + core + '</span>' + suffix); \r
+ isDirty = true;\r
+ }\r
+ });\r
},\r
selectTab: function(id) {\r
this.node.find('.rng-visualEditor-sidebarContentItem').hide();\r