JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6.1
[ckeditor.git] / _samples / api_dialog.html
index 652da55..af6f2a7 100644 (file)
@@ -1,29 +1,29 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
 <!--\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 -->\r
 <html xmlns="http://www.w3.org/1999/xhtml">\r
 <head>\r
-       <title>Sample - CKEditor</title>\r
-       <meta content="text/html; charset=utf-8" http-equiv="content-type"/>\r
+       <title>Using API to Customize Dialog Windows &mdash; CKEditor Sample</title>\r
+       <meta content="text/html; charset=utf-8" http-equiv="content-type" />\r
        <script type="text/javascript" src="../ckeditor.js"></script>\r
        <script src="sample.js" type="text/javascript"></script>\r
-       <link href="sample.css" rel="stylesheet" type="text/css"/>\r
+       <link href="sample.css" rel="stylesheet" type="text/css" />\r
        <style id="styles" type="text/css">\r
 \r
-.cke_button_myDialogCmd .cke_icon\r
-{\r
-       display : none !important;\r
-}\r
+               .cke_button_myDialogCmd .cke_icon\r
+               {\r
+                       display: none !important;\r
+               }\r
 \r
-.cke_button_myDialogCmd .cke_label\r
-{\r
-       display : inline !important;\r
-}\r
+               .cke_button_myDialogCmd .cke_label\r
+               {\r
+                       display: inline !important;\r
+               }\r
 \r
        </style>\r
-       <script id="headscript" type="text/javascript">\r
+       <script type="text/javascript">\r
        //<![CDATA[\r
 \r
 // When opening a dialog, its "definition" is created for it, for\r
@@ -87,16 +87,47 @@ CKEDITOR.on( 'dialogDefinition', function( ev )
                                        }\r
                                ]\r
                        });\r
+\r
+                       // Rewrite the 'onFocus' handler to always focus 'url' field.\r
+                       dialogDefinition.onFocus = function()\r
+                       {\r
+                               var urlField = this.getContentElement( 'info', 'url' );\r
+                               urlField.select();\r
+                       };\r
                }\r
        });\r
 \r
        //]]>\r
        </script>\r
+\r
 </head>\r
 <body>\r
-       <h1>\r
-               CKEditor Sample\r
+       <h1 class="samples">\r
+               CKEditor Sample &mdash; Using CKEditor Dialog API\r
        </h1>\r
+       <div class="description">\r
+       <p>\r
+               This sample shows how to use the\r
+               <a class="samples" href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html">CKEditor Dialog API</a>\r
+               to customize CKEditor dialog windows without changing the original editor code.\r
+               The following customizations are being done in the example below:\r
+       </p>\r
+       <ol>\r
+               <li><strong>Adding dialog window tabs</strong> &ndash; "My Tab" in the "Link" dialog window.</li>\r
+               <li><strong>Removing a dialog window tab</strong> &ndash; "Target" tab from the "Link" dialog window.</li>\r
+               <li><strong>Adding dialog window fields</strong> &ndash; "My Custom Field" in the "Link" dialog window.</li>\r
+               <li><strong>Removing dialog window fields</strong> &ndash; "Link Type" and "Browse Server" in the "Link"\r
+                       dialog window.</li>\r
+               <li><strong>Setting default values for dialog window fields</strong> &ndash; "URL" field in the\r
+                       "Link" dialog window. </li>\r
+               <li><strong>Creating a custom dialog window</strong> &ndash; "My Dialog" dialog window opened with the "My Dialog" toolbar button.</li>\r
+       </ol>\r
+       <p>\r
+For details on how to create this setup check the source code of this sample page.\r
+       </p>\r
+       </div>\r
+\r
+\r
        <!-- This <div> holds alert messages to be display in the sample page. -->\r
        <div id="alerts">\r
                <noscript>\r
@@ -109,20 +140,8 @@ CKEDITOR.on( 'dialogDefinition', function( ev )
        </div>\r
        <!-- This <fieldset> holds the HTML that you will usually find in your\r
             pages. -->\r
-       <p>\r
-                       This sample shows how to use the dialog API to customize dialogs whithout changing\r
-                       the original editor code. The following customizations are being done::</p>\r
-               <ol>\r
-                       <li><strong>Add dialog pages</strong> ("My Tab" in the Link dialog).</li>\r
-                       <li><strong>Remove a dialog tab</strong> ("Target" tab from the Link dialog).</li>\r
-                       <li><strong>Add dialog fields</strong> ("My Custom Field" into the Link dialog).</li>\r
-                       <li><strong>Remove dialog fields</strong> ("Link Type" and "Browser Server" the Link dialog).</li>\r
-                       <li><strong>Set default values for dialog fields</strong> (for the "URL" field in the\r
-                               Link dialog). </li>\r
-                       <li><strong>Create a custom dialog</strong> ("My Dialog" button).</li>\r
-               </ol>\r
-               <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>\r
-               <script type="text/javascript">\r
+       <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>\r
+       <script type="text/javascript">\r
                //<![CDATA[\r
                        // Replace the <textarea id="editor1"> with an CKEditor instance.\r
                        var editor = CKEDITOR.replace( 'editor1',\r
@@ -164,14 +183,15 @@ CKEDITOR.on( 'dialogDefinition', function( ev )
                                                } );\r
                                });\r
                //]]>\r
-               </script>\r
+       </script>\r
        <div id="footer">\r
-               <hr/>\r
+               <hr />\r
                <p>\r
-                       CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>\r
+                       CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>\r
                </p>\r
                <p id="copy">\r
-                       Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.\r
+                       Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
+                       Knabben. All rights reserved.\r
                </p>\r
        </div>\r
 </body>\r