1 /** |
1 /** |
2 * $Id: editor_plugin_src.js 450 2007-11-27 13:42:19Z spocke $ |
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ |
3 * |
3 * |
4 * @author Moxiecode |
4 * @author Moxiecode |
5 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. |
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. |
6 */ |
6 */ |
7 |
7 |
8 (function() { |
8 (function() { |
9 var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; |
9 var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; |
10 |
10 |
149 |
149 |
150 // Resize window |
150 // Resize window |
151 DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); |
151 DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); |
152 |
152 |
153 if (!f.type) { |
153 if (!f.type) { |
154 DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'width:10px;height:10px'}); |
154 DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); |
155 DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); |
155 DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); |
156 DOM.setAttrib(id + '_ifr', 'src', f.url || f.file); |
156 DOM.setAttrib(id + '_ifr', 'src', f.url || f.file); |
157 } else { |
157 } else { |
158 DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'button ok', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); |
158 DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'button ok', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); |
159 |
159 |
169 var n = e.target, w, vp; |
169 var n = e.target, w, vp; |
170 |
170 |
171 w = t.windows[id]; |
171 w = t.windows[id]; |
172 t.focus(id); |
172 t.focus(id); |
173 |
173 |
174 if (n.nodeName == 'A') { |
174 if (n.nodeName == 'A' || n.nodeName == 'a') { |
175 if (n.className == 'max') { |
175 if (n.className == 'max') { |
176 w.oldPos = w.element.getXY(); |
176 w.oldPos = w.element.getXY(); |
177 w.oldSize = w.element.getSize(); |
177 w.oldSize = w.element.getSize(); |
178 |
178 |
179 vp = DOM.getViewPort(); |
179 vp = DOM.getViewPort(); |