geri 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +26 -0
- data/app/assets/javascripts/geri/admin.js +33 -0
- data/app/assets/javascripts/geri/admin/app.js +758 -0
- data/app/assets/javascripts/geri/admin/editor.js +56 -0
- data/app/assets/javascripts/geri/admin/password_resets.js +2 -0
- data/app/assets/stylesheets/geri/admin.css.less +60 -0
- data/app/assets/stylesheets/geri/admin/app.css +4915 -0
- data/app/assets/stylesheets/geri/admin/ckeditor/contents.css +135 -0
- data/app/assets/stylesheets/geri/admin/editor.css.less +38 -0
- data/app/assets/stylesheets/geri/admin/password_resets.css +4 -0
- data/app/assets/stylesheets/geri/admin/skin-blue.less +142 -0
- data/app/assets/vendor/ckeditor/CHANGES.md +1065 -0
- data/app/assets/vendor/ckeditor/LICENSE.md +1420 -0
- data/app/assets/vendor/ckeditor/README.md +39 -0
- data/app/assets/vendor/ckeditor/adapters/jquery.js +10 -0
- data/app/assets/vendor/ckeditor/build-config.js +69 -0
- data/app/assets/vendor/ckeditor/ckeditor.js +775 -0
- data/app/assets/vendor/ckeditor/config.js +34 -0
- data/app/assets/vendor/ckeditor/contents.css +135 -0
- data/app/assets/vendor/ckeditor/lang/en.js +5 -0
- data/app/assets/vendor/ckeditor/plugins/about/dialogs/about.js +7 -0
- data/app/assets/vendor/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/clipboard/dialogs/paste.js +12 -0
- data/app/assets/vendor/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/app/assets/vendor/ckeditor/plugins/icons.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/icons_hidpi.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/link/dialogs/anchor.js +7 -0
- data/app/assets/vendor/ckeditor/plugins/link/dialogs/link.js +26 -0
- data/app/assets/vendor/ckeditor/plugins/link/images/anchor.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- data/app/assets/vendor/ckeditor/samples/css/samples.css +1640 -0
- data/app/assets/vendor/ckeditor/samples/img/github-top.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/header-bg.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/header-separator.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/logo.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/navigation-tip.png +0 -0
- data/app/assets/vendor/ckeditor/samples/index.html +128 -0
- data/app/assets/vendor/ckeditor/samples/js/sample.js +53 -0
- data/app/assets/vendor/ckeditor/samples/js/sf.js +17 -0
- data/app/assets/vendor/ckeditor/samples/old/ajax.html +85 -0
- data/app/assets/vendor/ckeditor/samples/old/api.html +210 -0
- data/app/assets/vendor/ckeditor/samples/old/appendto.html +59 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/posteddata.php +59 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/sample.jpg +0 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
- data/app/assets/vendor/ckeditor/samples/old/datafiltering.html +508 -0
- data/app/assets/vendor/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
- data/app/assets/vendor/ckeditor/samples/old/dialog/dialog.html +190 -0
- data/app/assets/vendor/ckeditor/samples/old/divreplace.html +144 -0
- data/app/assets/vendor/ckeditor/samples/old/enterkey/enterkey.html +106 -0
- data/app/assets/vendor/ckeditor/samples/old/index.html +122 -0
- data/app/assets/vendor/ckeditor/samples/old/inlineall.html +314 -0
- data/app/assets/vendor/ckeditor/samples/old/inlinebycode.html +124 -0
- data/app/assets/vendor/ckeditor/samples/old/inlinetextarea.html +113 -0
- data/app/assets/vendor/ckeditor/samples/old/jquery.html +103 -0
- data/app/assets/vendor/ckeditor/samples/old/readonly.html +76 -0
- data/app/assets/vendor/ckeditor/samples/old/replacebyclass.html +60 -0
- data/app/assets/vendor/ckeditor/samples/old/replacebycode.html +59 -0
- data/app/assets/vendor/ckeditor/samples/old/sample.css +357 -0
- data/app/assets/vendor/ckeditor/samples/old/sample.js +50 -0
- data/app/assets/vendor/ckeditor/samples/old/sample_posteddata.php +16 -0
- data/app/assets/vendor/ckeditor/samples/old/tabindex.html +78 -0
- data/app/assets/vendor/ckeditor/samples/old/toolbar/toolbar.html +235 -0
- data/app/assets/vendor/ckeditor/samples/old/uicolor.html +72 -0
- data/app/assets/vendor/ckeditor/samples/old/uilanguages.html +122 -0
- data/app/assets/vendor/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
- data/app/assets/vendor/ckeditor/samples/old/xhtmlstyle.html +234 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/index.html +446 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/LICENSE +19 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.css +325 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css +38 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_ie.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_ie7.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_ie8.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_iequirks.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_opera.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_gecko.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_ie.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_ie7.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_ie8.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_iequirks.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/icons.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/icons_hidpi.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/arrow.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/close.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/close.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/lock-open.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/lock.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/refresh.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/lock-open.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/lock.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/refresh.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/readme.md +35 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/bootstrapck-sample.html +127 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/css/bootstrapck-sample.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/js/analytics.js +4 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/js/jquery-1.11.0.min.js +189 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/gecko/editor_gecko.scss +25 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie/dialog_ie.scss +62 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie/editor_ie.scss +71 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie7/dialog_ie7.scss +68 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie7/editor_ie7.scss +213 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie8/dialog_ie8.scss +24 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie8/editor_ie8.scss +27 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/iequirks/dialog_iequirks.scss +21 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/iequirks/editor_iequirks.scss +79 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/opera/dialog_opera.scss +31 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_colorpanel.scss +119 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_elementspath.scss +66 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_mainui.scss +189 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_menu.scss +182 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_panel.scss +199 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_presets.scss +32 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_reset.scss +107 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_richcombo.scss +174 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_toolbar.scss +317 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/editor.scss +66 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/config/_colors.scss +61 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/config/_config.scss +9 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/config/_defaults.scss +37 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/dialog/dialog.scss +822 -0
- data/app/assets/vendor/ckeditor/styles.js +111 -0
- data/app/controllers/geri/admin/admin_users_controller.rb +56 -0
- data/app/controllers/geri/admin/dashboard_controller.rb +8 -0
- data/app/controllers/geri/admin/editor_controller.rb +33 -0
- data/app/controllers/geri/admin/password_resets_controller.rb +21 -0
- data/app/controllers/geri/admin/sessions_controller.rb +24 -0
- data/app/controllers/geri/admin_controller.rb +19 -0
- data/app/controllers/geri/application_controller.rb +5 -0
- data/app/controllers/geri/pages_controller.rb +34 -0
- data/app/helpers/geri/admin/dashboard_helper.rb +4 -0
- data/app/helpers/geri/admin/editor_helper.rb +4 -0
- data/app/helpers/geri/admin/pages_helper.rb +45 -0
- data/app/helpers/geri/admin/partials_helper.rb +4 -0
- data/app/helpers/geri/admin/password_resets_helper.rb +4 -0
- data/app/helpers/geri/admin/sessions_helper.rb +4 -0
- data/app/helpers/geri/admin_helper.rb +24 -0
- data/app/helpers/geri/admin_users_helper.rb +4 -0
- data/app/helpers/geri/application_helper.rb +26 -0
- data/app/helpers/geri/meta_helper.rb +32 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/mailers/geri/admin_user_mailer.rb +11 -0
- data/app/models/geri/admin_user.rb +14 -0
- data/app/models/geri/content.rb +6 -0
- data/app/models/geri/password_reset.rb +17 -0
- data/app/models/geri/session.rb +20 -0
- data/app/views/geri/admin/admin_users/_form.html.erb +5 -0
- data/app/views/geri/admin/admin_users/edit.html.erb +27 -0
- data/app/views/geri/admin/admin_users/index.html.erb +45 -0
- data/app/views/geri/admin/admin_users/new.html.erb +17 -0
- data/app/views/geri/admin/dashboard/index.html.erb +1 -0
- data/app/views/geri/admin/editor/template.html.erb +17 -0
- data/app/views/geri/admin/password_resets/new.html.erb +17 -0
- data/app/views/geri/admin/sessions/new.html.erb +23 -0
- data/app/views/geri/admin/shared/_aside.html.erb +16 -0
- data/app/views/geri/admin/shared/_header.html.erb +31 -0
- data/app/views/geri/admin/shared/_menu_item.html.erb +17 -0
- data/app/views/geri/admin_user_mailer/reset_password_email.text.erb +7 -0
- data/app/views/layouts/geri/admin.html.erb +24 -0
- data/app/views/layouts/geri/admin/sessions.html.erb +21 -0
- data/app/views/layouts/mailer.html.erb +5 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/config/initializers/geri.rb +7 -0
- data/config/initializers/sorcery.rb +463 -0
- data/config/locales/devise.en.yml +62 -0
- data/config/locales/en.yml +13 -0
- data/config/routes.rb +23 -0
- data/db/migrate/20160409151523_create_geri_contents.rb +8 -0
- data/db/migrate/20160411205412_sorcery_core.rb +20 -0
- data/lib/generators/geri/install/USAGE +8 -0
- data/lib/generators/geri/install/install_generator.rb +54 -0
- data/lib/generators/geri/install/templates/bower.json +8 -0
- data/lib/generators/geri/install/templates/index.html.erb +46 -0
- data/lib/generators/geri/install/templates/initializer.rb +12 -0
- data/lib/generators/geri/install/templates/layout.html.erb +11 -0
- data/lib/generators/geri/install/templates/site.css.less +1 -0
- data/lib/generators/geri/install/templates/site.js +1 -0
- data/lib/geri.rb +7 -0
- data/lib/geri/cli.rb +6 -0
- data/lib/geri/cli/base.rb +23 -0
- data/lib/geri/cli/extension.rb +18 -0
- data/lib/geri/config.rb +29 -0
- data/lib/geri/config/menu_item.rb +35 -0
- data/lib/geri/engine.rb +34 -0
- data/lib/geri/tasks.rb +3 -0
- data/lib/geri/tasks/create_admin_user.rb +40 -0
- data/lib/geri/version.rb +3 -0
- data/lib/tasks/geri_tasks.rake +15 -0
- metadata +449 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<!--
|
|
3
|
+
Copyright (c) 2003-2016, 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> – 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> – 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> – 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> – 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 – The text editor for the Internet – <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
|
117
|
+
</p>
|
|
118
|
+
<p class="grid-width-100" id="copy">
|
|
119
|
+
Copyright © 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> – 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-2016, 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-2016, 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-2016, 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 — 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> » 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><div></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 © 2003-2016, <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-2016, 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 — 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> » 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"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></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 "bold" Command">
|
|
178
|
+
<input id="exec-link" onclick="ExecuteCommand('link');" type="button" value="Execute "link" 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"><h2>Test</h2><p>This is some <a href="/Test1.html">sample</a> HTML code.</p></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 © 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
|
206
|
+
Knabben. All rights reserved.
|
|
207
|
+
</p>
|
|
208
|
+
</div>
|
|
209
|
+
</body>
|
|
210
|
+
</html>
|