122 lines
3.1 KiB
HTML
122 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
|
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
|
-->
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Code Snippet — CKEditor Sample</title>
|
|
<script src="../../../ckeditor.js"></script>
|
|
<link href="../../../samples/old/sample.css" rel="stylesheet">
|
|
<meta name="ckeditor-sample-name" content="Code Snippet plugin">
|
|
<meta name="ckeditor-sample-group" content="Plugins">
|
|
<meta name="ckeditor-sample-description" content="View and modify code using the Code Snippet plugin.">
|
|
<meta name="ckeditor-sample-isnew" content="1">
|
|
<style>
|
|
|
|
#editable
|
|
{
|
|
padding: 10px 20px;
|
|
}
|
|
pre > code {
|
|
display: block;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<textarea id="editor1">
|
|
<p>JavaScript code:</p>
|
|
|
|
<pre>
|
|
<code class="language-javascript">function isEmpty( object ) {
|
|
for ( var i in object ) {
|
|
if ( object.hasOwnProperty( i ) )
|
|
return false;
|
|
}
|
|
return true;
|
|
}</code></pre>
|
|
|
|
<p>SQL query:</p>
|
|
|
|
<pre>
|
|
<code class="language-sql">SELECT cust.id FROM cust LEFT JOIN loc ON ( cust.loc_id = loc.id ) WHERE cust.type IN ( 1, 2 );</code></pre>
|
|
|
|
<p>Unknown markup:</p>
|
|
|
|
<pre>
|
|
<code> ________________
|
|
/ \
|
|
| How about moo? | ^__^
|
|
\________________/ (oo)\_______
|
|
\ (__)\ )\/\
|
|
||----w |
|
|
|| ||
|
|
</code></pre>
|
|
</textarea>
|
|
|
|
<h2>Inline editor</h2>
|
|
|
|
<div id="editable" contenteditable="true">
|
|
|
|
<p>JavaScript code:</p>
|
|
|
|
<pre><code class="language-javascript">function isEmpty( object ) {
|
|
for ( var i in object ) {
|
|
if ( object.hasOwnProperty( i ) )
|
|
return false;
|
|
}
|
|
return true;
|
|
}</code></pre>
|
|
|
|
<p>SQL query:</p>
|
|
|
|
<pre><code class="language-sql">SELECT cust.id, cust.name, loc.city FROM cust LEFT JOIN loc ON ( cust.loc_id = loc.id ) WHERE cust.type IN ( 1, 2 );</code></pre>
|
|
|
|
<p>Unknown markup:</p>
|
|
|
|
<pre><code> ________________
|
|
/ \
|
|
| How about moo? | ^__^
|
|
\________________/ (oo)\_______
|
|
\ (__)\ )\/\
|
|
||----w |
|
|
|| ||
|
|
</code></pre>
|
|
</div>
|
|
|
|
<script>
|
|
( function() {
|
|
CKEDITOR.disableAutoInline = true;
|
|
|
|
var config = {
|
|
extraPlugins: 'codesnippet,codesnippetgeshi',
|
|
codeSnippetGeshi_url: 'plugins/codesnippetgeshi/dev/colorize.php',
|
|
toolbar: [
|
|
[ 'Source', 'Sourcedialog' ], [ 'Undo', 'Redo' ], [ 'Bold', 'Italic', 'Underline' ], [ 'CodeSnippet' ]
|
|
],
|
|
codeSnippet_theme: 'monokai_sublime',
|
|
height: 400
|
|
};
|
|
|
|
CKEDITOR.replace( 'editor1', config );
|
|
|
|
CKEDITOR.inline( 'editable', CKEDITOR.tools.extend( {}, config, {
|
|
extraPlugins: 'codesnippet,codesnippetgeshi,sourcedialog'
|
|
}, true ) );
|
|
}() );
|
|
</script>
|
|
|
|
<div id="footer">
|
|
<hr>
|
|
<p>
|
|
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
|
</p>
|
|
<p id="copy">
|
|
Copyright © 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
|
Knabben. All rights reserved.
|
|
</p>
|
|
</div>
|
|
</body>
|
|
</html>
|