PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/editors/tiny_mce_3_4_3_1/plugins/inlinepopups/editor_plugin_src.js

#
JavaScript | 696 lines | 508 code | 138 blank | 50 comment | 133 complexity | cb5da8f17d76e8344e1d04cef3ef4ef7 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. /**
  2. * editor_plugin_src.js
  3. *
  4. * Copyright 2009, Moxiecode Systems AB
  5. * Released under LGPL License.
  6. *
  7. * License: http://tinymce.moxiecode.com/license
  8. * Contributing: http://tinymce.moxiecode.com/contributing
  9. */
  10. (function() {
  11. var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
  12. tinymce.create('tinymce.plugins.InlinePopups', {
  13. init : function(ed, url) {
  14. // Replace window manager
  15. ed.onBeforeRenderUI.add(function() {
  16. ed.windowManager = new tinymce.InlineWindowManager(ed);
  17. DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");
  18. });
  19. },
  20. getInfo : function() {
  21. return {
  22. longname : 'InlinePopups',
  23. author : 'Moxiecode Systems AB',
  24. authorurl : 'http://tinymce.moxiecode.com',
  25. infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
  26. version : tinymce.majorVersion + "." + tinymce.minorVersion
  27. };
  28. }
  29. });
  30. tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {
  31. InlineWindowManager : function(ed) {
  32. var t = this;
  33. t.parent(ed);
  34. t.zIndex = 300000;
  35. t.count = 0;
  36. t.windows = {};
  37. },
  38. open : function(f, p) {
  39. var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow;
  40. f = f || {};
  41. p = p || {};
  42. // Run native windows
  43. if (!f.inline)
  44. return t.parent(f, p);
  45. parentWindow = t._frontWindow();
  46. if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
  47. parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
  48. }
  49. // Only store selection if the type is a normal window
  50. if (!f.type)
  51. t.bookmark = ed.selection.getBookmark(1);
  52. id = DOM.uniqueId();
  53. vp = DOM.getViewPort();
  54. f.width = parseInt(f.width || 320);
  55. f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
  56. f.min_width = parseInt(f.min_width || 150);
  57. f.min_height = parseInt(f.min_height || 100);
  58. f.max_width = parseInt(f.max_width || 2000);
  59. f.max_height = parseInt(f.max_height || 2000);
  60. f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));
  61. f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));
  62. f.movable = f.resizable = true;
  63. p.mce_width = f.width;
  64. p.mce_height = f.height;
  65. p.mce_inline = true;
  66. p.mce_window_id = id;
  67. p.mce_auto_focus = f.auto_focus;
  68. // Transpose
  69. // po = DOM.getPos(ed.getContainer());
  70. // f.left -= po.x;
  71. // f.top -= po.y;
  72. t.features = f;
  73. t.params = p;
  74. t.onOpen.dispatch(t, f, p);
  75. if (f.type) {
  76. opt += ' mceModal';
  77. if (f.type)
  78. opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);
  79. f.resizable = false;
  80. }
  81. if (f.statusbar)
  82. opt += ' mceStatusbar';
  83. if (f.resizable)
  84. opt += ' mceResizable';
  85. if (f.minimizable)
  86. opt += ' mceMinimizable';
  87. if (f.maximizable)
  88. opt += ' mceMaximizable';
  89. if (f.movable)
  90. opt += ' mceMovable';
  91. // Create DOM objects
  92. t._addAll(DOM.doc.body,
  93. ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
  94. ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
  95. ['div', {id : id + '_top', 'class' : 'mceTop'},
  96. ['div', {'class' : 'mceLeft'}],
  97. ['div', {'class' : 'mceCenter'}],
  98. ['div', {'class' : 'mceRight'}],
  99. ['span', {id : id + '_title'}, f.title || '']
  100. ],
  101. ['div', {id : id + '_middle', 'class' : 'mceMiddle'},
  102. ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
  103. ['span', {id : id + '_content'}],
  104. ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
  105. ],
  106. ['div', {id : id + '_bottom', 'class' : 'mceBottom'},
  107. ['div', {'class' : 'mceLeft'}],
  108. ['div', {'class' : 'mceCenter'}],
  109. ['div', {'class' : 'mceRight'}],
  110. ['span', {id : id + '_status'}, 'Content']
  111. ],
  112. ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],
  113. ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
  114. ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
  115. ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
  116. ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
  117. ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],
  118. ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],
  119. ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],
  120. ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],
  121. ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],
  122. ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],
  123. ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],
  124. ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]
  125. ]
  126. ]
  127. );
  128. DOM.setStyles(id, {top : -10000, left : -10000});
  129. // Fix gecko rendering bug, where the editors iframe messed with window contents
  130. if (tinymce.isGecko)
  131. DOM.setStyle(id, 'overflow', 'auto');
  132. // Measure borders
  133. if (!f.type) {
  134. dw += DOM.get(id + '_left').clientWidth;
  135. dw += DOM.get(id + '_right').clientWidth;
  136. dh += DOM.get(id + '_top').clientHeight;
  137. dh += DOM.get(id + '_bottom').clientHeight;
  138. }
  139. // Resize window
  140. DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
  141. u = f.url || f.file;
  142. if (u) {
  143. if (tinymce.relaxedDomain)
  144. u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
  145. u = tinymce._addVer(u);
  146. }
  147. if (!f.type) {
  148. DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
  149. DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});
  150. DOM.setAttrib(id + '_ifr', 'src', u);
  151. } else {
  152. DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');
  153. if (f.type == 'confirm')
  154. DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');
  155. DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
  156. DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
  157. Event.add(id, 'keyup', function(evt) {
  158. var VK_ESCAPE = 27;
  159. if (evt.keyCode === VK_ESCAPE) {
  160. f.button_func(false);
  161. return Event.cancel(evt);
  162. }
  163. });
  164. Event.add(id, 'keydown', function(evt) {
  165. var cancelButton, VK_TAB = 9;
  166. if (evt.keyCode === VK_TAB) {
  167. cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0];
  168. if (cancelButton && cancelButton !== evt.target) {
  169. cancelButton.focus();
  170. } else {
  171. DOM.get(id + '_ok').focus();
  172. }
  173. return Event.cancel(evt);
  174. }
  175. });
  176. }
  177. // Register events
  178. mdf = Event.add(id, 'mousedown', function(e) {
  179. var n = e.target, w, vp;
  180. w = t.windows[id];
  181. t.focus(id);
  182. if (n.nodeName == 'A' || n.nodeName == 'a') {
  183. if (n.className == 'mceMax') {
  184. w.oldPos = w.element.getXY();
  185. w.oldSize = w.element.getSize();
  186. vp = DOM.getViewPort();
  187. // Reduce viewport size to avoid scrollbars
  188. vp.w -= 2;
  189. vp.h -= 2;
  190. w.element.moveTo(vp.x, vp.y);
  191. w.element.resizeTo(vp.w, vp.h);
  192. DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});
  193. DOM.addClass(id + '_wrapper', 'mceMaximized');
  194. } else if (n.className == 'mceMed') {
  195. // Reset to old size
  196. w.element.moveTo(w.oldPos.x, w.oldPos.y);
  197. w.element.resizeTo(w.oldSize.w, w.oldSize.h);
  198. w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);
  199. DOM.removeClass(id + '_wrapper', 'mceMaximized');
  200. } else if (n.className == 'mceMove')
  201. return t._startDrag(id, e, n.className);
  202. else if (DOM.hasClass(n, 'mceResize'))
  203. return t._startDrag(id, e, n.className.substring(13));
  204. }
  205. });
  206. clf = Event.add(id, 'click', function(e) {
  207. var n = e.target;
  208. t.focus(id);
  209. if (n.nodeName == 'A' || n.nodeName == 'a') {
  210. switch (n.className) {
  211. case 'mceClose':
  212. t.close(null, id);
  213. return Event.cancel(e);
  214. case 'mceButton mceOk':
  215. case 'mceButton mceCancel':
  216. f.button_func(n.className == 'mceButton mceOk');
  217. return Event.cancel(e);
  218. }
  219. }
  220. });
  221. // Make sure the tab order loops within the dialog.
  222. Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
  223. var iframe = DOM.get(id + '_ifr');
  224. if (iframe) {
  225. var body = iframe.contentWindow.document.body;
  226. var focusable = DOM.select(':input:enabled,*[tabindex=0]', body);
  227. if (evt.target.id === (id + '_left')) {
  228. focusable[focusable.length - 1].focus();
  229. } else {
  230. focusable[0].focus();
  231. }
  232. } else {
  233. DOM.get(id + '_ok').focus();
  234. }
  235. });
  236. // Add window
  237. w = t.windows[id] = {
  238. id : id,
  239. mousedown_func : mdf,
  240. click_func : clf,
  241. element : new Element(id, {blocker : 1, container : ed.getContainer()}),
  242. iframeElement : new Element(id + '_ifr'),
  243. features : f,
  244. deltaWidth : dw,
  245. deltaHeight : dh
  246. };
  247. w.iframeElement.on('focus', function() {
  248. t.focus(id);
  249. });
  250. // Setup blocker
  251. if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {
  252. DOM.add(DOM.doc.body, 'div', {
  253. id : 'mceModalBlocker',
  254. 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',
  255. style : {zIndex : t.zIndex - 1}
  256. });
  257. DOM.show('mceModalBlocker'); // Reduces flicker in IE
  258. DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true');
  259. } else
  260. DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);
  261. if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))
  262. DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
  263. DOM.setAttrib(id, 'aria-hidden', 'false');
  264. t.focus(id);
  265. t._fixIELayout(id, 1);
  266. // Focus ok button
  267. if (DOM.get(id + '_ok'))
  268. DOM.get(id + '_ok').focus();
  269. t.count++;
  270. return w;
  271. },
  272. focus : function(id) {
  273. var t = this, w;
  274. if (w = t.windows[id]) {
  275. w.zIndex = this.zIndex++;
  276. w.element.setStyle('zIndex', w.zIndex);
  277. w.element.update();
  278. id = id + '_wrapper';
  279. DOM.removeClass(t.lastId, 'mceFocus');
  280. DOM.addClass(id, 'mceFocus');
  281. t.lastId = id;
  282. if (w.focussedElement) {
  283. w.focussedElement.focus();
  284. } else if (DOM.get(id + '_ok')) {
  285. DOM.get(w.id + '_ok').focus();
  286. } else if (DOM.get(w.id + '_ifr')) {
  287. DOM.get(w.id + '_ifr').focus();
  288. }
  289. }
  290. },
  291. _addAll : function(te, ne) {
  292. var i, n, t = this, dom = tinymce.DOM;
  293. if (is(ne, 'string'))
  294. te.appendChild(dom.doc.createTextNode(ne));
  295. else if (ne.length) {
  296. te = te.appendChild(dom.create(ne[0], ne[1]));
  297. for (i=2; i<ne.length; i++)
  298. t._addAll(te, ne[i]);
  299. }
  300. },
  301. _startDrag : function(id, se, ac) {
  302. 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;
  303. // Get positons and sizes
  304. // cp = DOM.getPos(t.editor.getContainer());
  305. cp = {x : 0, y : 0};
  306. vp = DOM.getViewPort();
  307. // Reduce viewport size to avoid scrollbars while dragging
  308. vp.w -= 2;
  309. vp.h -= 2;
  310. sex = se.screenX;
  311. sey = se.screenY;
  312. dx = dy = dw = dh = 0;
  313. // Handle mouse up
  314. mu = Event.add(d, 'mouseup', function(e) {
  315. Event.remove(d, 'mouseup', mu);
  316. Event.remove(d, 'mousemove', mm);
  317. if (eb)
  318. eb.remove();
  319. we.moveBy(dx, dy);
  320. we.resizeBy(dw, dh);
  321. sz = we.getSize();
  322. DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});
  323. t._fixIELayout(id, 1);
  324. return Event.cancel(e);
  325. });
  326. if (ac != 'Move')
  327. startMove();
  328. function startMove() {
  329. if (eb)
  330. return;
  331. t._fixIELayout(id, 0);
  332. // Setup event blocker
  333. DOM.add(d.body, 'div', {
  334. id : 'mceEventBlocker',
  335. 'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
  336. style : {zIndex : t.zIndex + 1}
  337. });
  338. if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))
  339. DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
  340. eb = new Element('mceEventBlocker');
  341. eb.update();
  342. // Setup placeholder
  343. p = we.getXY();
  344. sz = we.getSize();
  345. sx = cp.x + p.x - vp.x;
  346. sy = cp.y + p.y - vp.y;
  347. DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});
  348. ph = new Element('mcePlaceHolder');
  349. };
  350. // Handle mouse move/drag
  351. mm = Event.add(d, 'mousemove', function(e) {
  352. var x, y, v;
  353. startMove();
  354. x = e.screenX - sex;
  355. y = e.screenY - sey;
  356. switch (ac) {
  357. case 'ResizeW':
  358. dx = x;
  359. dw = 0 - x;
  360. break;
  361. case 'ResizeE':
  362. dw = x;
  363. break;
  364. case 'ResizeN':
  365. case 'ResizeNW':
  366. case 'ResizeNE':
  367. if (ac == "ResizeNW") {
  368. dx = x;
  369. dw = 0 - x;
  370. } else if (ac == "ResizeNE")
  371. dw = x;
  372. dy = y;
  373. dh = 0 - y;
  374. break;
  375. case 'ResizeS':
  376. case 'ResizeSW':
  377. case 'ResizeSE':
  378. if (ac == "ResizeSW") {
  379. dx = x;
  380. dw = 0 - x;
  381. } else if (ac == "ResizeSE")
  382. dw = x;
  383. dh = y;
  384. break;
  385. case 'mceMove':
  386. dx = x;
  387. dy = y;
  388. break;
  389. }
  390. // Boundary check
  391. if (dw < (v = w.features.min_width - sz.w)) {
  392. if (dx !== 0)
  393. dx += dw - v;
  394. dw = v;
  395. }
  396. if (dh < (v = w.features.min_height - sz.h)) {
  397. if (dy !== 0)
  398. dy += dh - v;
  399. dh = v;
  400. }
  401. dw = Math.min(dw, w.features.max_width - sz.w);
  402. dh = Math.min(dh, w.features.max_height - sz.h);
  403. dx = Math.max(dx, vp.x - (sx + vp.x));
  404. dy = Math.max(dy, vp.y - (sy + vp.y));
  405. dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));
  406. dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));
  407. // Move if needed
  408. if (dx + dy !== 0) {
  409. if (sx + dx < 0)
  410. dx = 0;
  411. if (sy + dy < 0)
  412. dy = 0;
  413. ph.moveTo(sx + dx, sy + dy);
  414. }
  415. // Resize if needed
  416. if (dw + dh !== 0)
  417. ph.resizeTo(sz.w + dw, sz.h + dh);
  418. return Event.cancel(e);
  419. });
  420. return Event.cancel(se);
  421. },
  422. resizeBy : function(dw, dh, id) {
  423. var w = this.windows[id];
  424. if (w) {
  425. w.element.resizeBy(dw, dh);
  426. w.iframeElement.resizeBy(dw, dh);
  427. }
  428. },
  429. close : function(win, id) {
  430. var t = this, w, d = DOM.doc, fw, id;
  431. id = t._findId(id || win);
  432. // Probably not inline
  433. if (!t.windows[id]) {
  434. t.parent(win);
  435. return;
  436. }
  437. t.count--;
  438. if (t.count == 0) {
  439. DOM.remove('mceModalBlocker');
  440. DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'false');
  441. t.editor.focus();
  442. }
  443. if (w = t.windows[id]) {
  444. t.onClose.dispatch(t);
  445. Event.remove(d, 'mousedown', w.mousedownFunc);
  446. Event.remove(d, 'click', w.clickFunc);
  447. Event.clear(id);
  448. Event.clear(id + '_ifr');
  449. DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
  450. w.element.remove();
  451. delete t.windows[id];
  452. fw = t._frontWindow();
  453. if (fw)
  454. t.focus(fw.id);
  455. }
  456. },
  457. // Find front most window
  458. _frontWindow : function() {
  459. var fw, ix = 0;
  460. // Find front most window and focus that
  461. each (this.windows, function(w) {
  462. if (w.zIndex > ix) {
  463. fw = w;
  464. ix = w.zIndex;
  465. }
  466. });
  467. return fw;
  468. },
  469. setTitle : function(w, ti) {
  470. var e;
  471. w = this._findId(w);
  472. if (e = DOM.get(w + '_title'))
  473. e.innerHTML = DOM.encode(ti);
  474. },
  475. alert : function(txt, cb, s) {
  476. var t = this, w;
  477. w = t.open({
  478. title : t,
  479. type : 'alert',
  480. button_func : function(s) {
  481. if (cb)
  482. cb.call(s || t, s);
  483. t.close(null, w.id);
  484. },
  485. content : DOM.encode(t.editor.getLang(txt, txt)),
  486. inline : 1,
  487. width : 400,
  488. height : 130
  489. });
  490. },
  491. confirm : function(txt, cb, s) {
  492. var t = this, w;
  493. w = t.open({
  494. title : t,
  495. type : 'confirm',
  496. button_func : function(s) {
  497. if (cb)
  498. cb.call(s || t, s);
  499. t.close(null, w.id);
  500. },
  501. content : DOM.encode(t.editor.getLang(txt, txt)),
  502. inline : 1,
  503. width : 400,
  504. height : 130
  505. });
  506. },
  507. // Internal functions
  508. _findId : function(w) {
  509. var t = this;
  510. if (typeof(w) == 'string')
  511. return w;
  512. each(t.windows, function(wo) {
  513. var ifr = DOM.get(wo.id + '_ifr');
  514. if (ifr && w == ifr.contentWindow) {
  515. w = wo.id;
  516. return false;
  517. }
  518. });
  519. return w;
  520. },
  521. _fixIELayout : function(id, s) {
  522. var w, img;
  523. if (!tinymce.isIE6)
  524. return;
  525. // Fixes the bug where hover flickers and does odd things in IE6
  526. each(['n','s','w','e','nw','ne','sw','se'], function(v) {
  527. var e = DOM.get(id + '_resize_' + v);
  528. DOM.setStyles(e, {
  529. width : s ? e.clientWidth : '',
  530. height : s ? e.clientHeight : '',
  531. cursor : DOM.getStyle(e, 'cursor', 1)
  532. });
  533. DOM.setStyle(id + "_bottom", 'bottom', '-1px');
  534. e = 0;
  535. });
  536. // Fixes graphics glitch
  537. if (w = this.windows[id]) {
  538. // Fixes rendering bug after resize
  539. w.element.hide();
  540. w.element.show();
  541. // Forced a repaint of the window
  542. //DOM.get(id).style.filter = '';
  543. // IE has a bug where images used in CSS won't get loaded
  544. // sometimes when the cache in the browser is disabled
  545. // This fix tries to solve it by loading the images using the image object
  546. each(DOM.select('div,a', id), function(e, i) {
  547. if (e.currentStyle.backgroundImage != 'none') {
  548. img = new Image();
  549. img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');
  550. }
  551. });
  552. DOM.get(id).style.filter = '';
  553. }
  554. }
  555. });
  556. // Register plugin
  557. tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);
  558. })();