JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.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                         <select disabled="disabled" id="languages" onchange="createEditor( this.value );">\r
34                                 <script type="text/javascript">\r
35                                 //<![CDATA[\r
36 \r
37                                         // Get the language list from the _languages.js file.\r
38                                         for ( var i = 0 ; i < window.CKEDITOR_LANGS.length ; i++ )\r
39                                         {\r
40                                                 document.write(\r
41                                                         '<option value="' + window.CKEDITOR_LANGS[i].code + '">' +\r
42                                                                 window.CKEDITOR_LANGS[i].name +\r
43                                                         '</option>' );\r
44                                         }\r
45 \r
46                                 //]]>\r
47                                 </script>\r
48                         </select>\r
49                         <br />\r
50                         <span style="color: #888888">(You may see strange characters if your system doesn't\r
51                                 support the selected language)</span>\r
52                 </p>\r
53                 <p>\r
54                         <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
55                         <script type="text/javascript">\r
56                         //<![CDATA[\r
57 \r
58                                 // Set the number of languages.\r
59                                 document.getElementById( 'count' ).innerHTML = window.CKEDITOR_LANGS.length;\r
60 \r
61                                 var editor;\r
62 \r
63                                 function createEditor( languageCode )\r
64                                 {\r
65                                         if ( editor )\r
66                                                 editor.destroy();\r
67 \r
68                                         // Replace the <textarea id="editor"> with an CKEditor\r
69                                         // instance, using default configurations.\r
70                                         editor = CKEDITOR.replace( 'editor1',\r
71                                                 {\r
72                                                         language : languageCode,\r
73 \r
74                                                         on :\r
75                                                         {\r
76                                                                 instanceReady : function()\r
77                                                                 {\r
78                                                                         // Wait for the editor to be ready to set\r
79                                                                         // the language combo.\r
80                                                                         var languages = document.getElementById( 'languages' );\r
81                                                                         languages.value = this.langCode;\r
82                                                                         languages.disabled = false;\r
83                                                                 }\r
84                                                         }\r
85                                                 } );\r
86                                 }\r
87 \r
88                                 // At page startup, load the default language:\r
89                                 createEditor( '' );\r
90 \r
91                         //]]>\r
92                         </script>\r
93                 </p>\r
94         </form>\r
95         <div id="footer">\r
96                 <hr />\r
97                 <p>\r
98                         CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>\r
99                 </p>\r
100                 <p id="copy">\r
101                         Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico\r
102                         Knabben. All rights reserved.\r
103                 </p>\r
104         </div>\r
105 </body>\r
106 </html>\r