Changes for page ContentEditable

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

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

Summary

Details

Page properties
Content
... ... @@ -1,10 +1,18 @@
1 -{{html}}
1 +{{html clean="false"}}
2 +<style type="text/css">
3 +span.readOnly::selection {
4 + background: #AAA;
5 +}
6 +span.readOnly::-moz-selection {
7 + background: #AAA;
8 +}
9 +</style>
2 2  <script type="text/javascript">
3 3  function onAction(hook){
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 = '<p>before<span contentEditable="false" onclick="this.style.backgroundColor=\'red\'">text</span>after</p>';
15 + iframe.contentWindow.document.body.innerHTML = '<p>before<span contentEditable="false" onclick="this.className=\'readOnly\'">text</span>after</p>';
8 8   //iframe.contentWindow.document.designMode = 'on';
9 9   iframe.contentWindow.document.body.contentEditable = true;
10 10   iframe.focus();