31 tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { |
31 tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { |
32 InlineWindowManager : function(ed) { |
32 InlineWindowManager : function(ed) { |
33 var t = this; |
33 var t = this; |
34 |
34 |
35 t.parent(ed); |
35 t.parent(ed); |
36 t.zIndex = 1000; |
36 t.zIndex = 300000; |
|
37 t.count = 0; |
37 }, |
38 }, |
38 |
39 |
39 open : function(f, p) { |
40 open : function(f, p) { |
40 var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u; |
41 var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u; |
41 |
42 |
95 |
100 |
96 if (f.movable) |
101 if (f.movable) |
97 opt += ' mceMovable'; |
102 opt += ' mceMovable'; |
98 |
103 |
99 // Create DOM objects |
104 // Create DOM objects |
100 t._addAll(document.body, |
105 t._addAll(DOM.doc.body, |
101 ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, |
106 ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, |
102 ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, |
107 ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, |
103 ['div', {id : id + '_top', 'class' : 'mceTop'}, |
108 ['div', {id : id + '_top', 'class' : 'mceTop'}, |
104 ['div', {'class' : 'mceLeft'}], |
109 ['div', {'class' : 'mceLeft'}], |
105 ['div', {'class' : 'mceCenter'}], |
110 ['div', {'class' : 'mceCenter'}], |
118 ['div', {'class' : 'mceCenter'}], |
123 ['div', {'class' : 'mceCenter'}], |
119 ['div', {'class' : 'mceRight'}], |
124 ['div', {'class' : 'mceRight'}], |
120 ['span', {id : id + '_status'}, 'Content'] |
125 ['span', {id : id + '_status'}, 'Content'] |
121 ], |
126 ], |
122 |
127 |
123 ['a', {'class' : 'mceMove', href : 'javascript:;'}], |
128 ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], |
124 ['a', {'class' : 'mceMin', href : 'javascript:;', onmousedown : 'return false;'}], |
129 ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], |
125 ['a', {'class' : 'mceMax', href : 'javascript:;', onmousedown : 'return false;'}], |
130 ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], |
126 ['a', {'class' : 'mceMed', href : 'javascript:;', onmousedown : 'return false;'}], |
131 ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], |
127 ['a', {'class' : 'mceClose', href : 'javascript:;', onmousedown : 'return false;'}], |
132 ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], |
128 ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', href : 'javascript:;'}], |
133 ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], |
129 ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', href : 'javascript:;'}], |
134 ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], |
130 ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', href : 'javascript:;'}], |
135 ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], |
131 ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', href : 'javascript:;'}], |
136 ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], |
132 ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', href : 'javascript:;'}], |
137 ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], |
133 ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', href : 'javascript:;'}], |
138 ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], |
134 ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', href : 'javascript:;'}], |
139 ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], |
135 ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', href : 'javascript:;'}] |
140 ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] |
136 ] |
141 ] |
137 ] |
142 ] |
138 ); |
143 ); |
139 |
144 |
140 DOM.setStyles(id, {top : -10000, left : -10000}); |
145 DOM.setStyles(id, {top : -10000, left : -10000}); |
153 |
158 |
154 // Resize window |
159 // Resize window |
155 DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); |
160 DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); |
156 |
161 |
157 u = f.url || f.file; |
162 u = f.url || f.file; |
158 if (tinymce.relaxedDomain) |
163 if (u) { |
159 u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; |
164 if (tinymce.relaxedDomain) |
|
165 u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; |
|
166 |
|
167 u = tinymce._addVer(u); |
|
168 } |
160 |
169 |
161 if (!f.type) { |
170 if (!f.type) { |
162 DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); |
171 DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); |
163 DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); |
172 DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); |
164 DOM.setAttrib(id + '_ifr', 'src', u); |
173 DOM.setAttrib(id + '_ifr', 'src', u); |
242 |
251 |
243 w.iframeElement.on('focus', function() { |
252 w.iframeElement.on('focus', function() { |
244 t.focus(id); |
253 t.focus(id); |
245 }); |
254 }); |
246 |
255 |
|
256 // Setup blocker |
|
257 if (t.count == 0 && t.editor.getParam('dialog_type') == 'modal') { |
|
258 DOM.add(DOM.doc.body, 'div', { |
|
259 id : 'mceModalBlocker', |
|
260 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', |
|
261 style : {left : vp.x, top : vp.y, zIndex : t.zIndex - 1} |
|
262 }); |
|
263 |
|
264 DOM.show('mceModalBlocker'); // Reduces flicker in IE |
|
265 } else |
|
266 DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); |
|
267 |
247 t.focus(id); |
268 t.focus(id); |
248 t._fixIELayout(id, 1); |
269 t._fixIELayout(id, 1); |
249 |
270 |
250 // if (DOM.get(id + '_ok')) |
271 // Focus ok button |
251 // DOM.get(id + '_ok').focus(); |
272 if (DOM.get(id + '_ok')) |
|
273 DOM.get(id + '_ok').focus(); |
|
274 |
|
275 t.count++; |
252 |
276 |
253 return w; |
277 return w; |
254 }, |
278 }, |
255 |
279 |
256 focus : function(id) { |
280 focus : function(id) { |
278 t._addAll(te, ne[i]); |
302 t._addAll(te, ne[i]); |
279 } |
303 } |
280 }, |
304 }, |
281 |
305 |
282 _startDrag : function(id, se, ac) { |
306 _startDrag : function(id, se, ac) { |
283 var t = this, mu, mm, d = document, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh; |
307 var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh; |
284 |
308 |
285 // Get positons and sizes |
309 // Get positons and sizes |
286 // cp = DOM.getPos(t.editor.getContainer()); |
310 // cp = DOM.getPos(t.editor.getContainer()); |
287 cp = {x : 0, y : 0}; |
311 cp = {x : 0, y : 0}; |
288 vp = DOM.getViewPort(); |
312 vp = DOM.getViewPort(); |
289 |
313 |
290 // Reduce viewport size to avoid scrollbars |
314 // Reduce viewport size to avoid scrollbars while dragging |
291 vp.w -= 2; |
315 vp.w -= 2; |
292 vp.h -= 2; |
316 vp.h -= 2; |
293 |
317 |
294 sex = se.screenX; |
318 sex = se.screenX; |
295 sey = se.screenY; |
319 sey = se.screenY; |