Changes for page ContentEditable

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

From version 12.1
edited by mflorea
on 2010/07/06 18:17
Change comment: There is no comment for this version
To version 13.1
edited by mflorea
on 2010/07/06 18:19
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,11 +1,15 @@
1 1  {{html clean="false"}}
2 2  <style type="text/css">
3 -span.readOnly::selection {
3 +span.readOnly-selected::selection {
4 4   background: #AAA;
5 5  }
6 -span.readOnly::-moz-selection {
6 +span.readOnly-selected::-moz-selection {
7 7   background: #AAA;
8 8  }
9 +span.readOnly {
10 + border: 1px dashed #777;
11 + padding: 3px;
12 +}
9 9  </style>
10 10  <script type="text/javascript">
11 11  function onAction(hook){
... ... @@ -12,7 +12,7 @@
12 12   var iframe = document.createElement('iframe');
13 13   iframe.style.border = '1px solid black';
14 14   iframe.addEventListener('load', function() {
15 - iframe.contentWindow.document.body.innerHTML = '<p>before<span contentEditable="false" onclick="this.className=\'readOnly\'">text</span>after</p>';
19 + iframe.contentWindow.document.body.innerHTML = '<p>before<span contentEditable="false" class="readOnly" onclick="this.className=\'readOnly readOnly-selected\'">text</span>after</p>';
16 16   //iframe.contentWindow.document.designMode = 'on';
17 17   iframe.contentWindow.document.body.contentEditable = true;
18 18   iframe.focus();