]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/Wikiwyg/Wikiwyg/Preview.js
added wysiwyg_editor-1.3a feature by Jean-Nicolas GEREONE <jean-nicolas.gereone@st...
[SourceForge/phpwiki.git] / themes / default / Wikiwyg / Wikiwyg / Preview.js
1 /*==============================================================================
2 This Wikiwyg mode supports a preview of current changes
3
4 COPYRIGHT:
5
6     Copyright (c) 2005 Socialtext Corporation 
7     655 High Street
8     Palo Alto, CA 94301 U.S.A.
9     All rights reserved.
10
11 Wikiwyg is free software. 
12
13 This library is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or (at
16 your option) any later version.
17
18 This library is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
21 General Public License for more details.
22
23     http://www.gnu.org/copyleft/lesser.txt
24
25  =============================================================================*/
26
27 proto = new Subclass('Wikiwyg.Preview', 'Wikiwyg.Mode');
28
29 proto.classtype = 'preview';
30 proto.modeDescription = 'Preview';
31
32 proto.initializeObject = function() {
33     this.div = document.createElement('div');
34     // XXX Make this a config option.
35     this.div.style.backgroundColor = 'lightyellow';
36 }
37
38 proto.fromHtml = function(html) {
39     this.div.innerHTML = html;
40 }
41
42 proto.toHtml = function(func) {
43     func(this.div.innerHTML);
44 }
45
46 proto.disableStarted = function() {
47     this.wikiwyg.divHeight = this.div.offsetHeight;
48 }