devtools.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.md or http://ckeditor.com/license
  5. -->
  6. <html>
  7. <head>
  8. <meta charset="utf-8">
  9. <title>Using DevTools Plugin &mdash; CKEditor Sample</title>
  10. <script src="../../../ckeditor.js"></script>
  11. <link rel="stylesheet" href="../../../samples/sample.css">
  12. <meta name="ckeditor-sample-name" content="Developer Tools plugin">
  13. <meta name="ckeditor-sample-group" content="Plugins">
  14. <meta name="ckeditor-sample-description" content="Using the Developer Tools plugin to display information about dialog window UI elements to allow for easier customization.">
  15. </head>
  16. <body>
  17. <h1 class="samples">
  18. <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Using the Developer Tools Plugin
  19. </h1>
  20. <div class="description">
  21. <p>
  22. This sample shows how to configure CKEditor instances to use the
  23. <strong>Developer Tools</strong> (<code>devtools</code>) plugin that displays
  24. information about dialog window elements, including the name of the dialog window,
  25. tab, and UI element. Please note that the tooltip also contains a link to the
  26. <a href="http://docs.ckeditor.com/#!/api">CKEditor JavaScript API</a>
  27. documentation for each of the selected elements.
  28. </p>
  29. <p>
  30. This plugin is aimed at developers who would like to customize their CKEditor
  31. instances and create their own plugins. By default it is turned off; it is
  32. usually useful to only turn it on in the development phase. Note that it works with
  33. all CKEditor dialog windows, including the ones that were created by custom plugins.
  34. </p>
  35. <p>
  36. To add a CKEditor instance using the <strong>devtools</strong> plugin, insert
  37. the following JavaScript call into your code:
  38. </p>
  39. <pre class="samples">
  40. CKEDITOR.replace( '<em>textarea_id</em>', {
  41. <strong>extraPlugins: 'devtools'</strong>
  42. });</pre>
  43. <p>
  44. Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
  45. the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
  46. </p>
  47. </div>
  48. <form action="../../../samples/sample_posteddata.php" method="post">
  49. <p>
  50. <label for="editor1">
  51. Editor 1:
  52. </label>
  53. <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>
  54. <script>
  55. // This call can be placed at any point after the
  56. // <textarea>, or inside a <head><script> in a
  57. // window.onload event handler.
  58. // Replace the <textarea id="editor"> with an CKEditor
  59. // instance, using default configurations.
  60. CKEDITOR.replace( 'editor1', {
  61. extraPlugins: 'devtools'
  62. });
  63. </script>
  64. </p>
  65. <p>
  66. <input type="submit" value="Submit">
  67. </p>
  68. </form>
  69. <div id="footer">
  70. <hr>
  71. <p>
  72. CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
  73. </p>
  74. <p id="copy">
  75. Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
  76. Knabben. All rights reserved.
  77. </p>
  78. </div>
  79. </body>
  80. </html>