ckeditor/samples/old/readonly.html
changeset 0 44d330dccc59
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ckeditor/samples/old/readonly.html	Thu Dec 15 18:10:20 2016 +0300
     1.3 @@ -0,0 +1,76 @@
     1.4 +<!DOCTYPE html>
     1.5 +<!--
     1.6 +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
     1.7 +For licensing, see LICENSE.md or http://ckeditor.com/license
     1.8 +-->
     1.9 +<html>
    1.10 +<head>
    1.11 +	<meta charset="utf-8">
    1.12 +	<title>Using the CKEditor Read-Only API &mdash; CKEditor Sample</title>
    1.13 +	<script src="../../ckeditor.js"></script>
    1.14 +	<link rel="stylesheet" href="sample.css">
    1.15 +	<script>
    1.16 +
    1.17 +		var editor;
    1.18 +
    1.19 +		// The instanceReady event is fired, when an instance of CKEditor has finished
    1.20 +		// its initialization.
    1.21 +		CKEDITOR.on( 'instanceReady', function( ev ) {
    1.22 +			editor = ev.editor;
    1.23 +
    1.24 +			// Show this "on" button.
    1.25 +			document.getElementById( 'readOnlyOn' ).style.display = '';
    1.26 +
    1.27 +			// Event fired when the readOnly property changes.
    1.28 +			editor.on( 'readOnly', function() {
    1.29 +				document.getElementById( 'readOnlyOn' ).style.display = this.readOnly ? 'none' : '';
    1.30 +				document.getElementById( 'readOnlyOff' ).style.display = this.readOnly ? '' : 'none';
    1.31 +			});
    1.32 +		});
    1.33 +
    1.34 +		function toggleReadOnly( isReadOnly ) {
    1.35 +			// Change the read-only state of the editor.
    1.36 +			// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly
    1.37 +			editor.setReadOnly( isReadOnly );
    1.38 +		}
    1.39 +
    1.40 +	</script>
    1.41 +</head>
    1.42 +<body>
    1.43 +	<h1 class="samples">
    1.44 +		<a href="index.html">CKEditor Samples</a> &raquo; Using the CKEditor Read-Only API
    1.45 +	</h1>
    1.46 +	<div class="warning deprecated">
    1.47 +		This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/readonly.html">brand new version in CKEditor SDK</a>.
    1.48 +	</div>
    1.49 +	<div class="description">
    1.50 +		<p>
    1.51 +			This sample shows how to use the
    1.52 +			<code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly">setReadOnly</a></code>
    1.53 +			API to put editor into the read-only state that makes it impossible for users to change the editor contents.
    1.54 +		</p>
    1.55 +		<p>
    1.56 +			For details on how to create this setup check the source code of this sample page.
    1.57 +		</p>
    1.58 +	</div>
    1.59 +	<form action="sample_posteddata.php" method="post">
    1.60 +		<p>
    1.61 +			<textarea class="ckeditor" id="editor1" name="editor1" cols="100" 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>
    1.62 +		</p>
    1.63 +		<p>
    1.64 +			<input id="readOnlyOn" onclick="toggleReadOnly();" type="button" value="Make it read-only" style="display:none">
    1.65 +			<input id="readOnlyOff" onclick="toggleReadOnly( false );" type="button" value="Make it editable again" style="display:none">
    1.66 +		</p>
    1.67 +	</form>
    1.68 +	<div id="footer">
    1.69 +		<hr>
    1.70 +		<p>
    1.71 +			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
    1.72 +		</p>
    1.73 +		<p id="copy">
    1.74 +			Copyright &copy; 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
    1.75 +			Knabben. All rights reserved.
    1.76 +		</p>
    1.77 +	</div>
    1.78 +</body>
    1.79 +</html>