Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 1
<!DOCTYPE html>
2
<!--
3
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
4
For licensing, see LICENSE.md or http://ckeditor.com/license
5
-->
6
<html>
7
 
8
    <head>
9
        <meta charset="utf-8">
10
        <title>jQuery Adapter &mdash; CKEditor Sample</title>
11
        <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
12
        <script src="../ckeditor.js"></script>
13
        <script src="../adapters/jquery.js"></script>
14
        <link href="sample.css" rel="stylesheet">
15
        <style>
16
            #editable {
17
                padding: 10px;
18
                float: left;
19
            }
20
        </style>
21
        <script>
22
            CKEDITOR.disableAutoInline = true;
23
            $(document).ready(function()
24
            {
25
                $('#editor1').ckeditor(); // Use CKEDITOR.replace() if element is <textarea>.
26
                $('#editable').ckeditor(); // Use CKEDITOR.inline().
27
            });
28
 
29
            function setValue()
30
            {
31
                $('#editor1').val($('input#val').val());
32
            }
33
        </script>
34
    </head>
35
 
36
    <body>
37
        <h1 class="samples">
38
            <a href="index.html" id="a-test">CKEditor Samples</a> &raquo; Create Editors with jQuery </h1>
39
        <form action="sample_posteddata.php" method="post">
40
            <div class="description">
41
                <p> This sample shows how to use the
42
                    <a href="http://docs.ckeditor.com/#!/guide/dev_jquery">jQuery adapter</a>. Note that you have to include both CKEditor and jQuery scripts before including the adapter. </p> <pre class="samples">
43
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
44
&lt;script src="/ckeditor/ckeditor.js"&gt;&lt;/script&gt;
45
&lt;script src="/ckeditor/adapters/jquery.js"&gt;&lt;/script&gt;
46
</pre>
47
                <p>Then you can replace HTML elements with a CKEditor instance using the <code>ckeditor()</code> method.</p> <pre class="samples">
48
$( document ).ready( function() {
49
	$( 'textarea#editor1' ).ckeditor();
50
} );
51
</pre> </div>
52
            <h2 class="samples">Inline Example</h2>
53
            <div id="editable" contenteditable="true">
54
                <p>
55
                    <img alt="Saturn V carrying Apollo 11" class="right" src="assets/sample.jpg" />
56
                    <b>Apollo 11</b> was the spaceflight that landed the first humans, Americans
57
                    <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and
58
                    <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p>
59
                <p>Armstrong spent about
60
                    <s>three and a half</s> two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5&nbsp;kg) of lunar material for return to Earth. A third member of the mission,
61
                    <a href="http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)"
62
                        title="Michael Collins (astronaut)">Michael Collins</a>, piloted the
63
                    <a href="http://en.wikipedia.org/wiki/Apollo_Command/Service_Module" title="Apollo Command/Service Module">command</a> spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.
64
                    <p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p>
65
                    <blockquote>
66
                        <p>One small step for [a] man, one giant leap for mankind.</p>
67
                    </blockquote>
68
                    <p>Apollo 11 effectively ended the
69
                        <a href="http://en.wikipedia.org/wiki/Space_Race" title="Space Race">Space Race</a> and fulfilled a national goal proposed in 1961 by the late U.S. President
70
                        <a href="http://en.wikipedia.org/wiki/John_F._Kennedy" title="John F. Kennedy">John F. Kennedy</a> in a speech before the United States Congress:</p>
71
                    <blockquote>
72
                        <p>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</p>
73
                    </blockquote>
74
            </div>
75
            <br style="clear: both">
76
            <h2 class="samples">Classic (iframe-based) Example</h2>
77
            <textarea cols="80" id="editor1" name="editor1" rows="10"> &lt;h2&gt;Technical details &lt;a id=&quot;tech-details&quot; name=&quot;tech-details&quot;&gt;&lt;/a&gt;&lt;/h2&gt; &lt;table align=&quot;right&quot; border=&quot;1&quot; bordercolor=&quot;#ccc&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;
78
                style=&quot;border-collapse:collapse;margin:10px 0 10px 15px;&quot;&gt; &lt;caption&gt;&lt;strong&gt;Mission crew&lt;/strong&gt;&lt;/caption&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope=&quot;col&quot;&gt;Position&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt;Astronaut&lt;/th&gt;
79
                &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Commander&lt;/td&gt; &lt;td&gt;Neil A. Armstrong&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Command Module Pilot&lt;/td&gt; &lt;td&gt;Michael Collins&lt;/td&gt; &lt;/tr&gt;
80
                &lt;tr&gt; &lt;td&gt;Lunar Module Pilot&lt;/td&gt; &lt;td&gt;Edwin &amp;quot;Buzz&amp;quot; E. Aldrin, Jr.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;Launched by a &lt;strong&gt;Saturn V&lt;/strong&gt; rocket from &lt;a
81
                href=&quot;http://en.wikipedia.org/wiki/Kennedy_Space_Center&quot; title=&quot;Kennedy Space Center&quot;&gt;Kennedy Space Center&lt;/a&gt; in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of &lt;a href=&quot;http://en.wikipedia.org/wiki/NASA&quot;
82
                title=&quot;NASA&quot;&gt;NASA&lt;/a&gt;&amp;#39;s Apollo program. The Apollo spacecraft had three parts:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Command Module&lt;/strong&gt; with a cabin for the three astronauts which was the only
83
                part which landed back on Earth&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Service Module&lt;/strong&gt; which supported the Command Module with propulsion, electrical power, oxygen and water&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Lunar Module&lt;/strong&gt;
84
                for landing on the Moon.&lt;/li&gt; &lt;/ol&gt; &lt;p&gt;After being sent to the Moon by the Saturn V&amp;#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit.
85
                Armstrong and Aldrin then moved into the Lunar Module and landed in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Mare_Tranquillitatis&quot; title=&quot;Mare Tranquillitatis&quot;&gt;Sea of Tranquility&lt;/a&gt;. They stayed a total
86
                of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Pacific_Ocean&quot;
87
                title=&quot;Pacific Ocean&quot;&gt;Pacific Ocean&lt;/a&gt; on July 24.&lt;/p&gt; &lt;hr/&gt; &lt;p style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Source: &lt;a href=&quot;http://en.wikipedia.org/wiki/Apollo_11&quot;&gt;Wikipedia.org&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
88
                </textarea>
89
            <p style="overflow: hidden">
90
                <input style="float: left" type="submit" value="Submit">
91
                <span style="float: right">
92
                    <input type="text" id="val" value="I'm using jQuery val()!" size="30">
93
                    <input onclick="setValue();" type="button" value="Set value"> </span>
94
            </p>
95
        </form>
96
        <div id="footer">
97
            <hr>
98
            <p> CKEditor - The text editor for the Internet -
99
                <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
100
            </p>
101
            <p id="copy"> Copyright &copy; 2003-2014,
102
                <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p>
103
        </div>
104
    </body>
105
 
106
</html>