JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1.1
[ckeditor.git] / _samples / ui_languages.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
2 <!--\r
3 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
4 For licensing, see LICENSE.html or http://ckeditor.com/license\r
5 -->\r
6 <html xmlns="http://www.w3.org/1999/xhtml">\r
7 <head>\r
8         <title>User Interface Globalization - CKEditor Sample</title>\r
9         <meta content="text/html; charset=utf-8" http-equiv="content-type" />\r
10         <script type="text/javascript" src="../ckeditor.js"></script>\r
11         <script type="text/javascript" src="../lang/_languages.js"></script>\r
12         <script src="sample.js" type="text/javascript"></script>\r
13         <link href="sample.css" rel="stylesheet" type="text/css" />\r
14 </head>\r
15 <body>\r
16         <h1>\r
17                 CKEditor Sample\r
18         </h1>\r
19         <!-- This <div> holds alert messages to be display in the sample page. -->\r
20         <div id="alerts">\r
21                 <noscript>\r
22                         <p>\r
23                                 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript\r
24                                 support, like yours, you should still see the contents (HTML data) and you should\r
25                                 be able to edit it normally, without a rich editor interface.\r
26                         </p>\r
27                 </noscript>\r
28         </div>\r
29         <form action="sample_posteddata.php" method="post">\r
30                 <p>\r
31                         <label for="editor1">\r
32                                 Available languages (<span id="count"> </span>languages!):</label><br />\r
33                                 <script type="text/javascript">\r
34                                 //<![CDATA[\r
35                                         document.write( '<select disabled="disabled" id="languages" onchange="createEditor( this.value );">' );\r
36                                         // Get the language list from the _languages.js file.\r
37                                         for ( var i = 0 ; i < window.CKEDITOR_LANGS.length ; i++ )\r
38                                         {\r
39                                                 document.write(\r
40                                                         '<option value="' + window.CKEDITOR_LANGS[i].code + '">' +\r
41                                                                 window.CKEDITOR_LANGS[i].name +\r
42                                                         '</option>' );\r
43                                         }\r
44                                         document.write( '</select>' );\r
45                                 //]]>\r
46                                 </script>\r
47                         <br />\r
48                         <span style="color: #888888">(You may see strange characters if your system doesn't\r
49                                 support the selected language)</span>\r
50                 </p>\r
51                 <p>\r
52                         <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
53                         <script type="text/javascript">\r
54                         //<![CDATA[\r
55 \r
56                                 // Set the number of languages.\r
57                                 document.getElementById( 'count' ).innerHTML = window.CKEDITOR_LANGS.length;\r
58 \r
59                                 var editor;\r
60 \r
61                                 function createEditor( languageCode )\r
62                                 {\r
63                                         if ( editor )\r
64                                                 editor.destroy();\r
65 \r
66                                         // Replace the <textarea id="editor"> with an CKEditor\r
67                                         // instance, using default configurations.\r
68                                         editor = CKEDITOR.replace( 'editor1',\r
69                                                 {\r
70                                                         language : languageCode,\r
71 \r
72                                                         on :\r
73                                                         {\r
74                                                                 instanceReady : function()\r
75                                                                 {\r
76                                                                         // Wait for the editor to be ready to set\r
77                                                                         // the language combo.\r
78                                                                         var languages = document.getElementById( 'languages' );\r
79                                                                         languages.value = this.langCode;\r
80                                                                         languages.disabled = false;\r
81                                                                 }\r
82                                                         }\r
83                                                 } );\r
84                                 }\r
85 \r
86                                 // At page startup, load the default language:\r
87                                 createEditor( '' );\r
88 \r
89                         //]]>\r
90                         </script>\r
91                 </p>\r
92         </form>\r
93         <div id="footer">\r
94                 <hr />\r
95                 <p>\r
96                         CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>\r
97                 </p>\r
98                 <p id="copy">\r
99                         Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico\r
100                         Knabben. All rights reserved.\r
101                 </p>\r
102         </div>\r
103 </body>\r
104 </html>\r