Ticket #6521: 6521_2.patch

File 6521_2.patch, 5.0 KB (added by Anna Tomanek, 13 years ago)

Alfonso's sample updated using the new samples format, with formatting, description etc. added.

  • _samples/index.html

     
    8282                <li><a class="samples" href="placeholder.html">Placeholder plugin</a><br />
    8383                        Using the Placeholder plugin to create uneditable sections that can only be created and modified with a proper dialog window.
    8484                </li>
     85                <li><a class="samples" href="tableresize.html">TableResize plugin</a><br />
     86                        Using the TableResize plugin to enable table column resizing and dragging.
     87                </li>
    8588        </ul>
    8689        <div id="footer">
    8790                <hr />
  • _samples/tableresize.html

     
     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 TableResize Plugin &mdash; 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</head>
     18<body>
     19        <h1 class="samples">
     20                CKEditor Sample &mdash; Using the TableResize Plugin
     21        </h1>
     22        <div class="description">
     23        <p>
     24                This sample shows how to configure CKEditor instances to use the
     25                <strong>TableResize</strong> (<code>tableresize</code>) plugin that allows
     26                the user to edit table columns by using the mouse.
     27        </p>
     28        <p>
     29                The TableResize plugin makes it possible to modify table column width. Hover
     30                your mouse over the column border to see the cursor change to indicate that
     31                the column can be resized. Click and drag your mouse to set the desired width.
     32        </p>
     33        <p>
     34                When TableResize is enabled, you can also change the column placement by using
     35                drag and drop. To achieve this effect, select a column and drag it to a new location.
     36        </p>
     37        <p>
     38                By default the plugin is turned off. To add a CKEditor instance using the
     39                <strong>tableresize</strong> plugin, insert the following JavaScript call into your code:
     40        </p>
     41        <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>',
     42        {
     43                <strong>extraPlugins : 'tableresize'</strong>
     44        });</pre>
     45        <p>
     46                Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
     47                the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
     48        </p>
     49        </div> 
     50        <!-- This <div> holds alert messages to be display in the sample page. -->
     51        <div id="alerts">
     52                <noscript>
     53                        <p>
     54                                <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
     55                                support, like yours, you should still see the contents (HTML data) and you should
     56                                be able to edit it normally, without a rich editor interface.
     57                        </p>
     58                </noscript>
     59        </div>
     60        <form action="sample_posteddata.php" method="post">
     61                <p>
     62                        <label for="editor1">
     63                                Editor 1:</label><br />
     64                        <textarea cols="80" id="editor1" name="editor1" rows="10">
     65&lt;table style="width: 500px;"&gt;
     66        &lt;caption&gt;
     67                A sample table&lt;/caption&gt;
     68        &lt;tbody&gt;
     69                &lt;tr&gt;
     70                        &lt;td&gt;
     71                                Cell 1&lt;/td&gt;
     72                        &lt;td&gt;
     73                                Cell 2&lt;/td&gt;
     74                &lt;/tr&gt;
     75                &lt;tr&gt;
     76                        &lt;td&gt;
     77                                You can resize a table column.&lt;/td&gt;
     78                        &lt;td&gt;
     79                                Hover your mouse over its border and drag to resize.&lt;/td&gt;
     80                &lt;/tr&gt;
     81                &lt;tr&gt;
     82                        &lt;td&gt;
     83                                Select a column and drag it.&lt;/td&gt;
     84                        &lt;td&gt;
     85                                This will change its location.&lt;/td&gt;
     86                &lt;/tr&gt;
     87        &lt;/tbody&gt;
     88&lt;/table&gt;
     89
     90
     91                        </textarea>
     92                        <script type="text/javascript">
     93                        //<![CDATA[
     94
     95                                // This call can be placed at any point after the
     96                                // <textarea>, or inside a <head><script> in a
     97                                // window.onload event handler.
     98
     99                                // Replace the <textarea id="editor"> with an CKEditor
     100                                // instance, using default configurations.
     101                                CKEDITOR.replace( 'editor1', {
     102                                        extraPlugins : 'tableresize'
     103                                });
     104
     105                        //]]>
     106                        </script>
     107                </p>
     108                <p>
     109                        <input type="submit" value="Submit" />
     110                </p>
     111        </form>
     112        <div id="footer">
     113                <hr />
     114                <p>
     115                        CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
     116                </p>
     117                <p id="copy">
     118                        Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
     119                        Knabben. All rights reserved.
     120                </p>
     121        </div>
     122</body>
     123</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy