textselection.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.html or http://ckeditor.com/license
  5. -->
  6. <html>
  7. <head>
  8. <title>Textselection Plugin &mdash; CKEditor Sample</title>
  9. <meta charset="utf-8">
  10. <script src="../../../ckeditor.js"></script>
  11. <link rel="stylesheet" href="../../../samples/sample.css">
  12. <meta name="ckeditor-sample-name" content="textselection plugin">
  13. <meta name="ckeditor-sample-group" content="Plugins">
  14. <meta name="ckeditor-sample-description" content="Using the textselection plugin in order to make the editor keep it's text-selection when switching between WYSIWYG and Source mode">
  15. </head>
  16. <body>
  17. <h1 class="samples">
  18. <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Using textselection Plugin
  19. </h1>
  20. <div class="description">
  21. <p>
  22. This sample shows how to configure CKEditor instances to use the
  23. <strong>textselection</strong> (<code>textselection</code>) plugin that makes the editor keep it's text-selection when switching between WYSIWYG and Source mode, and scrolls the selection into the viewport.</p>
  24. <p>
  25. To add a CKEditor instance using the <code>textselection</code> plugin, insert the following JavaScript call to your code:
  26. </p>
  27. <pre class="samples">
  28. CKEDITOR.replace( '<em>textarea_id</em>', {
  29. <strong>extraPlugins: 'textselection',</strong>
  30. });</pre>
  31. <p>
  32. Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
  33. the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.</p>
  34. </div>
  35. <form action="../../../samples/sample_posteddata.php" method="post">
  36. <p>
  37. <label for="editor1">
  38. CKEditor using the <code>textselection</code> plugin <strong>(mark some text and switch to Source View)</strong>: </label>
  39. <textarea cols="80" id="editor1" name="editor1" rows="10"><p>&nbsp;<p></p>
  40. <h1><img alt="Saturn V carrying Apollo 11" class="right" src="http://b.cksource.com/a/1/img/sample.jpg" /> Apollo 11</h1>
  41. <p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.<p></p>
  42. <p>Armstrong spent about <s>three and a half</s> two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5&nbsp;kg) of lunar material for return to Earth. A third member of the mission, <a href="http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)">Michael Collins</a>, piloted the <a href="http://en.wikipedia.org/wiki/Apollo_Command/Service_Module">command</a> spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.<p></p>
  43. <h2>Broadcasting and <em>quotes</em> <a id="quotes" name="quotes"></a></h2>
  44. <p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:<p></p>
  45. <blockquote>
  46. <p>One small step for [a] man, one giant leap for mankind.<p></p>
  47. </blockquote>
  48. <p>Apollo 11 effectively ended the <a href="http://en.wikipedia.org/wiki/Space_Race">Space Race</a> and fulfilled a national goal proposed in 1961 by the late U.S. President <a href="http://en.wikipedia.org/wiki/John_F._Kennedy">John F. Kennedy</a> in a speech before the United States Congress:<p></p>
  49. <blockquote>
  50. <p>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.<p></p>
  51. </blockquote>
  52. <h2>Technical details <a id="tech-details" name="tech-details"></a></h2>
  53. <table align="right" border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse">
  54. <caption><strong>Mission crew</strong></caption>
  55. <thead>
  56. <tr>
  57. <th scope="col">Position</th>
  58. <th scope="col">Astronaut</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. <tr>
  63. <td>Commander</td>
  64. <td>Neil A. Armstrong</td>
  65. </tr>
  66. <tr>
  67. <td>Command Module Pilot</td>
  68. <td>Michael Collins</td>
  69. </tr>
  70. <tr>
  71. <td>Lunar Module Pilot</td>
  72. <td>Edwin &quot;Buzz&quot; E. Aldrin, Jr.</td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <p>Launched by a <strong>Saturn V</strong> rocket from <a href="http://en.wikipedia.org/wiki/Kennedy_Space_Center">Kennedy Space Center</a> in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>&#39;s Apollo program. The Apollo spacecraft had three parts:<p></p>
  77. <ol>
  78. <li><strong>Command Module</strong> with a cabin for the three astronauts which was the only part which landed back on Earth</li>
  79. <li><strong>Service Module</strong> which supported the Command Module with propulsion, electrical power, oxygen and water</li>
  80. <li><strong>Lunar Module</strong> for landing on the Moon.</li>
  81. </ol>
  82. <p>After being sent to the Moon by the Saturn V&#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the <a href="http://en.wikipedia.org/wiki/Mare_Tranquillitatis">Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href="http://en.wikipedia.org/wiki/Pacific_Ocean">Pacific Ocean</a> on July 24.<p></p>
  83. <hr />
  84. <p><small>Source: <a href="http://en.wikipedia.org/wiki/Apollo_11">Wikipedia.org</a></small><p></p>
  85. <p>&nbsp;<p></p>
  86. </textarea>
  87. <script>
  88. CKEDITOR.replace( 'editor1', {
  89. extraPlugins: 'textselection',
  90. });
  91. </script>
  92. </p>
  93. <p>
  94. <input type="submit" value="Submit">
  95. </p>
  96. </form>
  97. <div id="footer">
  98. <hr>
  99. <p>
  100. CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
  101. </p>
  102. <p id="copy">
  103. Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
  104. Knabben. All rights reserved.
  105. </p>
  106. </div>
  107. </body>
  108. </html>