Changes for page ContentEditable

Last modified by mflorea on 2010/07/06 16:39

From version 20.1
edited by mflorea
on 2010/07/06 18:36
Change comment: There is no comment for this version
To version 17.1
edited by mflorea
on 2010/07/06 18:27
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,3 +1,7 @@
1 +{{velocity}}
2 +$xwiki.ssx.use("ContentEditable")
3 +{{/velocity}}
4 +
1 1  {{html clean="false"}}
2 2  <script type="text/javascript">
3 3  function onAction(hook){
... ... @@ -4,7 +4,7 @@
4 4   var iframe = document.createElement('iframe');
5 5   iframe.style.border = '1px solid black';
6 6   iframe.addEventListener('load', function() {
7 - iframe.contentWindow.document.body.innerHTML = '<link rel="stylesheet" type="text/css" href="/xwiki/bin/ssx/Test/ContentEditable?language=en"/><p>before<span contentEditable="false" class="readOnly" onclick="this.className=\'readOnly readOnly-selected\'">text</span>after</p>';
11 + iframe.contentWindow.document.body.innerHTML = '<p>before<span contentEditable="false" class="readOnly" onclick="this.className=\'readOnly readOnly-selected\'">text</span>after</p>';
8 8   //iframe.contentWindow.document.designMode = 'on';
9 9   iframe.contentWindow.document.body.contentEditable = true;
10 10   iframe.focus();
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,8 +1,8 @@
1 1  span.readOnly-selected::selection {
2 - background-color: #AAA;
2 + background: #AAA;
3 3  }
4 4  span.readOnly-selected::-moz-selection {
5 - background-color: #AAA;
5 + background: #AAA;
6 6  }
7 7  span.readOnly {
8 8   border: 1px dashed #777;