tiny.browser.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Ext.ns('Tiny');
  2. Tiny.browserCallback = function(data) {
  3. var FileBrowserDialogue = {
  4. init : function () {}
  5. ,selectURL : function (url) {
  6. var win = tinyMCEPopup.getWindowArg('window');
  7. /* insert information now */
  8. win.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = url;
  9. if (typeof(win.ImageDialog) != 'undefined') {
  10. /* for image browsers: update image dimensions */
  11. if (win.ImageDialog.getImageData) {
  12. win.ImageDialog.getImageData();
  13. }
  14. win.ImageDialog.showPreviewImage(url);
  15. }
  16. /* close popup window */
  17. tinyMCEPopup.close();
  18. win.focus(); win.document.focus();
  19. }
  20. };
  21. var fileUrl;
  22. if (inRevo20) {
  23. fileUrl = unescape(data.relativeUrl);
  24. } else {
  25. fileUrl = data.fullRelativeUrl;
  26. }
  27. tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
  28. function OpenFile(fileUrl){
  29. FileBrowserDialogue.selectURL(fileUrl);
  30. }
  31. OpenFile(fileUrl);
  32. };