Ticket #5386: ckeditor.html

File ckeditor.html, 2.3 KB (added by Marcos Wright Kuhns, 10 years ago)

An HTML file that can be used to replicate the error I've described.

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
2<html xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <title>CKEditor + Form + Google Chrome Mac bug</title>
5   
6    <script type="text/javascript">
7      CKEDITOR_BASEPATH = 'http://ckeditor.com/apps/ckeditor/3.2/';
8    </script>
9    <script type="text/javascript" src="http://ckeditor.com/apps/ckeditor/3.2/ckeditor.js?1269346523"></script>
10    <!--
11    <script type="text/javascript">
12      CKEDITOR_BASEPATH = 'http://localhost/javascripts/ckeditor_3.2/';
13    </script>
14    <script type="text/javascript" src="http://localhost/javascripts/ckeditor_3.2/ckeditor.js?1269378841"></script>
15    -->
16  </head>
17  <body>
18    <div id="form1_submit">
19      <b>form #1 submit == </b>
20    </div>
21    <div id="errors1">
22      <b>Errors on #1:</b><br />
23    </div>
24    <hr />
25   
26    <div id="form2_submit">
27      <b>form #2 submit == </b>
28    </div>
29    <div id="errors2">
30      <b>Errors on #2:</b><br />
31    </div>
32    <hr />
33   
34    <form id="form1">
35      <textarea id="editor1">CKEditor #1</textarea>
36    </form>
37   
38    <form id="form2">
39      <textarea id="editor2">CKEditor #2</textarea>
40    </form>
41   
42    <script type="text/javascript">
43      editor_id = 0;
44     
45      // Every half second, try to load the next CKEditor instance.
46      interval_id = setInterval(function() {
47        if(typeof CKEDITOR != 'undefined') {
48          loadNextCKEditor();
49        }
50      }, 500);
51     
52      function loadNextCKEditor() {
53        editor_id += 1;
54        var form = document.getElementById('form'+editor_id),
55          textarea = document.getElementById('editor'+editor_id),
56          errors = document.getElementById('errors'+editor_id),
57          submit = document.getElementById('form'+editor_id+'_submit');
58       
59        setTimeout(function() {
60          try {
61            CKEDITOR.replace(textarea);
62            errors.innerHTML += 'No Errors';
63            submit.innerHTML += form.submit;
64          } catch(err) {
65            window.errors = err;
66            errors.innerHTML += err + '<br />' + err.stack;
67            submit.innerHTML += form.submit;
68          }
69        }, 10);
70       
71        // Only load 2 CKEditor instances total.
72        if(editor_id >= 2) clearInterval(interval_id);
73      };
74    </script>
75   
76  </body>
77</html>
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy