tenon 1.0.76 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ckeditor/CHANGES.md +987 -0
  3. data/app/assets/javascripts/ckeditor/LICENSE.md +1420 -0
  4. data/app/assets/javascripts/ckeditor/README.md +39 -0
  5. data/app/assets/javascripts/ckeditor/adapters/jquery.js +10 -0
  6. data/app/assets/javascripts/ckeditor/build-config.js +74 -0
  7. data/app/assets/javascripts/ckeditor/ckeditor.js +820 -0
  8. data/app/assets/javascripts/ckeditor/config.js +38 -0
  9. data/app/assets/javascripts/ckeditor/contents.css +132 -0
  10. data/app/assets/javascripts/ckeditor/lang/en.js +5 -0
  11. data/app/assets/javascripts/ckeditor/lang/fr-ca.js +5 -0
  12. data/app/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
  13. data/app/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
  14. data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  15. data/app/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  16. data/app/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +7 -0
  17. data/app/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +26 -0
  18. data/app/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  19. data/app/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
  20. data/app/assets/javascripts/ckeditor/plugins/linktoasset/plugin.js +24 -0
  21. data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +32 -0
  22. data/app/assets/javascripts/ckeditor/plugins/sourcedialog/dialogs/sourcedialog.js +6 -0
  23. data/app/assets/javascripts/ckeditor/samples/css/samples.css +1640 -0
  24. data/app/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
  25. data/app/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
  26. data/app/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
  27. data/app/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  28. data/app/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
  29. data/app/assets/javascripts/ckeditor/samples/index.html +128 -0
  30. data/app/assets/javascripts/ckeditor/samples/js/sample.js +53 -0
  31. data/app/assets/javascripts/ckeditor/samples/js/sf.js +17 -0
  32. data/app/assets/javascripts/ckeditor/samples/old/ajax.html +85 -0
  33. data/app/assets/javascripts/ckeditor/samples/old/api.html +210 -0
  34. data/app/assets/javascripts/ckeditor/samples/old/appendto.html +59 -0
  35. data/app/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
  36. data/app/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
  37. data/app/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +59 -0
  38. data/app/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
  39. data/app/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
  40. data/app/assets/javascripts/ckeditor/samples/old/datafiltering.html +508 -0
  41. data/app/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
  42. data/app/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +190 -0
  43. data/app/assets/javascripts/ckeditor/samples/old/divreplace.html +144 -0
  44. data/app/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +106 -0
  45. data/app/assets/javascripts/ckeditor/samples/old/index.html +125 -0
  46. data/app/assets/javascripts/ckeditor/samples/old/inlineall.html +314 -0
  47. data/app/assets/javascripts/ckeditor/samples/old/inlinebycode.html +124 -0
  48. data/app/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +113 -0
  49. data/app/assets/javascripts/ckeditor/samples/old/jquery.html +103 -0
  50. data/app/assets/javascripts/ckeditor/samples/old/readonly.html +76 -0
  51. data/app/assets/javascripts/ckeditor/samples/old/replacebyclass.html +60 -0
  52. data/app/assets/javascripts/ckeditor/samples/old/replacebycode.html +59 -0
  53. data/app/assets/javascripts/ckeditor/samples/old/sample.css +357 -0
  54. data/app/assets/javascripts/ckeditor/samples/old/sample.js +50 -0
  55. data/app/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +16 -0
  56. data/app/assets/javascripts/ckeditor/samples/old/sourcedialog/sourcedialog.html +121 -0
  57. data/app/assets/javascripts/ckeditor/samples/old/tabindex.html +78 -0
  58. data/app/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +235 -0
  59. data/app/assets/javascripts/ckeditor/samples/old/uicolor.html +72 -0
  60. data/app/assets/javascripts/ckeditor/samples/old/uilanguages.html +122 -0
  61. data/app/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
  62. data/app/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +234 -0
  63. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
  64. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
  65. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
  66. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
  67. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
  68. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
  69. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
  70. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +446 -0
  71. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
  72. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
  73. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
  74. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
  75. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/LICENSE +19 -0
  76. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.css +325 -0
  77. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
  78. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
  79. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
  80. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css +38 -0
  81. data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
  82. data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog.css +5 -0
  83. data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_ie.css +5 -0
  84. data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_ie7.css +5 -0
  85. data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_ie8.css +5 -0
  86. data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_iequirks.css +5 -0
  87. data/app/assets/javascripts/ckeditor/skins/moono-dark/editor.css +7 -0
  88. data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_gecko.css +5 -0
  89. data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_ie.css +5 -0
  90. data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_ie7.css +5 -0
  91. data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_ie8.css +5 -0
  92. data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_iequirks.css +5 -0
  93. data/app/assets/javascripts/ckeditor/skins/moono-dark/icons.png +0 -0
  94. data/app/assets/javascripts/ckeditor/skins/moono-dark/icons_hidpi.png +0 -0
  95. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/arrow.png +0 -0
  96. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/close.png +0 -0
  97. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/close.png +0 -0
  98. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/lock-open.png +0 -0
  99. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/lock.png +0 -0
  100. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/refresh.png +0 -0
  101. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/lock-open.png +0 -0
  102. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/lock.png +0 -0
  103. data/app/assets/javascripts/ckeditor/skins/moono-dark/images/refresh.png +0 -0
  104. data/app/assets/javascripts/ckeditor/skins/moono-dark/readme.md +51 -0
  105. data/app/assets/javascripts/ckeditor/styles.js +111 -0
  106. data/app/assets/javascripts/tenon/features/editor.js.coffee +24 -0
  107. data/app/assets/javascripts/tenon/features/modal_windows.js.coffee +48 -21
  108. data/app/assets/javascripts/tenon/features/tenon_content/asset_link.js.coffee +9 -3
  109. data/app/assets/javascripts/tenon/features/tenon_content/editor.js.coffee +10 -3
  110. data/app/assets/javascripts/tenon/tenon.js +1 -2
  111. data/app/assets/javascripts/tenon/tenon_manifest.js +1 -1
  112. data/app/assets/stylesheets/tenon/{colors-custom.css.scss → colors-custom.scss} +0 -0
  113. data/app/assets/stylesheets/tenon/{colors-named.css.scss → colors-named.scss} +0 -0
  114. data/app/assets/stylesheets/tenon/{helpers.css.scss → helpers.scss} +0 -0
  115. data/app/assets/stylesheets/tenon/layout/{assets.css.scss → assets.scss} +0 -0
  116. data/app/assets/stylesheets/tenon/layout/{breakpoints.css.scss → breakpoints.scss} +0 -0
  117. data/app/assets/stylesheets/tenon/layout/{global.css.scss → global.scss} +0 -0
  118. data/app/assets/stylesheets/tenon/layout/{grid.css.scss → grid.scss} +0 -0
  119. data/app/assets/stylesheets/tenon/layout/{main-nav.css.scss → main-nav.scss} +0 -0
  120. data/app/assets/stylesheets/tenon/layout/{margins.css.scss → margins.scss} +0 -0
  121. data/app/assets/stylesheets/tenon/layout/{mobile.css.scss → mobile.scss} +0 -0
  122. data/app/assets/stylesheets/tenon/layout/{sidebar.css.scss → sidebar.scss} +0 -0
  123. data/app/assets/stylesheets/tenon/layout/{util-nav.css.scss → util-nav.scss} +0 -0
  124. data/app/assets/stylesheets/tenon/{mixins.css.scss → mixins.scss} +0 -0
  125. data/app/assets/stylesheets/tenon/{styleguide.css.scss → styleguide.scss} +0 -0
  126. data/app/assets/stylesheets/tenon/{tenon.css.scss → tenon.scss} +0 -0
  127. data/app/assets/stylesheets/tenon/{typography.css.scss → typography.scss} +0 -0
  128. data/app/assets/stylesheets/tenon/ui/{alerts.css.scss → alerts.scss} +0 -0
  129. data/app/assets/stylesheets/tenon/ui/{asset-attachment.css.scss → asset-attachment.scss} +0 -0
  130. data/app/assets/stylesheets/tenon/ui/{asset-cropping.css.scss → asset-cropping.scss} +0 -0
  131. data/app/assets/stylesheets/tenon/ui/{asset-uploads.css.scss → asset-uploads.scss} +0 -0
  132. data/app/assets/stylesheets/tenon/ui/{buttons.css.scss → buttons.scss} +0 -0
  133. data/app/assets/stylesheets/tenon/ui/{callouts.css.scss → callouts.scss} +0 -0
  134. data/app/assets/stylesheets/tenon/ui/{comments.css.scss → comments.scss} +0 -0
  135. data/app/assets/stylesheets/tenon/ui/{forms.css.scss → forms.scss} +16 -0
  136. data/app/assets/stylesheets/tenon/ui/{generic-loader.css.scss → generic-loader.scss} +0 -0
  137. data/app/assets/stylesheets/tenon/ui/{header-tools.css.scss → header-tools.scss} +0 -0
  138. data/app/assets/stylesheets/tenon/ui/{i18n.css.scss → i18n.scss} +0 -0
  139. data/app/assets/stylesheets/tenon/ui/{list-style-toggle.css.scss → list-style-toggle.scss} +0 -0
  140. data/app/assets/stylesheets/tenon/ui/{login.css.scss → login.scss} +0 -0
  141. data/app/assets/stylesheets/tenon/ui/{medium-editor.css.scss → medium-editor.scss} +0 -0
  142. data/app/assets/stylesheets/tenon/ui/{modals.css.scss → modals.scss} +0 -0
  143. data/app/assets/stylesheets/tenon/ui/{pagination.css.scss → pagination.scss} +0 -0
  144. data/app/assets/stylesheets/tenon/ui/{progress-bars.css.scss → progress-bars.scss} +0 -0
  145. data/app/assets/stylesheets/tenon/ui/{quick-search.css.scss → quick-search.scss} +0 -0
  146. data/app/assets/stylesheets/tenon/ui/{record-grids.css.scss → record-grids.scss} +0 -0
  147. data/app/assets/stylesheets/tenon/ui/{record-lists.css.scss → record-lists.scss} +0 -0
  148. data/app/assets/stylesheets/tenon/ui/{section-headers.css.scss → section-headers.scss} +0 -0
  149. data/app/assets/stylesheets/tenon/ui/{select2-custom.css.scss → select2-custom.scss} +0 -0
  150. data/app/assets/stylesheets/tenon/ui/{tables.css.scss → tables.scss} +0 -0
  151. data/app/assets/stylesheets/tenon/ui/{tabs.css.scss → tabs.scss} +0 -0
  152. data/app/assets/stylesheets/tenon/ui/{tenon-content-library.css.scss → tenon-content-library.scss} +0 -0
  153. data/app/assets/stylesheets/tenon/ui/{tenon-content-popped-out.css.scss → tenon-content-popped-out.scss} +0 -0
  154. data/app/assets/stylesheets/tenon/ui/{tenon-content.css.scss → tenon-content.scss} +0 -15
  155. data/app/assets/stylesheets/tenon/ui/{thinking.css.scss → thinking.scss} +0 -0
  156. data/app/assets/stylesheets/tenon/ui/{toolbox.css.scss → toolbox.scss} +0 -0
  157. data/app/assets/stylesheets/tenon/{z-indexes.css.scss → z-indexes.scss} +0 -0
  158. data/app/assets/stylesheets/{tenon_addons.css.scss → tenon_addons.scss} +0 -0
  159. data/app/form_builders/tenon/form_builder.rb +39 -19
  160. data/app/models/tenon/page.rb +6 -0
  161. data/app/views/tenon/fields/_asset.html.haml +32 -0
  162. data/app/views/tenon/fields/_rich_text.html.haml +8 -0
  163. data/app/views/tenon/galleries/_photo_fields.html.haml +2 -2
  164. data/app/views/tenon/posts/_form.html.haml +2 -5
  165. data/app/views/tenon/tenon_content/_row.html.haml +2 -2
  166. data/app/views/tenon/tenon_content/piece_types/form/_text.html.haml +2 -3
  167. data/lib/generators/tenon/scaffold/templates/view__form.html.haml +1 -1
  168. data/lib/tenon/version.rb +1 -1
  169. data/spec/controllers/tenon/pages_controller_spec.rb +1 -1
  170. data/vendor/assets/stylesheets/{bootstrap.css.scss → bootstrap.scss} +0 -0
  171. data/vendor/assets/stylesheets/{bootstrap.tables.css.scss → bootstrap.tables.scss} +0 -0
  172. data/vendor/assets/stylesheets/{jscrollpane.css.scss → jscrollpane.scss} +0 -0
  173. metadata +168 -63
  174. data/app/assets/javascripts/tenon/features/medium.js.coffee +0 -13
  175. data/app/views/tenon/shared/_asset_field.html.haml +0 -29
@@ -0,0 +1,128 @@
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>CKEditor Sample</title>
10
+ <script src="../ckeditor.js"></script>
11
+ <script src="js/sample.js"></script>
12
+ <link rel="stylesheet" href="css/samples.css">
13
+ <link rel="stylesheet" href="toolbarconfigurator/lib/codemirror/neo.css">
14
+ </head>
15
+ <body id="main">
16
+
17
+ <nav class="navigation-a">
18
+ <div class="grid-container">
19
+ <ul class="navigation-a-left grid-width-70">
20
+ <li><a href="http://ckeditor.com">Project Homepage</a></li>
21
+ <li><a href="http://dev.ckeditor.com/">I found a bug</a></li>
22
+ <li><a href="http://github.com/ckeditor/ckeditor-dev" class="icon-pos-right icon-navigation-a-github">Fork CKEditor on GitHub</a></li>
23
+ </ul>
24
+ <ul class="navigation-a-right grid-width-30">
25
+ <li><a href="http://ckeditor.com/blog-list">CKEditor Blog</a></li>
26
+ </ul>
27
+ </div>
28
+ </nav>
29
+
30
+ <header class="header-a">
31
+ <div class="grid-container">
32
+ <h1 class="header-a-logo grid-width-30">
33
+ <a href="index.html"><img src="img/logo.png" alt="CKEditor Sample"></a>
34
+ </h1>
35
+
36
+ <nav class="navigation-b grid-width-70">
37
+ <ul>
38
+ <li><a href="index.html" class="button-a button-a-background">Start</a></li>
39
+ <li><a href="toolbarconfigurator/index.html" class="button-a">Toolbar configurator <span class="balloon-a balloon-a-nw">Edit your toolbar now!</span></a></li>
40
+ </ul>
41
+ </nav>
42
+ </div>
43
+ </header>
44
+
45
+ <main>
46
+ <div class="adjoined-top">
47
+ <div class="grid-container">
48
+ <div class="content grid-width-100">
49
+ <h1>Congratulations!</h1>
50
+ <p>
51
+ If you can see CKEditor below, it means that the installation succeeded.
52
+ You can now try out your new editor version, see its features, and when you are ready to move on, check some of the <a href="#sample-customize">most useful resources</a> recommended below.
53
+ </p>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ <div class="adjoined-bottom">
58
+ <div class="grid-container">
59
+ <div class="grid-width-100">
60
+ <div id="editor">
61
+ <h1>Hello world!</h1>
62
+ <p>I'm an instance of <a href="http://ckeditor.com">CKEditor</a>.</p>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+
68
+ <div class="grid-container">
69
+ <div class="content grid-width-100">
70
+ <section id="sample-customize">
71
+ <h2>Customize Your Editor</h2>
72
+ <p>Modular build and <a href="http://docs.ckeditor.com/#!/guide/dev_configuration">numerous configuration options</a> give you nearly endless possibilities to customize CKEditor. Replace the content of your <code><a href="../config.js">config.js</a></code> file with the following code and refresh this page (<strong>remember to clear the browser cache</strong>)!</p>
73
+ <pre class="cm-s-neo CodeMirror"><code><span style="padding-right: 0.1px;"><span class="cm-variable">CKEDITOR</span>.<span class="cm-property">editorConfig</span> <span class="cm-operator">=</span> <span class="cm-keyword">function</span>( <span class="cm-def">config</span> ) {</span>
74
+ <span style="padding-right: 0.1px;"><span class="cm-tab"> </span><span class="cm-variable-2">config</span>.<span class="cm-property">language</span> <span class="cm-operator">=</span> <span class="cm-string">'es'</span>;</span>
75
+ <span style="padding-right: 0.1px;"><span class="cm-tab"> </span><span class="cm-variable-2">config</span>.<span class="cm-property">uiColor</span> <span class="cm-operator">=</span> <span class="cm-string">'#F7B42C'</span>;</span>
76
+ <span style="padding-right: 0.1px;"><span class="cm-tab"> </span><span class="cm-variable-2">config</span>.<span class="cm-property">height</span> <span class="cm-operator">=</span> <span class="cm-number">300</span>;</span>
77
+ <span style="padding-right: 0.1px;"><span class="cm-tab"> </span><span class="cm-variable-2">config</span>.<span class="cm-property">toolbarCanCollapse</span> <span class="cm-operator">=</span> <span class="cm-atom">true</span>;</span>
78
+ <span style="padding-right: 0.1px;">};</span></code></pre>
79
+ </section>
80
+
81
+ <section>
82
+ <h2>Toolbar Configuration</h2>
83
+ <p>If you want to reorder toolbar buttons or remove some of them, check <a href="toolbarconfigurator/index.html">this handy tool</a>!</p>
84
+ </section>
85
+
86
+ <section>
87
+ <h2>More Samples!</h2>
88
+ <p>Visit the <a href="http://sdk.ckeditor.com">CKEditor SDK</a> for a huge collection of samples showcasing editor features, with source code readily available to copy and use in your own implementation.</p>
89
+ </section>
90
+
91
+ <section>
92
+ <h2>Developer's Guide</h2>
93
+ <p>The most important resource for all developers working with CKEditor, integrating it with their websites and applications, and customizing to their needs. You can start from here:</p>
94
+ <ul>
95
+ <li><a href="http://docs.ckeditor.com/#!/guide/dev_installation">Getting Started</a> &ndash; Explains most crucial editor concepts and practices as well as the installation process and integration with your website.</li>
96
+ <li><a href="http://docs.ckeditor.com/#!/guide/dev_advanced_installation">Advanced Installation Concepts</a> &ndash; Describes how to upgrade, install additional components (plugins, skins), or create a custom build.</li>
97
+ </ul>
98
+ <p>When you have the basics sorted out, feel free to browse some more advanced sections like:</p>
99
+ <ul>
100
+ <li><a href="http://docs.ckeditor.com/#!/guide/dev_features">Functionality Overview</a> &ndash; Descriptions and samples of various editor features.</li>
101
+ <li><a href="http://docs.ckeditor.com/#!/guide/plugin_sdk_intro">Plugin SDK</a>, <a href="http://docs.ckeditor.com/#!/guide/widget_sdk_intro">Widget SDK</a>, and <a href="http://docs.ckeditor.com/#!/guide/skin_sdk_intro">Skin SDK</a> &ndash; Useful when you want to create your own editor components.</li>
102
+ </ul>
103
+ </section>
104
+
105
+ <section>
106
+ <h2>CKEditor JavaScript API</h2>
107
+ <p>CKEditor boasts a rich <a href="http://docs.ckeditor.com/#!/api">JavaScript API</a> that you can use to adjust the editor to your needs and integrate it with your website or application.</p>
108
+ </section>
109
+ </div>
110
+ </div>
111
+ </main>
112
+
113
+ <footer class="footer-a grid-container">
114
+ <div class="grid-container">
115
+ <p class="grid-width-100">
116
+ CKEditor &ndash; The text editor for the Internet &ndash; <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
117
+ </p>
118
+ <p class="grid-width-100" id="copy">
119
+ Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> &ndash; Frederico Knabben. All rights reserved.
120
+ </p>
121
+ </div>
122
+ </footer>
123
+ <script>
124
+ initSample();
125
+ </script>
126
+
127
+ </body>
128
+ </html>
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+
6
+ /* exported initSample */
7
+
8
+ if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
9
+ CKEDITOR.tools.enableHtml5Elements( document );
10
+
11
+ // The trick to keep the editor in the sample quite small
12
+ // unless user specified own height.
13
+ CKEDITOR.config.height = 150;
14
+ CKEDITOR.config.width = 'auto';
15
+
16
+ var initSample = ( function() {
17
+ var wysiwygareaAvailable = isWysiwygareaAvailable(),
18
+ isBBCodeBuiltIn = !!CKEDITOR.plugins.get( 'bbcode' );
19
+
20
+ return function() {
21
+ var editorElement = CKEDITOR.document.getById( 'editor' );
22
+
23
+ // :(((
24
+ if ( isBBCodeBuiltIn ) {
25
+ editorElement.setHtml(
26
+ 'Hello world!\n\n' +
27
+ 'I\'m an instance of [url=http://ckeditor.com]CKEditor[/url].'
28
+ );
29
+ }
30
+
31
+ // Depending on the wysiwygare plugin availability initialize classic or inline editor.
32
+ if ( wysiwygareaAvailable ) {
33
+ CKEDITOR.replace( 'editor' );
34
+ } else {
35
+ editorElement.setAttribute( 'contenteditable', 'true' );
36
+ CKEDITOR.inline( 'editor' );
37
+
38
+ // TODO we can consider displaying some info box that
39
+ // without wysiwygarea the classic editor may not work.
40
+ }
41
+ };
42
+
43
+ function isWysiwygareaAvailable() {
44
+ // If in development mode, then the wysiwygarea must be available.
45
+ // Split REV into two strings so builder does not replace it :D.
46
+ if ( CKEDITOR.revision == ( '%RE' + 'V%' ) ) {
47
+ return true;
48
+ }
49
+
50
+ return !!CKEDITOR.plugins.get( 'wysiwygarea' );
51
+ }
52
+ } )();
53
+
@@ -0,0 +1,17 @@
1
+ /*
2
+ Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+ var SF=function(){function d(a){return(a=a.attributes?a.attributes.getNamedItem("class"):null)?a.value.split(" "):[]}function c(a){var e=document.createAttribute("class");e.value=a.join(" ");return e}var b={attachListener:function(a,e,b){if(a.addEventListener)a.addEventListener(e,b,!1);else if(a.attachEvent)a.attachEvent("on"+e,function(){b.apply(a,arguments)});else throw Error("Could not attach event.");}};b.indexOf=function(){var a=Array.prototype.indexOf;return"function"===a?function(e,b){return a.call(e,
6
+ b)}:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]===b)return d;return-1}}();b.accept=function(a,e){var c;a.children?(c=a.children,e(a)):"number"===typeof a.length&&(c=a);for(var d=c?c.length||0:0;d--;)b.accept(c[d],e)};b.getByClass=function(){var a=document.getElementsByClassName;return"function"===typeof a?function(e,b){"string"===typeof e&&(b=e,e=document);return a.call(e,b)}:function(a,c){"string"===typeof a&&(c=a,a=document.getElementsByTagName("html")[0]);var d=[];b.accept(a,function(a){b.classList.contains(a,
7
+ c)&&d.push(a)});return d}}();b.classList={};b.classList.add=function(a,b){var f=d(a);f.push(b);a.attributes.setNamedItem(c(f))};b.classList.remove=function(a,e){var f=d(a,e),n=b.indexOf(f,e);-1!==n&&(f.splice(n,1),a.attributes.setNamedItem(c(f)))};b.classList.contains=function(a,c){return-1!==b.indexOf(d(a),c)};b.classList.toggle=function(a,b){this.contains(a,b)?this.remove(a,b):this.add(a,b)};return b}();"use strict";
8
+ (function(){function d(c){for(var b in c)delete c[b]}SF.modal=function(c){function b(a){27==a.keyCode&&f.close()}c.modalClass="modal content";c.closeClass="modal-close";c.modalStyles=d;c.closeStyles=d;var a=c.afterCreate,e=c.afterClose;c.afterCreate=function(c){a&&a(c);window.addEventListener("keydown",b)};c.afterClose=function(a){e&&e(a);window.removeEventListener("keydown",b)};var f=(new picoModal(c)).afterCreate(c.afterCreate).afterClose(c.afterClose);return f}})();"use strict";
9
+ (function(){for(var d=SF.getByClass("toggler"),c=d.length;c--;)SF.attachListener(d[c],"click",function(){var b=SF.classList.contains(this,"icon-toggler-expanded")||SF.classList.contains(this,"icon-toggler-collapsed"),a=document.getElementById(this.getAttribute("data-for"));SF.classList.toggle(this,"collapsed");SF.classList.contains(this,"collapsed")?(SF.classList.add(a,"collapsed"),b&&(SF.classList.remove(this,"icon-toggler-expanded"),SF.classList.add(this,"icon-toggler-collapsed"))):(SF.classList.remove(a,
10
+ "collapsed"),b&&(SF.classList.remove(this,"icon-toggler-collapsed"),SF.classList.add(this,"icon-toggler-expanded")))})})();"use strict";(function(){for(var d=SF.getByClass("tree-a"),c=d.length;c--;)SF.attachListener(d[c],"click",function(b){b=b.target||b.srcElement;"H2"!==b.nodeName||SF.classList.contains(b,"tree-a-no-sub")||SF.classList.toggle(b,"tree-a-active")})})();
11
+ (function(d,c){function b(a){return"object"===typeof Node?a instanceof Node:a&&"object"===typeof a&&"number"===typeof a.nodeType}function a(){var a=[];return{watch:a.push.bind(a),trigger:function(b){for(var c=!0,d={preventDefault:function(){c=!1}},e=0;e<a.length;e++)a[e](b,d);return c}}}function e(a){this.elem=a}function f(a,b){return e.div().clazz("pico-overlay").clazz(a("overlayClass","")).stylize({display:"block",position:"fixed",top:"0px",left:"0px",height:"100%",width:"100%",zIndex:1E4}).stylize(a("overlayStyles",
12
+ {opacity:.5,background:"#000"})).onClick(function(){a("overlayClose",!0)&&b()})}function n(a,b){var c=a("width","auto");"number"===typeof c&&(c=""+c+"px");return e.div().clazz("pico-content").clazz(a("modalClass","")).stylize({display:"block",position:"fixed",zIndex:10001,left:"50%",top:"50px",width:c,"-ms-transform":"translateX(-50%)","-moz-transform":"translateX(-50%)","-webkit-transform":"translateX(-50%)","-o-transform":"translateX(-50%)",transform:"translateX(-50%)"}).stylize(a("modalStyles",
13
+ {backgroundColor:"white",padding:"20px",borderRadius:"5px"})).html(a("content")).attr("role","dialog").onClick(function(a){(new e(a.target)).anyAncestor(function(a){return/\bpico-close\b/.test(a.elem.className)})&&b()})}function p(a){return function(){return a().elem}}function k(c){function e(a,b){var d=c[a];"function"===typeof d&&(d=d(b));return void 0===d?b:d}function k(){l().hide();m().hide();v.trigger(h)}function q(){w.trigger(h)&&k()}function g(a){return function(){a.apply(this,arguments);return h}}
14
+ function r(a){if(!t){var c=n(e,q),b=f(e,q),d;d=e("closeButton",!0)?c.child().html(e("closeHtml","\x26#xD7;")).clazz("pico-close").clazz(e("closeClass")).stylize(e("closeStyles",{borderRadius:"2px",cursor:"pointer",height:"15px",width:"15px",position:"absolute",top:"5px",right:"5px",fontSize:"16px",textAlign:"center",lineHeight:"15px",background:"#CCC"})):void 0;t={modal:c,overlay:b,close:d};x.trigger(h)}return t[a]}if("string"===typeof c||b(c))c={content:c};var x=a(),y=a(),z=a(),w=a(),v=a(),t,m=r.bind(d,
15
+ "modal"),l=r.bind(d,"overlay"),u=r.bind(d,"close"),h={modalElem:p(m),closeElem:p(u),overlayElem:p(l),show:function(){y.trigger(h)&&(l().show(),u(),m().show(),z.trigger(h));return this},close:g(q),forceClose:g(k),destroy:function(){m=m().destroy();l=l().destroy();u=void 0},options:function(a){c=a},afterCreate:g(x.watch),beforeShow:g(y.watch),afterShow:g(z.watch),beforeClose:g(w.watch),afterClose:g(v.watch)};return h}e.div=function(a){var b=c.createElement("div");(a||c.body).appendChild(b);return new e(b)};
16
+ e.prototype={child:function(){return e.div(this.elem)},stylize:function(a){a=a||{};"undefined"!==typeof a.opacity&&(a.filter="alpha(opacity\x3d"+100*a.opacity+")");for(var b in a)a.hasOwnProperty(b)&&(this.elem.style[b]=a[b]);return this},clazz:function(a){this.elem.className+=" "+a;return this},html:function(a){b(a)?this.elem.appendChild(a):this.elem.innerHTML=a;return this},onClick:function(a){this.elem.addEventListener("click",a);return this},destroy:function(){c.body.removeChild(this.elem)},hide:function(){this.elem.style.display=
17
+ "none"},show:function(){this.elem.style.display="block"},attr:function(a,b){this.elem.setAttribute(a,b);return this},anyAncestor:function(a){for(var b=this.elem;b;){if(a(new e(b)))return!0;b=b.parentNode}return!1}};"function"===typeof d.define&&d.define.amd?d.define(function(){return k}):d.picoModal=k})(window,document);
@@ -0,0 +1,85 @@
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>Ajax &mdash; CKEditor Sample</title>
10
+ <script src="../../ckeditor.js"></script>
11
+ <link rel="stylesheet" href="sample.css">
12
+ <script>
13
+
14
+ var editor, html = '';
15
+
16
+ function createEditor() {
17
+ if ( editor )
18
+ return;
19
+
20
+ // Create a new editor inside the <div id="editor">, setting its value to html
21
+ var config = {};
22
+ editor = CKEDITOR.appendTo( 'editor', config, html );
23
+ }
24
+
25
+ function removeEditor() {
26
+ if ( !editor )
27
+ return;
28
+
29
+ // Retrieve the editor contents. In an Ajax application, this data would be
30
+ // sent to the server or used in any other way.
31
+ document.getElementById( 'editorcontents' ).innerHTML = html = editor.getData();
32
+ document.getElementById( 'contents' ).style.display = '';
33
+
34
+ // Destroy the editor.
35
+ editor.destroy();
36
+ editor = null;
37
+ }
38
+
39
+ </script>
40
+ </head>
41
+ <body>
42
+ <h1 class="samples">
43
+ <a href="index.html">CKEditor Samples</a> &raquo; Create and Destroy Editor Instances for Ajax Applications
44
+ </h1>
45
+ <div class="warning deprecated">
46
+ This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/saveajax.html">brand new version in CKEditor SDK</a>.
47
+ </div>
48
+ <div class="description">
49
+ <p>
50
+ This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
51
+ area will be displayed in a <code>&lt;div&gt;</code> element.
52
+ </p>
53
+ <p>
54
+ For details of how to create this setup check the source code of this sample page
55
+ for JavaScript code responsible for the creation and destruction of a CKEditor instance.
56
+ </p>
57
+ </div>
58
+ <p>Click the buttons to create and remove a CKEditor instance.</p>
59
+ <p>
60
+ <input onclick="createEditor();" type="button" value="Create Editor">
61
+ <input onclick="removeEditor();" type="button" value="Remove Editor">
62
+ </p>
63
+ <!-- This div will hold the editor. -->
64
+ <div id="editor">
65
+ </div>
66
+ <div id="contents" style="display: none">
67
+ <p>
68
+ Edited Contents:
69
+ </p>
70
+ <!-- This div will be used to display the editor contents. -->
71
+ <div id="editorcontents">
72
+ </div>
73
+ </div>
74
+ <div id="footer">
75
+ <hr>
76
+ <p>
77
+ CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
78
+ </p>
79
+ <p id="copy">
80
+ Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
81
+ Knabben. All rights reserved.
82
+ </p>
83
+ </div>
84
+ </body>
85
+ </html>
@@ -0,0 +1,210 @@
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>API Usage &mdash; CKEditor Sample</title>
10
+ <script src="../../ckeditor.js"></script>
11
+ <link href="sample.css" rel="stylesheet">
12
+ <script>
13
+
14
+ // The instanceReady event is fired, when an instance of CKEditor has finished
15
+ // its initialization.
16
+ CKEDITOR.on( 'instanceReady', function( ev ) {
17
+ // Show the editor name and description in the browser status bar.
18
+ document.getElementById( 'eMessage' ).innerHTML = 'Instance <code>' + ev.editor.name + '<\/code> loaded.';
19
+
20
+ // Show this sample buttons.
21
+ document.getElementById( 'eButtons' ).style.display = 'block';
22
+ });
23
+
24
+ function InsertHTML() {
25
+ // Get the editor instance that we want to interact with.
26
+ var editor = CKEDITOR.instances.editor1;
27
+ var value = document.getElementById( 'htmlArea' ).value;
28
+
29
+ // Check the active editing mode.
30
+ if ( editor.mode == 'wysiwyg' )
31
+ {
32
+ // Insert HTML code.
33
+ // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertHtml
34
+ editor.insertHtml( value );
35
+ }
36
+ else
37
+ alert( 'You must be in WYSIWYG mode!' );
38
+ }
39
+
40
+ function InsertText() {
41
+ // Get the editor instance that we want to interact with.
42
+ var editor = CKEDITOR.instances.editor1;
43
+ var value = document.getElementById( 'txtArea' ).value;
44
+
45
+ // Check the active editing mode.
46
+ if ( editor.mode == 'wysiwyg' )
47
+ {
48
+ // Insert as plain text.
49
+ // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertText
50
+ editor.insertText( value );
51
+ }
52
+ else
53
+ alert( 'You must be in WYSIWYG mode!' );
54
+ }
55
+
56
+ function SetContents() {
57
+ // Get the editor instance that we want to interact with.
58
+ var editor = CKEDITOR.instances.editor1;
59
+ var value = document.getElementById( 'htmlArea' ).value;
60
+
61
+ // Set editor contents (replace current contents).
62
+ // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setData
63
+ editor.setData( value );
64
+ }
65
+
66
+ function GetContents() {
67
+ // Get the editor instance that you want to interact with.
68
+ var editor = CKEDITOR.instances.editor1;
69
+
70
+ // Get editor contents
71
+ // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData
72
+ alert( editor.getData() );
73
+ }
74
+
75
+ function ExecuteCommand( commandName ) {
76
+ // Get the editor instance that we want to interact with.
77
+ var editor = CKEDITOR.instances.editor1;
78
+
79
+ // Check the active editing mode.
80
+ if ( editor.mode == 'wysiwyg' )
81
+ {
82
+ // Execute the command.
83
+ // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-execCommand
84
+ editor.execCommand( commandName );
85
+ }
86
+ else
87
+ alert( 'You must be in WYSIWYG mode!' );
88
+ }
89
+
90
+ function CheckDirty() {
91
+ // Get the editor instance that we want to interact with.
92
+ var editor = CKEDITOR.instances.editor1;
93
+ // Checks whether the current editor contents present changes when compared
94
+ // to the contents loaded into the editor at startup
95
+ // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-checkDirty
96
+ alert( editor.checkDirty() );
97
+ }
98
+
99
+ function ResetDirty() {
100
+ // Get the editor instance that we want to interact with.
101
+ var editor = CKEDITOR.instances.editor1;
102
+ // Resets the "dirty state" of the editor (see CheckDirty())
103
+ // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-resetDirty
104
+ editor.resetDirty();
105
+ alert( 'The "IsDirty" status has been reset' );
106
+ }
107
+
108
+ function Focus() {
109
+ CKEDITOR.instances.editor1.focus();
110
+ }
111
+
112
+ function onFocus() {
113
+ document.getElementById( 'eMessage' ).innerHTML = '<b>' + this.name + ' is focused </b>';
114
+ }
115
+
116
+ function onBlur() {
117
+ document.getElementById( 'eMessage' ).innerHTML = this.name + ' lost focus';
118
+ }
119
+
120
+ </script>
121
+
122
+ </head>
123
+ <body>
124
+ <h1 class="samples">
125
+ <a href="index.html">CKEditor Samples</a> &raquo; Using CKEditor JavaScript API
126
+ </h1>
127
+ <div class="warning deprecated">
128
+ This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/api.html">brand new version in CKEditor SDK</a>.
129
+ </div>
130
+ <div class="description">
131
+ <p>
132
+ This sample shows how to use the
133
+ <a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor">CKEditor JavaScript API</a>
134
+ to interact with the editor at runtime.
135
+ </p>
136
+ <p>
137
+ For details on how to create this setup check the source code of this sample page.
138
+ </p>
139
+ </div>
140
+
141
+ <!-- This <div> holds alert messages to be display in the sample page. -->
142
+ <div id="alerts">
143
+ <noscript>
144
+ <p>
145
+ <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
146
+ support, like yours, you should still see the contents (HTML data) and you should
147
+ be able to edit it normally, without a rich editor interface.
148
+ </p>
149
+ </noscript>
150
+ </div>
151
+ <form action="../../../samples/sample_posteddata.php" method="post">
152
+ <textarea cols="100" 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>
153
+
154
+ <script>
155
+ // Replace the <textarea id="editor1"> with an CKEditor instance.
156
+ CKEDITOR.replace( 'editor1', {
157
+ on: {
158
+ focus: onFocus,
159
+ blur: onBlur,
160
+
161
+ // Check for availability of corresponding plugins.
162
+ pluginsLoaded: function( evt ) {
163
+ var doc = CKEDITOR.document, ed = evt.editor;
164
+ if ( !ed.getCommand( 'bold' ) )
165
+ doc.getById( 'exec-bold' ).hide();
166
+ if ( !ed.getCommand( 'link' ) )
167
+ doc.getById( 'exec-link' ).hide();
168
+ }
169
+ }
170
+ });
171
+ </script>
172
+
173
+ <p id="eMessage">
174
+ </p>
175
+
176
+ <div id="eButtons" style="display: none">
177
+ <input id="exec-bold" onclick="ExecuteCommand('bold');" type="button" value="Execute &quot;bold&quot; Command">
178
+ <input id="exec-link" onclick="ExecuteCommand('link');" type="button" value="Execute &quot;link&quot; Command">
179
+ <input onclick="Focus();" type="button" value="Focus">
180
+ <br><br>
181
+ <input onclick="InsertHTML();" type="button" value="Insert HTML">
182
+ <input onclick="SetContents();" type="button" value="Set Editor Contents">
183
+ <input onclick="GetContents();" type="button" value="Get Editor Contents (HTML)">
184
+ <br>
185
+ <textarea cols="100" id="htmlArea" rows="3">&lt;h2&gt;Test&lt;/h2&gt;&lt;p&gt;This is some &lt;a href="/Test1.html"&gt;sample&lt;/a&gt; HTML code.&lt;/p&gt;</textarea>
186
+ <br>
187
+ <br>
188
+ <input onclick="InsertText();" type="button" value="Insert Text">
189
+ <br>
190
+ <textarea cols="100" id="txtArea" rows="3"> First line with some leading whitespaces.
191
+
192
+ Second line of text preceded by two line breaks.</textarea>
193
+ <br>
194
+ <br>
195
+ <input onclick="CheckDirty();" type="button" value="checkDirty()">
196
+ <input onclick="ResetDirty();" type="button" value="resetDirty()">
197
+ </div>
198
+ </form>
199
+ <div id="footer">
200
+ <hr>
201
+ <p>
202
+ CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
203
+ </p>
204
+ <p id="copy">
205
+ Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
206
+ Knabben. All rights reserved.
207
+ </p>
208
+ </div>
209
+ </body>
210
+ </html>