summaryrefslogtreecommitdiff
path: root/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/samples/old/sourcedialog/sourcedialog.html
blob: b0e6a9c8ce4e36143b40a930b5731774774b90a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<!--
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
-->
<html>
<head>
	<meta charset="utf-8">
	<title>Editing source code in a dialog &mdash; CKEditor Sample</title>
	<script src="../../../ckeditor.js"></script>
	<link rel="stylesheet" href="../../../samples/old/sample.css">
	<meta name="ckeditor-sample-name" content="Editing source code in a dialog">
	<meta name="ckeditor-sample-group" content="Plugins">
	<meta name="ckeditor-sample-description" content="Editing HTML content of both inline and classic editor instances.">
	<meta name="ckeditor-sample-isnew" content="1">
	<style>

		#editable
		{
			padding: 10px;
			float: left;
		}

	</style>
</head>
<body>
	<h1 class="samples">
		<a href="../../../samples/old/index.html">CKEditor Samples</a> &raquo; Editing source code in a dialog
	</h1>
	<div class="warning deprecated">
		This sample is not maintained anymore. Check out its <a href="https://sdk.ckeditor.com/samples/sourcearea.html">brand new version in CKEditor SDK</a>.
	</div>
	<div class="description">
		<p>
			<strong>Sourcedialog</strong> plugin provides an easy way to edit raw HTML content
			of an editor, similarly to what is possible with <strong>Sourcearea</strong>
			plugin for classic (<code>iframe</code>-based) instances but using dialogs. Thanks to that, it's also possible
			to manipulate raw content of inline editor instances.
		</p>
		<p>
			This plugin extends the toolbar with a button,
			which opens a dialog window with a source code editor. It works with both classic
			and inline instances. To enable this
			plugin, basically add <code>extraPlugins: 'sourcedialog'</code> to editor's
			config:
		</p>
<pre class="samples">
// Inline editor.
CKEDITOR.inline( 'editable', {
	<strong>extraPlugins: 'sourcedialog'</strong>
});

// Classic (iframe-based) editor.
CKEDITOR.replace( 'textarea_id', {
	<strong>extraPlugins: 'sourcedialog'</strong>,
	removePlugins: 'sourcearea'
});
</pre>
		<p>
			Note that you may want to include <code>removePlugins: 'sourcearea'</code>
			in your config when using <strong>Sourcedialog</strong> in classic editor instances.
			This prevents feature redundancy.
		</p>
		<p>
			Note that <code>editable</code> in the code above is the <code>id</code>
			attribute of the <code>&lt;div&gt;</code> element to be converted into an inline instance.
		</p>
		<p>
			Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
			the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
		</p>
	</div>
	<div>
		<label for="editor1">
			Inline editor:
		</label>
		<div id="editor1" contenteditable="true" style="padding: 5px 20px;">
			<p>This is some <strong>sample text</strong>. You are using <a href="https://ckeditor.com/">CKEditor</a>.</p>
		</div>
	</div>
	<br>
	<div>
		<label for="editor2">
			Classic editor:
		</label>
		<textarea cols="80" id="editor2" name="editor2" rows="10">
			This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="https://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.
		</textarea>
	</div>
	<script>

		// We need to turn off the automatic editor creation first.
		CKEDITOR.disableAutoInline = true;

		var config = {
			toolbarGroups: [
				{ name: 'mode' },
				{ name: 'basicstyles' },
				{ name: 'links' }
			],
			extraPlugins: 'sourcedialog',
			removePlugins: 'sourcearea'
		}

		CKEDITOR.inline( 'editor1', config );
		CKEDITOR.replace( 'editor2', config );

	</script>
	<div id="footer">
		<hr>
		<p>
			CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">
				https://ckeditor.com</a>
		</p>
		<p id="copy">
			Copyright &copy; 2003-2018, <a class="samples" href="https://cksource.com/">CKSource</a>
			- Frederico Knabben. All rights reserved.
		</p>
	</div>
</body>
</html>