JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.1
[ckeditor.git] / _samples / bbcode.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-2011, 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>BBCode Plugin &mdash; 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 src="sample.js" type="text/javascript"></script>\r
12         <link href="sample.css" rel="stylesheet" type="text/css" />\r
13 </head>\r
14 <body>\r
15         <h1 class="samples">\r
16                 CKEditor Sample &mdash; BBCode Plugin\r
17         </h1>\r
18         <div class="description">\r
19         <p>\r
20                 This sample shows how to configure CKEditor to output <a href="http://en.wikipedia.org/wiki/BBCode">BBCode</a> format instead of HTML.\r
21                 Please note that the editor configuration was modified to reflect what is needed in a BBCode editing environment.\r
22                 Smiley images, for example, were stripped to the emoticons that are commonly used in some BBCode dialects.\r
23         </p>\r
24         <p>\r
25                 Please note that currently there is no standard for the BBCode markup language, so its implementation\r
26                 for different platforms (message boards, blogs etc.) can vary. This means that before using CKEditor to\r
27                 output BBCode you may need to adjust the implementation to your own environment.\r
28         </p>\r
29         <p>\r
30                 A snippet of the configuration code can be seen below; check the source of this page for\r
31                 a full definition:\r
32         </p>\r
33         <pre class="samples">\r
34 CKEDITOR.replace( 'editor1',\r
35         {\r
36                 <strong>extraPlugins : 'bbcode',</strong>\r
37                 toolbar :\r
38                 [\r
39                         ['Source', '-', 'Save','NewPage','-','Undo','Redo'],\r
40                         ['Find','Replace','-','SelectAll','RemoveFormat'],\r
41                         ['Link', 'Unlink', 'Image'],\r
42                         '/',\r
43                         ['FontSize', 'Bold', 'Italic','Underline'],\r
44                         ['NumberedList','BulletedList','-','Blockquote'],\r
45                         ['TextColor', '-', 'Smiley','SpecialChar', '-', 'Maximize']\r
46                 ],\r
47                 ... <i>some other configurations omitted here</i>\r
48         });     </pre>\r
49         </div>\r
50 \r
51         <!-- This <div> holds alert messages to be display in the sample page. -->\r
52         <div id="alerts">\r
53                 <noscript>\r
54                         <p>\r
55                                 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript\r
56                                 support, like yours, you should still see the contents (HTML data) and you should\r
57                                 be able to edit it normally, without a rich editor interface.\r
58                         </p>\r
59                 </noscript>\r
60         </div>\r
61         <form action="sample_posteddata.php" method="post">\r
62                 <p>\r
63                         <label for="editor1">\r
64                                 Editor 1:</label>\r
65                         <textarea cols="80" id="editor1" name="editor1" rows="10">This is some [b]sample text[/b]. You are using [url=http://ckeditor.com/]CKEditor[/url].</textarea>\r
66                         <script type="text/javascript">\r
67                         //<![CDATA[\r
68 \r
69                         // Replace the <textarea id="editor"> with an CKEditor\r
70                         // instance, using the "bbcode" plugin, shaping some of the\r
71                         // editor configuration to fit BBCode environment.\r
72                         CKEDITOR.replace( 'editor1',\r
73                                 {\r
74                                         extraPlugins : 'bbcode',\r
75                                         // Remove unused plugins.\r
76                                         removePlugins : 'bidi,button,dialogadvtab,div,filebrowser,flash,format,forms,horizontalrule,iframe,indent,justify,liststyle,pagebreak,showborders,stylescombo,table,tabletools,templates',\r
77                                         // Width and height are not supported in the BBCode format, so object resizing is disabled.\r
78                                         disableObjectResizing : true,\r
79                                         // Define font sizes in percent values.\r
80                                         fontSize_sizes : "30/30%;50/50%;100/100%;120/120%;150/150%;200/200%;300/300%",\r
81                                         toolbar :\r
82                                         [\r
83                                                 ['Source', '-', 'Save','NewPage','-','Undo','Redo'],\r
84                                                 ['Find','Replace','-','SelectAll','RemoveFormat'],\r
85                                                 ['Link', 'Unlink', 'Image', 'Smiley','SpecialChar'],\r
86                                                 '/',\r
87                                                 ['Bold', 'Italic','Underline'],\r
88                                                 ['FontSize'],\r
89                                                 ['TextColor'],\r
90                                                 ['NumberedList','BulletedList','-','Blockquote'],\r
91                                                 ['Maximize']\r
92                                         ],\r
93                                         // Strip CKEditor smileys to those commonly used in BBCode.\r
94                                         smiley_images :\r
95                                         [\r
96                                                 'regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','tounge_smile.gif',\r
97                                                 'embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angel_smile.gif','shades_smile.gif',\r
98                                                 'cry_smile.gif','kiss.gif'\r
99                                         ],\r
100                                         smiley_descriptions :\r
101                                         [\r
102                                                 'smiley', 'sad', 'wink', 'laugh', 'cheeky', 'blush', 'surprise',\r
103                                                 'indecision', 'angel', 'cool', 'crying', 'kiss'\r
104                                         ]\r
105                         } );\r
106 \r
107                         //]]>\r
108                         </script>\r
109                 </p>\r
110                 <p>\r
111                         <input type="submit" value="Submit" />\r
112                 </p>\r
113         </form>\r
114         <div id="footer">\r
115                 <hr />\r
116                 <p>\r
117                         CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>\r
118                 </p>\r
119                 <p id="copy">\r
120                         Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
121                         Knabben. All rights reserved.\r
122                 </p>\r
123         </div>\r
124 </body>\r
125 </html>\r