author | Dan |
Mon, 28 Dec 2009 16:53:19 -0500 | |
changeset 1198 | 3ec9ac297045 |
parent 1040 | c631faf25a12 |
child 1227 | bdac73ed481e |
permissions | -rw-r--r-- |
748
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
1 |
// The "Dynano" Javascript framework. Similar in syntax to JQuery but highly Enano-specific (TinyMCE, etc). |
1 | 2 |
|
1040 | 3 |
var $dynano = function(id) |
1 | 4 |
{ |
5 |
return new DNobj(id); |
|
6 |
} |
|
7 |
function DNobj(id) |
|
8 |
{ |
|
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
493
diff
changeset
|
9 |
if ( id == undefined ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
493
diff
changeset
|
10 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
493
diff
changeset
|
11 |
return {}; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
493
diff
changeset
|
12 |
} |
1 | 13 |
this.object = ( typeof(id) == 'object' ) ? id : document.getElementById(id); |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
1
diff
changeset
|
14 |
if ( !this.object ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
1
diff
changeset
|
15 |
{ |
493 | 16 |
console.warn('Dynano: requested object is bad. id parameter follows.'); |
17 |
console.debug(id); |
|
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
1
diff
changeset
|
18 |
this.object = false; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
1
diff
changeset
|
19 |
return this; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
1
diff
changeset
|
20 |
} |
748
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
21 |
if ( this.object.Dynano ) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
22 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
23 |
return this.object.Dynano; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
24 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
25 |
this.object.Dynano = this; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
26 |
|
1 | 27 |
this.height = __DNObjGetHeight(this.object); |
28 |
this.width = __DNObjGetWidth(this.object); |
|
29 |
||
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
30 |
if ( this.object.tagName == 'TEXTAREA' && ( typeof(tinyMCE) == 'object' || typeof(tinyMCE_GZ) == 'object' ) ) |
1 | 31 |
{ |
32 |
this.object.dnIsMCE = 'no'; |
|
33 |
this.switchToMCE = DN_switchToMCE; |
|
34 |
this.destroyMCE = DN_destroyMCE; |
|
35 |
this.getContent = DN_mceFetchContent; |
|
413
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
36 |
this.setContent = DN_mceSetContent; |
748
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
37 |
this.makeSwitchable = DN_makeSwitchableTA; |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
38 |
this.isMCE = DN_isMCE; |
1 | 39 |
} |
40 |
} |
|
41 |
function __DNObjGetHeight(o) { |
|
42 |
return o.offsetHeight; |
|
43 |
} |
|
44 |
||
45 |
function __DNObjGetWidth(o) { |
|
46 |
return o.offsetWidth; |
|
47 |
} |
|
48 |
||
49 |
function addClass(obj, clsname) |
|
50 |
{ |
|
51 |
var cnt = obj.className; |
|
52 |
var space = ( (cnt + '').length > 0 ) ? ' ' : ''; |
|
53 |
var cls = cnt + space + clsname; |
|
54 |
obj.className = cls; |
|
55 |
} |
|
56 |
||
57 |
function rmClass(obj, clsname) |
|
58 |
{ |
|
59 |
var cnt = obj.className; |
|
60 |
if ( cnt == clsname ) |
|
61 |
{ |
|
62 |
obj.className = ''; |
|
63 |
} |
|
64 |
else |
|
65 |
{ |
|
66 |
cnt = cnt.replace(clsname, ''); |
|
67 |
cnt = trim(cnt); |
|
68 |
obj.className = cnt; |
|
69 |
} |
|
70 |
} |
|
71 |
||
72 |
function hasClass(obj, clsname) |
|
73 |
{ |
|
74 |
var cnt = obj.className; |
|
75 |
if ( !cnt ) |
|
76 |
return false; |
|
77 |
if ( cnt == clsname ) |
|
78 |
return true; |
|
79 |
cnt = cnt.split(' '); |
|
80 |
||
81 |
for ( var i in cnt ) |
|
82 |
if ( cnt[i] == clsname ) |
|
83 |
return true; |
|
84 |
||
85 |
return false; |
|
86 |
} |
|
87 |
function __DNObjGetLeft(obj) { |
|
88 |
var left_offset = obj.offsetLeft; |
|
89 |
while ((obj = obj.offsetParent) != null) { |
|
90 |
left_offset += obj.offsetLeft; |
|
91 |
} |
|
92 |
return left_offset; |
|
93 |
} |
|
94 |
||
95 |
function __DNObjGetTop(obj) { |
|
96 |
var left_offset = obj.offsetTop; |
|
97 |
while ((obj = obj.offsetParent) != null) { |
|
98 |
left_offset += obj.offsetTop; |
|
99 |
} |
|
100 |
return left_offset; |
|
101 |
} |
|
102 |
||
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
103 |
function DN_switchToMCE(performWikiTransform) |
1 | 104 |
{ |
105 |
if ( !this.object.id ) |
|
106 |
this.object.id = 'textarea_' + Math.floor(Math.random() * 1000000); |
|
107 |
if ( !this.object.name ) |
|
108 |
this.object.name = 'textarea_' + Math.floor(Math.random() * 1000000); |
|
474
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
109 |
// Updated for TinyMCE 3.x |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
110 |
if ( performWikiTransform ) |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
111 |
{ |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
112 |
this.object.value = DN_WikitextToXHTML(this.object.value); |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
113 |
} |
474
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
114 |
// If tinyMCE init hasn't been called yet, do it now. |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
115 |
if ( !tinymce_initted ) |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
116 |
{ |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
588
diff
changeset
|
117 |
console.info('$dynano().switchToMCE(): doing "exact"-type MCE init'); |
474
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
118 |
enano_tinymce_options.mode = 'exact'; |
493 | 119 |
enano_tinymce_options.elements = this.object.id; |
474
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
120 |
initTinyMCE(); |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
121 |
this.object.dnIsMCE = 'yes'; |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
122 |
return true; |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
123 |
} |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
124 |
else |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
125 |
{ |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
588
diff
changeset
|
126 |
console.info('$dynano().switchToMCE(): tinyMCE already loaded, calling mceAddControl'); |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
127 |
tinymce.EditorManager.execCommand("mceAddControl", true, this.object.id); |
474
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
128 |
this.object.dnIsMCE = 'yes'; |
3d751a6f2b05
Changed TinyMCE init to run only on demand. Highly experimental.
Dan
parents:
413
diff
changeset
|
129 |
} |
1 | 130 |
return this; |
131 |
} |
|
132 |
||
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
133 |
function DN_destroyMCE(performWikiTransform) |
1 | 134 |
{ |
135 |
//if ( !this.object.dn_is_mce ) |
|
136 |
// return this; |
|
864
09c3ba4f6fbf
Dynano: don't try to destroy MCE if window.tinymce is invalid
Dan
parents:
832
diff
changeset
|
137 |
if ( this.object.id && window.tinymce ) |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
138 |
{ |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
139 |
// TinyMCE 2.x |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
140 |
// tinymce.EditorManager.removeMCEControl(this.object.name); |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
141 |
// TinyMCE 3.x |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
142 |
var ed = tinymce.EditorManager.getInstanceById(this.object.id); |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
143 |
if ( ed ) |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
144 |
{ |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
145 |
if ( !tinymce.EditorManager.execCommand("mceRemoveEditor", false, this.object.id) ) |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
146 |
alert('could not destroy editor'); |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
147 |
if ( performWikiTransform ) |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
148 |
{ |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
149 |
this.object.value = DN_XHTMLToWikitext(this.object.value); |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
150 |
} |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
151 |
} |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
152 |
} |
1 | 153 |
this.object.dnIsMCE = 'no'; |
154 |
return this; |
|
155 |
} |
|
156 |
||
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
157 |
function DN_isMCE() |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
158 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
159 |
return ( this.object.dnIsMCE == 'yes' ); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
160 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
161 |
|
1 | 162 |
function DN_mceFetchContent() |
163 |
{ |
|
164 |
if ( this.object.name ) |
|
165 |
{ |
|
166 |
var text = this.object.value; |
|
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
167 |
if ( tinymce.EditorManager.get(this.object.id) ) |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
168 |
{ |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
169 |
var editor = tinymce.EditorManager.get(this.object.id); |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
170 |
text = editor.getContent(); |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
171 |
} |
1 | 172 |
return text; |
173 |
} |
|
174 |
else |
|
175 |
{ |
|
176 |
return this.object.value; |
|
177 |
} |
|
178 |
} |
|
179 |
||
413
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
180 |
function DN_mceSetContent(text) |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
181 |
{ |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
182 |
if ( this.object.name ) |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
183 |
{ |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
184 |
this.object.value = text; |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
185 |
if ( tinymce.EditorManager.get(this.object.id) ) |
413
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
186 |
{ |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
582
diff
changeset
|
187 |
var editor = tinymce.EditorManager.get(this.object.id); |
413
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
188 |
editor.setContent(text); |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
189 |
} |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
190 |
} |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
191 |
else |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
192 |
{ |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
193 |
this.object.value = text; |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
194 |
} |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
195 |
} |
6607cd646d6d
Added autosave functionality and resurrected the old toolbar code that was added about a year ago but never uesd.
Dan
parents:
335
diff
changeset
|
196 |
|
748
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
197 |
var P_BOTTOM = 1; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
198 |
var P_TOP = 2; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
199 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
200 |
function DN_makeSwitchableTA(pos) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
201 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
202 |
if ( this.toggler ) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
203 |
return false; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
204 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
205 |
if ( !pos ) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
206 |
pos = P_BOTTOM; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
207 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
208 |
load_component('l10n'); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
209 |
var cookiename = 'enano_editor_mode'; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
210 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
211 |
var toggler = document.createElement('div'); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
212 |
toggler.dynano = this; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
213 |
this.toggler = toggler; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
214 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
215 |
if ( !this.object.id ) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
216 |
this.object.id = 'dynano_auto_' + Math.floor(Math.random() * 1000000); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
217 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
218 |
toggler.s_mode_text = $lang.get('editor_btn_wikitext'); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
219 |
toggler.s_mode_graphical = $lang.get('editor_btn_graphical'); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
220 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
221 |
toggler.set_text = function() |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
222 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
223 |
if ( this.dynano.object.dnIsMCE == 'yes' ) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
224 |
this.dynano.destroyMCE(); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
225 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
226 |
this.innerHTML = ''; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
227 |
this.appendChild(document.createTextNode(this.s_mode_text + ' | ')); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
228 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
229 |
var link = document.createElement('a'); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
230 |
link.href = '#'; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
231 |
link.onclick = function() |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
232 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
233 |
this.parentNode.set_graphical(); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
234 |
return false; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
235 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
236 |
link.appendChild(document.createTextNode(this.s_mode_graphical)); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
237 |
this.appendChild(link); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
238 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
239 |
createCookie('enano_editor_mode', 'text', 365); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
240 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
241 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
242 |
toggler.set_graphical = function() |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
243 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
244 |
this.dynano.switchToMCE(); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
245 |
this.innerHTML = ''; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
246 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
247 |
var link = document.createElement('a'); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
248 |
link.href = '#'; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
249 |
link.onclick = function() |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
250 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
251 |
this.parentNode.set_text(); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
252 |
return false; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
253 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
254 |
link.appendChild(document.createTextNode(this.s_mode_text)); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
255 |
this.appendChild(link); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
256 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
257 |
this.appendChild(document.createTextNode(' | ' + this.s_mode_graphical)); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
258 |
createCookie('enano_editor_mode', 'tinymce', 365); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
259 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
260 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
261 |
toggler.style.styleFloat = 'right'; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
262 |
toggler.style.cssFloat = 'right'; |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
263 |
if ( pos == P_BOTTOM ) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
264 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
265 |
insertAfter(this.object.parentNode, toggler, this.object); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
266 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
267 |
else |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
268 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
269 |
this.object.parentNode.insertBefore(toggler, this.object); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
270 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
271 |
|
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
272 |
if ( readCookie(cookiename) == 'tinymce' ) |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
273 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
274 |
toggler.set_graphical(); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
275 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
276 |
else |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
277 |
{ |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
278 |
toggler.set_text(); |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
279 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
280 |
} |
e39454295bbb
Added makeSwitchable Dynano method for textareas; enabled support for makeSwitchable in comment runtime
Dan
parents:
699
diff
changeset
|
281 |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
282 |
function DN_WikitextToXHTML(text) |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
283 |
{ |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
284 |
return DN_AjaxGetTransformedText(text, 'xhtml'); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
285 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
286 |
|
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
287 |
function DN_XHTMLToWikitext(text) |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
288 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
289 |
return DN_AjaxGetTransformedText(text, 'wikitext'); |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
290 |
} |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
291 |
|
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
292 |
// AJAX to the server to transform text |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
293 |
function DN_AjaxGetTransformedText(text, to) |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
294 |
{ |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
295 |
// get an XHR instance |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
296 |
var ajax = ajaxMakeXHR(); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
297 |
|
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
298 |
var uri = stdAjaxPrefix + '&_mode=transform&to=' + to; |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
299 |
var parms = 'text=' + ajaxEscape(text); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
300 |
try |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
301 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
302 |
ajax.open('POST', uri, false); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
303 |
ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
304 |
// Setting Content-length in Safari triggers a warning |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
305 |
if ( !is_Safari ) |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
306 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
307 |
ajax.setRequestHeader("Content-length", parms.length); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
308 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
309 |
ajax.send(parms); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
310 |
// async request, so if status != 200 at this point then we're screwed |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
311 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
312 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
313 |
var response = String(ajax.responseText + ''); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
314 |
if ( !check_json_response(response) ) |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
315 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
316 |
handle_invalid_json(response); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
317 |
return text; |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
318 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
319 |
response = parseJSON(response); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
320 |
if ( response.mode == 'error' ) |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
321 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
322 |
alert(response.error); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
323 |
return text; |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
324 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
325 |
return response.text; |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
326 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
327 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
328 |
catch(e) |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
329 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
330 |
console.warn('DN_AjaxGetTransformedText: XHR failed'); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
748
diff
changeset
|
331 |
} |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
332 |
return text; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
333 |
} |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
29
diff
changeset
|
334 |
|
1 | 335 |
DNobj.prototype.addClass = function(clsname) { addClass(this.object, clsname); return this; }; |
336 |
DNobj.prototype.rmClass = function(clsname) { rmClass( this.object, clsname); return this; }; |
|
337 |
DNobj.prototype.hasClass = function(clsname) { return hasClass(this.object, clsname); }; |
|
338 |
DNobj.prototype.Height = function() { return __DNObjGetHeight(this.object); } |
|
339 |
DNobj.prototype.Width = function() { return __DNObjGetWidth( this.object); } |
|
340 |
DNobj.prototype.Left = function() { /* return this.object.offsetLeft; */ return __DNObjGetLeft(this.object); } |
|
341 |
DNobj.prototype.Top = function() { /* return this.object.offsetTop; */ return __DNObjGetTop( this.object); } |
|
342 |