Ticket #2628: sample082.html

File sample082.html, 2.9 KB (added by Artur Formella, 15 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<!--
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2007 Frederico Caldeira Knabben
5 *
6 * == BEGIN LICENSE ==
7 *
8 * Licensed under the terms of any of the following licenses at your
9 * choice:
10 *
11 *  - GNU General Public License Version 2 or later (the "GPL")
12 *    http://www.gnu.org/licenses/gpl.html
13 *
14 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 *    http://www.gnu.org/licenses/lgpl.html
16 *
17 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18 *    http://www.mozilla.org/MPL/MPL-1.1.html
19 *
20 * == END LICENSE ==
21 *
22 * Sample page.
23-->
24<html xmlns="http://www.w3.org/1999/xhtml">
25<head>
26        <title>FCKeditor - Sample</title>
27        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28        <meta name="robots" content="noindex, nofollow" />
29        <link href="../sample.css" rel="stylesheet" type="text/css" />
30        <script type="text/javascript" src="./../../fckeditor.js"></script>
31        <script type="text/javascript">
32
33        var sBasePath = "./../../";
34       
35function FCKeditor_OnComplete( editorInstance )
36{
37        editorInstance.Events.AttachEvent( 'OnSelectionChange', myListener ) ;
38}
39
40
41function myListener( editorInstance )
42{
43        var textHtml = editorInstance.GetClipboardHTML() ;
44
45        var a=document.getElementById('blediv').innerHTML;
46        b=a*1;
47        b=a- (-1);
48        document.getElementById('blediv').innerHTML=b;
49       
50       
51       
52        return false ;
53}
54
55
56function CheckIsDirty()
57{
58        // Get the editor instance that we want to interact with.
59        var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
60        alert( oEditor.IsDirty() ) ;
61}
62
63function ResetIsDirty()
64{
65        // Get the editor instance that we want to interact with.
66        var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
67        oEditor.ResetIsDirty() ;
68        alert( 'The "IsDirty" status has been reset' ) ;
69}
70
71        </script>
72</head>
73<body>
74        <h1>
75                FCKeditor - JavaScript - Sample 8
76        </h1>
77        <div>
78                This sample shows how to use the FCKeditor JavaScript API to interact with the editor
79                at runtime.
80        </div>
81        <hr />
82        <form action="sampleposteddata.asp" method="post" target="_blank">
83                <script type="text/javascript">
84<!--
85var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
86oFCKeditor.BasePath     = sBasePath ;
87oFCKeditor.Config["EnterMode"]          = "p" ;
88oFCKeditor.Value        = 'test ' ;
89oFCKeditor.Width = '100%' ;
90oFCKeditor.Create() ;
91//-->
92                </script>
93                <br />
94                <input type="submit" value="Submit" />
95        </form>
96        <div>
97                &nbsp;
98        </div>
99        <hr />
100        <div id="eMessage">
101                &nbsp;
102        </div>
103        <div>
104                &nbsp;
105        </div>
106
107
108<div id="blediv" style='width:200px;height:20px;background-color:red'>0</div>
109        <div id="eButtons">
110                <input type="button" value="Check IsDirty()" onclick="CheckIsDirty();" />
111                <input type="button" value="Reset IsDirty()" onclick="ResetIsDirty();" />
112        </div>
113</body>
114</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy