|
| 1 | +<!DOCTYPE html> |
| 2 | +<html style="height: 100%;"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>Select Attachment</title> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2" /> |
| 7 | + |
| 8 | + <!-- Require JS (REQUIRED) --> |
| 9 | + <!-- Rename "main.default.js" to "main.js" and edit it if you need configure elFInder options or any things --> |
| 10 | + <!-- <script data-main="./main.js" src="js/require.min.js"></script> --> |
| 11 | + <script data-main="main.js" src="js/require.min.js"></script> |
| 12 | + <script> |
| 13 | + define('elFinderConfig', { |
| 14 | + // elFinder options (REQUIRED) |
| 15 | + // Documentation for client options: |
| 16 | + // https://github.com/Studio-42/elFinder/wiki/Client-configuration-options |
| 17 | + defaultOpts : { |
| 18 | + url : 'php/connector.roundcube.php' // connector URL (REQUIRED) |
| 19 | + ,resizable: false |
| 20 | + ,rememberLastDir: false |
| 21 | + ,reloadClearHistory: true |
| 22 | + ,useBrowserHistory: false |
| 23 | + ,requestType: 'post' |
| 24 | + ,defaultView: 'icons' |
| 25 | + ,ui: ['tree', 'stat'] |
| 26 | + ,commands: [ |
| 27 | + 'open', 'opendir' |
| 28 | + ] |
| 29 | + ,uiOptions : { |
| 30 | + // toolbar configuration |
| 31 | + toolbar : [ |
| 32 | + ['back', 'forward'], |
| 33 | + ['reload'], |
| 34 | + // ['home', 'up'], |
| 35 | + ['mkdir', 'mkfile'], |
| 36 | + ['open', 'download'], |
| 37 | + ['info'], |
| 38 | + ['quicklook'], |
| 39 | + ['copy', 'cut', 'paste'], |
| 40 | + ['rm'], |
| 41 | + ['duplicate', 'rename', 'edit'], |
| 42 | + ['extract', 'archive'], |
| 43 | + ['search'], |
| 44 | + ['view'] |
| 45 | + ], |
| 46 | + |
| 47 | + // directories tree options |
| 48 | + tree : { |
| 49 | + // expand current root on init |
| 50 | + openRootOnLoad : true, |
| 51 | + // auto load current dir parents |
| 52 | + syncTree : true |
| 53 | + }, |
| 54 | + |
| 55 | + // navbar options |
| 56 | + navbar : { |
| 57 | + minWidth : 190, |
| 58 | + maxWidth : 190 |
| 59 | + }, |
| 60 | + |
| 61 | + // current working directory options |
| 62 | + cwd : { |
| 63 | + // display parent directory in listing as ".." |
| 64 | + oldSchool : false |
| 65 | + } |
| 66 | + } |
| 67 | + ,commandsOptions : { |
| 68 | + edit : { |
| 69 | + extraOptions : { |
| 70 | + // set API key to enable Creative Cloud image editor |
| 71 | + // see https://console.adobe.io/ |
| 72 | + creativeCloudApiKey : '', |
| 73 | + // browsing manager URL for CKEditor, TinyMCE |
| 74 | + // uses self location with the empty value |
| 75 | + managerUrl : '' |
| 76 | + } |
| 77 | + } |
| 78 | + ,getfile : { |
| 79 | + oncomplete : 'destroy' |
| 80 | + ,multiple : true |
| 81 | + ,folders : false |
| 82 | + } |
| 83 | + ,quicklook : { |
| 84 | + // to enable preview with Google Docs Viewer |
| 85 | + googleDocsMimes : ['application/pdf', 'image/tiff', 'application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] |
| 86 | + } |
| 87 | + } |
| 88 | +/* ,getFileCallback: function(file) { |
| 89 | + var cid = location.search.split('id=')[1]; |
| 90 | + window.opener.elcallback(file.path,cid); |
| 91 | + window.close(); |
| 92 | + } |
| 93 | + */ |
| 94 | + ,getFileCallback : function(files) { |
| 95 | + //for (id in files) { |
| 96 | + var cid = location.search.split('id=')[1]; |
| 97 | + //var lock = rcmail.set_busy(true, 'elfinder.wait_load'); |
| 98 | + var tid = new Date().getTime(); |
| 99 | + window.opener.elcallback(files,cid,tid); |
| 100 | + /* |
| 101 | + rcmail.http_request('plugin.elfinder.load_attachments', |
| 102 | + { _id:rcmail.env.compose_id, |
| 103 | + _uploadid:tid, |
| 104 | + _filepath:files[id].url, |
| 105 | + }, lock); |
| 106 | + */ |
| 107 | + //} |
| 108 | + //displayed = false; |
| 109 | + window.close(); |
| 110 | + } |
| 111 | + // bootCalback calls at before elFinder boot up |
| 112 | + ,bootCallback : function(fm, extraObj) { |
| 113 | + /* any bind functions etc. */ |
| 114 | + fm.bind('init', function() { |
| 115 | + // any your code |
| 116 | + }); |
| 117 | + |
| 118 | + } |
| 119 | + }, |
| 120 | + managers : { |
| 121 | + // 'DOM Element ID': { /* elFinder options of this DOM Element */ } |
| 122 | + 'elfinder': {} |
| 123 | + } |
| 124 | + }); |
| 125 | + </script> |
| 126 | + </head><body style="margin: 0px; padding: 0px; overflow: hidden; height: 100%;"><div id="elfinder" style="margin: auto; min-height:100%; height: auto !important; height: 100%; border:0;"></div></body></html> |
0 commit comments