1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>Test</title> |
---|
5 | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script> |
---|
6 | <script src="../ckeditor.js" type="text/javascript"></script> |
---|
7 | <script type="text/javascript"> |
---|
8 | $(document).ready(function () { |
---|
9 | InitAllCkEditors(); |
---|
10 | }); |
---|
11 | function InitCustomCkEditor(textAreaId, width, height, toolbarSet) { |
---|
12 | CKEDITOR.replace(textAreaId, { |
---|
13 | toolbar: ((typeof (toolbarSet) == undefined || toolbarSet == null) ? "Custom" : toolbarSet), |
---|
14 | height: ((typeof (height) == undefined || height == null) ? '300px' : height), |
---|
15 | width: ((typeof (width) == undefined || width == null) ? '710px' : width) |
---|
16 | }); |
---|
17 | }; |
---|
18 | |
---|
19 | function InitAllCkEditors() { |
---|
20 | $('.ck-editor').each(function (i, e) { |
---|
21 | InitCustomCkEditor($(e).attr('id')); |
---|
22 | }); |
---|
23 | } |
---|
24 | </script> |
---|
25 | </head> |
---|
26 | <body> |
---|
27 | <div id="content"> |
---|
28 | <div class="formRow"> |
---|
29 | <div class="label"> |
---|
30 | <label for="Content">Content</label> |
---|
31 | </div> |
---|
32 | <div class="textarea-box"> |
---|
33 | <textarea class="ck-editor" cols="20" id="Content" name="Content" rows="2"> |
---|
34 | <div>Hello</div> |
---|
35 | <div>world</div> |
---|
36 | </textarea> |
---|
37 | </div> |
---|
38 | </div> |
---|
39 | </div> |
---|
40 | </body> |
---|
41 | </html> |
---|