You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

311 lines
9.8 KiB

  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.md or http://ckeditor.com/license
  5. -->
  6. <html>
  7. <head>
  8. <title>Massive inline editing &mdash; CKEditor Sample</title>
  9. <meta charset="utf-8">
  10. <script src="../ckeditor.js"></script>
  11. <script>
  12. // This code is generally not necessary, but it is here to demonstrate
  13. // how to customize specific editor instances on the fly. This fits well
  14. // this demo because we have editable elements (like headers) that
  15. // require less features.
  16. // The "instanceCreated" event is fired for every editor instance created.
  17. CKEDITOR.on( 'instanceCreated', function( event ) {
  18. var editor = event.editor,
  19. element = editor.element;
  20. // Customize editors for headers and tag list.
  21. // These editors don't need features like smileys, templates, iframes etc.
  22. if ( element.is( 'h1', 'h2', 'h3' ) || element.getAttribute( 'id' ) == 'taglist' ) {
  23. // Customize the editor configurations on "configLoaded" event,
  24. // which is fired after the configuration file loading and
  25. // execution. This makes it possible to change the
  26. // configurations before the editor initialization takes place.
  27. editor.on( 'configLoaded', function() {
  28. // Remove unnecessary plugins to make the editor simpler.
  29. editor.config.removePlugins = 'colorbutton,find,flash,font,' +
  30. 'forms,iframe,image,newpage,removeformat,' +
  31. 'smiley,specialchar,stylescombo,templates';
  32. // Rearrange the layout of the toolbar.
  33. editor.config.toolbarGroups = [
  34. { name: 'editing', groups: [ 'basicstyles', 'links' ] },
  35. { name: 'undo' },
  36. { name: 'clipboard', groups: [ 'selection', 'clipboard' ] },
  37. { name: 'about' }
  38. ];
  39. });
  40. }
  41. });
  42. </script>
  43. <link href="sample.css" rel="stylesheet">
  44. <style>
  45. /* The following styles are just to make the page look nice. */
  46. /* Workaround to show Arial Black in Firefox. */
  47. @font-face
  48. {
  49. font-family: 'arial-black';
  50. src: local('Arial Black');
  51. }
  52. *[contenteditable="true"]
  53. {
  54. padding: 10px;
  55. }
  56. #container
  57. {
  58. width: 960px;
  59. margin: 30px auto 0;
  60. }
  61. #header
  62. {
  63. overflow: hidden;
  64. padding: 0 0 30px;
  65. border-bottom: 5px solid #05B2D2;
  66. position: relative;
  67. }
  68. #headerLeft,
  69. #headerRight
  70. {
  71. width: 49%;
  72. overflow: hidden;
  73. }
  74. #headerLeft
  75. {
  76. float: left;
  77. padding: 10px 1px 1px;
  78. }
  79. #headerLeft h2,
  80. #headerLeft h3
  81. {
  82. text-align: right;
  83. margin: 0;
  84. overflow: hidden;
  85. font-weight: normal;
  86. }
  87. #headerLeft h2
  88. {
  89. font-family: "Arial Black",arial-black;
  90. font-size: 4.6em;
  91. line-height: 1.1em;
  92. text-transform: uppercase;
  93. }
  94. #headerLeft h3
  95. {
  96. font-size: 2.3em;
  97. line-height: 1.1em;
  98. margin: .2em 0 0;
  99. color: #666;
  100. }
  101. #headerRight
  102. {
  103. float: right;
  104. padding: 1px;
  105. }
  106. #headerRight p
  107. {
  108. line-height: 1.8em;
  109. text-align: justify;
  110. margin: 0;
  111. }
  112. #headerRight p + p
  113. {
  114. margin-top: 20px;
  115. }
  116. #headerRight > div
  117. {
  118. padding: 20px;
  119. margin: 0 0 0 30px;
  120. font-size: 1.4em;
  121. color: #666;
  122. }
  123. #columns
  124. {
  125. color: #333;
  126. overflow: hidden;
  127. padding: 20px 0;
  128. }
  129. #columns > div
  130. {
  131. float: left;
  132. width: 33.3%;
  133. }
  134. #columns #column1 > div
  135. {
  136. margin-left: 1px;
  137. }
  138. #columns #column3 > div
  139. {
  140. margin-right: 1px;
  141. }
  142. #columns > div > div
  143. {
  144. margin: 0px 10px;
  145. padding: 10px 20px;
  146. }
  147. #columns blockquote
  148. {
  149. margin-left: 15px;
  150. }
  151. #tagLine
  152. {
  153. border-top: 5px solid #05B2D2;
  154. padding-top: 20px;
  155. }
  156. #taglist {
  157. display: inline-block;
  158. margin-left: 20px;
  159. font-weight: bold;
  160. margin: 0 0 0 20px;
  161. }
  162. </style>
  163. </head>
  164. <body>
  165. <div>
  166. <h1 class="samples"><a href="index.html">CKEditor Samples</a> &raquo; Massive inline editing</h1>
  167. <div class="description">
  168. <p>This sample page demonstrates the inline editing feature - CKEditor instances will be created automatically from page elements with <strong>contentEditable</strong> attribute set to value <strong>true</strong>:</p>
  169. <pre class="samples">&lt;div <strong>contenteditable="true</strong>" &gt; ... &lt;/div&gt;</pre>
  170. <p>Click inside of any element below to start editing.</p>
  171. </div>
  172. </div>
  173. <div id="container">
  174. <div id="header">
  175. <div id="headerLeft">
  176. <h2 id="sampleTitle" contenteditable="true">
  177. CKEditor<br> Goes Inline!
  178. </h2>
  179. <h3 contenteditable="true">
  180. Lorem ipsum dolor sit amet dolor duis blandit vestibulum faucibus a, tortor.
  181. </h3>
  182. </div>
  183. <div id="headerRight">
  184. <div contenteditable="true">
  185. <p>
  186. Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies.
  187. </p>
  188. <p>
  189. Curabitur et ligula. Ut molestie a, ultricies porta urna. Vestibulum commodo volutpat a, convallis ac, laoreet enim. Phasellus fermentum in, dolor. Pellentesque facilisis. Nulla imperdiet sit amet magna. Vestibulum dapibus, mauris nec malesuada fames ac.
  190. </p>
  191. </div>
  192. </div>
  193. </div>
  194. <div id="columns">
  195. <div id="column1">
  196. <div contenteditable="true">
  197. <h3>
  198. Fusce vitae porttitor
  199. </h3>
  200. <p>
  201. <strong>
  202. Lorem ipsum dolor sit amet dolor. Duis blandit vestibulum faucibus a, tortor.
  203. </strong>
  204. </p>
  205. <p>
  206. Proin nunc justo felis mollis tincidunt, risus risus pede, posuere cubilia Curae, Nullam euismod, enim. Etiam nibh ultricies dolor ac dignissim erat volutpat. Vivamus fermentum <a href="http://ckeditor.com/">nisl nulla sem in</a> metus. Maecenas wisi. Donec nec erat volutpat.
  207. </p>
  208. <blockquote>
  209. <p>
  210. Fusce vitae porttitor a, euismod convallis nisl, blandit risus tortor, pretium.
  211. Vehicula vitae, imperdiet vel, ornare enim vel sodales rutrum
  212. </p>
  213. </blockquote>
  214. <blockquote>
  215. <p>
  216. Libero nunc, rhoncus ante ipsum non ipsum. Nunc eleifend pede turpis id sollicitudin fringilla. Phasellus ultrices, velit ac arcu.
  217. </p>
  218. </blockquote>
  219. <p>Pellentesque nunc. Donec suscipit erat. Pellentesque habitant morbi tristique ullamcorper.</p>
  220. <p><s>Mauris mattis feugiat lectus nec mauris. Nullam vitae ante.</s></p>
  221. </div>
  222. </div>
  223. <div id="column2">
  224. <div contenteditable="true">
  225. <h3>
  226. Integer condimentum sit amet
  227. </h3>
  228. <p>
  229. <strong>Aenean nonummy a, mattis varius. Cras aliquet.</strong>
  230. Praesent <a href="http://ckeditor.com/">magna non mattis ac, rhoncus nunc</a>, rhoncus eget, cursus pulvinar mollis.</p>
  231. <p>Proin id nibh. Sed eu libero posuere sed, lectus. Phasellus dui gravida gravida feugiat mattis ac, felis.</p>
  232. <p>Integer condimentum sit amet, tempor elit odio, a dolor non ante at sapien. Sed ac lectus. Nulla ligula quis eleifend mi, id leo velit pede cursus arcu id nulla ac lectus. Phasellus vestibulum. Nunc viverra enim quis diam.</p>
  233. </div>
  234. <div contenteditable="true">
  235. <h3>
  236. Praesent wisi accumsan sit amet nibh
  237. </h3>
  238. <p>Donec ullamcorper, risus tortor, pretium porttitor. Morbi quam quis lectus non leo.</p>
  239. <p style="margin-left: 40px; ">Integer faucibus scelerisque. Proin faucibus at, aliquet vulputate, odio at eros. Fusce <a href="http://ckeditor.com/">gravida, erat vitae augue</a>. Fusce urna fringilla gravida.</p>
  240. <p>In hac habitasse platea dictumst. Praesent wisi accumsan sit amet nibh. Maecenas orci luctus a, lacinia quam sem, posuere commodo, odio condimentum tempor, pede semper risus. Suspendisse pede. In hac habitasse platea dictumst. Nam sed laoreet sit amet erat. Integer.</p>
  241. </div>
  242. </div>
  243. <div id="column3">
  244. <div contenteditable="true">
  245. <p>
  246. <img src="assets/inlineall/logo.png" alt="CKEditor logo" style="float:left">
  247. </p>
  248. <p>Quisque justo neque, mattis sed, fermentum ultrices <strong>posuere cubilia Curae</strong>, Vestibulum elit metus, quis placerat ut, lectus. Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis. Fusce porttitor, nulla quis turpis. Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi. Donec odio nec velit ac nunc sit amet, accumsan cursus aliquet. Vestibulum ante sit amet sagittis mi.</p>
  249. <h3>
  250. Nullam laoreet vel consectetuer tellus suscipit
  251. </h3>
  252. <ul>
  253. <li>Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis.</li>
  254. <li>Fusce porttitor, nulla quis turpis. Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi.</li>
  255. <li>Mauris eget tellus. Donec non felis. Nam eget dolor. Vestibulum enim. Donec.</li>
  256. </ul>
  257. <p>Quisque justo neque, mattis sed, <a href="http://ckeditor.com/">fermentum ultrices posuere cubilia</a> Curae, Vestibulum elit metus, quis placerat ut, lectus.</p>
  258. <p>Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi. Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis. Fusce porttitor, nulla quis turpis.</p>
  259. <p>Donec odio nec velit ac nunc sit amet, accumsan cursus aliquet. Vestibulum ante sit amet sagittis mi. Sed in nonummy faucibus turpis. Mauris eget tellus. Donec non felis. Nam eget dolor. Vestibulum enim. Donec.</p>
  260. </div>
  261. </div>
  262. </div>
  263. <div id="tagLine">
  264. Tags of this article:
  265. <p id="taglist" contenteditable="true">
  266. inline, editing, floating, CKEditor
  267. </p>
  268. </div>
  269. </div>
  270. <div id="footer">
  271. <hr>
  272. <p>
  273. CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">
  274. http://ckeditor.com</a>
  275. </p>
  276. <p id="copy">
  277. Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a>
  278. - Frederico Knabben. All rights reserved.
  279. </p>
  280. </div>
  281. </body>
  282. </html>