Ticket #5772: api_dialog.html

File api_dialog.html, 2.9 KB (added by Garry Yao, 15 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<!--
3Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
4For licensing, see LICENSE.html or http://ckeditor.com/license
5-->
6<html xmlns="http://www.w3.org/1999/xhtml">
7<head>
8        <title>Using API to customize dialogs - CKEditor Sample</title>
9        <meta content="text/html; charset=utf-8" http-equiv="content-type" />
10        <!-- CKReleaser %REMOVE_LINE%
11        <script type="text/javascript" src="../ckeditor.js"></script>
12        CKReleaser %REMOVE_START% -->
13        <script type="text/javascript" src="../ckeditor_source.js"></script>
14        <!-- CKReleaser %REMOVE_END% -->
15        <script src="sample.js" type="text/javascript"></script>
16        <link href="sample.css" rel="stylesheet" type="text/css" />
17        <style id="styles" type="text/css">
18
19                .cke_button_myDialogCmd .cke_icon
20                {
21                        display: none !important;
22                }
23
24                .cke_button_myDialogCmd .cke_label
25                {
26                        display: inline !important;
27                }
28
29        </style>
30        <script type="text/javascript">
31        //<![CDATA[
32
33// When opening a dialog, its "definition" is created for it, for
34// each editor instance. The "dialogDefinition" event is then
35// fired. We should use this event to make customizations to the
36// definition of existing dialogs.
37CKEDITOR.on( 'dialogDefinition', function( ev )
38        {
39                // Take the dialog name and its definition from the event
40                // data.
41                var dialogName = ev.data.name;
42                var dialogDefinition = ev.data.definition;
43
44                // Check if the definition is from the dialog we're
45                // interested on (the "NumberedListStyle" dialog).
46                if ( dialogName == 'numberedListStyle' )
47                {
48                        // Get a reference to the "Info" tab.
49                        var infoTab = dialogDefinition.getContents( 'info' );
50
51                        // Remove option 'armenian' from list-style-type select.
52                        var listTypeField = infoTab.get( 'type' );
53                        listTypeField.items.splice( 1, 1 );
54                }
55        });
56
57        //]]>
58        </script>
59
60</head>
61<body>
62        <h1>
63                CKEditor Sample
64        </h1>
65        <!-- This <div> holds alert messages to be display in the sample page. -->
66        <div id="alerts">
67                <noscript>
68                        <p>
69                                <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
70                                support, like yours, you should still see the contents (HTML data) and you should
71                                be able to edit it normally, without a rich editor interface.
72                        </p>
73                </noscript>
74        </div>
75        <textarea cols="80" id="editor1" name="editor1" rows="10"><ol><li>item</li></ol></textarea>
76        <script type="text/javascript">
77                //<![CDATA[
78                        // Replace the <textarea id="editor1"> with an CKEditor instance.
79                        var editor = CKEDITOR.replace( 'editor1' );
80                //]]>
81        </script>
82        <div id="footer">
83                <hr />
84                <p>
85                        CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
86                </p>
87                <p id="copy">
88                        Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico
89                        Knabben. All rights reserved.
90                </p>
91        </div>
92</body>
93</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy