ckfinder.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <title>CKFinder</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="robots" content="noindex, nofollow" />
  7. <script type="text/javascript" src="ckfinder.js"></script>
  8. <style type="text/css">
  9. body, html, iframe, #ckfinder {
  10. margin: 0;
  11. padding: 0;
  12. border: 0;
  13. width: 100%;
  14. height: 100%;
  15. overflow: hidden;
  16. }
  17. </style>
  18. </head>
  19. <body class="CKFinderFrameWindow">
  20. <div id="ckfinder"></div>
  21. <script type="text/javascript">
  22. //<![CDATA[
  23. (function()
  24. {
  25. var config = {};
  26. var get = CKFinder.tools.getUrlParam;
  27. var getBool = function( v )
  28. {
  29. var t = get( v );
  30. if ( t === null )
  31. return null;
  32. return t == '0' ? false : true;
  33. };
  34. var tmp;
  35. if ( tmp = get( 'configId' ) )
  36. {
  37. var win = window.opener || window;
  38. try
  39. {
  40. while ( ( !win.CKFinder || !win.CKFinder._.instanceConfig[ tmp ] ) && win != window.top )
  41. win = win.parent;
  42. if ( win.CKFinder._.instanceConfig[ tmp ] )
  43. config = CKFINDER.tools.extend( {}, win.CKFinder._.instanceConfig[ tmp ] );
  44. }
  45. catch(e) {}
  46. }
  47. if ( tmp = get( 'startupPath' ) || get( 'start' ) )
  48. config.startupPath = decodeURIComponent( tmp );
  49. config.id = get( 'id' ) || '';
  50. if ( ( tmp = getBool( 'rlf' ) ) !== null )
  51. config.rememberLastFolder = tmp;
  52. if ( ( tmp = getBool( 'dts' ) ) !== null )
  53. config.disableThumbnailSelection = tmp;
  54. if ( tmp = get( 'data' ) )
  55. config.selectActionData = tmp;
  56. if ( tmp = get( 'tdata' ) )
  57. config.selectThumbnailActionData = tmp;
  58. if ( tmp = get( 'type' ) )
  59. config.resourceType = tmp;
  60. if ( tmp = get( 'langCode' ) )
  61. config.language = tmp;
  62. if ( typeof( config.selectActionFunction ) == 'undefined' )
  63. {
  64. // Try to get desired "File Select" action from the URL.
  65. var action;
  66. if ( tmp = get( 'CKEditor' ) )
  67. {
  68. if ( tmp.length )
  69. action = 'ckeditor';
  70. }
  71. if ( !action )
  72. action = get( 'action' );
  73. var parentWindow = ( window.parent == window ) ? window.opener : window.parent;
  74. switch ( action )
  75. {
  76. case 'js':
  77. var actionFunction = get( 'func' );
  78. if ( actionFunction && actionFunction.length > 0 )
  79. config.selectActionFunction = parentWindow[ actionFunction ];
  80. actionFunction = get( 'thumbFunc' );
  81. if ( actionFunction && actionFunction.length > 0 )
  82. config.selectThumbnailActionFunction = parentWindow[ actionFunction ];
  83. break ;
  84. case 'ckeditor':
  85. var funcNum = get( 'CKEditorFuncNum' );
  86. if ( parentWindow['CKEDITOR'] )
  87. {
  88. config.selectActionFunction = function( fileUrl, data )
  89. {
  90. parentWindow['CKEDITOR'].tools.callFunction( funcNum, fileUrl, data );
  91. };
  92. config.selectThumbnailActionFunction = config.selectActionFunction;
  93. }
  94. break;
  95. default:
  96. if ( parentWindow && parentWindow['FCK'] && parentWindow['SetUrl'] )
  97. {
  98. action = 'fckeditor' ;
  99. config.selectActionFunction = parentWindow['SetUrl'];
  100. if ( !config.disableThumbnailSelection )
  101. config.selectThumbnailActionFunction = parentWindow['SetUrl'];
  102. }
  103. else
  104. action = null ;
  105. }
  106. config.action = action;
  107. }
  108. // Always use 100% width and height when nested using this middle page.
  109. config.width = config.height = '100%';
  110. var ckfinder = new CKFinder( config );
  111. ckfinder.replace( 'ckfinder', config );
  112. })();
  113. //]]>
  114. </script>
  115. </body>
  116. </html>