File Manager - Version 2.2.4

Version Description

Download this release

Release Info

Developer aihimel
Plugin Icon 128x128 File Manager
Version 2.2.4
Comparing to
See all releases

Version 2.2.4

Files changed (65) hide show
  1. BootStart/BootStart.php +467 -0
  2. BootStart/CSV.php +108 -0
  3. BootStart/CacheEngine.php +111 -0
  4. BootStart/Debug.php +19 -0
  5. BootStart/FTP.php +136 -0
  6. BootStart/HL7.php +113 -0
  7. BootStart/OptionsManager.php +254 -0
  8. BootStart/REST.php +153 -0
  9. BootStart/__init__.php +28 -0
  10. css/admin-style.css +38 -0
  11. css/front-style.css +13 -0
  12. elFinder/Changelog +173 -0
  13. elFinder/README.md +222 -0
  14. elFinder/composer.json +40 -0
  15. elFinder/css/elfinder.full.css +1883 -0
  16. elFinder/css/elfinder.min.css +9 -0
  17. elFinder/css/theme.css +57 -0
  18. elFinder/elfinder.html +42 -0
  19. elFinder/files/.gitkeep +0 -0
  20. elFinder/files/car-1.jpeg +0 -0
  21. elFinder/files/car3.jpg +0 -0
  22. elFinder/files/crop.gif +0 -0
  23. elFinder/files/dialogs.png +0 -0
  24. elFinder/files/file-2.jpg +0 -0
  25. elFinder/files/icons-big.png +0 -0
  26. elFinder/files/icons-small.png +0 -0
  27. elFinder/files/logo.png +0 -0
  28. elFinder/files/progress.gif +0 -0
  29. elFinder/files/quicklook-bg.png +0 -0
  30. elFinder/files/quicklook-icons.png +0 -0
  31. elFinder/files/resize.png +0 -0
  32. elFinder/files/spinner-mini.gif +0 -0
  33. elFinder/files/toolbar.png +0 -0
  34. elFinder/img/arrows-active.png +0 -0
  35. elFinder/img/arrows-normal.png +0 -0
  36. elFinder/img/crop.gif +0 -0
  37. elFinder/img/dialogs.png +0 -0
  38. elFinder/img/icons-big.png +0 -0
  39. elFinder/img/icons-small.png +0 -0
  40. elFinder/img/logo.png +0 -0
  41. elFinder/img/progress.gif +0 -0
  42. elFinder/img/quicklook-bg.png +0 -0
  43. elFinder/img/quicklook-icons.png +0 -0
  44. elFinder/img/resize.png +0 -0
  45. elFinder/img/spinner-mini.gif +0 -0
  46. elFinder/img/toolbar.png +0 -0
  47. elFinder/img/volume_icon_dropbox.png +0 -0
  48. elFinder/img/volume_icon_ftp.png +0 -0
  49. elFinder/img/volume_icon_local.png +0 -0
  50. elFinder/img/volume_icon_sql.png +0 -0
  51. elFinder/js/elfinder.full.js +15976 -0
  52. elFinder/js/elfinder.min.js +15 -0
  53. elFinder/js/i18n/elfinder.LANG.js +426 -0
  54. elFinder/js/i18n/elfinder.ar.js +367 -0
  55. elFinder/js/i18n/elfinder.bg.js +404 -0
  56. elFinder/js/i18n/elfinder.ca.js +367 -0
  57. elFinder/js/i18n/elfinder.cs.js +367 -0
  58. elFinder/js/i18n/elfinder.da.js +366 -0
  59. elFinder/js/i18n/elfinder.de.js +411 -0
  60. elFinder/js/i18n/elfinder.el.js +366 -0
  61. elFinder/js/i18n/elfinder.es.js +410 -0
  62. elFinder/js/i18n/elfinder.fa.js +366 -0
  63. elFinder/js/i18n/elfinder.fo.js +411 -0
  64. elFinder/js/i18n/elfinder.fr.js +366 -0
  65. elFinder/js/i18n/elfinder.he.js +360 -0
BootStart/BootStart.php ADDED
@@ -0,0 +1,467 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * The starter file that holds everything togather.
5
+ *
6
+ * @package BootStart_1_0_0
7
+ *
8
+ * @since version 0.1.1
9
+ *
10
+ * */
11
+ namespace BootStart_1_0_0;
12
+ use OptionsManager_1_0_0 as OM;
13
+ use CacheEngine_1_0_0 as CE;
14
+ /**
15
+ *
16
+ * Holds almost all the functionality that this nano framework supports.
17
+ *
18
+ *
19
+ * We will eventually add more detailed description later.
20
+ *
21
+ * */
22
+ abstract class BootStart{
23
+
24
+ /**
25
+ *
26
+ * @var string $name name of the plugin
27
+ *
28
+ * */
29
+ protected $name;
30
+
31
+ /**
32
+ *
33
+ * @var string $prefix Plugin wide prefix that will be used to differentiate from other plugin / or system vars
34
+ *
35
+ * */
36
+ protected $prefix;
37
+
38
+ /**
39
+ *
40
+ * @var string $path Absolute path of the plugin.
41
+ *
42
+ * */
43
+ protected $path;
44
+
45
+ /**
46
+ *
47
+ * @var bool $devEnv This variable is used to determine if the plugin will use the DevEnv variable which is defined at wp-config file.
48
+ *
49
+ * */
50
+ protected $devEnv;
51
+
52
+ /**
53
+ *
54
+ * @var array $CPTD Custom Post Type Data
55
+ *
56
+ * */
57
+ protected $CPTD;
58
+
59
+ /**
60
+ *
61
+ * @var array $SCD Short Code Data
62
+ *
63
+ * */
64
+ protected $SCD;
65
+
66
+ /**
67
+ *
68
+ * @var object $options The object of the options class
69
+ *
70
+ * */
71
+ protected $options;
72
+
73
+ /**
74
+ *
75
+ * @var string $upload_path :: This variable holds the path of the default upload folder
76
+ *
77
+ * */
78
+ protected $upload_path;
79
+
80
+ /**
81
+ *
82
+ * @var array $menu :: Defines how the menu would be
83
+ *
84
+ * */
85
+ protected $menu_data;
86
+
87
+ /**
88
+ *
89
+ * @var CE Cache Engine object
90
+ *
91
+ * */
92
+ protected $CE;
93
+
94
+ /**
95
+ *
96
+ * Constructor function
97
+ *
98
+ *
99
+ * This function does the works that every plugin must do like checking ABSPATH,
100
+ * triggering activation and deactivation hooks etc.
101
+ *
102
+ * @todo Add an uninstall function
103
+ *
104
+ * */
105
+ function __construct($name){
106
+
107
+ // Assigning name
108
+ $this->name = trim($name);
109
+
110
+ // Assigning prefix
111
+ $this->prefix = str_replace( ' ', '-', strtolower(trim($this->name)) );
112
+
113
+ // Assigning path
114
+ $this->path = __FILE__;
115
+
116
+ // Assigning DevEnv
117
+ $this->devEnv = false;
118
+
119
+ // Upload file path
120
+ $this->upload_path = ABSPATH . 'wp-content/uploads/' . $this->prefix;
121
+
122
+ // Setting php.ini variables
123
+ $this->php_ini_settings();
124
+
125
+ // Loading Options
126
+
127
+ $this->options = new OM\OptionsManager($this->name);
128
+
129
+ // Creating upload folder.
130
+ $this->upload_folder();
131
+
132
+ // Cache Object
133
+ $this->CE = new CE\CacheEngine($this->prefix, $this->upload_path);
134
+
135
+ // Frontend asset loading
136
+ add_action('wp_enqueue_scripts', array(&$this, 'assets') );
137
+
138
+ // Admin Panel asset loading
139
+ add_action('admin_enqueue_scripts', array(&$this, 'admin_assets') );
140
+
141
+ // Adding a menu at admin area
142
+ add_action( 'admin_menu', array(&$this, 'menu') );
143
+
144
+ // Adding uninstall hook
145
+
146
+
147
+ // Adding Ajax hooks
148
+
149
+
150
+ // Custom post hook
151
+ add_action( 'init', array(&$this, 'custom_post') );
152
+
153
+ // Shortcode hook
154
+ add_action( 'init', array(&$this, 'shortcode') );
155
+
156
+ // Registering activation hook
157
+ register_activation_hook(__FILE__, array('BootStart', 'activate') );
158
+
159
+ // Registering deactivation hook
160
+ register_deactivation_hook(__FILE__, array('BootStart', 'deactivate') );
161
+
162
+ }
163
+
164
+ /**
165
+ *
166
+ * Set the all necessary variables of php.ini file.
167
+ *
168
+ * @todo Add some php.ini variables.
169
+ *
170
+ * */
171
+ protected function php_ini_settings(){
172
+
173
+ // This should have a standard variable list.
174
+ /**
175
+ *
176
+ * ## Increase file upload limit
177
+ * ## Turn on error if of php if debugging variable is defined and set to true.
178
+ *
179
+ * */
180
+
181
+ }
182
+
183
+ /**
184
+ *
185
+ * Activation hook function
186
+ *
187
+ * @todo Add dependency check
188
+ *
189
+ * */
190
+ public static function activate(){
191
+
192
+ // Nothing yet
193
+
194
+ }
195
+
196
+ /**
197
+ *
198
+ * Deactivation hook function
199
+ *
200
+ * */
201
+ public static function deactivate(){
202
+
203
+ // Nothing is added here yet.
204
+
205
+ }
206
+
207
+ /**
208
+ *
209
+ * Loads frontend assets
210
+ *
211
+ * */
212
+ public function assets(){
213
+
214
+ // Including front-style.css
215
+ wp_enqueue_style($this->__('front-style'), $this->url('css/front-style.css'), false);
216
+
217
+ // Including front-script.js
218
+ wp_enqueue_script($this->__('front-script'), $this->url('js/front-script.js'), array(), '1.0.0', true );
219
+
220
+ // Including media for media upload
221
+ wp_enqueue_media();
222
+
223
+ // Including magnific popup
224
+ wp_enqueue_script( $this->__( 'movies-magnific-popup-js' ), $this->url( 'magnific-popup/jquery.magnific-popup.min.js' ), array( 'jquery' ) );
225
+
226
+ }
227
+
228
+ /*
229
+ *
230
+ * Loads the backend / admin assets
231
+ *
232
+ * */
233
+ public function admin_assets(){
234
+
235
+ // Jquery UI CSS
236
+ wp_enqueue_style( $this->__('jquery-ui-css'), $this->url('jquery-ui-1.11.4/jquery-ui.min.css') );
237
+
238
+ // elFinder CSS
239
+ wp_enqueue_style( $this->__('elfinder-css'), $this->url('elFinder/css/elfinder.min.css') );
240
+
241
+ // elFinder theme CSS
242
+ wp_enqueue_style( $this->__('elfinder-theme-css'), $this->url('elFinder/css/theme.css') );
243
+
244
+ // Including admin-style.css
245
+ wp_enqueue_style( $this->__('admin-style'), $this->url('css/admin-style.css') );
246
+
247
+ // Including utility.php
248
+ wp_enqueue_script( $this->__('utility-script'), $this->url('js/utility.php') );
249
+
250
+ // Including admin-script.js
251
+ wp_enqueue_script( $this->__('admin-script'), $this->url('js/admin-script.js'), array('jquery') );
252
+
253
+ // Jquery UI scripts
254
+ wp_enqueue_script( $this->__('jquery-ui-script'), $this->url('jquery-ui-1.11.4/jquery-ui.min.js'), array('jquery') );
255
+
256
+ // elFinder Scripts
257
+ wp_enqueue_script( $this->__('elfinder-script'), $this->url('elFinder/js/elfinder.full.js'), array('jquery') );
258
+
259
+ }
260
+
261
+ /**
262
+ *
263
+ * Adds a sidebar/sub/top menu
264
+ *
265
+ * */
266
+ public function menu(){
267
+
268
+ if( empty( $this->menu_data ) ) return;
269
+
270
+ if($this->menu_data['type'] == 'menu'){
271
+ // @ add_menu_page( $this->name, $this->name, 'manage_options', $this->prefix, array($this, 'admin_page'));
272
+ add_menu_page( $this->name, $this->name, 'manage_options', $this->prefix.'_settings', array(&$this, 'admin_panel'), '', 7 );
273
+ // @ add_posts_page( 'V Movies', 'V Movies', 'manage_options', 'v-movies', array($this, 'admin_panel') );
274
+ }
275
+
276
+ }
277
+
278
+ /**
279
+ *
280
+ * Adds an admin page to the backend.
281
+ *
282
+ * */
283
+ public function admin_panel(){
284
+
285
+ if(!current_user_can('manage_options')) die( $this->render('', 'access-denied') );
286
+
287
+ $this->render('', 'admin/index');
288
+
289
+ }
290
+
291
+ /**
292
+ *
293
+ * Absolute path finder
294
+ *
295
+ * @param string $relative_path relative path to the this plugin root folder.
296
+ * */
297
+ protected function path($relative_path){
298
+
299
+ return ABSPATH.'wp-content/plugins/'.$this->prefix.'/'.$relative_path;
300
+
301
+ }
302
+
303
+ /**
304
+ *
305
+ * Absolute URL finder
306
+ *
307
+ * @param string $string the relative url
308
+ *
309
+ * */
310
+ public function url($string){
311
+
312
+ return plugins_url('/'.$this->prefix.'/'.$string);
313
+
314
+ }
315
+
316
+ /**
317
+ *
318
+ * Prefixes
319
+ *
320
+ * @param string $string Takes any literal string.
321
+ *
322
+ * */
323
+ private function __($string){
324
+
325
+ return $string = $this->prefix.'__'.$string;
326
+
327
+ }
328
+
329
+ /**
330
+ *
331
+ * Shows the debugs
332
+ *
333
+ * @param string/array/int $data
334
+ *
335
+ * */
336
+ public function pr($data){
337
+
338
+ if($this->devEnv) if( !defined('DevEnv') || DevEnv == false ) return;
339
+ echo "<pre>";
340
+ print_r($data);
341
+ echo "</pre>";
342
+
343
+ }
344
+
345
+ /**
346
+ *
347
+ * Adds ajax hooks and functions automatically
348
+ *
349
+ *
350
+ * @param string $name Name of the function
351
+ *
352
+ * @param bool $guest Should the function work for guests *Default: false*
353
+ *
354
+ * */
355
+ public function add_ajax($name, $guest = false){
356
+
357
+ // Adds admin ajax
358
+ $hook = 'wp_ajax_'.$name;
359
+ add_action( $hook, array($this, $name) );
360
+
361
+ // Allow guests
362
+ if(!$guest) return;
363
+
364
+ $hook = 'wp_ajax_nopriv_'.$name;
365
+ add_action( $hook, array($this, $name) );
366
+
367
+ }
368
+
369
+ /**
370
+ *
371
+ * Get the script for ajax request
372
+ *
373
+ *
374
+ * @param string $name Name of the ajax request fuction.
375
+ *
376
+ * @param array $data Post data to send
377
+ *
378
+ * @return string $script A jQuery.post() request function to show on the the main page.
379
+ *
380
+ * */
381
+ public function get_ajax_script($name, $data){
382
+
383
+ $data['action'] = $name;
384
+
385
+ ?>
386
+
387
+ jQuery.post(
388
+ '<?php echo admin_url('admin-ajax.php'); ?>',
389
+ <?php echo json_encode($data);?>
390
+ '<?php echo $name; ?>'
391
+ );
392
+
393
+ <?php
394
+
395
+ }
396
+
397
+ /**
398
+ *
399
+ * Adds custom post
400
+ *
401
+ * */
402
+ public function custom_post(){
403
+
404
+ if(empty($this->CPTD)) return;
405
+
406
+ foreach ( $this->CPTD as $custom_post ){
407
+
408
+ $ret = register_post_type($custom_post[0], $custom_post[1]);
409
+
410
+ }
411
+
412
+ }
413
+
414
+ /**
415
+ *
416
+ * Adds Shortcodes
417
+ *
418
+ * */
419
+ public function shortcode(){
420
+
421
+ if( empty($this->STD) ) return;
422
+
423
+ foreach ( $this->STD as $std ){
424
+
425
+ $ret = add_shortcode($std, array($this, $std.'_view') );
426
+
427
+ }
428
+
429
+ }
430
+
431
+ /**
432
+ *
433
+ * Includes a view file form the view folder which matches the called functions name
434
+ *
435
+ * @param string $view_file Name of the view file.
436
+ *
437
+ * */
438
+ protected function render($data=null, $view_file = null){
439
+
440
+ if($view_file == null){
441
+
442
+ // Generates file name from function name
443
+ $trace = debug_backtrace();
444
+ $view_file = $trace[1]['function'].'.php';
445
+
446
+ } else {
447
+
448
+ $view_file .='.php';
449
+
450
+ }
451
+
452
+ include( $this->path('views/'.$view_file) );
453
+
454
+ }
455
+
456
+ /**
457
+ *
458
+ * @function upload_folder Checks if the upload folder is present. If not creates a upload folder.
459
+ *
460
+ * */
461
+ protected function upload_folder(){
462
+
463
+ // Creats upload directory for this specific plugin
464
+ if( !is_dir($this->upload_path ) ) mkdir( $this->upload_path , 0777 );
465
+
466
+ }
467
+ }
BootStart/CSV.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Workis with .csv extension file
5
+ *
6
+ * @package BootStart_0_1_0
7
+ *
8
+ * @since version 0.1.0
9
+ *
10
+ *
11
+ *
12
+ * @name CSV
13
+ *
14
+ * @author Aftabul Islam <toaihimel@gmail.com>
15
+ *
16
+ * @license GNU/GPLv3 or later
17
+ *
18
+ *
19
+ *
20
+ * */
21
+ namespace CSV_1_0_0;
22
+
23
+ class CSV{
24
+
25
+ /**
26
+ *
27
+ * @var string $path :: This variable is the file path of the .csv file.
28
+ *
29
+ * */
30
+ protected $path;
31
+
32
+ /**
33
+ *
34
+ * @var array $callback :: The callback function for every row.
35
+ *
36
+ * */
37
+ protected $callback;
38
+
39
+ /**
40
+ *
41
+ * @var string $token :: The token that devides the column of the csv.
42
+ *
43
+ * */
44
+ protected $token;
45
+
46
+ /**
47
+ *
48
+ * @var file-pointer $fp :: The pointer of the .csv file.
49
+ *
50
+ * */
51
+ protected $fp;
52
+
53
+ /**
54
+ *
55
+ * @var array $headers :: The headers of the .csv file.
56
+ *
57
+ * */
58
+ public $headers;
59
+
60
+ /**
61
+ *
62
+ * @var string $message :: Any message that the class has to show.
63
+ *
64
+ * */
65
+ protected $message;
66
+
67
+ /**
68
+ *
69
+ * Constructor function
70
+ *
71
+ * @param string $path :: Path of the .csv file. The path should be absolute path of the file.
72
+ *
73
+ * @param array $callback_function :: This is used to callback a function with the row array.
74
+ *
75
+ * @param string $token :: The token that devides the .csv columns
76
+ *
77
+ * */
78
+ public function __construct( $path = null, $token = ',' ){
79
+
80
+ // Checks if the file path is valid.
81
+ if( !$path ){
82
+ $this->message .= '<br/>Error: File Path is empty. It is essential that you input a valid file path.<br/>';
83
+ return;
84
+ }
85
+
86
+ $this->path = $path;
87
+ $this->token = $token;
88
+
89
+ // Opening the file
90
+ $this->fp = fopen( $path, "r" );
91
+
92
+ // Getting the header data
93
+ $this->headers = fgetcsv( $this->fp, 0, $this->token );
94
+
95
+ }
96
+
97
+ /**
98
+ *
99
+ * get_row function
100
+ *
101
+ * This function gets the row of the .csv file.
102
+ *
103
+ * */
104
+ public function get_row(){
105
+ return fgetcsv( $this->fp, 0, $this->token );
106
+ }
107
+
108
+ }
BootStart/CacheEngine.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace CacheEngine_1_0_0;
4
+ /**
5
+ *
6
+ * This class creates and saves a cache file on upload directory and provides necessary function to access special type of data as JSON.
7
+ *
8
+ * */
9
+ class CacheEngine{
10
+
11
+ /**
12
+ *
13
+ * @var $plugin_prefix prefix of the plugin that the CacheEngine will be used.
14
+ *
15
+ * */
16
+ public $plugin_prefix;
17
+
18
+ /**
19
+ *
20
+ * @var $upload_url upload path for the plugin
21
+ *
22
+ * */
23
+ public $upload_path;
24
+
25
+ /**
26
+ * Constructor function
27
+ *
28
+ * Checks if the upload derictory is created, and creates a subdirectory called "cache" to save the cache files.
29
+ *
30
+ * @param $plugin_prefix prefix of the plugin that will hold the cache engine data.
31
+ *
32
+ * @param $upload_path path of the upload directory
33
+ *
34
+ * */
35
+ public function __construct($plugin_prefix, $upload_path){
36
+
37
+ // Initializing the class-global $plugin_prefix variable
38
+ $this->plugin_prefix = $plugin_prefix;
39
+
40
+ // Initializing the class-global $upload_url variable
41
+ $this->upload_path = $upload_path;
42
+
43
+ // Creates cache folder
44
+ $this->create_cache_folder();
45
+
46
+ // Creating the default text file
47
+ $this->create_storage();
48
+ }
49
+
50
+ /**
51
+ *
52
+ * Creates the cache folder to save the data file
53
+ *
54
+ * */
55
+ protected function create_cache_folder(){
56
+
57
+ if( !is_dir($this->upload_path.'/cache/' ) ) mkdir( $this->upload_path.'/cache/' , 0777 );
58
+
59
+ }
60
+
61
+
62
+ /**
63
+ *
64
+ * Create the data storeage file if not created
65
+ *
66
+ * */
67
+ public function create_storage($file_name = null){
68
+
69
+ if($file_name == null) $file_name = $this->plugin_prefix;
70
+
71
+ $file_path = $this->upload_path.'/cache/'.$file_name.'.txt';
72
+ if(!file_exists($file_path)) fopen($file_path, 'w');
73
+
74
+ }
75
+
76
+ /**
77
+ *
78
+ * Load the javascript array
79
+ *
80
+ * @param $file_name Name of the file to fetch data form.
81
+ *
82
+ * @param $as_array if the data is shown as array.
83
+ *
84
+ * */
85
+ public function get_data($file_name = null, $as_array = true){
86
+
87
+ if($file_name == null) $file_name = $this->plugin_prefix;
88
+ $file_path = $this->upload_path.'/cache/'.$file_name.'.txt';
89
+ //~ if(!file_exists($file_path)) fopen($file_path, 'r');
90
+
91
+ return json_decode(file_get_contents($file_path), $as_array);
92
+
93
+
94
+ }
95
+
96
+ /**
97
+ *
98
+ * Updates the data file
99
+ *
100
+ * @param $array array data to be saved.
101
+ *
102
+ * @param $file_name Name of the file.
103
+ *
104
+ * */
105
+ public function set_data($array, $file_name = null){
106
+
107
+ if($file_name == null) $file_name = $this->plugin_prefix;
108
+ $file_path = $this->upload_path.'/cache/'.$file_name.'.txt';
109
+
110
+ }
111
+ }
BootStart/Debug.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Debug_1_0_0;
4
+
5
+ class Debug{
6
+
7
+ public static function P($variable){
8
+
9
+ if( !defined('B_DEBUG') || !B_DEBUG) return;
10
+
11
+ echo "<pre>";
12
+ print_r($variable);
13
+ echo "</pre>";
14
+
15
+ }
16
+
17
+ }
18
+
19
+ ?>
BootStart/FTP.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Downloads file to local server for later use.
5
+ *
6
+ * @package BootStart_0_1_0
7
+ *
8
+ * @since version 0.1.0
9
+ *
10
+ *
11
+ *
12
+ * @name CSV
13
+ *
14
+ * @author Aftabul Islam <toaihimel@gmail.com>
15
+ *
16
+ * @license GNU/GPLv3 or later
17
+ *
18
+ *
19
+ *
20
+ * */
21
+ namespace FTP_1_0_0;
22
+
23
+ class FTP{
24
+
25
+ /**
26
+ *
27
+ * @var string $server :: Name of the remote file server where the file resides.
28
+ *
29
+ * */
30
+ protected $server;
31
+
32
+ /**
33
+ *
34
+ * @var string $username :: Username
35
+ *
36
+ * */
37
+ protected $username;
38
+
39
+ /**
40
+ *
41
+ * @var string $password :: Password of the associated username.
42
+ *
43
+ * */
44
+ protected $password;
45
+
46
+ /**
47
+ *
48
+ * @var pointer $connect :: The server connection.
49
+ *
50
+ * */
51
+ protected $connect;
52
+
53
+ /**
54
+ *
55
+ * @var constant $file_transfer_mode :: File transfer mode FTP_ASCII and FTP_BINARY
56
+ *
57
+ * */
58
+ protected $file_transfer_mode;
59
+
60
+ /**
61
+ *
62
+ * @var string $message :: Any message that the class has to show.
63
+ *
64
+ * */
65
+ protected $message;
66
+
67
+ /**
68
+ *
69
+ * Constructor function
70
+ *
71
+ * */
72
+ public function __construct( $server = null, $username = null, $password = null){
73
+
74
+ // Populating Global Variables
75
+ $this->server = $server;
76
+ $this->username = $username;
77
+ $this->password = $password;
78
+ $this->stablish_connection();
79
+ }
80
+
81
+ /**
82
+ *
83
+ * stablish_connection
84
+ *
85
+ * Stablishes connection
86
+ *
87
+ * */
88
+ public function stablish_connection(){
89
+ // Connecting
90
+ $this->connect = ftp_connect( $this->server );
91
+
92
+ // Populating Local Variables
93
+ $login = ftp_login( $this->connect, $this->username, $this->password );
94
+ }
95
+
96
+ /**
97
+ *
98
+ * get_file function
99
+ *
100
+ * This function gets the row of the .csv file.
101
+ *
102
+ * */
103
+ public function get_file($file_location_local, $file_location_remote, $file_transfer_mode = FTP_ASCII){
104
+
105
+ $response = ftp_get( $this->connect, $file_location_local, $file_location_remote, $file_transfer_mode );
106
+ ftp_close($this->connect);
107
+ return $response;
108
+ }
109
+
110
+ /**
111
+ *
112
+ * get_files
113
+ *
114
+ * Gets all the file list in a directory
115
+ *
116
+ * */
117
+ public function get_files($directory_path){
118
+
119
+ $file_list = ftp_nlist( $this->connect, $directory_path );
120
+
121
+ return $file_list;
122
+
123
+ }
124
+
125
+ /**
126
+ *
127
+ * delete_file
128
+ *
129
+ * Deletes single file from the remote server
130
+ *
131
+ * */
132
+ public function delete_file($file_path){
133
+ return ftp_delete($this->connect, $file_path);
134
+ }
135
+
136
+ }
BootStart/HL7.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Workis with .hl7 extension file
5
+ *
6
+ * @package BootStart_0_1_1
7
+ *
8
+ * @since version 0.1.1
9
+ *
10
+ *
11
+ *
12
+ * @name HL7
13
+ *
14
+ * @author Aftabul Islam <toaihimel@gmail.com>
15
+ *
16
+ * @license GNU/GPLv3 or later
17
+ *
18
+ * TERMINOLOGY FOR HL7 FILE
19
+ * MSH = Message Id
20
+ * PID = Paitent Identity
21
+ * OBR = Exam/Digonostic Information
22
+ * ORC = Commor Order Request
23
+ * OBX = Transmit single observation
24
+ *
25
+ * */
26
+ namespace HL7_1_0_0;
27
+
28
+ class HL7{
29
+
30
+ /**
31
+ *
32
+ * @var array $data :: This variable holds the entire data
33
+ *
34
+ * */
35
+ protected $data;
36
+
37
+ /**
38
+ *
39
+ * @var string $path :: This variable is the file path of the .hl7 file.
40
+ *
41
+ * */
42
+ protected $path;
43
+
44
+ /**
45
+ *
46
+ * @var string $token :: The token that devides the column of the .hl7.
47
+ *
48
+ * */
49
+ protected $token;
50
+
51
+ /**
52
+ *
53
+ * @var file-pointer $fp :: The pointer of the .hl7 file.
54
+ *
55
+ * */
56
+ protected $fp;
57
+
58
+ /**
59
+ *
60
+ * @var array $headers :: The headers of the .hl7 file.
61
+ *
62
+ * */
63
+ public $headers;
64
+
65
+ /**
66
+ *
67
+ * @var string $message :: Any message that the class has to show.
68
+ *
69
+ * */
70
+ protected $message;
71
+
72
+ /**
73
+ *
74
+ * Constructor function
75
+ *
76
+ * @param string $path :: Path of the .hl7 file. The path should be absolute path of the file.
77
+ *
78
+ * @param array $callback_function :: This is used to callback a function with the row array.
79
+ *
80
+ * @param string $token :: The token that devides the .hl7 columns
81
+ *
82
+ * */
83
+ public function __construct( $path = null, $token = '|' ){
84
+
85
+ // Checks if the file path is valid.
86
+ if( !$path ){
87
+ $this->message .= '<br/>Error: File Path is empty. It is essential that you input a valid file path.<br/>';
88
+ return;
89
+ }
90
+
91
+ $this->path = $path;
92
+ $this->token = $token;
93
+
94
+ // Opening the file
95
+ $this->fp = fopen( $path, "r" );
96
+
97
+ }
98
+
99
+ /**
100
+ *
101
+ * get_row function
102
+ *
103
+ * This function gets the row of the .hl7 file.
104
+ *
105
+ * */
106
+ public function parse_data(){
107
+
108
+ while ( $data = fgetcsv( $this->fp, 0, $this->token ) ) $this->data[$data[0]][] = $data;
109
+
110
+ return $this->data;
111
+ }
112
+
113
+ }
BootStart/OptionsManager.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Managers options. Works with BootStart Class
5
+ *
6
+ * @package BootStart_0_1_0
7
+ *
8
+ * @since version 0.1.0
9
+ *
10
+ *
11
+ *
12
+ * @name CSV
13
+ *
14
+ * @author Aftabul Islam <toaihimel@gmail.com>
15
+ *
16
+ * @license GNU/GPLv3 or later
17
+ *
18
+ *
19
+ *
20
+ * */
21
+ namespace OptionsManager_1_0_0;
22
+
23
+
24
+ class OptionsManager{
25
+
26
+ /**
27
+ *
28
+ * @var string $name Name of the plugin.
29
+ *
30
+ * */
31
+ protected $name;
32
+
33
+ /**
34
+ *
35
+ * @var string $prefix Prefix of the plugin calculated from then name.
36
+ *
37
+ * */
38
+ protected $prefix;
39
+
40
+ /**
41
+ *
42
+ * @var string $options_name Name of the option which is going to be stored in the wpdb.
43
+ * It is same as the prefix but added for clearification.
44
+ *
45
+ * */
46
+ protected $options_name;
47
+
48
+ /**
49
+ *
50
+ * @var array $options The options are stored in this variable.
51
+ *
52
+ * */
53
+ public $options;
54
+
55
+ /**
56
+ *
57
+ * The main constructor function. Initializes and loads the options from the database.
58
+ *
59
+ * @param string $name Name of the plugin. It helps to retrive option data.
60
+ *
61
+ * */
62
+ function __construct($name = null){
63
+
64
+ $this->name = $name;
65
+ $this->prefix = str_replace(' ', '-', trim($name) );
66
+ $this->options_name = $this->prefix;
67
+
68
+ // Retrive the options from the database.
69
+ $this->options = $this->retrive();
70
+
71
+ // Registering shutdown function as destructor
72
+ register_shutdown_function(array($this, 'destruct'));
73
+
74
+ }
75
+
76
+ /**
77
+ *
78
+ * This function retrives the options from the database.
79
+ * If the options data is not present then it creates and retrives the data.
80
+ *
81
+ * @return array $options
82
+ *
83
+ * */
84
+ protected function retrive(){
85
+
86
+ $this->options = get_option($this->prefix);
87
+
88
+ if( empty($this->options) ){
89
+
90
+ update_option($this->prefix,array());
91
+ $this->options = array();
92
+
93
+ } else return $this->options;
94
+
95
+ }
96
+
97
+ /**
98
+ *
99
+ * This function sets the value value of an option.
100
+ *
101
+ * @params string $name Name of the option.
102
+ * @params mixed $value Value against the name.
103
+ *
104
+ * @return bool/string $error Error or successess message.
105
+ *
106
+ * */
107
+ public function set($name, $value){
108
+
109
+ $this->options[$name] = $value;
110
+
111
+ }
112
+
113
+ /**
114
+ *
115
+ * This function returns the value of the option
116
+ *
117
+ * @param string $name Name of the option.
118
+ *
119
+ * @reurn mixed $value Value set against the name.
120
+ *
121
+ * */
122
+ public function get($name){
123
+
124
+ return $this->options[$name];
125
+
126
+ }
127
+
128
+ /**
129
+ *
130
+ * Returns a form that manipulates the options.
131
+ *
132
+ * @params array $list List of the options that is the forms to be generated.
133
+ *
134
+ * @retrun A HTML form to manipulate options.
135
+ *
136
+ * */
137
+ public function get_form(array $list){
138
+
139
+
140
+ $form = "<form method='post' action='' >";
141
+ $form .='<table><tbody>';
142
+
143
+ // Traversing the entire list
144
+ foreach($list as $li){
145
+
146
+ $name = $li['key'];
147
+ $type = isset($li['type']) && !empty($li['type']) ? $li['type'] : 'text';
148
+ $label = $li['label'];
149
+ $id = $name.'_id';
150
+ $class = "OMDC_input ".$li['class'];
151
+ $required = isset($li['required']) && $li['required'] ? 'required' : '' ;
152
+ $default = isset($li['default']) ? $li['default'] : '';
153
+
154
+ $value = $this->path_to_val($name);
155
+
156
+ $value = $value ? $value : $default;
157
+
158
+ // Genarating input fields.
159
+ $input ='<tr><td>';
160
+ $input .= "<label for='{$id}' class='OMDC_label'>{$label}</label></td>";
161
+ $input .= "<td/><input type='{$type}' name='{$name}' id='{$id}' class='{$class}' value='{$value}' {$required} /><br/>";
162
+ $input .= "</td></tr>";
163
+ $form .= $input;
164
+ }
165
+ $form .= "<tr><td><input type='submit' value='Save' id='op_submit' /></td><td id='op_message'></td></tr>";
166
+ $form .= "</tbody></table>";
167
+ $form .= "</form>";
168
+
169
+ return $form;
170
+
171
+ }
172
+
173
+ /**
174
+ *
175
+ * Saves the data from the settings form
176
+ *
177
+ * @param array $list List of the settings
178
+ *
179
+ * @return string $string Success/Error Message.
180
+ *
181
+ * @todo Sanitize post data
182
+ *
183
+ * */
184
+ public function save_form($list){
185
+
186
+ if( empty($_POST) ) return;
187
+
188
+ $posts = $_POST;
189
+
190
+ $keys = array_keys($posts);
191
+ foreach ($keys as $key){
192
+
193
+ $value = $posts[$key];
194
+ $this->path_to_val($key, $value);
195
+
196
+ }
197
+
198
+ }
199
+
200
+ /**
201
+ *
202
+ * Converts string to value
203
+ *
204
+ * @param string $name The array string path.
205
+ *
206
+ * @param string $set If the value needs to be stored. If false the value is searched and returned. Default is false.
207
+ *
208
+ * @param mixed $val The value which has to be set.
209
+ *
210
+ * @return mixed $value The value of the options. Returns false if the value doesn't exists.
211
+ *
212
+ * */
213
+ protected function path_to_val($name, $val = '' ){
214
+
215
+ // calculating path
216
+ $nested = explode(':', $name);
217
+ $path = '';
218
+ foreach($nested as $ne){
219
+ $path .= "['{$ne}']";
220
+ }
221
+ $statement = '$setted = isset($this->options'.$path.');';
222
+ eval($statement);
223
+
224
+ if( !empty($val) ){
225
+
226
+ $statement = '$this->options'.$path." = '{$val}';";
227
+ eval($statement);
228
+ return true;
229
+
230
+ } elseif($setted){
231
+
232
+ $statement = '$value = $this->options'.$path.';';
233
+ eval($statement);
234
+ return $value;
235
+
236
+ }else {
237
+
238
+ return false;
239
+
240
+ }
241
+
242
+ }
243
+
244
+ /**
245
+ *
246
+ * Destructor function which saves the options value to the database.
247
+ *
248
+ * */
249
+ public function destruct(){
250
+
251
+ update_option($this->prefix, $this->options);
252
+
253
+ }
254
+ }
BootStart/REST.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Works with REST. Recives REST data.
5
+ *
6
+ * @package BootStart_0_1_0
7
+ *
8
+ * @since version 0.1.0
9
+ *
10
+ *
11
+ *
12
+ * @name CSV
13
+ *
14
+ * @author Aftabul Islam <toaihimel@gmail.com>
15
+ *
16
+ * @license GNU/GPLv3 or later
17
+ *
18
+ *
19
+ *
20
+ * */
21
+ namespace REST_1_0_0;
22
+
23
+ class REST{
24
+
25
+ /**
26
+ *
27
+ * @var array $post The post data that has to be sent to the the remove server.
28
+ *
29
+ * */
30
+ protected $post;
31
+
32
+ /**
33
+ *
34
+ * @var string $url URL of the request.
35
+ *
36
+ * */
37
+ protected $url;
38
+
39
+ /**
40
+ *
41
+ * @var array $header Header data that is to be included.
42
+ *
43
+ * */
44
+ protected $header;
45
+
46
+ /**
47
+ *
48
+ * @var string $response_type What type of response does the request return JSON/XML
49
+ *
50
+ * */
51
+ protected $return_type;
52
+
53
+ /**
54
+ *
55
+ * @var string $prefix The prefix of this class to store cached data in the database.
56
+ *
57
+ * */
58
+ protected $prefix;
59
+
60
+ /**
61
+ *
62
+ * @var array $cache The cached data will be stored here.
63
+ *
64
+ * */
65
+ protected $cache;
66
+
67
+ /**
68
+ *
69
+ * Constructor function
70
+ *
71
+ * @param string $url URL of the request
72
+ *
73
+ * @param array $post The post data that had to be sent
74
+ *
75
+ * @param string $return_type The response type
76
+ *
77
+ * @param string $prefix Prefix to be used for saving cached data.
78
+ *
79
+ * */
80
+ function __construct($url, $return_type = 'JSON', $post = null, $header = null, $prefix = 'REST_'){
81
+
82
+ $this->url = $url;
83
+
84
+ $this->post = $post;
85
+
86
+ $this->return_type = $return_type;
87
+
88
+ $this->header = $header;
89
+
90
+ $this->prefix = $prefix;
91
+
92
+ // Loading cached data
93
+ $this->cache = get_option($this->prefix);
94
+ $this->cache = !empty($this->cache) ? $this->cache : array();
95
+
96
+ // Registering function
97
+ register_shutdown_function( array($this, 'destruct') );
98
+
99
+ }
100
+
101
+ /**
102
+ *
103
+ * Get the response from the remote server.
104
+ *
105
+ * @param bool $from_cache Should the result be retirved from cache.
106
+ *
107
+ * @return array $response The data fetched from the request.
108
+ *
109
+ * */
110
+ public function get_response($from_cache = false){
111
+
112
+ $key = $this->url.$this->return_type.serialize($this->post).serialize($this->header);
113
+
114
+ // Should the data be returned from cahce
115
+ if($from_cache){
116
+
117
+ if( isset($this->cache["{$key}"]) && !empty($this->cache["{$key}"]) ) return $this->cache["{$key}"];
118
+
119
+ }
120
+
121
+ $ch = curl_init();
122
+
123
+ curl_setopt($ch, CURLOPT_URL, $this->url);
124
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
125
+
126
+ // Setting header information
127
+ if( !empty($this->header) ) curl_setopt( $ch, CURLOPT_HTTPHEADER, $this->header );
128
+
129
+ $response = curl_exec($ch);
130
+
131
+
132
+
133
+ curl_close($ch);
134
+
135
+ $data = json_decode($response);
136
+
137
+ $this->cache["{$key}"] = $data;
138
+
139
+ return $data;
140
+ }
141
+
142
+ /**
143
+ *
144
+ * Destructor function
145
+ *
146
+ * */
147
+ function destruct(){
148
+
149
+ update_option($this->prefix, $this->cache);
150
+
151
+ }
152
+
153
+ }
BootStart/__init__.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * Initialize and loads the entire framework
6
+ *
7
+ * @package BootStart_1_0_0
8
+ *
9
+ * @since version 0.1.0
10
+ *
11
+ * */
12
+ namespace BootStart_1_0_0;
13
+
14
+ $modules = array(
15
+
16
+ 'BootStart',
17
+ 'OptionsManager',
18
+ 'CSV',
19
+ 'HL7',
20
+ 'FTP',
21
+ 'REST',
22
+ 'Debug',
23
+ 'CacheEngine'
24
+
25
+ );
26
+
27
+ // Loading all the files
28
+ foreach ( $modules as $module ) require_once( $module . '.php' );
css/admin-style.css ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .bootstart-admin-container{
2
+ float: unset;
3
+ margin: 0px auto;
4
+ margin-right: 12px;
5
+ padding: 0px;
6
+ }
7
+
8
+ .bootstart-admin-header{
9
+ font-size: 1.8em;
10
+ text-align: center;
11
+ }
12
+
13
+ .bootstart-admin-header h2{
14
+ color: #43EBCC;
15
+ }
16
+
17
+ .bootstart-admin-navigation{
18
+ text-align: center;
19
+ }
20
+
21
+ .bootstart-admin-navigation ul li{
22
+ display: inline-block;
23
+ font-size: 1.2em;
24
+ margin: 5px;
25
+ padding:10px;
26
+ }
27
+
28
+ .bootstart-admin-navigation ul li:hover{
29
+ border-bottom: 2px solid #43EBCC;
30
+ }
31
+
32
+ .bootstart-admin-active-page{
33
+ border-bottom: 2px solid #43EBCC;
34
+ }
35
+
36
+ .bootstart-admin-navigation ul li a{
37
+ text-decoration: none;
38
+ }
css/front-style.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #shipping_last_name_field{
2
+ padding: 0px;
3
+ }
4
+
5
+ .cuar-private-page > div:nth-child(1) > div:nth-child(1) > a:nth-child(1){
6
+ font-size: 24px;
7
+ color: #0080C6 !important;
8
+ }
9
+
10
+ p.myaccount_user{
11
+ font-size: 24px;
12
+ line-height: initial;
13
+ }
elFinder/Changelog ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2016-01-19 Naoki Sawada <hypweb@gmail.com>
2
+
3
+ * elFinder (2.1.6):
4
+ - Fixed #1074 startPath for multi volumes
5
+ - Fixed #1172 enbug-fix of rename command
6
+ - Fixed #1174 support for multi-instance on the same connector
7
+ - Plugin: AutoResize New option `preserveExif`
8
+ - Fixed #179 JPEG quality specifiable
9
+ - Fixed #1176 auto-sync check with HTTP long polling/inotifywait
10
+ - Fixed #1181 case insensitive search problem of LocalFileSystem driver
11
+ - Added an autosync button into contextmenu `Reload`
12
+ - Added new client configuration `syncStart`
13
+ - Search result view optimization
14
+ - Adddd new volume root option `searchTimeout` (default 30s)
15
+ - Added new crient command `opendir` - opens selected item's parent folder at search result
16
+ - Sortable "Places" (your favorites)
17
+ - Fixed #1193 open the file at direct URL if possible
18
+ - And some minor bug fixes
19
+
20
+
21
+ 2015-12-26 Naoki Sawada <hypweb@gmail.com>
22
+
23
+ * elFinder (2.1.5):
24
+ - Fixed bug that can't in writable with `chmod`
25
+ - Show remove item info in confirm dialog on `rm` action
26
+ - Fixed #1165, MIME types maintenance (doc, dot, xlt, xla)
27
+ - Fixed problem if filename included character that can't be json encode
28
+ - Added option `convmap` to Normalizer plugin
29
+ - And some minor bug fixes
30
+
31
+
32
+ 2015-12-16 Naoki Sawada <hypweb@gmail.com>
33
+
34
+ * elFinder (2.1.4):
35
+ - Fixed #1163 Dropbox driver supported windows server
36
+ - Fixed search problem on Windows server
37
+
38
+
39
+ 2015-12-13 Naoki Sawada <hypweb@gmail.com>
40
+
41
+ * elFinder (2.1.3):
42
+ - Auto configure `customHeaders`, `xhrFields` for CORS
43
+ - Allow set elFinder::$volumesCnt by HTTP header "X-elFinder-VolumesCntStart"
44
+ - Resolved #1145, Configurable keyboard shortcuts of any command
45
+ - Force non-overwrite on URL uploading
46
+ - Supported Drag out function with [Shift] + Drag of file item (with out IE)
47
+ - Drag and Drop copy from elFinder(A) to elFinder(B)
48
+ - Make list of download url to Text editor
49
+ - Drag and Drop download with Chrome (Single file only)
50
+ - etc.
51
+ - Choosable "backup" at pasting of same name files
52
+ - Show confirm at uploading of same name file exists
53
+ - Show URL link icon on Download menu in contextmenu
54
+ - This icon is clickable as normal link, shows context menu and drag out
55
+ - Added more feedback sign of jQuery DnD drag icon
56
+ - Others, some minor bug fixes
57
+
58
+
59
+ 2015-11-23 Naoki Sawada <hypweb@gmail.com>
60
+
61
+ * elFinder (2.1.2):
62
+ - [security-fix] vulnerability of the MIME type quarantine
63
+ - Multi-line filename editing on icon view
64
+ - Auto expands filename editing on list view
65
+ - Fixed #1124, Uploading problem exactly 20MiB/30MiB/40MiB...
66
+ - Marged #1125, Fix file permissions for MySQL LOAD_FILE command
67
+ - Fixed #1127, Supported full path including the drive letter of the Windows server
68
+ - Marged #1131, #1132, Complete Romanian(ro) translation
69
+ - Fixed symbolic link file stats `mtime`, `size`
70
+ - Marged #1133, Complete German(de) translation
71
+ - Marged #1139, Complete Türkçe(tr) translation
72
+ - Marged #1141, Plugin Normalizer function: make filename lowercase
73
+ - Others, some minor bug fixes
74
+
75
+
76
+ 2015-11-23 Naoki Sawada <hypweb@gmail.com>
77
+
78
+ * elFinder (2.0.4):
79
+ - [security-fix] vulnerability of the MIME type quarantine
80
+
81
+
82
+ 2015-11-10 Naoki Sawada <hypweb@gmail.com>
83
+
84
+ * elFinder (2.1.1):
85
+ - More High performance server backend and light client UI
86
+ - Connector plugin
87
+ - AutoResize : Auto resize on file upload.
88
+ - Normalizer : UTF-8 Normalizer of file-name and file-path etc.
89
+ - Sanitizer : Sanitizer of file-name and file-path etc.
90
+ - Watermark : Print watermark on file upload.
91
+ - Folder upload with Chrome
92
+ - Chunked file upload
93
+ - Upload directly to the folder
94
+ - Creating the archive by specifying the file name
95
+ - Direct extraction to the current working directory (you do not want to create a folder)
96
+ - Support Dropbox.com© (Configurable & As network volume)
97
+ - Supports custom information in info dialog
98
+ - Configuable columns of list view
99
+ - Supports custom CSS class function of tree view
100
+
101
+
102
+ 2015-11-10 Naoki Sawada <hypweb@gmail.com>
103
+
104
+ * elFinder (2.0.3):
105
+ - jQuery 1.9+ support
106
+ - 350+ bugs fixed since rc1 version
107
+ - Modify translations and some new translations
108
+ - Netmount volume function
109
+
110
+
111
+ 2012-04-10 Troex Nevelin <troex@fury.scancode.ru>
112
+
113
+ * elFinder (2.0 rc1):
114
+ - Major code refactor
115
+ - 200+ bugs fixed since beta version
116
+ - 14 new translations
117
+ - FTP volume driver
118
+ - Advanced image editing dialog
119
+
120
+
121
+ 2011-07-10 Troex Nevelin <troex@fury.scancode.ru>
122
+
123
+ * elFinder (2.0 beta):
124
+ - New branch 2.x, total rewrite from scratch
125
+ - MySQL volume driver support (as file storage)
126
+ - Full drag & drop support with HTML5 upload
127
+
128
+
129
+ 2011-06-20 Troex Nevelin <troex@fury.scancode.ru>
130
+
131
+ * elFinder (1.2):
132
+ - jQuery and UI updated
133
+ - Python connector improvements
134
+ - QuickLook fixed
135
+ - CSS fixes
136
+ - New icons from http://pixel-mixer.com/
137
+ - New languages: Czech, Dutch, German, Greek, French, Hungarian,
138
+ Italian, Japanese, Latvian, Polish, Brazilian Portuguese,
139
+ Slovak, Thai, Turkish, Vietnamese, Simplified Chinese,
140
+ Traditional Chinese
141
+
142
+
143
+ 2010-03-11 Troex Nevelin <troex@fury.scancode.ru>
144
+
145
+ * elFinder (1.1):
146
+ - Total rewrite from scratch.
147
+ - New PHP connector.
148
+ - Python connector.
149
+ - Create/Extract archives.
150
+ - QuickLook.
151
+ - "Places" for favorites.
152
+ - Background thumbnails creation.
153
+ - Exteneded configuration options of connector and client.
154
+ - Spanish localization.
155
+ - JSON API description.
156
+ - Full documentation in English, Russian and Spanish.
157
+ - No more use of jquery plugins.
158
+ - Website update.
159
+ - [bugfix] All known bugs fixed.
160
+
161
+
162
+ 2009-11-09 Dmitry Levashov <dio@std42.ru>
163
+
164
+ * elFinder (1.0.1):
165
+ - In directory tree panel added arrows to open/close directories
166
+ without entering in.
167
+ - Added shortcut support for copy/cut/paste/delete files and
168
+ folders. For Mac users added Command+Backspace support.
169
+ - Added context menu to current directory.
170
+ - Added help.
171
+ - [bugfix] invalid determing files/folders permissions using
172
+ "perms" options in php connector
173
+
elFinder/README.md ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ elFinder
2
+ ========
3
+
4
+ <pre>
5
+ _ ______ _ _
6
+ | | ____(_) | |
7
+ ___| | |__ _ _ __ __| | ___ _ __
8
+ / _ \ | __| | | '_ \ / _` |/ _ \ '__|
9
+ | __/ | | | | | | | (_| | __/ |
10
+ \___|_|_| |_|_| |_|\__,_|\___|_|
11
+ </pre>
12
+
13
+ elFinder is an open-source file manager for web, written in JavaScript using
14
+ jQuery UI. Creation is inspired by simplicity and convenience of Finder program
15
+ used in Mac OS X operating system.
16
+
17
+ Contents
18
+ --------
19
+ * [Branches](#branches)
20
+ * [Features](#features)
21
+ * [Requirements](#requirements)
22
+ * [Installation](#installation)
23
+ * [Downloads](#downloads)
24
+ * [Demo Sites](#demo-sites)
25
+ * [FAQs](#faqs)
26
+ * [3rd Party Connectors](#3rd-party-connectors)
27
+ * [3rd Party Volume Drivers](#3rd-party-volume-drivers)
28
+ * [3rd Party Themes](#3rd-party-themes)
29
+ * [Support](#support)
30
+ * [Authors](#authors)
31
+ * [License](#license)
32
+
33
+ Branches
34
+ --------
35
+ - [master](https://github.com/Studio-42/elFinder/tree/master) - Main development branch
36
+ - [2.1-src](https://github.com/Studio-42/elFinder/tree/2.1-src) - 2.1 development branch, auto build to 2.1 on commit
37
+ - [2.0-src](https://github.com/Studio-42/elFinder/tree/2.0-src) - 2.0 development branch (Security fix only), auto build to 2.0 on commit
38
+ - [2.1](https://github.com/Studio-42/elFinder/tree/2.1) - 2.1 nightly build branch
39
+ - [2.0](https://github.com/Studio-42/elFinder/tree/2.0) - 2.0 nightly build branch
40
+
41
+ Features
42
+ --------
43
+ **2.0.x**
44
+ * All operations with files and folders on a remote server (copy, move,
45
+ upload, create folder/file, rename, etc.)
46
+ * High performance server backend and light client UI
47
+ * Multi-root support
48
+ * Local file system, MySQL, FTP volume storage drivers
49
+ * Background file upload with Drag & Drop HTML5 support
50
+ * List and Icons view
51
+ * Keyboard shortcuts
52
+ * Standard methods of file/group selection using mouse or keyboard
53
+ * Move/Copy files with Drag & Drop
54
+ * Archives create/extract (zip, rar, 7z, tar, gzip, bzip2)
55
+ * Rich context menu and toolbar
56
+ * Quicklook, preview for common file types
57
+ * Edit text files and images
58
+ * "Places" for your favorites
59
+ * Calculate directory sizes
60
+ * Thumbnails for image files
61
+ * Easy to integrate with web editors (elRTE, CKEditor, TinyMCE)
62
+ * Flexible configuration of access rights, upload file types, user interface
63
+ and other
64
+ * Extensibility
65
+ * Simple client-server API based on JSON
66
+
67
+ **2.1.x**
68
+ * More High performance server backend and light client UI
69
+ * Connector plugin
70
+ * [AutoResize](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/AutoResize/plugin.php) : Auto resize on file upload.
71
+ * [Normalizer](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/Normalizer/plugin.php) : UTF-8 Normalizer of file-name and file-path etc.
72
+ * [Sanitizer](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/Sanitizer/plugin.php) : Sanitizer of file-name and file-path etc.
73
+ * [Watermark](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/Watermark/plugin.php) : Print watermark on file upload.
74
+ * Folder upload with Chrome
75
+ * Chunked file upload
76
+ * Upload directly to the folder
77
+ * Upload form URL (or list)
78
+ * Creating the archive by specifying the file name
79
+ * Direct extraction to the current working directory (you do not want to create a folder)
80
+ * Supports Dropbox.com&copy; (Configurable & As network volume)
81
+ * Supports custom information in info dialog
82
+ * Configuable columns of list view
83
+ * Supports custom CSS class function of tree view
84
+
85
+ Requirements
86
+ ------------
87
+
88
+ ### Client
89
+ * Modern browser. elFinder was tested in Firefox 12, Internet Explorer 8+,
90
+ Safari 6, Opera 12 and Chrome 19
91
+
92
+ ### Server
93
+ * Any web server
94
+ * PHP 5.2+ (for thumbnails - mogrify utility or GD/Imagick module)
95
+
96
+ Installation
97
+ ------------
98
+ ### Builds (compressed)
99
+ 1. Download and unzip one of the [builds](#downloads) below to your PHP server
100
+ 2. Rename `/php/connector.minimal.php-dist` to `/php/connector.minimal.php`
101
+ 3. Load `/elfinder.html` in your browser to run elFinder
102
+
103
+ ### Source (uncompressed)
104
+ 1. Clone this repository to your PHP server
105
+
106
+ ```
107
+ $ git clone https://github.com/Studio-42/elFinder.git
108
+ ```
109
+
110
+ 2. Rename `/php/connector.minimal.php-dist` to `/php/connector.minimal.php`
111
+ 3. Load `/elfinder.src.html` in your browser to run elFinder
112
+
113
+ Downloads
114
+ ------------
115
+ **Stable releases**
116
+ + [elFinder 2.1.6](https://github.com/Studio-42/elFinder/archive/2.1.6.zip)
117
+ + [elFinder 2.0.5](https://github.com/Studio-42/elFinder/archive/2.0.5.zip)
118
+
119
+ **Nightly builds**
120
+ + [elFinder 2.1.x (Nightly)](https://github.com/Studio-42/elFinder/archive/2.1.zip)
121
+ + [elFinder 2.0.x (Nightly)](https://github.com/Studio-42/elFinder/archive/2.0.zip)
122
+
123
+ Demo sites
124
+ ------------
125
+ **2.1.x Nightly**
126
+ + http://studio-42.github.io/elFinder/ (with CORS)
127
+ + http://hypweb.net/elFinder-nightly/demo/2.1/
128
+
129
+ **2.0**
130
+ + http://elfinder.org/ (rc1)
131
+ + http://hypweb.net/elFinder-nightly/demo/2.0/ (2.0.x Nightly)
132
+
133
+ FAQs
134
+ ------------
135
+ ### Which version of elFinder should I use?
136
+ * **2.0.x** if you want to use 2.0 with legacy connectors.
137
+
138
+ * **2.1.x** if you want to try the experimental (*bleeding edge, but connector is PHP only*).
139
+
140
+ ### Should I use elFinder builds (compressed) or source (uncompressed)?
141
+
142
+ For debugging and development, use the [source](#source-uncompressed). For production, use [builds](#builds-compressed).
143
+
144
+ ### How do I integrate elFinder with CKEditor/TinyMCE/elRTE/etc...?
145
+ Check out the [wiki](https://github.com/studio-42/elFinder/wiki#howtos) for individual instructions.
146
+
147
+ ### The procedure of language files created or modified?
148
+
149
+ You can create or modify the language file to use translation tool. Please refer to the pull request the results to the respective branch.
150
+ * [2.1 branch translation tool](http://studio-42.github.io/elFinder/tools/langman/#2.1)
151
+ * [2.0 branch translation tool](http://studio-42.github.io/elFinder/tools/langman/#2.0)
152
+
153
+
154
+ 3rd party connectors
155
+ --------------------
156
+ * [Python](https://github.com/Studio-42/elfinder-python)
157
+ * [Django](https://github.com/mikery/django-elfinder)
158
+ * [Ruby/Rails](https://github.com/phallstrom/el_finder)
159
+ * [Java Servlet](https://github.com/Studio-42/elfinder-servlet)
160
+ * [Laravel](https://github.com/barryvdh/laravel-elfinder)
161
+
162
+ 3rd party Volume Drivers
163
+ --------------------
164
+ * [League\Flysystem (PHP)](https://github.com/barryvdh/elfinder-flysystem-driver) (for elFinder 2.1+)
165
+
166
+ 3rd party Themes
167
+ --------------------
168
+ * [lokothodida/elfinder-theme-moono](https://github.com/lokothodida/elfinder-theme-moono)
169
+ * [lokothodida/elfinder-theme-windows-10](https://github.com/lokothodida/elfinder-theme-windows-10)
170
+
171
+ Support
172
+ -------
173
+
174
+ * [Homepage](http://elfinder.org)
175
+ * [Wiki](https://github.com/Studio-42/elFinder/wiki)
176
+ * [Issues](https://github.com/Studio-42/elFinder/issues)
177
+ * [Forum](http://elfinder.org/forum/)
178
+ * <dev@std42.ru>
179
+
180
+
181
+ Authors
182
+ -------
183
+
184
+ * Chief developer: Dmitry "dio" Levashov <dio@std42.ru>
185
+ * Maintainer: Troex Nevelin <troex@fury.scancode.ru>
186
+ * Developers: Alexey Sukhotin <strogg@yandex.ru>, Naoki Sawada <hypweb@gmail.com>
187
+ * Icons: [PixelMixer](http://pixelmixer.ru), [Yusuke Kamiyamane](http://p.yusukekamiyamane.com)
188
+
189
+ We hope our tools will be helpful for you.
190
+
191
+
192
+ License
193
+ -------
194
+
195
+ elFinder is issued under a 3-clauses BSD license.
196
+
197
+ <pre>
198
+ Copyright (c) 2009-2012, Studio 42
199
+ All rights reserved.
200
+
201
+ Redistribution and use in source and binary forms, with or without
202
+ modification, are permitted provided that the following conditions are met:
203
+ * Redistributions of source code must retain the above copyright
204
+ notice, this list of conditions and the following disclaimer.
205
+ * Redistributions in binary form must reproduce the above copyright
206
+ notice, this list of conditions and the following disclaimer in the
207
+ documentation and/or other materials provided with the distribution.
208
+ * Neither the name of the Studio 42 Ltd. nor the
209
+ names of its contributors may be used to endorse or promote products
210
+ derived from this software without specific prior written permission.
211
+
212
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
213
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
214
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
215
+ DISCLAIMED. IN NO EVENT SHALL "STUDIO 42" BE LIABLE FOR ANY DIRECT, INDIRECT,
216
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
217
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
218
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
219
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
220
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
221
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
222
+ </pre>
elFinder/composer.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "studio-42/elfinder",
3
+ "description": "File manager for web",
4
+ "license": "BSD-3-Clause",
5
+ "homepage": "http://elfinder.org",
6
+ "authors": [
7
+ {
8
+ "name": "Dmitry Levashov",
9
+ "homepage": "http://std42.ru",
10
+ "email": "dio@std42.ru"
11
+ },
12
+ {
13
+ "name": "Troex Nevelin",
14
+ "homepage": "http://std42.ru",
15
+ "email": "troex@fury.scancode.ru"
16
+ },
17
+ {
18
+ "name": "Naoki Sawada",
19
+ "homepage": "http://xoops.hypweb.net",
20
+ "email": "hypweb@gmail.com"
21
+ },
22
+ {
23
+ "name": "Community contributions",
24
+ "homepage": "https://github.com/Studio-42/elFinder/contributors"
25
+ }
26
+ ],
27
+ "require": {
28
+ "php": ">=5.2"
29
+ },
30
+ "suggest": {
31
+ "dropbox-php/dropbox-php": "elFinder Volume driver `Dropbox` require `dropbox-php/dropbox-php`.",
32
+ "pear/auth": "dropbox-php require `pear/auth` or `PHP OAuth extension`.",
33
+ "pear/http_request2": "dropbox-php require `pear/http_request2` or `PHP OAuth extension`.",
34
+ "pear/net_url2": "dropbox-php require `pear/net_url2` or `PHP OAuth extension`.",
35
+ "barryvdh/elfinder-flysystem-driver": "VolumeDriver for elFinder to use Flysystem as a root."
36
+ },
37
+ "autoload": {
38
+ "classmap": ["php"]
39
+ }
40
+ }
elFinder/css/elfinder.full.css ADDED
@@ -0,0 +1,1883 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * elFinder - file manager for web
3
+ * Version 2.1.6 (2016-01-19)
4
+ * http://elfinder.org
5
+ *
6
+ * Copyright 2009-2016, Studio 42
7
+ * Licensed under a 3 clauses BSD license
8
+ */
9
+
10
+ /* File: /css/commands.css */
11
+ /******************************************************************/
12
+ /* COMMANDS STYLES */
13
+ /******************************************************************/
14
+
15
+ /********************** COMMAND "RESIZE" ****************************/
16
+ .elfinder-dialog-resize { margin-top:.3em; }
17
+ .elfinder-resize-type { float:left; margin-bottom: .4em; }
18
+ .elfinder-resize-control { padding-top:3em; }
19
+ .elfinder-resize-control input[type=text] { border:1px solid #aaa; text-align: right; }
20
+ .elfinder-resize-preview {
21
+ width:400px;
22
+ height:400px;
23
+ padding:10px;
24
+ background:#fff;
25
+ border:1px solid #aaa;
26
+ float:right;
27
+ position:relative;
28
+ overflow:auto;
29
+ /* z-index:100;*/
30
+ }
31
+
32
+ .elfinder-resize-handle { position:relative;}
33
+
34
+ .elfinder-resize-handle-hline,
35
+ .elfinder-resize-handle-vline {
36
+ position:absolute;
37
+ background-image:url("../img/crop.gif");
38
+ }
39
+
40
+ .elfinder-resize-handle-hline {
41
+ width:100%;
42
+ height:1px !important;
43
+ background-repeat:repeat-x;
44
+ }
45
+ .elfinder-resize-handle-vline {
46
+ width:1px !important;
47
+ height:100%;
48
+ background-repeat:repeat-y;
49
+ }
50
+
51
+ .elfinder-resize-handle-hline-top { top:0; left:0; }
52
+ .elfinder-resize-handle-hline-bottom { bottom:0; left:0; }
53
+ .elfinder-resize-handle-vline-left { top:0; left:0; }
54
+ .elfinder-resize-handle-vline-right { top:0; right:0; }
55
+
56
+ .elfinder-resize-handle-point {
57
+ position:absolute;
58
+ width:8px;
59
+ height:8px;
60
+ border:1px solid #777;
61
+ background:transparent;
62
+ }
63
+
64
+ .elfinder-resize-handle-point-n {
65
+ top:0;
66
+ left:50%;
67
+ margin-top:-5px;
68
+ margin-left:-5px;
69
+ }
70
+ .elfinder-resize-handle-point-ne {
71
+ top:0;
72
+ right:0;
73
+ margin-top:-5px;
74
+ margin-right:-5px;
75
+ }
76
+ .elfinder-resize-handle-point-e {
77
+ top:50%;
78
+ right:0;
79
+ margin-top:-5px;
80
+ margin-right:-5px;
81
+ }
82
+ .elfinder-resize-handle-point-se {
83
+ bottom:0;
84
+ right:0;
85
+ margin-bottom:-5px;
86
+ margin-right:-5px;
87
+ }
88
+ .elfinder-resize-handle-point-s {
89
+ bottom:0;
90
+ left:50%;
91
+ margin-bottom:-5px;
92
+ margin-left:-5px;
93
+ }
94
+ .elfinder-resize-handle-point-sw {
95
+ bottom:0;
96
+ left:0;
97
+ margin-bottom:-5px;
98
+ margin-left:-5px;
99
+ }
100
+ .elfinder-resize-handle-point-w {
101
+ top:50%;
102
+ left:0;
103
+ margin-top:-5px;
104
+ margin-left:-5px;
105
+ }
106
+ .elfinder-resize-handle-point-nw {
107
+ top:0;
108
+ left:0;
109
+ margin-top:-5px;
110
+ margin-left:-5px;
111
+ }
112
+
113
+ .elfinder-resize-spinner {
114
+ position:absolute;
115
+ width:200px;
116
+ height:30px;
117
+ top:50%;
118
+ margin-top:-25px;
119
+ left:50%;
120
+ margin-left:-100px;
121
+ text-align:center;
122
+ background:url(../img/progress.gif) center bottom repeat-x;
123
+ }
124
+
125
+ .elfinder-resize-row { margin-bottom:7px; position:relative;}
126
+
127
+ .elfinder-resize-label { float:left; width:80px; padding-top: 3px; }
128
+
129
+ .elfinder-resize-reset {
130
+ width:16px;
131
+ height:16px;
132
+ /* border:1px solid #111;*/
133
+ position:absolute;
134
+ margin-top:-8px;
135
+ }
136
+
137
+ .elfinder-dialog .elfinder-dialog-resize .ui-resizable-e { height:100%; width:10px; }
138
+ .elfinder-dialog .elfinder-dialog-resize .ui-resizable-s { width:100%; height:10px; }
139
+ .elfinder-dialog .elfinder-dialog-resize .ui-resizable-se {
140
+ background:transparent;
141
+ bottom:0;
142
+ right:0;
143
+ margin-right:-7px;
144
+ margin-bottom:-7px;
145
+ }
146
+
147
+ .elfinder-dialog-resize .ui-icon-grip-solid-vertical {
148
+ position:absolute;
149
+ top:50%;
150
+ right:0;
151
+ margin-top:-8px;
152
+ margin-right:-11px;
153
+ }
154
+ .elfinder-dialog-resize .ui-icon-grip-solid-horizontal {
155
+ position:absolute;
156
+ left:50%;
157
+ bottom:0;
158
+ margin-left:-8px;
159
+ margin-bottom:-11px;;
160
+ }
161
+
162
+ .elfinder-resize-row .elfinder-buttonset { float:right; }
163
+
164
+ .elfinder-resize-rotate-slider {
165
+ float: left;
166
+ width: 195px;
167
+ margin: 7px;
168
+ }
169
+
170
+ /********************** COMMAND "EDIT" ****************************/
171
+ /* edit text file textarea */
172
+ .elfinder-file-edit {
173
+ width:99%;
174
+ height:99%;
175
+ margin:0;
176
+ padding:2px;
177
+ border:1px solid #ccc;
178
+ }
179
+
180
+ /********************** COMMAND "SORT" ****************************/
181
+ /* for list table header sort triangle icon */
182
+ div.elfinder-cwd-wrapper-list tr.ui-state-default td {
183
+ position: relative;
184
+ }
185
+ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon {
186
+ position: absolute;
187
+ top: 0.4em;
188
+ left: 0;
189
+ right: 0;
190
+ margin: auto 0px auto auto;
191
+ }
192
+
193
+
194
+ /********************** COMMAND "HELP" ****************************/
195
+ /* help dialog */
196
+ .elfinder-help { margin-bottom:.5em; }
197
+
198
+ /* fix tabs */
199
+ .elfinder-help .ui-tabs-panel { padding:.5em; }
200
+ .elfinder-dialog .ui-tabs .ui-tabs-nav li a { padding:.2em 1em;}
201
+
202
+ .elfinder-help-shortcuts {
203
+ height:300px;
204
+ padding:1em;
205
+ margin:.5em 0;
206
+ overflow:auto;
207
+ }
208
+ .elfinder-help-shortcut { white-space:nowrap; clear:both;}
209
+
210
+ .elfinder-help-shortcut-pattern { float:left; width:160px;}
211
+
212
+ .elfinder-help-logo {
213
+ width:100px;
214
+ height:96px;
215
+ float:left;
216
+ margin-right:1em;
217
+ background:url('../img/logo.png') center center no-repeat;
218
+ }
219
+
220
+ .elfinder-help h3 { font-size:1.5em; margin:.2em 0 .3em 0; }
221
+
222
+ .elfinder-help-separator { clear:both; padding:.5em; }
223
+
224
+ .elfinder-help-link { padding:2px; }
225
+
226
+ .elfinder-help .ui-priority-secondary { font-size:.9em;}
227
+
228
+ .elfinder-help .ui-priority-primary { margin-bottom:7px;}
229
+
230
+ .elfinder-help-team {
231
+ clear: both;
232
+ text-align:right;
233
+ border-bottom:1px solid #ccc;
234
+ margin:.5em 0;
235
+ font-size:.9em;
236
+ }
237
+
238
+ .elfinder-help-team div { float:left; }
239
+ .elfinder-help-license { font-size:.9em;}
240
+
241
+ .elfinder-help-disabled {
242
+ font-weight:bold;
243
+ text-align:center;
244
+ margin:90px 0;
245
+ }
246
+
247
+ .elfinder-help .elfinder-dont-panic {
248
+ display:block;
249
+ border:1px solid transparent;
250
+ width:200px;
251
+ height:200px;
252
+ margin:30px auto;
253
+ text-decoration:none;
254
+ text-align:center;
255
+ position:relative;
256
+ background:#d90004;
257
+ -moz-box-shadow: 5px 5px 9px #111;
258
+ -webkit-box-shadow: 5px 5px 9px #111;
259
+ box-shadow: 5px 5px 9px #111;
260
+ background: -moz-radial-gradient(80px 80px, circle farthest-corner, #d90004 35%, #960004 100%);
261
+ background: -webkit-gradient(radial, 80 80, 60, 80 80, 120, from(#d90004), to(#960004));
262
+ -moz-border-radius: 100px;
263
+ -webkit-border-radius: 100px;
264
+ border-radius: 100px;
265
+ outline:none;
266
+ }
267
+
268
+ .elfinder-help .elfinder-dont-panic span {
269
+ font-size:3em;
270
+ font-weight:bold;
271
+ text-align:center;
272
+ color:#fff;
273
+ position:absolute;
274
+ left:0;
275
+ top:45px;
276
+ }
277
+
278
+
279
+
280
+
281
+ /* File: /css/common.css */
282
+ /*********************************************/
283
+ /* COMMON ELFINDER STUFFS */
284
+ /*********************************************/
285
+
286
+ /* common container */
287
+ .elfinder { padding:0; position:relative; display:block; }
288
+
289
+ /* right to left enviroment */
290
+ .elfinder-rtl { text-align:right; direction:rtl; }
291
+
292
+ /* nav and cwd container */
293
+ .elfinder-workzone {
294
+ padding: 0;
295
+ position:relative;
296
+ overflow:hidden;
297
+ }
298
+
299
+ /* dir/file permissions and symlink markers */
300
+ .elfinder-lock,
301
+ .elfinder-perms,
302
+ .elfinder-symlink {
303
+ position:absolute;
304
+ width:16px;
305
+ height:16px;
306
+ background-image:url(../img/toolbar.png);
307
+ background-repeat:no-repeat;
308
+ background-position:0 -528px;
309
+ }
310
+
311
+ .elfinder-symlink { }
312
+
313
+ /* noaccess */
314
+ .elfinder-na .elfinder-perms { background-position:0 -96px; }
315
+
316
+ /* read only */
317
+ .elfinder-ro .elfinder-perms { background-position:0 -64px;}
318
+
319
+ /* write only */
320
+ .elfinder-wo .elfinder-perms { background-position:0 -80px;}
321
+
322
+ /* locked */
323
+ .elfinder-lock {
324
+ background-position:0 -656px;
325
+ }
326
+
327
+ /* drag helper */
328
+ .elfinder-drag-helper {
329
+ width:70px;
330
+ height:60px;
331
+ padding:0 0 0 25px;
332
+ z-index:100000;
333
+ }
334
+ .elfinder-drag-helper.html5-native {
335
+ position: absolute;
336
+ top: -1000px;
337
+ left: -1000px;
338
+ }
339
+
340
+ /* drag helper status icon (default no-drop) */
341
+ .elfinder-drag-helper-icon-status {
342
+ position:absolute;
343
+ width:16px;
344
+ height:16px;
345
+ left:42px;
346
+ top:60px;
347
+ background:url('../img/toolbar.png') 0 -96px no-repeat;
348
+ display: block;
349
+ }
350
+
351
+ /* show "up-arrow" icon for move item */
352
+ .elfinder-drag-helper-move .elfinder-drag-helper-icon-status {
353
+ background-position:0 -720px;
354
+ }
355
+ /* show "plus" icon when ctrl/shift pressed */
356
+ .elfinder-drag-helper-plus .elfinder-drag-helper-icon-status {
357
+ background-position:0 -544px;
358
+ }
359
+
360
+ /* files num in drag helper */
361
+ .elfinder-drag-num {
362
+ position:absolute;
363
+ top:0;
364
+ left:0;
365
+ width:16px;
366
+ height:14px;
367
+ text-align:center;
368
+ padding-top:2px;
369
+
370
+ font-weight:bold;
371
+ color:#fff;
372
+ background-color:red;
373
+ -moz-border-radius: 8px;
374
+ -webkit-border-radius: 8px;
375
+ border-radius: 8px;
376
+ }
377
+
378
+ /* icon in drag helper */
379
+ .elfinder-drag-helper .elfinder-cwd-icon { margin:0 0 0 -24px; float:left; }
380
+
381
+ /* transparent overlay >_< */
382
+ /*.elfinder-overlay { opacity: 0; filter:Alpha(Opacity=0); }*/
383
+ .elfinder-overlay { position: absolute; }
384
+
385
+ /* panels under/below cwd (for search field etc) */
386
+ .elfinder .elfinder-panel {
387
+ position:relative;
388
+ background-image:none;
389
+ padding:7px 12px;
390
+ }
391
+
392
+ /* for html5 drag and drop */
393
+ [draggable=true] {
394
+ -khtml-user-drag: element;
395
+ }
396
+
397
+
398
+ /* File: /css/contextmenu.css */
399
+ /* menu and submenu */
400
+ .elfinder-contextmenu,
401
+ .elfinder-contextmenu-sub {
402
+ display:none;
403
+ position:absolute;
404
+ border:1px solid #aaa;
405
+ background:#fff;
406
+ color:#555;
407
+ padding:4px 0;
408
+ }
409
+
410
+ /* submenu */
411
+ .elfinder-contextmenu-sub { top:5px; }
412
+ /* submenu in rtl/ltr enviroment */
413
+ .elfinder-contextmenu-ltr .elfinder-contextmenu-sub { margin-left:-5px; }
414
+ .elfinder-contextmenu-rtl .elfinder-contextmenu-sub { margin-right:-5px; }
415
+
416
+ /* menu item */
417
+ .elfinder-contextmenu-item {
418
+ position:relative;
419
+ display:block;
420
+ padding:4px 30px;
421
+ text-decoration:none;
422
+ white-space:nowrap;
423
+ cursor:default;
424
+ }
425
+ .elfinder-contextmenu-item .ui-icon {
426
+ width:16px;
427
+ height:16px;
428
+ position:absolute;
429
+ left:2px;
430
+ top:50%;
431
+ margin-top:-8px;
432
+ display:none;
433
+ }
434
+ .elfinder-contextmenu-item.elfinder-touch {
435
+ padding:12px 30px;
436
+ }
437
+
438
+ /* text in item */
439
+ .elfinder-contextmenu .elfinder-contextmenu-item span { display:block; }
440
+
441
+
442
+
443
+ /* submenu item in rtl/ltr enviroment */
444
+ .elfinder-contextmenu-ltr .elfinder-contextmenu-item { text-align:left; }
445
+ .elfinder-contextmenu-rtl .elfinder-contextmenu-item { text-align:right; }
446
+ .elfinder-contextmenu-ltr .elfinder-contextmenu-sub .elfinder-contextmenu-item { padding-left:12px; }
447
+ .elfinder-contextmenu-rtl .elfinder-contextmenu-sub .elfinder-contextmenu-item { padding-right:12px; }
448
+
449
+ /* command/submenu icon */
450
+ .elfinder-contextmenu-extra-icon,
451
+ .elfinder-contextmenu-arrow,
452
+ .elfinder-contextmenu-icon {
453
+ position:absolute;
454
+ top:50%;
455
+ margin-top:-8px;
456
+ overflow: hidden;
457
+ }
458
+
459
+ /* command icon in rtl/ltr enviroment */
460
+ .elfinder-contextmenu-ltr .elfinder-contextmenu-icon { left:8px; }
461
+ .elfinder-contextmenu-rtl .elfinder-contextmenu-icon { right:8px; }
462
+ .elfinder-contextmenu-ltr .elfinder-contextmenu-extra-icon { right:8px; }
463
+ .elfinder-contextmenu-rtl .elfinder-contextmenu-extra-icon { left:8px; }
464
+
465
+ /* arrow icon */
466
+ .elfinder-contextmenu-arrow {
467
+ width:16px;
468
+ height:16px;
469
+ background:url('../img/arrows-normal.png') 5px 4px no-repeat;
470
+ }
471
+
472
+ /* arrow icon in rtl/ltr enviroment */
473
+ .elfinder-contextmenu-ltr .elfinder-contextmenu-arrow { right:5px; }
474
+ .elfinder-contextmenu-rtl .elfinder-contextmenu-arrow { left:5px; background-position: 0 -10px; }
475
+
476
+ /* command extra icon's <a>, <span> tag */
477
+ .elfinder-contextmenu-extra-icon a,
478
+ .elfinder-contextmenu-extra-icon span {
479
+ display: inline-block;
480
+ width: 100%;
481
+ height: 100%;
482
+ padding: 20px;
483
+ margin: 0;
484
+ color: transparent !important;
485
+ text-decoration: none;
486
+ cursor: pointer;
487
+ }
488
+
489
+ /* disable ui border/bg image on hover */
490
+ .elfinder-contextmenu .ui-state-hover { border:0 solid; background-image:none;}
491
+
492
+ /* separator */
493
+ .elfinder-contextmenu-separator {
494
+ height:0px;
495
+ border-top:1px solid #ccc;
496
+ margin:0 1px;
497
+ }
498
+
499
+ /* File: /css/cwd.css */
500
+ /******************************************************************/
501
+ /* CURRENT DIRECTORY STYLES */
502
+ /******************************************************************/
503
+ /* cwd container to avoid selectable on scrollbar */
504
+ .elfinder-cwd-wrapper {
505
+ overflow: auto;
506
+ position:relative;
507
+ padding:2px;
508
+ margin:0;
509
+ }
510
+
511
+ .elfinder-cwd-wrapper-list { padding:0; }
512
+
513
+ /* container */
514
+ .elfinder-cwd {
515
+ position:relative;
516
+ cursor:default;
517
+ padding:0;
518
+ margin:0;
519
+ -ms-touch-action: auto;
520
+ touch-action: auto;
521
+ -moz-user-select: -moz-none;
522
+ -khtml-user-select: none;
523
+ -webkit-user-select: none;
524
+ user-select: none;
525
+ -webkit-tap-highlight-color:rgba(0,0,0,0);
526
+ -webkit-touch-callout:none;
527
+ user-select: none;
528
+ -webkit-user-select: none;
529
+ -moz-user-select: none;
530
+ -khtml-user-select: none;
531
+ }
532
+
533
+ /* container active on dropenter */
534
+ .elfinder .elfinder-cwd-wrapper.elfinder-droppable-active {
535
+ outline: 2px solid #8cafed;
536
+ outline-offset: -2px;
537
+ }
538
+
539
+ .elfinder-cwd-wrapper-empty .elfinder-cwd:after {
540
+ display: block;
541
+ position: absolute;
542
+ top: 40%;
543
+ left: 0;
544
+ right: 0;
545
+ margin-top: -2em;
546
+ line-height: 1.5em;
547
+ text-align: center;
548
+ white-space: pre-wrap;
549
+ opacity: 0.6;
550
+ font-weight: bold;
551
+ }
552
+
553
+
554
+ /************************** ICONS VIEW ********************************/
555
+
556
+ /* file container */
557
+ .elfinder-cwd-view-icons .elfinder-cwd-file {
558
+ width:120px;
559
+ height:80px;
560
+ padding-bottom:2px;
561
+ cursor:default;
562
+ border:none;
563
+ /* overflow:hidden;*/
564
+ /* position:relative;*/
565
+ }
566
+
567
+ /* ltr/rtl enviroment */
568
+ .elfinder-ltr .elfinder-cwd-view-icons .elfinder-cwd-file { float:left; margin:0 3px 12px 0; }
569
+ .elfinder-rtl .elfinder-cwd-view-icons .elfinder-cwd-file { float:right; margin:0 0 5px 3px; }
570
+
571
+ /* remove ui hover class border */
572
+ .elfinder-cwd-view-icons .elfinder-cwd-file .ui-state-hover { border:0 solid; }
573
+
574
+ /* icon wrapper to create selected highlight around icon */
575
+ .elfinder-cwd-view-icons .elfinder-cwd-file-wrapper {
576
+ width:52px;
577
+ height:52px;
578
+ margin:1px auto 1px auto;
579
+ padding:2px;
580
+ position:relative;
581
+ }
582
+
583
+ /* file name place */
584
+ .elfinder-cwd-view-icons .elfinder-cwd-filename {
585
+ text-align:center;
586
+ max-height:32px;
587
+ white-space:pre-wrap;
588
+ word-break:normal;
589
+ overflow:hidden;
590
+ text-overflow:ellipsis;
591
+ -o-text-overflow:ellipsis;
592
+ margin:3px 1px 0 1px;
593
+ padding:1px;
594
+ -moz-border-radius: 8px;
595
+ -webkit-border-radius: 8px;
596
+ border-radius: 8px;
597
+ }
598
+
599
+ /* permissions/symlink markers */
600
+ .elfinder-cwd-view-icons .elfinder-perms { bottom:4px; right:2px; }
601
+ .elfinder-cwd-view-icons .elfinder-lock { top:-3px; right:-2px; }
602
+ .elfinder-cwd-view-icons .elfinder-symlink { bottom:6px; left:0px; }
603
+
604
+ /* icon/thumbnail */
605
+ .elfinder-cwd-icon {
606
+ display:block;
607
+ width:48px;
608
+ height:48px;
609
+ margin:0 auto;
610
+ background: url('../img/icons-big.png') 0 0 no-repeat;
611
+ -moz-background-clip: padding;
612
+ -webkit-background-clip: padding-box;
613
+ background-clip: padding-box;
614
+ }
615
+
616
+ /* "opened folder" icon on dragover */
617
+ .elfinder-cwd .elfinder-droppable-active .elfinder-cwd-icon { background-position: 0 -100px; }
618
+
619
+ /* mimetypes icons */
620
+ .elfinder-cwd-icon-directory { background-position:0 -50px; }
621
+ .elfinder-cwd-icon-application { background-position:0 -150px; }
622
+ .elfinder-cwd-icon-x-empty,
623
+ .elfinder-cwd-icon-text { background-position:0 -200px; }
624
+ .elfinder-cwd-icon-image,
625
+ .elfinder-cwd-icon-vnd-adobe-photoshop,
626
+ .elfinder-cwd-icon-postscript { background-position:0 -250px; }
627
+ .elfinder-cwd-icon-audio { background-position:0 -300px; }
628
+ .elfinder-cwd-icon-video,
629
+ .elfinder-cwd-icon-flash-video { background-position:0 -350px; }
630
+ .elfinder-cwd-icon-rtf,
631
+ .elfinder-cwd-icon-rtfd { background-position: 0 -401px; }
632
+ .elfinder-cwd-icon-pdf { background-position: 0 -450px; }
633
+ .elfinder-cwd-icon-ms-excel,
634
+ .elfinder-cwd-icon-msword,
635
+ .elfinder-cwd-icon-vnd-ms-excel,
636
+ .elfinder-cwd-icon-vnd-ms-excel-addin-macroEnabled-12,
637
+ .elfinder-cwd-icon-vnd-ms-excel-sheet-binary-macroEnabled-12,
638
+ .elfinder-cwd-icon-vnd-ms-excel-sheet-macroEnabled-12,
639
+ .elfinder-cwd-icon-vnd-ms-excel-template-macroEnabled-12,
640
+ .elfinder-cwd-icon-vnd-ms-office,
641
+ .elfinder-cwd-icon-vnd-ms-powerpoint,
642
+ .elfinder-cwd-icon-vnd-ms-powerpoint-addin-macroEnabled-12,
643
+ .elfinder-cwd-icon-vnd-ms-powerpoint-presentation-macroEnabled-12,
644
+ .elfinder-cwd-icon-vnd-ms-powerpoint-slide-macroEnabled-12,
645
+ .elfinder-cwd-icon-vnd-ms-powerpoint-slideshow-macroEnabled-12,
646
+ .elfinder-cwd-icon-vnd-ms-powerpoint-template-macroEnabled-12,
647
+ .elfinder-cwd-icon-vnd-ms-word,
648
+ .elfinder-cwd-icon-vnd-ms-word-document-macroEnabled-12,
649
+ .elfinder-cwd-icon-vnd-ms-word-template-macroEnabled-12,
650
+ .elfinder-cwd-icon-vnd-oasis-opendocument-chart,
651
+ .elfinder-cwd-icon-vnd-oasis-opendocument-database,
652
+ .elfinder-cwd-icon-vnd-oasis-opendocument-formula,
653
+ .elfinder-cwd-icon-vnd-oasis-opendocument-graphics,
654
+ .elfinder-cwd-icon-vnd-oasis-opendocument-graphics-template,
655
+ .elfinder-cwd-icon-vnd-oasis-opendocument-image,
656
+ .elfinder-cwd-icon-vnd-oasis-opendocument-presentation,
657
+ .elfinder-cwd-icon-vnd-oasis-opendocument-presentation-template,
658
+ .elfinder-cwd-icon-vnd-oasis-opendocument-spreadsheet,
659
+ .elfinder-cwd-icon-vnd-oasis-opendocument-spreadsheet-template,
660
+ .elfinder-cwd-icon-vnd-oasis-opendocument-text,
661
+ .elfinder-cwd-icon-vnd-oasis-opendocument-text-master,
662
+ .elfinder-cwd-icon-vnd-oasis-opendocument-text-template,
663
+ .elfinder-cwd-icon-vnd-oasis-opendocument-text-web,
664
+ .elfinder-cwd-icon-vnd-openofficeorg-extension,
665
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-presentation,
666
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-slide,
667
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-slideshow,
668
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-template,
669
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-spreadsheetml-sheet,
670
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-spreadsheetml-template,
671
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-wordprocessingml-document,
672
+ .elfinder-cwd-icon-vnd-openxmlformats-officedocument-wordprocessingml-template { background-position: 0 -500px; }
673
+ .elfinder-cwd-icon-html { background-position: 0 -550px; }
674
+ .elfinder-cwd-icon-css { background-position: 0 -600px; }
675
+ .elfinder-cwd-icon-javascript,
676
+ .elfinder-cwd-icon-x-javascript { background-position: 0 -650px; }
677
+ .elfinder-cwd-icon-x-perl { background-position: 0 -700px; }
678
+ .elfinder-cwd-icon-x-python { background-position: 0 -750px; }
679
+ .elfinder-cwd-icon-x-ruby { background-position: 0 -800px; }
680
+ .elfinder-cwd-icon-x-sh,
681
+ .elfinder-cwd-icon-x-shellscript { background-position: 0 -850px; }
682
+ .elfinder-cwd-icon-x-c,
683
+ .elfinder-cwd-icon-x-csrc,
684
+ .elfinder-cwd-icon-x-chdr,
685
+ .elfinder-cwd-icon-x-c--,
686
+ .elfinder-cwd-icon-x-c--src,
687
+ .elfinder-cwd-icon-x-c--hdr,
688
+ .elfinder-cwd-icon-x-java,
689
+ .elfinder-cwd-icon-x-java-source { background-position: 0 -900px; }
690
+ .elfinder-cwd-icon-x-php { background-position: 0 -950px; }
691
+ .elfinder-cwd-icon-xml { background-position: 0 -1000px; }
692
+ .elfinder-cwd-icon-zip,
693
+ .elfinder-cwd-icon-x-zip,
694
+ .elfinder-cwd-icon-x-xz,
695
+ .elfinder-cwd-icon-x-7z-compressed { background-position: 0 -1050px; }
696
+ .elfinder-cwd-icon-x-gzip,
697
+ .elfinder-cwd-icon-x-tar { background-position: 0 -1100px; }
698
+ .elfinder-cwd-icon-x-bzip,
699
+ .elfinder-cwd-icon-x-bzip2 { background-position: 0 -1150px; }
700
+ .elfinder-cwd-icon-x-rar,
701
+ .elfinder-cwd-icon-x-rar-compressed { background-position: 0 -1200px; }
702
+ .elfinder-cwd-icon-x-shockwave-flash { background-position: 0 -1250px; }
703
+ .elfinder-cwd-icon-group { background-position:0 -1300px;}
704
+
705
+ /* textfield inside icon */
706
+ .elfinder-cwd input { width:100%; border:0px solid; margin:0; padding:0; }
707
+ .elfinder-cwd-view-icons input {text-align:center; }
708
+ .elfinder-cwd-view-icons textarea {
709
+ width: 100%;
710
+ border: 0px solid;
711
+ margin: 0;
712
+ padding: 0;
713
+ text-align: center;
714
+ overflow: hidden;
715
+ resize: none;
716
+ }
717
+
718
+ .elfinder-cwd-view-icons { text-align:center; }
719
+
720
+
721
+ /************************************ LIST VIEW ************************************/
722
+
723
+ /*.elfinder-cwd-view-list { padding:0 0 4px 0; }*/
724
+
725
+ .elfinder-cwd table {
726
+ width: 100%;
727
+ border-collapse: separate;
728
+ border: 0 solid;
729
+ margin: 0 0 10px 0;
730
+ border-spacing: 0;
731
+ box-sizing: padding-box;
732
+ padding: 2px;
733
+ }
734
+ .elfinder .elfinder-cwd table thead tr { border-left:0 solid; border-top:0 solid; border-right:0 solid; }
735
+
736
+ .elfinder .elfinder-cwd table thead td {
737
+ padding: 4px 14px;
738
+ }
739
+ .elfinder .elfinder-cwd table thead td.ui-state-active {
740
+ background: #ebf1f6;
741
+ background: -moz-linear-gradient(top, #ebf1f6 0%, #abd3ee 50%, #89c3eb 51%, #d5ebfb 100%);
742
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ebf1f6), color-stop(50%,#abd3ee), color-stop(51%,#89c3eb), color-stop(100%,#d5ebfb));
743
+ background: -webkit-linear-gradient(top, #ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);
744
+ background: -o-linear-gradient(top, #ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);
745
+ background: -ms-linear-gradient(top, #ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);
746
+ background: linear-gradient(to bottom, #ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);
747
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ebf1f6', endColorstr='#d5ebfb',GradientType=0 );
748
+ }
749
+
750
+ .elfinder .elfinder-cwd table td {
751
+ padding:4px 12px;
752
+ white-space:pre;
753
+ overflow:hidden;
754
+ text-align:right;
755
+ cursor:default;
756
+ border:0 solid;
757
+ }
758
+
759
+ .elfinder .elfinder-cwd table td div {
760
+ box-sizing: content-box;
761
+ }
762
+
763
+ .elfinder .elfinder-cwd tr.elfinder-touch td {
764
+ padding: 10px 12px;
765
+ }
766
+
767
+ .elfinder .elfinder-cwd tr.elfinder-cwd-file.elfinder-touch td {
768
+ padding: 13px 12px;
769
+ }
770
+
771
+ .elfinder-ltr .elfinder-cwd table td { text-align:right; }
772
+ .elfinder-ltr .elfinder-cwd table td:first-child { text-align:left; }
773
+ .elfinder-rtl .elfinder-cwd table td { text-align:left; }
774
+ .elfinder-rtl .elfinder-cwd table td:first-child { text-align:right; }
775
+
776
+ .elfinder-odd-row { background:#eee; }
777
+
778
+ /* filename container */
779
+ .elfinder-cwd-view-list .elfinder-cwd-file-wrapper { width:97%; position:relative; }
780
+ /* filename container in ltr/rtl enviroment */
781
+ .elfinder-ltr .elfinder-cwd-view-list .elfinder-cwd-file-wrapper { padding-left:23px; }
782
+ .elfinder-rtl .elfinder-cwd-view-list .elfinder-cwd-file-wrapper { padding-right:23px; }
783
+
784
+ /* premissions/symlink marker */
785
+ .elfinder-cwd-view-list .elfinder-perms,
786
+ .elfinder-cwd-view-list .elfinder-lock,
787
+ .elfinder-cwd-view-list .elfinder-symlink { top:50%; margin-top:-6px; }
788
+ /* markers in ltr/rtl enviroment */
789
+ .elfinder-ltr .elfinder-cwd-view-list .elfinder-perms { left:7px; }
790
+ .elfinder-ltr .elfinder-cwd-view-list .elfinder-lock { left:9px; top:0px; }
791
+ .elfinder-ltr .elfinder-cwd-view-list .elfinder-symlink { left:-7px; }
792
+
793
+ /* file icon */
794
+ .elfinder-cwd-view-list td .elfinder-cwd-icon {
795
+ width:16px;
796
+ height:16px;
797
+ position:absolute;
798
+ top:50%;
799
+ margin-top:-8px;
800
+ background-image:url(../img/icons-small.png);
801
+ }
802
+ /* icon in ltr/rtl enviroment */
803
+ .elfinder-ltr .elfinder-cwd-view-list .elfinder-cwd-icon { left:0; }
804
+ .elfinder-rtl .elfinder-cwd-view-list .elfinder-cwd-icon { right:0; }
805
+ /* File: /css/dialog.css */
806
+ /*********************************************/
807
+ /* DIALOGS STYLES */
808
+ /*********************************************/
809
+
810
+ /* common dialogs class */
811
+ .std42-dialog {
812
+ padding:0;
813
+ position:absolute;
814
+ left:auto;
815
+ right:auto;
816
+ }
817
+
818
+ /* titlebar */
819
+ .std42-dialog .ui-dialog-titlebar {
820
+ border-left:0 solid transparent;
821
+ border-top:0 solid transparent;
822
+ border-right:0 solid transparent;
823
+ -moz-border-radius-bottomleft: 0;
824
+ -webkit-border-bottom-left-radius: 0;
825
+ border-bottom-left-radius: 0;
826
+ -moz-border-radius-bottomright: 0;
827
+ -webkit-border-bottom-right-radius: 0;
828
+ border-bottom-right-radius: 0;
829
+ font-weight:normal;
830
+ padding:.2em 1em;
831
+ }
832
+
833
+ .std42-dialog .ui-dialog-titlebar-close,
834
+ .std42-dialog .ui-dialog-titlebar-close:hover { padding:1px; }
835
+
836
+ .elfinder-rtl .elfinder-dialog .ui-dialog-titlebar { text-align:right; }
837
+ .elfinder-rtl .elfinder-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close { right:auto; left:.3em; }
838
+
839
+ /* content */
840
+ .std42-dialog .ui-dialog-content {
841
+ padding:.3em .5em;
842
+ }
843
+
844
+ /* buttons */
845
+ .std42-dialog .ui-dialog-buttonpane {
846
+ border:0 solid;
847
+ margin:0;
848
+ padding:.5em .7em;
849
+ }
850
+
851
+ .std42-dialog .ui-dialog-buttonpane button { margin:0 0 0 .4em; padding:0; outline:0px solid; }
852
+ .std42-dialog .ui-dialog-buttonpane button span { padding:2px 9px; }
853
+ .std42-dialog .ui-dialog-buttonpane button span.ui-icon { padding: 2px; }
854
+
855
+ .elfinder-dialog .ui-resizable-e,
856
+ .elfinder-dialog .ui-resizable-s { width:0; height:0;}
857
+
858
+ .std42-dialog .ui-button input { cursor: pointer;}
859
+
860
+ /* error/notify/confirm dialogs icon */
861
+ .elfinder-dialog-icon {
862
+ position:absolute;
863
+ width:32px;
864
+ height:32px;
865
+ left:12px;
866
+ top:50%;
867
+ margin-top:-15px;
868
+ background:url("../img/dialogs.png") 0 0 no-repeat;
869
+ }
870
+
871
+ .elfinder-rtl .elfinder-dialog-icon { left:auto; right:12px;}
872
+
873
+
874
+
875
+ /*********************** ERROR DIALOG **************************/
876
+
877
+ .elfinder-dialog-error .ui-dialog-content,
878
+ .elfinder-dialog-confirm .ui-dialog-content { padding-left: 56px; min-height:35px; }
879
+
880
+ .elfinder-rtl .elfinder-dialog-error .ui-dialog-content,
881
+ .elfinder-rtl .elfinder-dialog-confirm .ui-dialog-content { padding-left:0; padding-right: 56px; }
882
+
883
+ /*********************** NOTIFY DIALOG **************************/
884
+
885
+ .elfinder-dialog-notify .ui-dialog-titlebar-close { display:none; }
886
+ .elfinder-dialog-notify .ui-dialog-content { padding:0; }
887
+
888
+ /* one notification container */
889
+ .elfinder-notify {
890
+ border-bottom:1px solid #ccc;
891
+ position:relative;
892
+ padding:.5em;
893
+
894
+ text-align:center;
895
+ overflow:hidden;
896
+ }
897
+
898
+ .elfinder-ltr .elfinder-notify { padding-left:30px; }
899
+ .elfinder-rtl .elfinder-notify { padding-right:30px; }
900
+
901
+ .elfinder-notify:last-child { border:0 solid; }
902
+
903
+ /* progressbar */
904
+ .elfinder-notify-progressbar {
905
+ width:180px;
906
+ height:8px;
907
+ border:1px solid #aaa;
908
+ background:#f5f5f5;
909
+ margin:5px auto;
910
+ overflow:hidden;
911
+ }
912
+
913
+ .elfinder-notify-progress {
914
+ width:100%;
915
+ height:8px;
916
+ background:url(../img/progress.gif) center center repeat-x;
917
+ }
918
+
919
+ .elfinder-notify-progressbar, .elfinder-notify-progress {
920
+ -moz-border-radius: 2px;
921
+ -webkit-border-radius: 2px;
922
+ border-radius: 2px;
923
+ }
924
+
925
+ /* icons */
926
+ .elfinder-dialog-icon-open,
927
+ .elfinder-dialog-icon-readdir,
928
+ .elfinder-dialog-icon-file { background-position: 0 -225px; }
929
+ .elfinder-dialog-icon-reload { background-position: 0 -225px; }
930
+ .elfinder-dialog-icon-mkdir { background-position: 0 -64px; }
931
+ .elfinder-dialog-icon-mkfile { background-position: 0 -96px; }
932
+ .elfinder-dialog-icon-copy,
933
+ .elfinder-dialog-icon-prepare,
934
+ .elfinder-dialog-icon-move { background-position: 0 -128px;}
935
+ .elfinder-dialog-icon-upload { background-position: 0 -160px; }
936
+ .elfinder-dialog-icon-chunkmerge { background-position: 0 -160px; }
937
+ .elfinder-dialog-icon-rm { background-position: 0 -192px; }
938
+ .elfinder-dialog-icon-download { background-position: 0 -260px; }
939
+ .elfinder-dialog-icon-save { background-position: 0 -295px; }
940
+ .elfinder-dialog-icon-rename { background-position: 0 -330px; }
941
+ .elfinder-dialog-icon-archive,
942
+ .elfinder-dialog-icon-extract { background-position: 0 -365px; }
943
+ .elfinder-dialog-icon-search { background-position: 0 -402px; }
944
+ .elfinder-dialog-icon-resize,
945
+ .elfinder-dialog-icon-loadimg,
946
+ .elfinder-dialog-icon-netmount,
947
+ .elfinder-dialog-icon-netunmount,
948
+ .elfinder-dialog-icon-chmod,
949
+ .elfinder-dialog-icon-preupload,
950
+ .elfinder-dialog-icon-dim { background-position: 0 -434px; }
951
+
952
+ /*********************** CONFIRM DIALOG **************************/
953
+
954
+ .elfinder-dialog-confirm-applyall { padding-top:3px; }
955
+
956
+ .elfinder-dialog-confirm .elfinder-dialog-icon { background-position:0 -32px; }
957
+
958
+
959
+
960
+ /*********************** FILE INFO DIALOG **************************/
961
+
962
+
963
+ .elfinder-info-title .elfinder-cwd-icon {
964
+ float:left;
965
+ width:48px;
966
+ height:48px;
967
+ margin-right:1em;
968
+ }
969
+
970
+ .elfinder-rtl .elfinder-info-title .elfinder-cwd-icon {
971
+ float: right;
972
+ margin-right: 0;
973
+ margin-left: 1em;
974
+ }
975
+
976
+ .elfinder-info-title strong { display:block; padding:.3em 0 .5em 0; }
977
+
978
+ .elfinder-info-tb {
979
+ min-width:200px;
980
+ border:0 solid;
981
+ margin:1em .2em 1em .2em;
982
+ }
983
+
984
+ .elfinder-info-tb td { white-space:nowrap; padding:2px; }
985
+
986
+ .elfinder-info-tb tr td:first-child { text-align:right; }
987
+
988
+ .elfinder-info-tb span { float:left;}
989
+ .elfinder-info-tb a { outline: none; text-decoration:underline; }
990
+ .elfinder-info-tb a:hover { text-decoration:none; }
991
+ .elfinder-info-spinner {
992
+ width:14px;
993
+ height:14px;
994
+ float:left;
995
+ background: url("../img/spinner-mini.gif") center center no-repeat;
996
+ margin:0 5px;
997
+ }
998
+
999
+ .elfinder-netmount-tb { margin:0 auto; }
1000
+ .elfinder-netmount-tb input { border:1px solid #ccc; }
1001
+ /*********************** UPLOAD DIALOG **************************/
1002
+
1003
+ .elfinder-upload-dropbox {
1004
+ text-align:center;
1005
+ padding:2em 0;
1006
+ border:3px dashed #aaa;
1007
+ height: 1em;
1008
+ overflow: hidden;
1009
+ }
1010
+
1011
+ .elfinder-upload-dropbox.ui-state-hover {
1012
+ background:#dfdfdf;
1013
+ border:3px dashed #555;
1014
+ }
1015
+
1016
+ .elfinder-upload-dialog-or {
1017
+ margin:.3em 0;
1018
+ text-align:center;
1019
+ }
1020
+
1021
+ .elfinder-upload-dialog-wrapper { text-align:center; }
1022
+
1023
+ .elfinder-upload-dialog-wrapper .ui-button { position:relative; overflow:hidden; }
1024
+
1025
+ .elfinder-upload-dialog-wrapper .ui-button form {
1026
+ position:absolute;
1027
+ right:0;
1028
+ top:0;
1029
+ opacity: 0; filter:Alpha(Opacity=0);
1030
+ }
1031
+
1032
+ .elfinder-upload-dialog-wrapper .ui-button form input {
1033
+ padding:0 20px;
1034
+ font-size:3em;
1035
+
1036
+ }
1037
+
1038
+
1039
+ /* dialog for elFinder itself */
1040
+ .dialogelfinder .dialogelfinder-drag {
1041
+ border-left:0 solid;
1042
+ border-top:0 solid;
1043
+ border-right:0 solid;
1044
+ font-weight:normal;
1045
+ padding:2px 12px;
1046
+ cursor:move;
1047
+ position:relative;
1048
+ text-align:left;
1049
+ }
1050
+
1051
+ .elfinder-rtl .dialogelfinder-drag { text-align:right;}
1052
+
1053
+ .dialogelfinder-drag-close {
1054
+ position: absolute;
1055
+ top:50%;
1056
+ margin-top:-8px;
1057
+ }
1058
+
1059
+ .elfinder-ltr .dialogelfinder-drag-close { right:12px; }
1060
+ .elfinder-rtl .dialogelfinder-drag-close { left:12px; }
1061
+
1062
+
1063
+ /*********************** RM CONFIRM **************************/
1064
+ .elfinder-rm-title {
1065
+ margin-bottom: .5ex;
1066
+ }
1067
+
1068
+ .elfinder-rm-title .elfinder-cwd-icon {
1069
+ float:left;
1070
+ width:48px;
1071
+ height:48px;
1072
+ margin-right:1em;
1073
+ }
1074
+
1075
+ .elfinder-rtl .elfinder-rm-title .elfinder-cwd-icon {
1076
+ float: right;
1077
+ margin-right: 0;
1078
+ margin-left: 1em;
1079
+ }
1080
+
1081
+ .elfinder-rm-title strong {
1082
+ display: block;
1083
+ /*word-wrap: break-word;*/
1084
+ white-space: pre-wrap;
1085
+ word-break: normal;
1086
+ overflow: hidden;
1087
+ text-overflow: ellipsis;
1088
+ }
1089
+
1090
+ .elfinder-rm-title+br {
1091
+ display: none;
1092
+ }
1093
+ /* File: /css/fonts.css */
1094
+ .elfinder-contextmenu .elfinder-contextmenu-item span { font-size:.76em; }
1095
+
1096
+ .elfinder-cwd-view-icons .elfinder-cwd-filename { font-size:.7em; }
1097
+ .elfinder-cwd-view-list td { font-size:.7em; }
1098
+
1099
+ .std42-dialog .ui-dialog-titlebar { font-size:.82em; }
1100
+ .std42-dialog .ui-dialog-content { font-size:.72em; }
1101
+ .std42-dialog .ui-dialog-buttonpane { font-size:.76em; }
1102
+ .elfinder-info-tb { font-size:.9em; }
1103
+ .elfinder-upload-dropbox { font-size:1.2em; }
1104
+ .elfinder-upload-dialog-or { font-size:1.2em; }
1105
+ .dialogelfinder .dialogelfinder-drag { font-size:.9em; }
1106
+ .elfinder .elfinder-navbar { font-size:.72em; }
1107
+ .elfinder-place-drag .elfinder-navbar-dir { font-size:.9em;}
1108
+ .elfinder-quicklook-title { font-size:.7em; }
1109
+ .elfinder-quicklook-info-data { font-size:.72em; }
1110
+ .elfinder-quicklook-preview-text-wrapper { font-size:.9em; }
1111
+ .elfinder-button-menu-item { font-size:.72em; }
1112
+ .elfinder-button-search input { font-size:.8em; }
1113
+ .elfinder-statusbar div { font-size:.7em; }
1114
+ .elfinder-drag-num { font-size:12px; }
1115
+
1116
+
1117
+ /* File: /css/navbar.css */
1118
+ /*********************************************/
1119
+ /* NAVIGATION PANEL */
1120
+ /*********************************************/
1121
+
1122
+ /* container */
1123
+ .elfinder .elfinder-navbar {
1124
+ width:230px;
1125
+ padding:3px 5px;
1126
+ background-image:none;
1127
+ border-top:0 solid;
1128
+ border-bottom:0 solid;
1129
+ overflow:auto;
1130
+ display:none;
1131
+ position:relative;
1132
+ -moz-user-select: none;
1133
+ -khtml-user-select: none;
1134
+ -webkit-user-select: none;
1135
+ user-select: none;
1136
+ -webkit-tap-highlight-color:rgba(0,0,0,0);
1137
+ /* border:1px solid #111;*/
1138
+ -webkit-touch-callout:none;
1139
+ user-select: none;
1140
+ -webkit-user-select: none;
1141
+ -moz-user-select: none;
1142
+ -khtml-user-select: none;
1143
+ }
1144
+
1145
+
1146
+ /* ltr/rtl enviroment */
1147
+ .elfinder-ltr .elfinder-navbar { float:left; border-left:0 solid; }
1148
+ .elfinder-rtl .elfinder-navbar { float:right; border-right:0 solid; }
1149
+ .elfinder-ltr .ui-resizable-e { margin-left:10px; }
1150
+
1151
+ /* folders tree container */
1152
+ .elfinder-tree {
1153
+ display:table; width:100%; margin: 0 0 .5em 0;
1154
+ -webkit-tap-highlight-color:rgba(0,0,0,0);
1155
+ }
1156
+
1157
+ /* one folder wrapper */
1158
+ .elfinder-navbar-wrapper, .elfinder-place-wrapper { }
1159
+
1160
+ /* folder */
1161
+ .elfinder-navbar-dir {
1162
+ position:relative;
1163
+ display:block;
1164
+ white-space:nowrap;
1165
+ padding:3px 12px;
1166
+ margin: 0;
1167
+ outline:0px solid;
1168
+ border:1px solid transparent;
1169
+ cursor:default;
1170
+ }
1171
+ .elfinder-navbar-dir.elfinder-touch {
1172
+ padding: 12px 12px;
1173
+ }
1174
+
1175
+ /* ltr/rtl enviroment */
1176
+ .elfinder-ltr .elfinder-navbar-dir { padding-left:35px; }
1177
+ .elfinder-rtl .elfinder-navbar-dir { padding-right:35px; }
1178
+
1179
+ /* arrow before icon */
1180
+ .elfinder-navbar-arrow {
1181
+ width:12px;
1182
+ height:14px;
1183
+ position:absolute;
1184
+ display:none;
1185
+ top:50%;
1186
+ margin-top:-8px;
1187
+ background-image:url("../img/arrows-normal.png");
1188
+ background-repeat:no-repeat;
1189
+ /* border:1px solid #111;*/
1190
+ }
1191
+
1192
+ .ui-state-active .elfinder-navbar-arrow { background-image:url("../img/arrows-active.png"); }
1193
+
1194
+ /* collapsed/expanded arrow view */
1195
+ .elfinder-navbar-collapsed .elfinder-navbar-arrow { display:block; }
1196
+
1197
+ /* arrow ltr/rtl enviroment */
1198
+ .elfinder-ltr .elfinder-navbar-collapsed .elfinder-navbar-arrow { background-position: 0 4px; left:0; }
1199
+ .elfinder-rtl .elfinder-navbar-collapsed .elfinder-navbar-arrow { background-position: 0 -10px; right:0; }
1200
+ .elfinder-ltr .elfinder-navbar-expanded .elfinder-navbar-arrow,
1201
+ .elfinder-rtl .elfinder-navbar-expanded .elfinder-navbar-arrow { background-position:0 -21px; }
1202
+
1203
+
1204
+ /* folder icon */
1205
+ .elfinder-navbar-icon {
1206
+ width:16px;
1207
+ height:16px;
1208
+ position:absolute;
1209
+ top:50%;
1210
+ margin-top:-8px;
1211
+ background-image:url("../img/toolbar.png");
1212
+ background-repeat:no-repeat;
1213
+ background-position:0 -16px;
1214
+ }
1215
+
1216
+ /* ltr/rtl enviroment */
1217
+ .elfinder-ltr .elfinder-navbar-icon { left:14px; }
1218
+ .elfinder-rtl .elfinder-navbar-icon { right:14px; }
1219
+
1220
+ /* root folder */
1221
+ .elfinder-tree .elfinder-navbar-root .elfinder-navbar-icon { background-position:0 0; }
1222
+ .elfinder-places .elfinder-navbar-root .elfinder-navbar-icon { background-position:0 -704px; }
1223
+
1224
+ /* root icon of each volume */
1225
+ .elfinder-tree .elfinder-navbar-root-local .elfinder-navbar-icon { background-image:url("../img/volume_icon_local.png"); }
1226
+ .elfinder-tree .elfinder-navbar-root-ftp .elfinder-navbar-icon { background-image:url("../img/volume_icon_ftp.png"); }
1227
+ .elfinder-tree .elfinder-navbar-root-sql .elfinder-navbar-icon { background-image:url("../img/volume_icon_sql.png"); }
1228
+ .elfinder-tree .elfinder-navbar-root-dropbox .elfinder-navbar-icon { background-image:url("../img/volume_icon_dropbox.png"); }
1229
+
1230
+ /* icon in active/hove/dropactive state */
1231
+ .ui-state-active .elfinder-navbar-icon,
1232
+ .elfinder-droppable-active .elfinder-navbar-icon,
1233
+ .ui-state-hover .elfinder-navbar-icon { background-position:0 -32px; }
1234
+
1235
+ /* subdirs tree */
1236
+ .elfinder-navbar-subtree { display:none; }
1237
+
1238
+ /* ltr/rtl enviroment */
1239
+ .elfinder-ltr .elfinder-navbar-subtree { margin-left:12px; }
1240
+ .elfinder-rtl .elfinder-navbar-subtree { margin-right:12px; }
1241
+
1242
+
1243
+ /* spinner */
1244
+ .elfinder-navbar-spinner {
1245
+ width:14px;
1246
+ height:14px;
1247
+ position:absolute;
1248
+ display:block;
1249
+ top:50%;
1250
+ margin-top:-7px;
1251
+ background: url("../img/spinner-mini.gif") center center no-repeat;
1252
+ }
1253
+ /* spinner ltr/rtl enviroment */
1254
+ .elfinder-ltr .elfinder-navbar-spinner { left:0; margin-left:-2px; }
1255
+ .elfinder-rtl .elfinder-navbar-spinner { right:0; margin-right:-2px; }
1256
+
1257
+ /* permissions marker */
1258
+ .elfinder-navbar .elfinder-perms { top:50%; margin-top:-8px; }
1259
+
1260
+ /* locked marker */
1261
+ .elfinder-navbar .elfinder-lock { top:-2px; }
1262
+
1263
+ /* permissions/symlink markers ltr/rtl enviroment */
1264
+ .elfinder-ltr .elfinder-navbar .elfinder-perms { left: 18px; }
1265
+ .elfinder-rtl .elfinder-navbar .elfinder-perms { right: 18px; }
1266
+ .elfinder-ltr .elfinder-navbar .elfinder-lock { left: 18px; }
1267
+ .elfinder-rtl .elfinder-navbar .elfinder-lock { right: 18px; }
1268
+ .elfinder-ltr .elfinder-navbar .elfinder-symlink { left: 8px; }
1269
+ .elfinder-rtl .elfinder-navbar .elfinder-symlink { right: 8px; }
1270
+
1271
+ /* navbar input */
1272
+ .elfinder-navbar input { width:100%; border:0px solid; margin:0; padding:0; }
1273
+
1274
+ /* resizable */
1275
+ .elfinder-navbar .ui-resizable-handle { width:12px; background:transparent url('../img/resize.png') center center no-repeat; }
1276
+ .elfinder-nav-handle-icon {
1277
+ position:absolute;
1278
+ top:50%;
1279
+ margin:-8px 2px 0 2px;
1280
+ opacity: .5; filter:Alpha(Opacity=50);
1281
+ }
1282
+
1283
+ .elfinder-places {
1284
+ border: none;
1285
+ margin: 0;
1286
+ padding: 0;
1287
+ }
1288
+ .elfinder-places.elfinder-droppable-active {
1289
+ /*border:1px solid #8cafed;*/
1290
+ }
1291
+
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+ /* File: /css/places.css */
1299
+ /*********************************************/
1300
+ /* PLACES STYLES */
1301
+ /*********************************************/
1302
+ /* root extra icon */
1303
+ .elfinder-navbar-root .elfinder-places-root-icon {
1304
+ position: absolute;
1305
+ top: 50%;
1306
+ margin-top: -9px;
1307
+ cursor: pointer;
1308
+ display: none;
1309
+ }
1310
+ .elfinder-ltr .elfinder-places-root-icon {
1311
+ right: 10px;
1312
+ }
1313
+ .elfinder-rtl .elfinder-places-root-icon {
1314
+ left: 10px;
1315
+ }
1316
+ .elfinder-navbar-expanded .elfinder-places-root-icon {
1317
+ display: block;
1318
+ }
1319
+
1320
+ /* dragging helper base */
1321
+ .elfinder-place-drag {
1322
+ font-size: 0.8em;
1323
+ }
1324
+
1325
+ /* File: /css/quicklook.css */
1326
+ /* quicklook window */
1327
+ .elfinder-quicklook {
1328
+ position:absolute;
1329
+ background:url("../img/quicklook-bg.png");
1330
+ display:none;
1331
+ overflow:hidden;
1332
+ border-radius:7px;
1333
+ -moz-border-radius:7px;
1334
+ -webkit-border-radius:7px;
1335
+ padding:20px 0 40px 0;
1336
+ }
1337
+
1338
+ .elfinder-quicklook .ui-resizable-se {
1339
+ width:14px;
1340
+ height:14px;
1341
+ right:5px;
1342
+ bottom:3px;
1343
+ background:url("../img/toolbar.png") 0 -496px no-repeat;}
1344
+
1345
+ /* quicklook fullscreen window */
1346
+ .elfinder-quicklook-fullscreen {
1347
+ border-radius:0;
1348
+ -moz-border-radius:0;
1349
+ -webkit-border-radius:0;
1350
+ -webkit-background-clip: padding-box;
1351
+ /* background-clip:padding-box;*/
1352
+ padding:0;
1353
+ background:#000;
1354
+ z-index:90000;
1355
+ display:block;
1356
+ }
1357
+ /* hide titlebar in fullscreen mode */
1358
+ .elfinder-quicklook-fullscreen .elfinder-quicklook-titlebar { display:none; }
1359
+
1360
+ /* hide preview border in fullscreen mode */
1361
+ .elfinder-quicklook-fullscreen .elfinder-quicklook-preview { border:0 solid ;}
1362
+
1363
+ /* quicklook titlebar */
1364
+ .elfinder-quicklook-titlebar {
1365
+ text-align:center;
1366
+ background:#777;
1367
+ position:absolute;
1368
+ left:0;
1369
+ top:0;
1370
+ width:100%;
1371
+ height:20px;
1372
+ -moz-border-radius-topleft: 7px;
1373
+ -webkit-border-top-left-radius: 7px;
1374
+ border-top-left-radius: 7px;
1375
+ -moz-border-radius-topright: 7px;
1376
+ -webkit-border-top-right-radius: 7px;
1377
+ border-top-right-radius: 7px;
1378
+ cursor:move;
1379
+ }
1380
+
1381
+ /* window title */
1382
+ .elfinder-quicklook-title {
1383
+ color:#fff;
1384
+ white-space:nowrap;
1385
+ overflow:hidden;
1386
+ padding:2px 0;
1387
+ }
1388
+
1389
+ /* icon "close" in titlebar */
1390
+ .elfinder-quicklook-titlebar .ui-icon {
1391
+ position:absolute;
1392
+ left : 4px;
1393
+ top:50%;
1394
+ margin-top:-8px;
1395
+ width:16px;
1396
+ height:16px;
1397
+ cursor:default;
1398
+ }
1399
+
1400
+ /* main part of quicklook window */
1401
+ .elfinder-quicklook-preview {
1402
+ overflow:hidden;
1403
+ position:relative;
1404
+ border:0 solid;
1405
+ border-left:1px solid transparent;
1406
+ border-right:1px solid transparent;
1407
+ height:100%;
1408
+ }
1409
+
1410
+ /* wrapper for file info/icon */
1411
+ .elfinder-quicklook-info-wrapper {
1412
+ position:absolute;
1413
+ width:100%;
1414
+ left:0;
1415
+ top:50%;
1416
+ margin-top:-50px;
1417
+ }
1418
+
1419
+ /* file info */
1420
+ .elfinder-quicklook-info {
1421
+ padding: 0 12px 0 112px;
1422
+ }
1423
+
1424
+ /* file name in info */
1425
+ .elfinder-quicklook-info .elfinder-quicklook-info-data:first-child {
1426
+ color:#fff;
1427
+ font-weight:bold;
1428
+ padding-bottom:.5em;
1429
+ }
1430
+
1431
+ /* other data in info */
1432
+ .elfinder-quicklook-info-data {
1433
+ padding-bottom:.2em;
1434
+ color:#fff;
1435
+ }
1436
+
1437
+
1438
+ /* file icon */
1439
+ .elfinder-quicklook .elfinder-cwd-icon {
1440
+ position:absolute;
1441
+ left:32px;
1442
+ top:50%;
1443
+ margin-top:-20px;
1444
+ }
1445
+
1446
+ /* image in preview */
1447
+ .elfinder-quicklook-preview img {
1448
+ display:block;
1449
+ margin:0 auto;
1450
+ }
1451
+
1452
+ /* navigation bar on quicklook window bottom */
1453
+ .elfinder-quicklook-navbar {
1454
+ position:absolute;
1455
+ left:50%;
1456
+ bottom:4px;
1457
+ width:140px;
1458
+ height:32px;
1459
+ padding:0px;
1460
+ margin-left:-70px;
1461
+ border:1px solid transparent;
1462
+ border-radius:19px;
1463
+ -moz-border-radius:19px;
1464
+ -webkit-border-radius:19px;
1465
+ }
1466
+
1467
+ /* navigation bar in fullscreen mode */
1468
+ .elfinder-quicklook-fullscreen .elfinder-quicklook-navbar {
1469
+ width:188px;
1470
+ margin-left:-94px;
1471
+ padding:5px;
1472
+ border:1px solid #eee;
1473
+ background:#000;
1474
+ }
1475
+
1476
+ /* show close icon in fullscreen mode */
1477
+ .elfinder-quicklook-fullscreen .elfinder-quicklook-navbar-icon-close,
1478
+ .elfinder-quicklook-fullscreen .elfinder-quicklook-navbar-separator {
1479
+ display:inline;
1480
+ }
1481
+
1482
+ /* icons in navbar */
1483
+ .elfinder-quicklook-navbar-icon {
1484
+ width:32px;
1485
+ height:32px;
1486
+ margin:0 7px;
1487
+ float:left;
1488
+ background:url("../img/quicklook-icons.png") 0 0 no-repeat;
1489
+
1490
+ }
1491
+
1492
+ /* fullscreen icon */
1493
+ .elfinder-quicklook-navbar-icon-fullscreen {
1494
+ background-position:0 -64px;
1495
+ }
1496
+
1497
+ /* exit fullscreen icon */
1498
+ .elfinder-quicklook-navbar-icon-fullscreen-off {
1499
+ background-position:0 -96px;
1500
+ }
1501
+
1502
+ /* prev file icon */
1503
+ .elfinder-quicklook-navbar-icon-prev {
1504
+ background-position:0 0;
1505
+ }
1506
+
1507
+ /* next file icon */
1508
+ .elfinder-quicklook-navbar-icon-next {
1509
+ background-position:0 -32px;
1510
+ }
1511
+
1512
+ /* close icon */
1513
+ .elfinder-quicklook-navbar-icon-close {
1514
+ background-position:0 -128px;
1515
+ display:none;
1516
+ }
1517
+
1518
+ /* icons separator */
1519
+ .elfinder-quicklook-navbar-separator {
1520
+ width:1px;
1521
+ height:32px;
1522
+ float:left;
1523
+ border-left:1px solid #fff;
1524
+ display:none;
1525
+ }
1526
+
1527
+ /* text files preview wrapper */
1528
+ .elfinder-quicklook-preview-text-wrapper {
1529
+ width: 100%;
1530
+ height:100%;
1531
+ background:#fff;
1532
+ color:#222;
1533
+ overflow:auto;
1534
+ }
1535
+
1536
+ /* text preview */
1537
+ pre.elfinder-quicklook-preview-text {
1538
+ margin:0;
1539
+ padding:3px 9px;
1540
+ }
1541
+
1542
+ /* html/pdf preview */
1543
+ .elfinder-quicklook-preview-html,
1544
+ .elfinder-quicklook-preview-pdf {
1545
+ width:100%;
1546
+ height:100%;
1547
+ background:#fff;
1548
+ border:0 solid;
1549
+ margin:0;
1550
+ }
1551
+
1552
+ /* swf preview container */
1553
+ .elfinder-quicklook-preview-flash {
1554
+ width:100%;
1555
+ height:100%;
1556
+ }
1557
+
1558
+ /* audio preview container */
1559
+ .elfinder-quicklook-preview-audio {
1560
+ width:100%;
1561
+ position:absolute;
1562
+ bottom:0;
1563
+ left:0;
1564
+ }
1565
+
1566
+ /* audio preview using embed */
1567
+ embed.elfinder-quicklook-preview-audio {
1568
+ height:30px;
1569
+ background:transparent;
1570
+ }
1571
+
1572
+ /* video preview container */
1573
+ .elfinder-quicklook-preview-video {
1574
+ width:100%;
1575
+ height:100%;
1576
+ }
1577
+
1578
+
1579
+
1580
+
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+
1587
+
1588
+
1589
+
1590
+
1591
+ /* File: /css/statusbar.css */
1592
+ /******************************************************************/
1593
+ /* STATUSBAR STYLES */
1594
+ /******************************************************************/
1595
+
1596
+
1597
+ /* statusbar container */
1598
+ .elfinder-statusbar {
1599
+ text-align:center;
1600
+ font-weight:normal;
1601
+ padding:.2em .5em;
1602
+
1603
+ border-right:0 solid transparent;
1604
+ border-bottom:0 solid transparent;
1605
+ border-left:0 solid transparent;
1606
+
1607
+ -webkit-touch-callout:none;
1608
+ user-select: none;
1609
+ -webkit-user-select: none;
1610
+ -moz-user-select: none;
1611
+ -khtml-user-select: none;
1612
+ }
1613
+
1614
+ .elfinder-statusbar a { text-decoration:none; }
1615
+
1616
+
1617
+
1618
+ /* path in statusbar */
1619
+ .elfinder-path {
1620
+ max-width:30%;
1621
+ white-space:nowrap;
1622
+ overflow:hidden;
1623
+ text-overflow:ellipsis;
1624
+ -o-text-overflow:ellipsis;
1625
+ }
1626
+ .elfinder-ltr .elfinder-path { float:left; }
1627
+ .elfinder-rtl .elfinder-path { float:right; }
1628
+
1629
+ /* total/selected size in statusbar */
1630
+ .elfinder-stat-size { white-space:nowrap; }
1631
+ .elfinder-ltr .elfinder-stat-size { float:right; }
1632
+ .elfinder-rtl .elfinder-stat-size { float:left; }
1633
+
1634
+ .elfinder-stat-selected { white-space:nowrap; overflow:hidden; }
1635
+
1636
+ /* File: /css/toolbar.css */
1637
+ /*********************************************/
1638
+ /* TOOLBAR STYLES */
1639
+ /*********************************************/
1640
+ /* toolbar container */
1641
+ .elfinder-toolbar {
1642
+ padding:4px 0 3px 0;
1643
+ border-left:0 solid transparent;
1644
+ border-top:0 solid transparent;
1645
+ border-right:0 solid transparent;
1646
+ }
1647
+
1648
+ /* container for button's group */
1649
+ .elfinder-buttonset {
1650
+ margin: 1px 4px;
1651
+ float:left;
1652
+ background:transparent;
1653
+ padding:0;
1654
+ -moz-border-radius: 4px;
1655
+ -webkit-border-radius: 4px;
1656
+ border-radius: 4px;
1657
+ }
1658
+
1659
+ /*.elfinder-buttonset:first-child { margin:0; }*/
1660
+
1661
+ /* button */
1662
+ .elfinder .elfinder-button {
1663
+ width:16px;
1664
+ height:16px;
1665
+ margin:0;
1666
+ padding:4px;
1667
+ float:left;
1668
+ overflow:hidden;
1669
+ position:relative;
1670
+ border:0 solid;
1671
+ -webkit-box-sizing: content-box;
1672
+ -moz-box-sizing: content-box;
1673
+ box-sizing: content-box;
1674
+ }
1675
+
1676
+ .elfinder .ui-icon-search { cursor:pointer;}
1677
+
1678
+ .elfinder-button:first-child {
1679
+ -moz-border-radius-topleft: 4px;
1680
+ -webkit-border-top-left-radius: 4px;
1681
+ border-top-left-radius: 4px;
1682
+ -moz-border-radius-bottomleft: 4px;
1683
+ -webkit-border-bottom-left-radius: 4px;
1684
+ border-bottom-left-radius: 4px;
1685
+ }
1686
+
1687
+ .elfinder-button:last-child {
1688
+ -moz-border-radius-topright: 4px;
1689
+ -webkit-border-top-right-radius: 4px;
1690
+ border-top-right-radius: 4px;
1691
+ -moz-border-radius-bottomright: 4px;
1692
+ -webkit-border-bottom-right-radius: 4px;
1693
+ border-bottom-right-radius: 4px;
1694
+ }
1695
+
1696
+ /* separator between buttons, required for berder between button with ui color */
1697
+ .elfinder-toolbar-button-separator {
1698
+ float:left;
1699
+ padding:0;
1700
+ height:24px;
1701
+ border-top:0 solid;
1702
+ border-right:0 solid;
1703
+ border-bottom:0 solid;
1704
+ width:0;
1705
+ }
1706
+
1707
+ /* change icon opacity^ not button */
1708
+ .elfinder .elfinder-button.ui-state-disabled { opacity:1; filter:Alpha(Opacity=100);}
1709
+ .elfinder .elfinder-button.ui-state-disabled .elfinder-button-icon { opacity:.4; filter:Alpha(Opacity=40);}
1710
+
1711
+ /* rtl enviroment */
1712
+ .elfinder-rtl .elfinder-buttonset { float:right; }
1713
+
1714
+ /* icon inside button */
1715
+ .elfinder-button-icon {
1716
+ width:16px;
1717
+ height:16px;
1718
+ display:block;
1719
+ background:url('../img/toolbar.png') no-repeat;
1720
+ }
1721
+
1722
+ /* buttons icons */
1723
+ .elfinder-button-icon-home { background-position: 0 0; }
1724
+ .elfinder-button-icon-back { background-position: 0 -112px; }
1725
+ .elfinder-button-icon-forward { background-position: 0 -128px; }
1726
+ .elfinder-button-icon-up { background-position: 0 -144px; }
1727
+ .elfinder-button-icon-opendir { background-position: 0 -32px; }
1728
+ .elfinder-button-icon-reload { background-position: 0 -160px; }
1729
+ .elfinder-button-icon-open { background-position: 0 -176px; }
1730
+ .elfinder-button-icon-mkdir { background-position: 0 -192px; }
1731
+ .elfinder-button-icon-mkfile { background-position: 0 -208px; }
1732
+ .elfinder-button-icon-rm { background-position: 0 -224px; }
1733
+ .elfinder-button-icon-copy { background-position: 0 -240px; }
1734
+ .elfinder-button-icon-cut { background-position: 0 -256px; }
1735
+ .elfinder-button-icon-paste { background-position: 0 -272px; }
1736
+ .elfinder-button-icon-getfile { background-position: 0 -288px; }
1737
+ .elfinder-button-icon-duplicate { background-position: 0 -304px; }
1738
+ .elfinder-button-icon-rename { background-position: 0 -320px; }
1739
+ .elfinder-button-icon-edit { background-position: 0 -336px; }
1740
+ .elfinder-button-icon-quicklook { background-position: 0 -352px; }
1741
+ .elfinder-button-icon-upload { background-position: 0 -368px; }
1742
+ .elfinder-button-icon-download { background-position: 0 -384px; }
1743
+ .elfinder-button-icon-info { background-position: 0 -400px; }
1744
+ .elfinder-button-icon-extract { background-position: 0 -416px; }
1745
+ .elfinder-button-icon-archive { background-position: 0 -432px; }
1746
+ .elfinder-button-icon-view { background-position: 0 -448px; }
1747
+ .elfinder-button-icon-view-list { background-position: 0 -464px; }
1748
+ .elfinder-button-icon-help { background-position: 0 -480px; }
1749
+ .elfinder-button-icon-resize { background-position: 0 -512px; }
1750
+ .elfinder-button-icon-link { background-position: 0 -528px; }
1751
+ .elfinder-button-icon-search { background-position: 0 -561px; }
1752
+ .elfinder-button-icon-sort { background-position: 0 -577px; }
1753
+ .elfinder-button-icon-rotate-r { background-position: 0 -625px; }
1754
+ .elfinder-button-icon-rotate-l { background-position: 0 -641px; }
1755
+ .elfinder-button-icon-netmount { background-position: 0 -688px; }
1756
+ .elfinder-button-icon-netunmount { background-position: 0 -96px; }
1757
+ .elfinder-button-icon-places { background-position: 0 -704px; }
1758
+ .elfinder-button-icon-chmod { background-position: 0 -48px; }
1759
+ .elfinder-button-icon-accept { background-position: 0 -736px; }
1760
+ .elfinder-button-icon-opendir { background-position: 0 -32px; }
1761
+
1762
+ /* button with dropdown menu*/
1763
+ .elfinder .elfinder-menubutton { overflow:visible; }
1764
+
1765
+ /* button with spinner icon */
1766
+ .elfinder-button-icon-spinner { background: url("../img/spinner-mini.gif") center center no-repeat; }
1767
+
1768
+ /* menu */
1769
+ .elfinder-button-menu {
1770
+ position:absolute;
1771
+ left:0;
1772
+ top:25px;
1773
+ padding:3px 0;
1774
+ }
1775
+
1776
+ /* menu item */
1777
+ .elfinder-button-menu-item {
1778
+ white-space:nowrap;
1779
+ cursor:default;
1780
+ padding:5px 19px;
1781
+ position:relative;
1782
+ }
1783
+
1784
+ /* fix hover ui class */
1785
+ .elfinder-button-menu .ui-state-hover { border:0 solid; }
1786
+
1787
+ .elfinder-button-menu-item-separated { border-top:1px solid #ccc; }
1788
+
1789
+ .elfinder-button-menu-item .ui-icon {
1790
+ width:16px;
1791
+ height:16px;
1792
+ position:absolute;
1793
+ left:2px;
1794
+ top:50%;
1795
+ margin-top:-8px;
1796
+ display:none;
1797
+ }
1798
+
1799
+ .elfinder-button-menu-item-selected .ui-icon { display:block; }
1800
+ .elfinder-button-menu-item-selected-asc .ui-icon-arrowthick-1-n { display:none; }
1801
+ .elfinder-button-menu-item-selected-desc .ui-icon-arrowthick-1-s { display:none; }
1802
+
1803
+ /* hack for upload button */
1804
+ .elfinder-button form {
1805
+ position:absolute;
1806
+ top:0;
1807
+ right:0;
1808
+ opacity: 0; filter:Alpha(Opacity=0);
1809
+ cursor: pointer;
1810
+ }
1811
+
1812
+ .elfinder .elfinder-button form input { background:transparent; cursor: default;}
1813
+
1814
+ /* search "button" */
1815
+ .elfinder .elfinder-button-search {
1816
+ border:0 solid;
1817
+ background:transparent;
1818
+ padding:0;
1819
+ margin: 1px 4px;
1820
+ height: auto;
1821
+ min-height: 26px;
1822
+ float:right;
1823
+ width:202px;
1824
+ overflow: visible;
1825
+ }
1826
+
1827
+ .elfinder .elfinder-button-search .elfinder-button-menu {
1828
+ font-size: 8pt;
1829
+ text-align: center;
1830
+ width: 100%;
1831
+ }
1832
+
1833
+ .elfinder .elfinder-button-search .elfinder-button-menu div {
1834
+ margin-left: auto;
1835
+ margin-right: auto;
1836
+ margin-bottom: 5px;
1837
+ }
1838
+
1839
+ .elfinder .elfinder-button-search .elfinder-button-menu div .ui-state-hover {
1840
+ border: 1px solid;
1841
+ }
1842
+
1843
+ /* ltr/rte enviroment */
1844
+ .elfinder-ltr .elfinder-button-search { float:right; margin-right:10px; }
1845
+ .elfinder-rtl .elfinder-button-search { float:left; margin-left:10px; }
1846
+
1847
+ /* search text field */
1848
+ .elfinder-button-search input {
1849
+ width:160px;
1850
+ height:22px;
1851
+ padding:0 20px;
1852
+ line-height: 22px;
1853
+ border:0 solid;
1854
+ border:1px solid #aaa;
1855
+ -moz-border-radius: 12px;
1856
+ -webkit-border-radius: 12px;
1857
+ border-radius: 12px;
1858
+ outline:0px solid;
1859
+ }
1860
+
1861
+ .elfinder-rtl .elfinder-button-search input { direction:rtl; }
1862
+
1863
+ /* icons */
1864
+ .elfinder-button-search .ui-icon {
1865
+ position:absolute;
1866
+ height:18px;
1867
+ top: 50%;
1868
+ margin:-9px 4px 0 4px;
1869
+ opacity: .6;
1870
+ filter:Alpha(Opacity=60);
1871
+ }
1872
+
1873
+ /* search/close icons */
1874
+ .elfinder-ltr .elfinder-button-search .ui-icon-search { left:0;}
1875
+ .elfinder-rtl .elfinder-button-search .ui-icon-search { right:0;}
1876
+ .elfinder-ltr .elfinder-button-search .ui-icon-close { right:0;}
1877
+ .elfinder-rtl .elfinder-button-search .ui-icon-close { left:0;}
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+
elFinder/css/elfinder.min.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * elFinder - file manager for web
3
+ * Version 2.1.6 (2016-01-19)
4
+ * http://elfinder.org
5
+ *
6
+ * Copyright 2009-2016, Studio 42
7
+ * Licensed under a 3 clauses BSD license
8
+ */
9
+ .elfinder-dialog-resize{margin-top:.3em}.elfinder-resize-type{float:left;margin-bottom:.4em}.elfinder-resize-control{padding-top:3em}.elfinder-resize-control input[type=text]{border:1px solid #aaa;text-align:right}.elfinder-resize-preview{width:400px;height:400px;padding:10px;background:#fff;border:1px solid #aaa;float:right;position:relative;overflow:auto}.elfinder-resize-handle{position:relative}.elfinder-resize-handle-hline,.elfinder-resize-handle-vline{position:absolute;background-image:url("../img/crop.gif")}.elfinder-resize-handle-hline{width:100%;height:1px!important;background-repeat:repeat-x}.elfinder-resize-handle-vline{width:1px!important;height:100%;background-repeat:repeat-y}.elfinder-resize-handle-hline-top{top:0;left:0}.elfinder-resize-handle-hline-bottom{bottom:0;left:0}.elfinder-resize-handle-vline-left{top:0;left:0}.elfinder-resize-handle-vline-right{top:0;right:0}.elfinder-resize-handle-point{position:absolute;width:8px;height:8px;border:1px solid #777;background:0 0}.elfinder-resize-handle-point-n{top:0;left:50%;margin-top:-5px;margin-left:-5px}.elfinder-resize-handle-point-ne{top:0;right:0;margin-top:-5px;margin-right:-5px}.elfinder-resize-handle-point-e{top:50%;right:0;margin-top:-5px;margin-right:-5px}.elfinder-resize-handle-point-se{bottom:0;right:0;margin-bottom:-5px;margin-right:-5px}.elfinder-resize-handle-point-s{bottom:0;left:50%;margin-bottom:-5px;margin-left:-5px}.elfinder-resize-handle-point-sw{bottom:0;left:0;margin-bottom:-5px;margin-left:-5px}.elfinder-resize-handle-point-w{top:50%;left:0;margin-top:-5px;margin-left:-5px}.elfinder-resize-handle-point-nw{top:0;left:0;margin-top:-5px;margin-left:-5px}.elfinder-resize-spinner{position:absolute;width:200px;height:30px;top:50%;margin-top:-25px;left:50%;margin-left:-100px;text-align:center;background:url(../img/progress.gif) center bottom repeat-x}.elfinder-resize-row{margin-bottom:7px;position:relative}.elfinder-resize-label{float:left;width:80px;padding-top:3px}.elfinder-resize-reset{width:16px;height:16px;position:absolute;margin-top:-8px}.elfinder-dialog .elfinder-dialog-resize .ui-resizable-e{height:100%;width:10px}.elfinder-dialog .elfinder-dialog-resize .ui-resizable-s{width:100%;height:10px}.elfinder-dialog .elfinder-dialog-resize .ui-resizable-se{background:0 0;bottom:0;right:0;margin-right:-7px;margin-bottom:-7px}.elfinder-dialog-resize .ui-icon-grip-solid-vertical{position:absolute;top:50%;right:0;margin-top:-8px;margin-right:-11px}.elfinder-dialog-resize .ui-icon-grip-solid-horizontal{position:absolute;left:50%;bottom:0;margin-left:-8px;margin-bottom:-11px}.elfinder-resize-row .elfinder-buttonset{float:right}.elfinder-resize-rotate-slider{float:left;width:195px;margin:7px}.elfinder-file-edit{width:99%;height:99%;margin:0;padding:2px;border:1px solid #ccc}div.elfinder-cwd-wrapper-list tr.ui-state-default td{position:relative}div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon{position:absolute;top:.4em;left:0;right:0;margin:auto 0 auto auto}.elfinder-help{margin-bottom:.5em}.elfinder-help .ui-tabs-panel{padding:.5em}.elfinder-dialog .ui-tabs .ui-tabs-nav li a{padding:.2em 1em}.elfinder-help-shortcuts{height:300px;padding:1em;margin:.5em 0;overflow:auto}.elfinder-help-shortcut{white-space:nowrap;clear:both}.elfinder-help-shortcut-pattern{float:left;width:160px}.elfinder-help-logo{width:100px;height:96px;float:left;margin-right:1em;background:url('../img/logo.png') center center no-repeat}.elfinder-help h3{font-size:1.5em;margin:.2em 0 .3em}.elfinder-help-separator{clear:both;padding:.5em}.elfinder-help-link{padding:2px}.elfinder-help .ui-priority-secondary{font-size:.9em}.elfinder-help .ui-priority-primary{margin-bottom:7px}.elfinder-help-team{clear:both;text-align:right;border-bottom:1px solid #ccc;margin:.5em 0;font-size:.9em}.elfinder-help-team div{float:left}.elfinder-help-license{font-size:.9em}.elfinder-help-disabled{font-weight:700;text-align:center;margin:90px 0}.elfinder-help .elfinder-dont-panic{display:block;border:1px solid transparent;width:200px;height:200px;margin:30px auto;text-decoration:none;text-align:center;position:relative;background:#d90004;-moz-box-shadow:5px 5px 9px #111;-webkit-box-shadow:5px 5px 9px #111;box-shadow:5px 5px 9px #111;background:-moz-radial-gradient(80px 80px,circle farthest-corner,#d90004 35%,#960004 100%);background:-webkit-gradient(radial,80 80,60,80 80,120,from(#d90004),to(#960004));-moz-border-radius:100px;-webkit-border-radius:100px;border-radius:100px;outline:none}.elfinder-help .elfinder-dont-panic span{font-size:3em;font-weight:700;text-align:center;color:#fff;position:absolute;left:0;top:45px}.elfinder{padding:0;position:relative;display:block}.elfinder-rtl{text-align:right;direction:rtl}.elfinder-workzone{padding:0;position:relative;overflow:hidden}.elfinder-lock,.elfinder-perms,.elfinder-symlink{position:absolute;width:16px;height:16px;background-image:url(../img/toolbar.png);background-repeat:no-repeat;background-position:0 -528px}.elfinder-na .elfinder-perms{background-position:0 -96px}.elfinder-ro .elfinder-perms{background-position:0 -64px}.elfinder-wo .elfinder-perms{background-position:0 -80px}.elfinder-lock{background-position:0 -656px}.elfinder-drag-helper{width:70px;height:60px;padding:0 0 0 25px;z-index:100000}.elfinder-drag-helper.html5-native{position:absolute;top:-1000px;left:-1000px}.elfinder-drag-helper-icon-status{position:absolute;width:16px;height:16px;left:42px;top:60px;background:url('../img/toolbar.png') 0 -96px no-repeat;display:block}.elfinder-drag-helper-move .elfinder-drag-helper-icon-status{background-position:0 -720px}.elfinder-drag-helper-plus .elfinder-drag-helper-icon-status{background-position:0 -544px}.elfinder-drag-num{position:absolute;top:0;left:0;width:16px;height:14px;text-align:center;padding-top:2px;font-weight:700;color:#fff;background-color:red;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.elfinder-drag-helper .elfinder-cwd-icon{margin:0 0 0 -24px;float:left}.elfinder-overlay{position:absolute}.elfinder .elfinder-panel{position:relative;background-image:none;padding:7px 12px}[draggable=true]{-khtml-user-drag:element}.elfinder-contextmenu,.elfinder-contextmenu-sub{display:none;position:absolute;border:1px solid #aaa;background:#fff;color:#555;padding:4px 0}.elfinder-contextmenu-sub{top:5px}.elfinder-contextmenu-ltr .elfinder-contextmenu-sub{margin-left:-5px}.elfinder-contextmenu-rtl .elfinder-contextmenu-sub{margin-right:-5px}.elfinder-contextmenu-item{position:relative;display:block;padding:4px 30px;text-decoration:none;white-space:nowrap;cursor:default}.elfinder-contextmenu-item .ui-icon{width:16px;height:16px;position:absolute;left:2px;top:50%;margin-top:-8px;display:none}.elfinder-contextmenu-item.elfinder-touch{padding:12px 30px}.elfinder-contextmenu .elfinder-contextmenu-item span{display:block}.elfinder-contextmenu-ltr .elfinder-contextmenu-item{text-align:left}.elfinder-contextmenu-rtl .elfinder-contextmenu-item{text-align:right}.elfinder-contextmenu-ltr .elfinder-contextmenu-sub .elfinder-contextmenu-item{padding-left:12px}.elfinder-contextmenu-rtl .elfinder-contextmenu-sub .elfinder-contextmenu-item{padding-right:12px}.elfinder-contextmenu-extra-icon,.elfinder-contextmenu-arrow,.elfinder-contextmenu-icon{position:absolute;top:50%;margin-top:-8px;overflow:hidden}.elfinder-contextmenu-ltr .elfinder-contextmenu-icon{left:8px}.elfinder-contextmenu-rtl .elfinder-contextmenu-icon,.elfinder-contextmenu-ltr .elfinder-contextmenu-extra-icon{right:8px}.elfinder-contextmenu-rtl .elfinder-contextmenu-extra-icon{left:8px}.elfinder-contextmenu-arrow{width:16px;height:16px;background:url('../img/arrows-normal.png') 5px 4px no-repeat}.elfinder-contextmenu-ltr .elfinder-contextmenu-arrow{right:5px}.elfinder-contextmenu-rtl .elfinder-contextmenu-arrow{left:5px;background-position:0 -10px}.elfinder-contextmenu-extra-icon a,.elfinder-contextmenu-extra-icon span{display:inline-block;width:100%;height:100%;padding:20px;margin:0;color:transparent!important;text-decoration:none;cursor:pointer}.elfinder-contextmenu .ui-state-hover{border:0 solid;background-image:none}.elfinder-contextmenu-separator{height:0;border-top:1px solid #ccc;margin:0 1px}.elfinder-cwd-wrapper{overflow:auto;position:relative;padding:2px;margin:0}.elfinder-cwd-wrapper-list{padding:0}.elfinder-cwd{position:relative;cursor:default;padding:0;margin:0;-ms-touch-action:auto;touch-action:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none}.elfinder .elfinder-cwd-wrapper.elfinder-droppable-active{outline:2px solid #8cafed;outline-offset:-2px}.elfinder-cwd-wrapper-empty .elfinder-cwd:after{display:block;position:absolute;top:40%;left:0;right:0;margin-top:-2em;line-height:1.5em;text-align:center;white-space:pre-wrap;opacity:.6;font-weight:700}.elfinder-cwd-view-icons .elfinder-cwd-file{width:120px;height:80px;padding-bottom:2px;cursor:default;border:none}.elfinder-ltr .elfinder-cwd-view-icons .elfinder-cwd-file{float:left;margin:0 3px 12px 0}.elfinder-rtl .elfinder-cwd-view-icons .elfinder-cwd-file{float:right;margin:0 0 5px 3px}.elfinder-cwd-view-icons .elfinder-cwd-file .ui-state-hover{border:0 solid}.elfinder-cwd-view-icons .elfinder-cwd-file-wrapper{width:52px;height:52px;margin:1px auto;padding:2px;position:relative}.elfinder-cwd-view-icons .elfinder-cwd-filename{text-align:center;max-height:32px;white-space:pre-wrap;word-break:normal;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;margin:3px 1px 0;padding:1px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.elfinder-cwd-view-icons .elfinder-perms{bottom:4px;right:2px}.elfinder-cwd-view-icons .elfinder-lock{top:-3px;right:-2px}.elfinder-cwd-view-icons .elfinder-symlink{bottom:6px;left:0}.elfinder-cwd-icon{display:block;width:48px;height:48px;margin:0 auto;background:url('../img/icons-big.png') 0 0 no-repeat;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box}.elfinder-cwd .elfinder-droppable-active .elfinder-cwd-icon{background-position:0 -100px}.elfinder-cwd-icon-directory{background-position:0 -50px}.elfinder-cwd-icon-application{background-position:0 -150px}.elfinder-cwd-icon-x-empty,.elfinder-cwd-icon-text{background-position:0 -200px}.elfinder-cwd-icon-image,.elfinder-cwd-icon-vnd-adobe-photoshop,.elfinder-cwd-icon-postscript{background-position:0 -250px}.elfinder-cwd-icon-audio{background-position:0 -300px}.elfinder-cwd-icon-video,.elfinder-cwd-icon-flash-video{background-position:0 -350px}.elfinder-cwd-icon-rtf,.elfinder-cwd-icon-rtfd{background-position:0 -401px}.elfinder-cwd-icon-pdf{background-position:0 -450px}.elfinder-cwd-icon-ms-excel,.elfinder-cwd-icon-msword,.elfinder-cwd-icon-vnd-ms-excel,.elfinder-cwd-icon-vnd-ms-excel-addin-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-excel-sheet-binary-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-excel-sheet-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-excel-template-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-office,.elfinder-cwd-icon-vnd-ms-powerpoint,.elfinder-cwd-icon-vnd-ms-powerpoint-addin-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-powerpoint-presentation-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-powerpoint-slide-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-powerpoint-slideshow-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-powerpoint-template-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-word,.elfinder-cwd-icon-vnd-ms-word-document-macroEnabled-12,.elfinder-cwd-icon-vnd-ms-word-template-macroEnabled-12,.elfinder-cwd-icon-vnd-oasis-opendocument-chart,.elfinder-cwd-icon-vnd-oasis-opendocument-database,.elfinder-cwd-icon-vnd-oasis-opendocument-formula,.elfinder-cwd-icon-vnd-oasis-opendocument-graphics,.elfinder-cwd-icon-vnd-oasis-opendocument-graphics-template,.elfinder-cwd-icon-vnd-oasis-opendocument-image,.elfinder-cwd-icon-vnd-oasis-opendocument-presentation,.elfinder-cwd-icon-vnd-oasis-opendocument-presentation-template,.elfinder-cwd-icon-vnd-oasis-opendocument-spreadsheet,.elfinder-cwd-icon-vnd-oasis-opendocument-spreadsheet-template,.elfinder-cwd-icon-vnd-oasis-opendocument-text,.elfinder-cwd-icon-vnd-oasis-opendocument-text-master,.elfinder-cwd-icon-vnd-oasis-opendocument-text-template,.elfinder-cwd-icon-vnd-oasis-opendocument-text-web,.elfinder-cwd-icon-vnd-openofficeorg-extension,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-presentation,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-slide,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-slideshow,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-template,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-spreadsheetml-sheet,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-spreadsheetml-template,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-wordprocessingml-document,.elfinder-cwd-icon-vnd-openxmlformats-officedocument-wordprocessingml-template{background-position:0 -500px}.elfinder-cwd-icon-html{background-position:0 -550px}.elfinder-cwd-icon-css{background-position:0 -600px}.elfinder-cwd-icon-javascript,.elfinder-cwd-icon-x-javascript{background-position:0 -650px}.elfinder-cwd-icon-x-perl{background-position:0 -700px}.elfinder-cwd-icon-x-python{background-position:0 -750px}.elfinder-cwd-icon-x-ruby{background-position:0 -800px}.elfinder-cwd-icon-x-sh,.elfinder-cwd-icon-x-shellscript{background-position:0 -850px}.elfinder-cwd-icon-x-c,.elfinder-cwd-icon-x-csrc,.elfinder-cwd-icon-x-chdr,.elfinder-cwd-icon-x-c--,.elfinder-cwd-icon-x-c--src,.elfinder-cwd-icon-x-c--hdr,.elfinder-cwd-icon-x-java,.elfinder-cwd-icon-x-java-source{background-position:0 -900px}.elfinder-cwd-icon-x-php{background-position:0 -950px}.elfinder-cwd-icon-xml{background-position:0 -1000px}.elfinder-cwd-icon-zip,.elfinder-cwd-icon-x-zip,.elfinder-cwd-icon-x-xz,.elfinder-cwd-icon-x-7z-compressed{background-position:0 -1050px}.elfinder-cwd-icon-x-gzip,.elfinder-cwd-icon-x-tar{background-position:0 -1100px}.elfinder-cwd-icon-x-bzip,.elfinder-cwd-icon-x-bzip2{background-position:0 -1150px}.elfinder-cwd-icon-x-rar,.elfinder-cwd-icon-x-rar-compressed{background-position:0 -1200px}.elfinder-cwd-icon-x-shockwave-flash{background-position:0 -1250px}.elfinder-cwd-icon-group{background-position:0 -1300px}.elfinder-cwd input{width:100%;border:0 solid;margin:0;padding:0}.elfinder-cwd-view-icons input{text-align:center}.elfinder-cwd-view-icons textarea{width:100%;border:0 solid;margin:0;padding:0;text-align:center;overflow:hidden;resize:none}.elfinder-cwd-view-icons{text-align:center}.elfinder-cwd table{width:100%;border-collapse:separate;border:0 solid;margin:0 0 10px;border-spacing:0;box-sizing:padding-box;padding:2px}.elfinder .elfinder-cwd table thead tr{border-left:0 solid;border-top:0 solid;border-right:0 solid}.elfinder .elfinder-cwd table thead td{padding:4px 14px}.elfinder .elfinder-cwd table thead td.ui-state-active{background:#ebf1f6;background:-moz-linear-gradient(top,#ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ebf1f6),color-stop(50%,#abd3ee),color-stop(51%,#89c3eb),color-stop(100%,#d5ebfb));background:-webkit-linear-gradient(top,#ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);background:-o-linear-gradient(top,#ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);background:-ms-linear-gradient(top,#ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);background:linear-gradient(to bottom,#ebf1f6 0%,#abd3ee 50%,#89c3eb 51%,#d5ebfb 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ebf1f6', endColorstr='#d5ebfb',GradientType=0 )}.elfinder .elfinder-cwd table td{padding:4px 12px;white-space:pre;overflow:hidden;text-align:right;cursor:default;border:0 solid}.elfinder .elfinder-cwd table td div{box-sizing:content-box}.elfinder .elfinder-cwd tr.elfinder-touch td{padding:10px 12px}.elfinder .elfinder-cwd tr.elfinder-cwd-file.elfinder-touch td{padding:13px 12px}.elfinder-ltr .elfinder-cwd table td{text-align:right}.elfinder-ltr .elfinder-cwd table td:first-child{text-align:left}.elfinder-rtl .elfinder-cwd table td{text-align:left}.elfinder-rtl .elfinder-cwd table td:first-child{text-align:right}.elfinder-odd-row{background:#eee}.elfinder-cwd-view-list .elfinder-cwd-file-wrapper{width:97%;position:relative}.elfinder-ltr .elfinder-cwd-view-list .elfinder-cwd-file-wrapper{padding-left:23px}.elfinder-rtl .elfinder-cwd-view-list .elfinder-cwd-file-wrapper{padding-right:23px}.elfinder-cwd-view-list .elfinder-perms,.elfinder-cwd-view-list .elfinder-lock,.elfinder-cwd-view-list .elfinder-symlink{top:50%;margin-top:-6px}.elfinder-ltr .elfinder-cwd-view-list .elfinder-perms{left:7px}.elfinder-ltr .elfinder-cwd-view-list .elfinder-lock{left:9px;top:0}.elfinder-ltr .elfinder-cwd-view-list .elfinder-symlink{left:-7px}.elfinder-cwd-view-list td .elfinder-cwd-icon{width:16px;height:16px;position:absolute;top:50%;margin-top:-8px;background-image:url(../img/icons-small.png)}.elfinder-ltr .elfinder-cwd-view-list .elfinder-cwd-icon{left:0}.elfinder-rtl .elfinder-cwd-view-list .elfinder-cwd-icon{right:0}.std42-dialog{padding:0;position:absolute;left:auto;right:auto}.std42-dialog .ui-dialog-titlebar{border-left:0 solid transparent;border-top:0 solid transparent;border-right:0 solid transparent;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;font-weight:400;padding:.2em 1em}.std42-dialog .ui-dialog-titlebar-close,.std42-dialog .ui-dialog-titlebar-close:hover{padding:1px}.elfinder-rtl .elfinder-dialog .ui-dialog-titlebar{text-align:right}.elfinder-rtl .elfinder-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close{right:auto;left:.3em}.std42-dialog .ui-dialog-content{padding:.3em .5em}.std42-dialog .ui-dialog-buttonpane{border:0 solid;margin:0;padding:.5em .7em}.std42-dialog .ui-dialog-buttonpane button{margin:0 0 0 .4em;padding:0;outline:0 solid}.std42-dialog .ui-dialog-buttonpane button span{padding:2px 9px}.std42-dialog .ui-dialog-buttonpane button span.ui-icon{padding:2px}.elfinder-dialog .ui-resizable-e,.elfinder-dialog .ui-resizable-s{width:0;height:0}.std42-dialog .ui-button input{cursor:pointer}.elfinder-dialog-icon{position:absolute;width:32px;height:32px;left:12px;top:50%;margin-top:-15px;background:url("../img/dialogs.png") 0 0 no-repeat}.elfinder-rtl .elfinder-dialog-icon{left:auto;right:12px}.elfinder-dialog-error .ui-dialog-content,.elfinder-dialog-confirm .ui-dialog-content{padding-left:56px;min-height:35px}.elfinder-rtl .elfinder-dialog-error .ui-dialog-content,.elfinder-rtl .elfinder-dialog-confirm .ui-dialog-content{padding-left:0;padding-right:56px}.elfinder-dialog-notify .ui-dialog-titlebar-close{display:none}.elfinder-dialog-notify .ui-dialog-content{padding:0}.elfinder-notify{border-bottom:1px solid #ccc;position:relative;padding:.5em;text-align:center;overflow:hidden}.elfinder-ltr .elfinder-notify{padding-left:30px}.elfinder-rtl .elfinder-notify{padding-right:30px}.elfinder-notify:last-child{border:0 solid}.elfinder-notify-progressbar{width:180px;height:8px;border:1px solid #aaa;background:#f5f5f5;margin:5px auto;overflow:hidden}.elfinder-notify-progress{width:100%;height:8px;background:url(../img/progress.gif) center center repeat-x}.elfinder-notify-progressbar,.elfinder-notify-progress{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.elfinder-dialog-icon-open,.elfinder-dialog-icon-readdir,.elfinder-dialog-icon-file,.elfinder-dialog-icon-reload{background-position:0 -225px}.elfinder-dialog-icon-mkdir{background-position:0 -64px}.elfinder-dialog-icon-mkfile{background-position:0 -96px}.elfinder-dialog-icon-copy,.elfinder-dialog-icon-prepare,.elfinder-dialog-icon-move{background-position:0 -128px}.elfinder-dialog-icon-upload,.elfinder-dialog-icon-chunkmerge{background-position:0 -160px}.elfinder-dialog-icon-rm{background-position:0 -192px}.elfinder-dialog-icon-download{background-position:0 -260px}.elfinder-dialog-icon-save{background-position:0 -295px}.elfinder-dialog-icon-rename{background-position:0 -330px}.elfinder-dialog-icon-archive,.elfinder-dialog-icon-extract{background-position:0 -365px}.elfinder-dialog-icon-search{background-position:0 -402px}.elfinder-dialog-icon-resize,.elfinder-dialog-icon-loadimg,.elfinder-dialog-icon-netmount,.elfinder-dialog-icon-netunmount,.elfinder-dialog-icon-chmod,.elfinder-dialog-icon-preupload,.elfinder-dialog-icon-dim{background-position:0 -434px}.elfinder-dialog-confirm-applyall{padding-top:3px}.elfinder-dialog-confirm .elfinder-dialog-icon{background-position:0 -32px}.elfinder-info-title .elfinder-cwd-icon{float:left;width:48px;height:48px;margin-right:1em}.elfinder-rtl .elfinder-info-title .elfinder-cwd-icon{float:right;margin-right:0;margin-left:1em}.elfinder-info-title strong{display:block;padding:.3em 0 .5em}.elfinder-info-tb{min-width:200px;border:0 solid;margin:1em .2em}.elfinder-info-tb td{white-space:nowrap;padding:2px}.elfinder-info-tb tr td:first-child{text-align:right}.elfinder-info-tb span{float:left}.elfinder-info-tb a{outline:none;text-decoration:underline}.elfinder-info-tb a:hover{text-decoration:none}.elfinder-info-spinner{width:14px;height:14px;float:left;background:url("../img/spinner-mini.gif") center center no-repeat;margin:0 5px}.elfinder-netmount-tb{margin:0 auto}.elfinder-netmount-tb input{border:1px solid #ccc}.elfinder-upload-dropbox{text-align:center;padding:2em 0;border:3px dashed #aaa;height:1em;overflow:hidden}.elfinder-upload-dropbox.ui-state-hover{background:#dfdfdf;border:3px dashed #555}.elfinder-upload-dialog-or{margin:.3em 0;text-align:center}.elfinder-upload-dialog-wrapper{text-align:center}.elfinder-upload-dialog-wrapper .ui-button{position:relative;overflow:hidden}.elfinder-upload-dialog-wrapper .ui-button form{position:absolute;right:0;top:0;opacity:0;filter:Alpha(Opacity=0)}.elfinder-upload-dialog-wrapper .ui-button form input{padding:0 20px;font-size:3em}.dialogelfinder .dialogelfinder-drag{border-left:0 solid;border-top:0 solid;border-right:0 solid;font-weight:400;padding:2px 12px;cursor:move;position:relative;text-align:left}.elfinder-rtl .dialogelfinder-drag{text-align:right}.dialogelfinder-drag-close{position:absolute;top:50%;margin-top:-8px}.elfinder-ltr .dialogelfinder-drag-close{right:12px}.elfinder-rtl .dialogelfinder-drag-close{left:12px}.elfinder-rm-title{margin-bottom:.5ex}.elfinder-rm-title .elfinder-cwd-icon{float:left;width:48px;height:48px;margin-right:1em}.elfinder-rtl .elfinder-rm-title .elfinder-cwd-icon{float:right;margin-right:0;margin-left:1em}.elfinder-rm-title strong{display:block;white-space:pre-wrap;word-break:normal;overflow:hidden;text-overflow:ellipsis}.elfinder-rm-title+br{display:none}.elfinder-contextmenu .elfinder-contextmenu-item span{font-size:.76em}.elfinder-cwd-view-icons .elfinder-cwd-filename,.elfinder-cwd-view-list td{font-size:.7em}.std42-dialog .ui-dialog-titlebar{font-size:.82em}.std42-dialog .ui-dialog-content{font-size:.72em}.std42-dialog .ui-dialog-buttonpane{font-size:.76em}.elfinder-info-tb{font-size:.9em}.elfinder-upload-dropbox,.elfinder-upload-dialog-or{font-size:1.2em}.dialogelfinder .dialogelfinder-drag{font-size:.9em}.elfinder .elfinder-navbar{font-size:.72em}.elfinder-place-drag .elfinder-navbar-dir{font-size:.9em}.elfinder-quicklook-title{font-size:.7em}.elfinder-quicklook-info-data{font-size:.72em}.elfinder-quicklook-preview-text-wrapper{font-size:.9em}.elfinder-button-menu-item{font-size:.72em}.elfinder-button-search input{font-size:.8em}.elfinder-statusbar div{font-size:.7em}.elfinder-drag-num{font-size:12px}.elfinder .elfinder-navbar{width:230px;padding:3px 5px;background-image:none;border-top:0 solid;border-bottom:0 solid;overflow:auto;display:none;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none}.elfinder-ltr .elfinder-navbar{float:left;border-left:0 solid}.elfinder-rtl .elfinder-navbar{float:right;border-right:0 solid}.elfinder-ltr .ui-resizable-e{margin-left:10px}.elfinder-tree{display:table;width:100%;margin:0 0 .5em;-webkit-tap-highlight-color:rgba(0,0,0,0)}.elfinder-navbar-dir{position:relative;display:block;white-space:nowrap;padding:3px 12px;margin:0;outline:0 solid;border:1px solid transparent;cursor:default}.elfinder-navbar-dir.elfinder-touch{padding:12px}.elfinder-ltr .elfinder-navbar-dir{padding-left:35px}.elfinder-rtl .elfinder-navbar-dir{padding-right:35px}.elfinder-navbar-arrow{width:12px;height:14px;position:absolute;display:none;top:50%;margin-top:-8px;background-image:url("../img/arrows-normal.png");background-repeat:no-repeat}.ui-state-active .elfinder-navbar-arrow{background-image:url("../img/arrows-active.png")}.elfinder-navbar-collapsed .elfinder-navbar-arrow{display:block}.elfinder-ltr .elfinder-navbar-collapsed .elfinder-navbar-arrow{background-position:0 4px;left:0}.elfinder-rtl .elfinder-navbar-collapsed .elfinder-navbar-arrow{background-position:0 -10px;right:0}.elfinder-ltr .elfinder-navbar-expanded .elfinder-navbar-arrow,.elfinder-rtl .elfinder-navbar-expanded .elfinder-navbar-arrow{background-position:0 -21px}.elfinder-navbar-icon{width:16px;height:16px;position:absolute;top:50%;margin-top:-8px;background-image:url("../img/toolbar.png");background-repeat:no-repeat;background-position:0 -16px}.elfinder-ltr .elfinder-navbar-icon{left:14px}.elfinder-rtl .elfinder-navbar-icon{right:14px}.elfinder-tree .elfinder-navbar-root .elfinder-navbar-icon{background-position:0 0}.elfinder-places .elfinder-navbar-root .elfinder-navbar-icon{background-position:0 -704px}.elfinder-tree .elfinder-navbar-root-local .elfinder-navbar-icon{background-image:url("../img/volume_icon_local.png")}.elfinder-tree .elfinder-navbar-root-ftp .elfinder-navbar-icon{background-image:url("../img/volume_icon_ftp.png")}.elfinder-tree .elfinder-navbar-root-sql .elfinder-navbar-icon{background-image:url("../img/volume_icon_sql.png")}.elfinder-tree .elfinder-navbar-root-dropbox .elfinder-navbar-icon{background-image:url("../img/volume_icon_dropbox.png")}.ui-state-active .elfinder-navbar-icon,.elfinder-droppable-active .elfinder-navbar-icon,.ui-state-hover .elfinder-navbar-icon{background-position:0 -32px}.elfinder-navbar-subtree{display:none}.elfinder-ltr .elfinder-navbar-subtree{margin-left:12px}.elfinder-rtl .elfinder-navbar-subtree{margin-right:12px}.elfinder-navbar-spinner{width:14px;height:14px;position:absolute;display:block;top:50%;margin-top:-7px;background:url("../img/spinner-mini.gif") center center no-repeat}.elfinder-ltr .elfinder-navbar-spinner{left:0;margin-left:-2px}.elfinder-rtl .elfinder-navbar-spinner{right:0;margin-right:-2px}.elfinder-navbar .elfinder-perms{top:50%;margin-top:-8px}.elfinder-navbar .elfinder-lock{top:-2px}.elfinder-ltr .elfinder-navbar .elfinder-perms{left:18px}.elfinder-rtl .elfinder-navbar .elfinder-perms{right:18px}.elfinder-ltr .elfinder-navbar .elfinder-lock{left:18px}.elfinder-rtl .elfinder-navbar .elfinder-lock{right:18px}.elfinder-ltr .elfinder-navbar .elfinder-symlink{left:8px}.elfinder-rtl .elfinder-navbar .elfinder-symlink{right:8px}.elfinder-navbar input{width:100%;border:0 solid;margin:0;padding:0}.elfinder-navbar .ui-resizable-handle{width:12px;background:url('../img/resize.png') center center no-repeat}.elfinder-nav-handle-icon{position:absolute;top:50%;margin:-8px 2px 0;opacity:.5;filter:Alpha(Opacity=50)}.elfinder-places{border:none;margin:0;padding:0}.elfinder-navbar-root .elfinder-places-root-icon{position:absolute;top:50%;margin-top:-9px;cursor:pointer;display:none}.elfinder-ltr .elfinder-places-root-icon{right:10px}.elfinder-rtl .elfinder-places-root-icon{left:10px}.elfinder-navbar-expanded .elfinder-places-root-icon{display:block}.elfinder-place-drag{font-size:.8em}.elfinder-quicklook{position:absolute;background:url("../img/quicklook-bg.png");display:none;overflow:hidden;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;padding:20px 0 40px}.elfinder-quicklook .ui-resizable-se{width:14px;height:14px;right:5px;bottom:3px;background:url("../img/toolbar.png") 0 -496px no-repeat}.elfinder-quicklook-fullscreen{border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;-webkit-background-clip:padding-box;padding:0;background:#000;z-index:90000;display:block}.elfinder-quicklook-fullscreen .elfinder-quicklook-titlebar{display:none}.elfinder-quicklook-fullscreen .elfinder-quicklook-preview{border:0 solid}.elfinder-quicklook-titlebar{text-align:center;background:#777;position:absolute;left:0;top:0;width:100%;height:20px;-moz-border-radius-topleft:7px;-webkit-border-top-left-radius:7px;border-top-left-radius:7px;-moz-border-radius-topright:7px;-webkit-border-top-right-radius:7px;border-top-right-radius:7px;cursor:move}.elfinder-quicklook-title{color:#fff;white-space:nowrap;overflow:hidden;padding:2px 0}.elfinder-quicklook-titlebar .ui-icon{position:absolute;left:4px;top:50%;margin-top:-8px;width:16px;height:16px;cursor:default}.elfinder-quicklook-preview{overflow:hidden;position:relative;border:0 solid;border-left:1px solid transparent;border-right:1px solid transparent;height:100%}.elfinder-quicklook-info-wrapper{position:absolute;width:100%;left:0;top:50%;margin-top:-50px}.elfinder-quicklook-info{padding:0 12px 0 112px}.elfinder-quicklook-info .elfinder-quicklook-info-data:first-child{color:#fff;font-weight:700;padding-bottom:.5em}.elfinder-quicklook-info-data{padding-bottom:.2em;color:#fff}.elfinder-quicklook .elfinder-cwd-icon{position:absolute;left:32px;top:50%;margin-top:-20px}.elfinder-quicklook-preview img{display:block;margin:0 auto}.elfinder-quicklook-navbar{position:absolute;left:50%;bottom:4px;width:140px;height:32px;padding:0;margin-left:-70px;border:1px solid transparent;border-radius:19px;-moz-border-radius:19px;-webkit-border-radius:19px}.elfinder-quicklook-fullscreen .elfinder-quicklook-navbar{width:188px;margin-left:-94px;padding:5px;border:1px solid #eee;background:#000}.elfinder-quicklook-fullscreen .elfinder-quicklook-navbar-icon-close,.elfinder-quicklook-fullscreen .elfinder-quicklook-navbar-separator{display:inline}.elfinder-quicklook-navbar-icon{width:32px;height:32px;margin:0 7px;float:left;background:url("../img/quicklook-icons.png") 0 0 no-repeat}.elfinder-quicklook-navbar-icon-fullscreen{background-position:0 -64px}.elfinder-quicklook-navbar-icon-fullscreen-off{background-position:0 -96px}.elfinder-quicklook-navbar-icon-prev{background-position:0 0}.elfinder-quicklook-navbar-icon-next{background-position:0 -32px}.elfinder-quicklook-navbar-icon-close{background-position:0 -128px;display:none}.elfinder-quicklook-navbar-separator{width:1px;height:32px;float:left;border-left:1px solid #fff;display:none}.elfinder-quicklook-preview-text-wrapper{width:100%;height:100%;background:#fff;color:#222;overflow:auto}pre.elfinder-quicklook-preview-text{margin:0;padding:3px 9px}.elfinder-quicklook-preview-html,.elfinder-quicklook-preview-pdf{width:100%;height:100%;background:#fff;border:0 solid;margin:0}.elfinder-quicklook-preview-flash{width:100%;height:100%}.elfinder-quicklook-preview-audio{width:100%;position:absolute;bottom:0;left:0}embed.elfinder-quicklook-preview-audio{height:30px;background:0 0}.elfinder-quicklook-preview-video{width:100%;height:100%}.elfinder-statusbar{text-align:center;font-weight:400;padding:.2em .5em;border-right:0 solid transparent;border-bottom:0 solid transparent;border-left:0 solid transparent;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none}.elfinder-statusbar a{text-decoration:none}.elfinder-path{max-width:30%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis}.elfinder-ltr .elfinder-path{float:left}.elfinder-rtl .elfinder-path{float:right}.elfinder-stat-size{white-space:nowrap}.elfinder-ltr .elfinder-stat-size{float:right}.elfinder-rtl .elfinder-stat-size{float:left}.elfinder-stat-selected{white-space:nowrap;overflow:hidden}.elfinder-toolbar{padding:4px 0 3px;border-left:0 solid transparent;border-top:0 solid transparent;border-right:0 solid transparent}.elfinder-buttonset{margin:1px 4px;float:left;background:0 0;padding:0;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.elfinder .elfinder-button{width:16px;height:16px;margin:0;padding:4px;float:left;overflow:hidden;position:relative;border:0 solid;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.elfinder .ui-icon-search{cursor:pointer}.elfinder-button:first-child{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.elfinder-button:last-child{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.elfinder-toolbar-button-separator{float:left;padding:0;height:24px;border-top:0 solid;border-right:0 solid;border-bottom:0 solid;width:0}.elfinder .elfinder-button.ui-state-disabled{opacity:1;filter:Alpha(Opacity=100)}.elfinder .elfinder-button.ui-state-disabled .elfinder-button-icon{opacity:.4;filter:Alpha(Opacity=40)}.elfinder-rtl .elfinder-buttonset{float:right}.elfinder-button-icon{width:16px;height:16px;display:block;background:url('../img/toolbar.png') no-repeat}.elfinder-button-icon-home{background-position:0 0}.elfinder-button-icon-back{background-position:0 -112px}.elfinder-button-icon-forward{background-position:0 -128px}.elfinder-button-icon-up{background-position:0 -144px}.elfinder-button-icon-reload{background-position:0 -160px}.elfinder-button-icon-open{background-position:0 -176px}.elfinder-button-icon-mkdir{background-position:0 -192px}.elfinder-button-icon-mkfile{background-position:0 -208px}.elfinder-button-icon-rm{background-position:0 -224px}.elfinder-button-icon-copy{background-position:0 -240px}.elfinder-button-icon-cut{background-position:0 -256px}.elfinder-button-icon-paste{background-position:0 -272px}.elfinder-button-icon-getfile{background-position:0 -288px}.elfinder-button-icon-duplicate{background-position:0 -304px}.elfinder-button-icon-rename{background-position:0 -320px}.elfinder-button-icon-edit{background-position:0 -336px}.elfinder-button-icon-quicklook{background-position:0 -352px}.elfinder-button-icon-upload{background-position:0 -368px}.elfinder-button-icon-download{background-position:0 -384px}.elfinder-button-icon-info{background-position:0 -400px}.elfinder-button-icon-extract{background-position:0 -416px}.elfinder-button-icon-archive{background-position:0 -432px}.elfinder-button-icon-view{background-position:0 -448px}.elfinder-button-icon-view-list{background-position:0 -464px}.elfinder-button-icon-help{background-position:0 -480px}.elfinder-button-icon-resize{background-position:0 -512px}.elfinder-button-icon-link{background-position:0 -528px}.elfinder-button-icon-search{background-position:0 -561px}.elfinder-button-icon-sort{background-position:0 -577px}.elfinder-button-icon-rotate-r{background-position:0 -625px}.elfinder-button-icon-rotate-l{background-position:0 -641px}.elfinder-button-icon-netmount{background-position:0 -688px}.elfinder-button-icon-netunmount{background-position:0 -96px}.elfinder-button-icon-places{background-position:0 -704px}.elfinder-button-icon-chmod{background-position:0 -48px}.elfinder-button-icon-accept{background-position:0 -736px}.elfinder-button-icon-opendir{background-position:0 -32px}.elfinder .elfinder-menubutton{overflow:visible}.elfinder-button-icon-spinner{background:url("../img/spinner-mini.gif") center center no-repeat}.elfinder-button-menu{position:absolute;left:0;top:25px;padding:3px 0}.elfinder-button-menu-item{white-space:nowrap;cursor:default;padding:5px 19px;position:relative}.elfinder-button-menu .ui-state-hover{border:0 solid}.elfinder-button-menu-item-separated{border-top:1px solid #ccc}.elfinder-button-menu-item .ui-icon{width:16px;height:16px;position:absolute;left:2px;top:50%;margin-top:-8px;display:none}.elfinder-button-menu-item-selected .ui-icon{display:block}.elfinder-button-menu-item-selected-asc .ui-icon-arrowthick-1-n,.elfinder-button-menu-item-selected-desc .ui-icon-arrowthick-1-s{display:none}.elfinder-button form{position:absolute;top:0;right:0;opacity:0;filter:Alpha(Opacity=0);cursor:pointer}.elfinder .elfinder-button form input{background:0 0;cursor:default}.elfinder .elfinder-button-search{border:0 solid;background:0 0;padding:0;margin:1px 4px;height:auto;min-height:26px;float:right;width:202px;overflow:visible}.elfinder .elfinder-button-search .elfinder-button-menu{font-size:8pt;text-align:center;width:100%}.elfinder .elfinder-button-search .elfinder-button-menu div{margin-left:auto;margin-right:auto;margin-bottom:5px}.elfinder .elfinder-button-search .elfinder-button-menu div .ui-state-hover{border:1px solid}.elfinder-ltr .elfinder-button-search{float:right;margin-right:10px}.elfinder-rtl .elfinder-button-search{float:left;margin-left:10px}.elfinder-button-search input{width:160px;height:22px;padding:0 20px;line-height:22px;border:1px solid #aaa;-moz-border-radius:12px;-webkit-border-radius:12px;border-radius:12px;outline:0 solid}.elfinder-rtl .elfinder-button-search input{direction:rtl}.elfinder-button-search .ui-icon{position:absolute;height:18px;top:50%;margin:-9px 4px 0;opacity:.6;filter:Alpha(Opacity=60)}.elfinder-ltr .elfinder-button-search .ui-icon-search{left:0}.elfinder-rtl .elfinder-button-search .ui-icon-search,.elfinder-ltr .elfinder-button-search .ui-icon-close{right:0}.elfinder-rtl .elfinder-button-search .ui-icon-close{left:0}
elFinder/css/theme.css ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * MacOS X like theme for elFinder.
3
+ * Required jquery ui "smoothness" theme.
4
+ *
5
+ * @author Dmitry (dio) Levashov
6
+ **/
7
+
8
+ /* dialogs */
9
+ .std42-dialog, .std42-dialog .ui-widget-content { background-color:#ededed; background-image:none; background-clip: content-box; }
10
+
11
+ /* navbar */
12
+ .elfinder .elfinder-navbar { background:#dde4eb; }
13
+ .elfinder-navbar .ui-state-hover { color:#000; background-color:#edf1f4; border-color:#bdcbd8; }
14
+ .elfinder-navbar .ui-state-active { background: #3875d7; border-color:#3875d7; color:#fff; }
15
+ .elfinder-navbar .elfinder-droppable-active {background:#A7C6E5 !important;}
16
+ /* disabled elfinder */
17
+ .elfinder-disabled .elfinder-navbar .ui-state-active { background: #dadada; border-color:#aaa; color:#fff; }
18
+
19
+
20
+ /* current directory */
21
+ /* selected file in "icons" view */
22
+ .elfinder-cwd-view-icons .elfinder-cwd-file .ui-state-hover { background:#ccc; }
23
+
24
+ /* list view*/
25
+ .elfinder-cwd table thead td.ui-state-hover { background:#ddd; }
26
+ .elfinder-cwd table tr:nth-child(odd) { background-color:#edf3fe; }
27
+ .elfinder-cwd table tr {
28
+ border: 1px solid transparent;
29
+ border-top:1px solid #fff;
30
+ }
31
+ .elfinder-cwd .elfinder-droppable-active td { background:#A7C6E5 !important; }
32
+
33
+
34
+ /* common selected background/color */
35
+ .elfinder-cwd-view-icons .elfinder-cwd-file .elfinder-cwd-filename.ui-state-hover,
36
+ .elfinder-cwd table td.ui-state-hover,
37
+ .elfinder-button-menu .ui-state-hover { background: #3875d7; color:#fff;}
38
+ /* disabled elfinder */
39
+ .elfinder-disabled .elfinder-cwd-view-icons .elfinder-cwd-file .elfinder-cwd-filename.ui-state-hover,
40
+ .elfinder-disabled .elfinder-cwd table td.ui-state-hover { background:#dadada;}
41
+
42
+ /* statusbar */
43
+ .elfinder .elfinder-statusbar { color:#555; }
44
+ .elfinder .elfinder-statusbar a { text-decoration:none; color:#555;}
45
+
46
+
47
+ .std42-dialog .elfinder-help, .std42-dialog .elfinder-help .ui-widget-content { background:#fff;}
48
+
49
+ /* contextmenu */
50
+ .elfinder-contextmenu .ui-state-hover { background: #3875d7; color:#fff; }
51
+ .elfinder-contextmenu .ui-state-hover .elfinder-contextmenu-arrow { background-image:url('../img/arrows-active.png'); }
52
+
53
+
54
+
55
+
56
+
57
+
elFinder/elfinder.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>elFinder 2.1.x source version with PHP connector</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2" />
7
+
8
+ <!-- jQuery and jQuery UI (REQUIRED) -->
9
+ <link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
10
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
11
+ <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
12
+
13
+ <!-- elFinder CSS (REQUIRED) -->
14
+ <link rel="stylesheet" type="text/css" href="css/elfinder.min.css">
15
+ <link rel="stylesheet" type="text/css" href="css/theme.css">
16
+
17
+ <!-- elFinder JS (REQUIRED) -->
18
+ <script src="js/elfinder.min.js"></script>
19
+
20
+ <!-- elFinder translation (OPTIONAL) -->
21
+ <script src="js/i18n/elfinder.ru.js"></script>
22
+
23
+ <!-- elFinder initialization (REQUIRED) -->
24
+ <script type="text/javascript" charset="utf-8">
25
+ // Documentation for client options:
26
+ // https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
27
+ $(document).ready(function() {
28
+ $('#elfinder').elfinder({
29
+ url : 'php/connector.minimal.php' // connector URL (REQUIRED)
30
+ // , lang: 'ru' // language (OPTIONAL)
31
+
32
+ });
33
+ });
34
+ </script>
35
+ </head>
36
+ <body>
37
+
38
+ <!-- Element where elFinder will be created (REQUIRED) -->
39
+ <div id="elfinder"></div>
40
+
41
+ </body>
42
+ </html>
elFinder/files/.gitkeep ADDED
File without changes
elFinder/files/car-1.jpeg ADDED
Binary file
elFinder/files/car3.jpg ADDED
Binary file
elFinder/files/crop.gif ADDED
Binary file
elFinder/files/dialogs.png ADDED
Binary file
elFinder/files/file-2.jpg ADDED
Binary file
elFinder/files/icons-big.png ADDED
Binary file
elFinder/files/icons-small.png ADDED
Binary file
elFinder/files/logo.png ADDED
Binary file
elFinder/files/progress.gif ADDED
Binary file
elFinder/files/quicklook-bg.png ADDED
Binary file
elFinder/files/quicklook-icons.png ADDED
Binary file
elFinder/files/resize.png ADDED
Binary file
elFinder/files/spinner-mini.gif ADDED
Binary file
elFinder/files/toolbar.png ADDED
Binary file
elFinder/img/arrows-active.png ADDED
Binary file
elFinder/img/arrows-normal.png ADDED
Binary file
elFinder/img/crop.gif ADDED
Binary file
elFinder/img/dialogs.png ADDED
Binary file
elFinder/img/icons-big.png ADDED
Binary file
elFinder/img/icons-small.png ADDED
Binary file
elFinder/img/logo.png ADDED
Binary file
elFinder/img/progress.gif ADDED
Binary file
elFinder/img/quicklook-bg.png ADDED
Binary file
elFinder/img/quicklook-icons.png ADDED
Binary file
elFinder/img/resize.png ADDED
Binary file
elFinder/img/spinner-mini.gif ADDED
Binary file
elFinder/img/toolbar.png ADDED
Binary file
elFinder/img/volume_icon_dropbox.png ADDED
Binary file
elFinder/img/volume_icon_ftp.png ADDED
Binary file
elFinder/img/volume_icon_local.png ADDED
Binary file
elFinder/img/volume_icon_sql.png ADDED
Binary file
elFinder/js/elfinder.full.js ADDED
@@ -0,0 +1,15976 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * elFinder - file manager for web
3
+ * Version 2.1.6 (2016-01-19)
4
+ * http://elfinder.org
5
+ *
6
+ * Copyright 2009-2016, Studio 42
7
+ * Licensed under a 3 clauses BSD license
8
+ */
9
+ (function($) {
10
+
11
+
12
+ /*
13
+ * File: /js/elFinder.js
14
+ */
15
+
16
+ /**
17
+ * @class elFinder - file manager for web
18
+ *
19
+ * @author Dmitry (dio) Levashov
20
+ **/
21
+ window.elFinder = function(node, opts) {
22
+ //this.time('load');
23
+
24
+ var self = this,
25
+
26
+ /**
27
+ * Node on which elfinder creating
28
+ *
29
+ * @type jQuery
30
+ **/
31
+ node = $(node),
32
+
33
+ /**
34
+ * Store node contents.
35
+ *
36
+ * @see this.destroy
37
+ * @type jQuery
38
+ **/
39
+ prevContent = $('<div/>').append(node.contents()),
40
+
41
+ /**
42
+ * Store node inline styles
43
+ *
44
+ * @see this.destroy
45
+ * @type String
46
+ **/
47
+ prevStyle = node.attr('style'),
48
+
49
+ /**
50
+ * Instance ID. Required to get/set cookie
51
+ *
52
+ * @type String
53
+ **/
54
+ id = node.attr('id') || '',
55
+
56
+ /**
57
+ * Events namespace
58
+ *
59
+ * @type String
60
+ **/
61
+ namespace = 'elfinder-'+(id || Math.random().toString().substr(2, 7)),
62
+
63
+ /**
64
+ * Mousedown event
65
+ *
66
+ * @type String
67
+ **/
68
+ mousedown = 'mousedown.'+namespace,
69
+
70
+ /**
71
+ * Keydown event
72
+ *
73
+ * @type String
74
+ **/
75
+ keydown = 'keydown.'+namespace,
76
+
77
+ /**
78
+ * Keypress event
79
+ *
80
+ * @type String
81
+ **/
82
+ keypress = 'keypress.'+namespace,
83
+
84
+ /**
85
+ * Is shortcuts/commands enabled
86
+ *
87
+ * @type Boolean
88
+ **/
89
+ enabled = true,
90
+
91
+ /**
92
+ * Store enabled value before ajax requiest
93
+ *
94
+ * @type Boolean
95
+ **/
96
+ prevEnabled = true,
97
+
98
+ /**
99
+ * List of build-in events which mapped into methods with same names
100
+ *
101
+ * @type Array
102
+ **/
103
+ events = ['enable', 'disable', 'load', 'open', 'reload', 'select', 'add', 'remove', 'change', 'dblclick', 'getfile', 'lockfiles', 'unlockfiles', 'dragstart', 'dragstop'],
104
+
105
+ /**
106
+ * Rules to validate data from backend
107
+ *
108
+ * @type Object
109
+ **/
110
+ rules = {},
111
+
112
+ /**
113
+ * Current working directory hash
114
+ *
115
+ * @type String
116
+ **/
117
+ cwd = '',
118
+
119
+ /**
120
+ * Current working directory options
121
+ *
122
+ * @type Object
123
+ **/
124
+ cwdOptions = {
125
+ path : '',
126
+ url : '',
127
+ tmbUrl : '',
128
+ disabled : [],
129
+ separator : '/',
130
+ archives : [],
131
+ extract : [],
132
+ copyOverwrite : true,
133
+ uploadOverwrite : true,
134
+ uploadMaxSize : 0,
135
+ jpgQuality : 100,
136
+ tmb : false // old API
137
+ },
138
+
139
+ /**
140
+ * Files/dirs cache
141
+ *
142
+ * @type Object
143
+ **/
144
+ files = {},
145
+
146
+ /**
147
+ * Selected files hashes
148
+ *
149
+ * @type Array
150
+ **/
151
+ selected = [],
152
+
153
+ /**
154
+ * Events listeners
155
+ *
156
+ * @type Object
157
+ **/
158
+ listeners = {},
159
+
160
+ /**
161
+ * Shortcuts
162
+ *
163
+ * @type Object
164
+ **/
165
+ shortcuts = {},
166
+
167
+ /**
168
+ * Buffer for copied files
169
+ *
170
+ * @type Array
171
+ **/
172
+ clipboard = [],
173
+
174
+ /**
175
+ * Copied/cuted files hashes
176
+ * Prevent from remove its from cache.
177
+ * Required for dispaly correct files names in error messages
178
+ *
179
+ * @type Array
180
+ **/
181
+ remember = [],
182
+
183
+ /**
184
+ * Queue for 'open' requests
185
+ *
186
+ * @type Array
187
+ **/
188
+ queue = [],
189
+
190
+ /**
191
+ * Commands prototype
192
+ *
193
+ * @type Object
194
+ **/
195
+ base = new self.command(self),
196
+
197
+ /**
198
+ * elFinder node width
199
+ *
200
+ * @type String
201
+ * @default "auto"
202
+ **/
203
+ width = 'auto',
204
+
205
+ /**
206
+ * elFinder node height
207
+ *
208
+ * @type Number
209
+ * @default 400
210
+ **/
211
+ height = 400,
212
+
213
+ /**
214
+ * elfinder path for sound played on remove
215
+ * @type String
216
+ * @default ./sounds/
217
+ **/
218
+ soundPath = '../wp-content/plugins/file-manager/elFinder/sounds/',
219
+
220
+ beeper = $(document.createElement('audio')).hide().appendTo('body')[0],
221
+
222
+ syncInterval,
223
+
224
+ uiCmdMapPrev = '',
225
+
226
+ open = function(data) {
227
+ var volumeid, contextmenu, emptyDirs = {}, stayDirs = {};
228
+
229
+ self.commandMap = (data.options.uiCmdMap && Object.keys(data.options.uiCmdMap).length)? data.options.uiCmdMap : {};
230
+
231
+ // support volume driver option `uiCmdMap`
232
+ if (uiCmdMapPrev !== JSON.stringify(self.commandMap)) {
233
+ uiCmdMapPrev = JSON.stringify(self.commandMap);
234
+ if (Object.keys(self.commandMap).length) {
235
+ // for contextmenu
236
+ contextmenu = self.getUI('contextmenu');
237
+ if (!contextmenu.data('cmdMaps')) {
238
+ contextmenu.data('cmdMaps', {});
239
+ }
240
+ volumeid = data.cwd? data.cwd.volumeid : null;
241
+ if (volumeid && !contextmenu.data('cmdMaps')[volumeid]) {
242
+ contextmenu.data('cmdMaps')[volumeid] = self.commandMap;
243
+ }
244
+ }
245
+ }
246
+
247
+ if (data.init) {
248
+ // init - reset cache
249
+ files = {};
250
+ } else {
251
+ // remove only files from prev cwd
252
+ // and collapsed directory (included 100+ directories) to empty for perfomance tune in DnD
253
+ $.each(Object.keys(files), function(n, i) {
254
+ var isDir = (files[i].mime === 'directory'),
255
+ phash = files[i].phash,
256
+ collapsed = self.res('class', 'navcollapse'),
257
+ pnav;
258
+ if (
259
+ (!isDir
260
+ || emptyDirs[phash]
261
+ || (!stayDirs[phash]
262
+ && $('#'+self.navHash2Id(files[i].hash)).is(':hidden')
263
+ && $('#'+self.navHash2Id(phash)).next('.elfinder-navbar-subtree').children().length > 100
264
+ )
265
+ )
266
+ && (isDir || phash === cwd)
267
+ && $.inArray(i, remember) === -1
268
+ ) {
269
+ if (isDir && !emptyDirs[phash]) {
270
+ emptyDirs[phash] = true;
271
+ }
272
+ delete files[i];
273
+ } else if (isDir) {
274
+ stayDirs[phash] = true;
275
+ }
276
+ });
277
+ $.each(Object.keys(emptyDirs), function(n, i) {
278
+ var rmClass = 'elfinder-subtree-loaded ' + self.res('class', 'navexpand');
279
+ $('#'+self.navHash2Id(i))
280
+ .removeClass(rmClass)
281
+ .next('.elfinder-navbar-subtree').empty();
282
+ });
283
+ }
284
+
285
+ cwd = data.cwd.hash;
286
+ cache(data.files);
287
+ if (!files[cwd]) {
288
+ cache([data.cwd]);
289
+ }
290
+ self.lastDir(cwd);
291
+
292
+ self.autoSync();
293
+ },
294
+
295
+ /**
296
+ * Store info about files/dirs in "files" object.
297
+ *
298
+ * @param Array files
299
+ * @return void
300
+ **/
301
+ cache = function(data) {
302
+ var l = data.length, f, i;
303
+
304
+ for (i = 0; i < l; i++) {
305
+ f = data[i];
306
+ if (f.name && f.hash && f.mime) {
307
+ if (!f.phash) {
308
+ var name = 'volume_'+f.name,
309
+ i18 = self.i18n(name);
310
+
311
+ if (name != i18) {
312
+ f.i18 = i18;
313
+ }
314
+
315
+ // set disabledCmds, tmbUrls for each volume
316
+ if (f.volumeid) {
317
+ f.disabled && (self.disabledCmds[f.volumeid] = f.disabled);
318
+ self.tmbUrls[f.volumeid] = self.option('tmbUrl');
319
+ }
320
+ }
321
+ files[f.hash] = f;
322
+ }
323
+ }
324
+ },
325
+
326
+ /**
327
+ * Exec shortcut
328
+ *
329
+ * @param jQuery.Event keydown/keypress event
330
+ * @return void
331
+ */
332
+ execShortcut = function(e) {
333
+ var code = e.keyCode,
334
+ ctrlKey = !!(e.ctrlKey || e.metaKey);
335
+
336
+ if (enabled) {
337
+
338
+ $.each(shortcuts, function(i, shortcut) {
339
+ if (shortcut.type == e.type
340
+ && shortcut.keyCode == code
341
+ && shortcut.shiftKey == e.shiftKey
342
+ && shortcut.ctrlKey == ctrlKey
343
+ && shortcut.altKey == e.altKey) {
344
+ e.preventDefault()
345
+ e.stopPropagation();
346
+ shortcut.callback(e, self);
347
+ self.debug('shortcut-exec', i+' : '+shortcut.description);
348
+ }
349
+ });
350
+
351
+ // prevent tab out of elfinder
352
+ if (code == 9 && !$(e.target).is(':input')) {
353
+ e.preventDefault();
354
+ }
355
+
356
+ // cancel copy or cut by [Esc] key
357
+ if (code == 27 && self.clipboard().length) {
358
+ self.clipboard([]);
359
+ }
360
+
361
+ }
362
+ },
363
+ date = new Date(),
364
+ utc,
365
+ i18n
366
+ ;
367
+
368
+
369
+ /**
370
+ * Protocol version
371
+ *
372
+ * @type String
373
+ **/
374
+ this.api = null;
375
+
376
+ /**
377
+ * elFinder use new api
378
+ *
379
+ * @type Boolean
380
+ **/
381
+ this.newAPI = false;
382
+
383
+ /**
384
+ * elFinder use old api
385
+ *
386
+ * @type Boolean
387
+ **/
388
+ this.oldAPI = false;
389
+
390
+ /**
391
+ * Net drivers names
392
+ *
393
+ * @type Array
394
+ **/
395
+ this.netDrivers = [];
396
+ /**
397
+ * User os. Required to bind native shortcuts for open/rename
398
+ *
399
+ * @type String
400
+ **/
401
+ this.OS = navigator.userAgent.indexOf('Mac') !== -1 ? 'mac' : navigator.userAgent.indexOf('Win') !== -1 ? 'win' : 'other';
402
+
403
+ /**
404
+ * User browser UA.
405
+ * jQuery.browser: version deprecated: 1.3, removed: 1.9
406
+ *
407
+ * @type Object
408
+ **/
409
+ this.UA = (function(){
410
+ var webkit = !document.uniqueID && !window.opera && !window.sidebar && window.localStorage && typeof window.orientation == "undefined";
411
+ return {
412
+ // Browser IE <= IE 6
413
+ ltIE6:typeof window.addEventListener == "undefined" && typeof document.documentElement.style.maxHeight == "undefined",
414
+ // Browser IE <= IE 7
415
+ ltIE7:typeof window.addEventListener == "undefined" && typeof document.querySelectorAll == "undefined",
416
+ // Browser IE <= IE 8
417
+ ltIE8:typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined",
418
+ IE:document.uniqueID,
419
+ Firefox:window.sidebar,
420
+ Opera:window.opera,
421
+ Webkit:webkit,
422
+ Chrome:webkit && window.chrome,
423
+ Safari:webkit && !window.chrome,
424
+ Mobile:typeof window.orientation != "undefined",
425
+ Touch:typeof window.ontouchstart != "undefined"
426
+ };
427
+ })();
428
+
429
+ /**
430
+ * Configuration options
431
+ *
432
+ * @type Object
433
+ **/
434
+ this.options = $.extend(true, {}, this._options, opts||{});
435
+
436
+ if (opts.ui) {
437
+ this.options.ui = opts.ui;
438
+ }
439
+
440
+ if (opts.commands) {
441
+ this.options.commands = opts.commands;
442
+ }
443
+
444
+ if (opts.uiOptions && opts.uiOptions.toolbar) {
445
+ this.options.uiOptions.toolbar = opts.uiOptions.toolbar;
446
+ }
447
+
448
+ if (opts.uiOptions && opts.uiOptions.cwd && opts.uiOptions.cwd.listView && opts.uiOptions.cwd.listView.columns) {
449
+ this.options.uiOptions.cwd.listView.columns = opts.uiOptions.cwd.listView.columns;
450
+ }
451
+ if (opts.uiOptions && opts.uiOptions.cwd && opts.uiOptions.cwd.listView && opts.uiOptions.cwd.listView.columnsCustomName) {
452
+ this.options.uiOptions.cwd.listView.columnsCustomName = opts.uiOptions.cwd.listView.columnsCustomName;
453
+ }
454
+
455
+ // configure for CORS
456
+ (function(){
457
+ var parseUrl = document.createElement('a'),
458
+ parseUploadUrl;
459
+ parseUrl.href = opts.url;
460
+ if (opts.urlUpload && (opts.urlUpload !== opts.url)) {
461
+ parseUploadUrl = document.createElement('a');
462
+ parseUploadUrl.href = opts.urlUpload;
463
+ }
464
+ if (window.location.host !== parseUrl.host || (parseUploadUrl && (window.location.host !== parseUploadUrl.host))) {
465
+ if (!$.isPlainObject(self.options.customHeaders)) {
466
+ self.options.customHeaders = {};
467
+ }
468
+ if (!$.isPlainObject(self.options.xhrFields)) {
469
+ self.options.xhrFields = {};
470
+ }
471
+ self.options.requestType = 'post';
472
+ self.options.customHeaders['X-Requested-With'] = 'XMLHttpRequest';
473
+ self.options.xhrFields['withCredentials'] = true;
474
+ }
475
+ })();
476
+
477
+ $.extend(this.options.contextmenu, opts.contextmenu);
478
+
479
+ /**
480
+ * Ajax request type
481
+ *
482
+ * @type String
483
+ * @default "get"
484
+ **/
485
+ this.requestType = /^(get|post)$/i.test(this.options.requestType) ? this.options.requestType.toLowerCase() : 'get',
486
+
487
+ /**
488
+ * Any data to send across every ajax request
489
+ *
490
+ * @type Object
491
+ * @default {}
492
+ **/
493
+ this.customData = $.isPlainObject(this.options.customData) ? this.options.customData : {};
494
+
495
+ /**
496
+ * Any custom headers to send across every ajax request
497
+ *
498
+ * @type Object
499
+ * @default {}
500
+ */
501
+ this.customHeaders = $.isPlainObject(this.options.customHeaders) ? this.options.customHeaders : {};
502
+
503
+ /**
504
+ * Any custom xhrFields to send across every ajax request
505
+ *
506
+ * @type Object
507
+ * @default {}
508
+ */
509
+ this.xhrFields = $.isPlainObject(this.options.xhrFields) ? this.options.xhrFields : {};
510
+
511
+ /**
512
+ * ID. Required to create unique cookie name
513
+ *
514
+ * @type String
515
+ **/
516
+ this.id = id;
517
+
518
+ /**
519
+ * ui.nav id prefix
520
+ *
521
+ * @type String
522
+ */
523
+ this.navPrefix = 'nav' + (elFinder.prototype.uniqueid? elFinder.prototype.uniqueid : '') + '-';
524
+
525
+ /**
526
+ * ui.cwd id prefix
527
+ *
528
+ * @type String
529
+ */
530
+ this.cwdPrefix = elFinder.prototype.uniqueid? ('cwd' + elFinder.prototype.uniqueid + '-') : '';
531
+
532
+ // Increment elFinder.prototype.uniqueid
533
+ ++elFinder.prototype.uniqueid;
534
+
535
+ /**
536
+ * URL to upload files
537
+ *
538
+ * @type String
539
+ **/
540
+ this.uploadURL = opts.urlUpload || opts.url;
541
+
542
+ /**
543
+ * Events namespace
544
+ *
545
+ * @type String
546
+ **/
547
+ this.namespace = namespace;
548
+
549
+ /**
550
+ * Interface language
551
+ *
552
+ * @type String
553
+ * @default "en"
554
+ **/
555
+ this.lang = this.i18[this.options.lang] && this.i18[this.options.lang].messages ? this.options.lang : 'en';
556
+
557
+ i18n = this.lang == 'en'
558
+ ? this.i18['en']
559
+ : $.extend(true, {}, this.i18['en'], this.i18[this.lang]);
560
+
561
+ /**
562
+ * Interface direction
563
+ *
564
+ * @type String
565
+ * @default "ltr"
566
+ **/
567
+ this.direction = i18n.direction;
568
+
569
+ /**
570
+ * i18 messages
571
+ *
572
+ * @type Object
573
+ **/
574
+ this.messages = i18n.messages;
575
+
576
+ /**
577
+ * Date/time format
578
+ *
579
+ * @type String
580
+ * @default "m.d.Y"
581
+ **/
582
+ this.dateFormat = this.options.dateFormat || i18n.dateFormat;
583
+
584
+ /**
585
+ * Date format like "Yesterday 10:20:12"
586
+ *
587
+ * @type String
588
+ * @default "{day} {time}"
589
+ **/
590
+ this.fancyFormat = this.options.fancyDateFormat || i18n.fancyDateFormat;
591
+
592
+ /**
593
+ * Today timestamp
594
+ *
595
+ * @type Number
596
+ **/
597
+ this.today = (new Date(date.getFullYear(), date.getMonth(), date.getDate())).getTime()/1000;
598
+
599
+ /**
600
+ * Yesterday timestamp
601
+ *
602
+ * @type Number
603
+ **/
604
+ this.yesterday = this.today - 86400;
605
+
606
+ utc = this.options.UTCDate ? 'UTC' : '';
607
+
608
+ this.getHours = 'get'+utc+'Hours';
609
+ this.getMinutes = 'get'+utc+'Minutes';
610
+ this.getSeconds = 'get'+utc+'Seconds';
611
+ this.getDate = 'get'+utc+'Date';
612
+ this.getDay = 'get'+utc+'Day';
613
+ this.getMonth = 'get'+utc+'Month';
614
+ this.getFullYear = 'get'+utc+'FullYear';
615
+
616
+ /**
617
+ * Css classes
618
+ *
619
+ * @type String
620
+ **/
621
+ this.cssClass = 'ui-helper-reset ui-helper-clearfix ui-widget ui-widget-content ui-corner-all elfinder elfinder-'+(this.direction == 'rtl' ? 'rtl' : 'ltr')+' '+this.options.cssClass;
622
+
623
+ /**
624
+ * Method to store/fetch data
625
+ *
626
+ * @type Function
627
+ **/
628
+ this.storage = (function() {
629
+ try {
630
+ return 'localStorage' in window && window['localStorage'] !== null ? self.localStorage : self.cookie;
631
+ } catch (e) {
632
+ return self.cookie;
633
+ }
634
+ })();
635
+
636
+ this.viewType = this.storage('view') || this.options.defaultView || 'icons';
637
+
638
+ this.sortType = this.storage('sortType') || this.options.sortType || 'name';
639
+
640
+ this.sortOrder = this.storage('sortOrder') || this.options.sortOrder || 'asc';
641
+
642
+ this.sortStickFolders = this.storage('sortStickFolders');
643
+
644
+ if (this.sortStickFolders === null) {
645
+ this.sortStickFolders = !!this.options.sortStickFolders;
646
+ } else {
647
+ this.sortStickFolders = !!this.sortStickFolders
648
+ }
649
+
650
+ this.sortRules = $.extend(true, {}, this._sortRules, this.options.sortsRules);
651
+
652
+ $.each(this.sortRules, function(name, method) {
653
+ if (typeof method != 'function') {
654
+ delete self.sortRules[name];
655
+ }
656
+ });
657
+
658
+ this.compare = $.proxy(this.compare, this);
659
+
660
+ /**
661
+ * Delay in ms before open notification dialog
662
+ *
663
+ * @type Number
664
+ * @default 500
665
+ **/
666
+ this.notifyDelay = this.options.notifyDelay > 0 ? parseInt(this.options.notifyDelay) : 500;
667
+
668
+ /**
669
+ * Dragging UI Helper object
670
+ *
671
+ * @type jQuery | null
672
+ **/
673
+ this.draggingUiHelper = null,
674
+
675
+ /**
676
+ * Base draggable options
677
+ *
678
+ * @type Object
679
+ **/
680
+ this.draggable = {
681
+ appendTo : 'body',
682
+ addClasses : true,
683
+ delay : 30,
684
+ distance : 8,
685
+ revert : true,
686
+ refreshPositions : false,
687
+ cursor : 'crosshair',
688
+ cursorAt : {left : 50, top : 47},
689
+ start : function(e, ui) {
690
+ var targets = $.map(ui.helper.data('files')||[], function(h) { return h || null ;}),
691
+ locked = false,
692
+ cnt, h;
693
+ self.draggingUiHelper = ui.helper;
694
+ cnt = targets.length;
695
+ while (cnt--) {
696
+ h = targets[cnt];
697
+ if (files[h].locked) {
698
+ locked = true;
699
+ ui.helper.data('locked', true);
700
+ break;
701
+ }
702
+ }
703
+ !locked && self.trigger('lockfiles', {files : targets});
704
+
705
+ },
706
+ drag : function(e, ui) {
707
+ var helper = ui.helper;
708
+ if (helper.data('refreshPositions') && $(this).draggable('instance')) {
709
+ if (helper.data('refreshPositions') > 0) {
710
+ $(this).draggable('option', { refreshPositions : true });
711
+ helper.data('refreshPositions', -1);
712
+ } else {
713
+ $(this).draggable('option', { refreshPositions : false });
714
+ helper.data('refreshPositions', null);
715
+ }
716
+ }
717
+ },
718
+ stop : function(e, ui) {
719
+ var files;
720
+ $(this).draggable('instance') && $(this).draggable('option', { refreshPositions : false });
721
+ self.draggingUiHelper = null;
722
+ self.trigger('focus').trigger('dragstop');
723
+ if (! ui.helper.data('droped')) {
724
+ files = $.map(ui.helper.data('files')||[], function(h) { return h || null ;});
725
+ self.trigger('unlockfiles', {files : files});
726
+ self.trigger('selectfiles', {files : files});
727
+ }
728
+ },
729
+ helper : function(e, ui) {
730
+ var element = this.id ? $(this) : $(this).parents('[id]:first'),
731
+ helper = $('<div class="elfinder-drag-helper"><span class="elfinder-drag-helper-icon-status"/></div>'),
732
+ icon = function(f) {
733
+ var mime = f.mime, i;
734
+ i = '<div class="elfinder-cwd-icon '+self.mime2class(mime)+' ui-corner-all"/>';
735
+ if (f.tmb && f.tmb !== 1) {
736
+ i = $(i).css('background', "url('"+self.option('tmbUrl')+f.tmb+"') center center no-repeat").get(0).outerHTML;
737
+ }
738
+ return i;
739
+ },
740
+ hashes, l, ctr;
741
+
742
+ self.draggingUiHelper && self.draggingUiHelper.stop(true, true);
743
+
744
+ self.trigger('dragstart', {target : element[0], originalEvent : e});
745
+
746
+ hashes = element.hasClass(self.res('class', 'cwdfile'))
747
+ ? self.selected()
748
+ : [self.navId2Hash(element.attr('id'))];
749
+
750
+ helper.append(icon(files[hashes[0]])).data('files', hashes).data('locked', false).data('droped', false).data('namespace', self.namespace).data('dropover', 0);
751
+
752
+ if ((l = hashes.length) > 1) {
753
+ helper.append(icon(files[hashes[l-1]]) + '<span class="elfinder-drag-num">'+l+'</span>');
754
+ }
755
+
756
+ $(document).on(keydown + ' keyup.' + namespace, function(e){
757
+ var chk = (e.shiftKey||e.ctrlKey||e.metaKey);
758
+ if (ctr !== chk) {
759
+ ctr = chk;
760
+ if (helper.is(':visible') && helper.data('dropover') && ! helper.data('droped')) {
761
+ helper.toggleClass('elfinder-drag-helper-plus', helper.data('locked')? true : ctr);
762
+ self.trigger(ctr? 'unlockfiles' : 'lockfiles', {files : hashes, helper: helper});
763
+ }
764
+ }
765
+ });
766
+
767
+ return helper;
768
+ }
769
+ };
770
+
771
+ /**
772
+ * Base droppable options
773
+ *
774
+ * @type Object
775
+ **/
776
+ this.droppable = {
777
+ greedy : true,
778
+ tolerance : 'pointer',
779
+ accept : '.elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file,.elfinder-cwd-filename',
780
+ hoverClass : this.res('class', 'adroppable'),
781
+ autoDisable: true, // elFinder original, see jquery.elfinder.js
782
+ drop : function(e, ui) {
783
+ var dst = $(this),
784
+ targets = $.map(ui.helper.data('files')||[], function(h) { return h || null }),
785
+ result = [],
786
+ dups = [],
787
+ faults = [],
788
+ isCopy = ui.helper.hasClass('elfinder-drag-helper-plus'),
789
+ c = 'class',
790
+ cnt, hash, i, h;
791
+
792
+ if (ui.helper.data('namespace') !== self.namespace) {
793
+ return false;
794
+ }
795
+ if (dst.hasClass(self.res(c, 'cwdfile'))) {
796
+ hash = self.cwdId2Hash(dst.attr('id'));
797
+ } else if (dst.hasClass(self.res(c, 'navdir'))) {
798
+ hash = self.navId2Hash(dst.attr('id'));
799
+ } else {
800
+ hash = cwd;
801
+ }
802
+
803
+ cnt = targets.length;
804
+
805
+ while (cnt--) {
806
+ h = targets[cnt];
807
+ // ignore drop into itself or in own location
808
+ if (h != hash && files[h].phash != hash) {
809
+ result.push(h);
810
+ } else {
811
+ ((isCopy && h !== hash && files[hash].write)? dups : faults).push(h);
812
+ }
813
+ }
814
+
815
+ if (faults.length) {
816
+ return false;
817
+ }
818
+
819
+ ui.helper.data('droped', true);
820
+
821
+ if (dups.length) {
822
+ ui.helper.hide();
823
+ self.exec('duplicate', dups);
824
+ }
825
+
826
+ if (result.length) {
827
+ ui.helper.hide();
828
+ self.clipboard(result, !isCopy);
829
+ self.exec('paste', hash, void 0, hash).always(function(){
830
+ self.trigger('unlockfiles', {files : targets});
831
+ });
832
+ self.trigger('drop', {files : targets});
833
+ }
834
+ }
835
+ };
836
+
837
+ /**
838
+ * Return true if filemanager is active
839
+ *
840
+ * @return Boolean
841
+ **/
842
+ this.enabled = function() {
843
+ return node.is(':visible') && enabled;
844
+ }
845
+
846
+ /**
847
+ * Return true if filemanager is visible
848
+ *
849
+ * @return Boolean
850
+ **/
851
+ this.visible = function() {
852
+ return node.is(':visible');
853
+ }
854
+
855
+ /**
856
+ * Return root dir hash for current working directory
857
+ *
858
+ * @return String
859
+ */
860
+ this.root = function(hash) {
861
+ var dir = files[hash || cwd], i;
862
+
863
+ while (dir && dir.phash) {
864
+ dir = files[dir.phash]
865
+ }
866
+ if (dir) {
867
+ return dir.hash;
868
+ }
869
+
870
+ while (i in files && files.hasOwnProperty(i)) {
871
+ dir = files[i]
872
+ if (!dir.phash && !dir.mime == 'directory' && dir.read) {
873
+ return dir.hash;
874
+ }
875
+ }
876
+
877
+ return '';
878
+ }
879
+
880
+ /**
881
+ * Return current working directory info
882
+ *
883
+ * @return Object
884
+ */
885
+ this.cwd = function() {
886
+ return files[cwd] || {};
887
+ }
888
+
889
+ /**
890
+ * Return required cwd option
891
+ *
892
+ * @param String option name
893
+ * @return mixed
894
+ */
895
+ this.option = function(name) {
896
+ return cwdOptions[name]||'';
897
+ }
898
+
899
+ /**
900
+ * Return file data from current dir or tree by it's hash
901
+ *
902
+ * @param String file hash
903
+ * @return Object
904
+ */
905
+ this.file = function(hash) {
906
+ return files[hash];
907
+ };
908
+
909
+ /**
910
+ * Return all cached files
911
+ *
912
+ * @return Array
913
+ */
914
+ this.files = function() {
915
+ return $.extend(true, {}, files);
916
+ }
917
+
918
+ /**
919
+ * Return list of file parents hashes include file hash
920
+ *
921
+ * @param String file hash
922
+ * @return Array
923
+ */
924
+ this.parents = function(hash) {
925
+ var parents = [],
926
+ dir;
927
+
928
+ while ((dir = this.file(hash))) {
929
+ parents.unshift(dir.hash);
930
+ hash = dir.phash;
931
+ }
932
+ return parents;
933
+ }
934
+
935
+ this.path2array = function(hash, i18) {
936
+ var file,
937
+ path = [];
938
+
939
+ while (hash && (file = files[hash]) && file.hash) {
940
+ path.unshift(i18 && file.i18 ? file.i18 : file.name);
941
+ hash = file.phash;
942
+ }
943
+
944
+ return path;
945
+ }
946
+
947
+ /**
948
+ * Return file path
949
+ *
950
+ * @param Object file
951
+ * @return String
952
+ */
953
+ this.path = function(hash, i18) {
954
+ return files[hash] && files[hash].path
955
+ ? files[hash].path
956
+ : this.path2array(hash, i18).join(cwdOptions.separator);
957
+ }
958
+
959
+ /**
960
+ * Return file url if set
961
+ *
962
+ * @param String file hash
963
+ * @return String
964
+ */
965
+ this.url = function(hash) {
966
+ var file = files[hash];
967
+
968
+ if (!file || !file.read) {
969
+ return '';
970
+ }
971
+
972
+ if (file.url == '1') {
973
+ this.request({
974
+ data : {cmd : 'url', target : hash},
975
+ preventFail : true,
976
+ options: {async: false}
977
+ })
978
+ .done(function(data) {
979
+ file.url = data.url || '';
980
+ })
981
+ .fail(function() {
982
+ file.url = '';
983
+ });
984
+ }
985
+
986
+ if (file.url) {
987
+ return file.url;
988
+ }
989
+
990
+ if (cwdOptions.url) {
991
+ return cwdOptions.url + $.map(this.path2array(hash), function(n) { return encodeURIComponent(n); }).slice(1).join('/')
992
+ }
993
+
994
+ var params = $.extend({}, this.customData, {
995
+ cmd: 'file',
996
+ target: file.hash
997
+ });
998
+ if (this.oldAPI) {
999
+ params.cmd = 'open';
1000
+ params.current = file.phash;
1001
+ }
1002
+ return this.options.url + (this.options.url.indexOf('?') === -1 ? '?' : '&') + $.param(params, true);
1003
+ }
1004
+
1005
+ /**
1006
+ * Convert from relative URL to abstract URL based on current URL
1007
+ *
1008
+ * @param String URL
1009
+ * @return String
1010
+ */
1011
+ this.convAbsUrl = function(url) {
1012
+ if (url.match(/^http/i)) {
1013
+ return url;
1014
+ }
1015
+ var root = window.location.protocol + '//' + window.location.host,
1016
+ reg = /[^\/]+\/\.\.\//,
1017
+ ret;
1018
+ if (url.substr(0, 1) === '/') {
1019
+ ret = root + url;
1020
+ } else {
1021
+ ret = root + window.location.pathname + url;
1022
+ }
1023
+ ret = ret.replace('/./', '/');
1024
+ while(reg.test(ret)) {
1025
+ ret = ret.replace(reg, '');
1026
+ }
1027
+ return ret;
1028
+ }
1029
+
1030
+ /**
1031
+ * Return file url for open in elFinder
1032
+ *
1033
+ * @param String file hash
1034
+ * @param Bool for download link
1035
+ * @return String
1036
+ */
1037
+ this.openUrl = function(hash, download) {
1038
+ var file = files[hash],
1039
+ url = '';
1040
+
1041
+ if (!file || !file.read) {
1042
+ return '';
1043
+ }
1044
+
1045
+ if (!download) {
1046
+ if (file.url) {
1047
+ if (file.url != 1) {
1048
+ return file.url;
1049
+ }
1050
+ } else if (cwdOptions.url) {
1051
+ return cwdOptions.url + $.map(this.path2array(hash), function(n) { return encodeURIComponent(n); }).slice(1).join('/');
1052
+ }
1053
+ }
1054
+
1055
+ url = this.options.url;
1056
+ url = url + (url.indexOf('?') === -1 ? '?' : '&')
1057
+ + (this.oldAPI ? 'cmd=open&current='+file.phash : 'cmd=file')
1058
+ + '&target=' + file.hash;
1059
+
1060
+ if (download) {
1061
+ url += '&download=1';
1062
+ }
1063
+
1064
+ $.each(this.options.customData, function(key, val) {
1065
+ url += '&' + encodeURIComponent(key) + '=' + encodeURIComponent(val);
1066
+ });
1067
+
1068
+ return url;
1069
+ }
1070
+
1071
+ /**
1072
+ * Return thumbnail url
1073
+ *
1074
+ * @param String file hash
1075
+ * @return String
1076
+ */
1077
+ this.tmb = function(hash) {
1078
+ var file = files[hash],
1079
+ geturl = function(hash){
1080
+ var turl = cwdOptions['tmbUrl'];
1081
+ $.each(self.tmbUrls, function(i, u){
1082
+ if (hash.indexOf(i) === 0) {
1083
+ turl = self.tmbUrls[i];
1084
+ return false;
1085
+ }
1086
+ });
1087
+ return turl;
1088
+ },
1089
+ tmbUrl = (self.tmbUrls._search && hash.indexOf(self.cwd().volumeid) !== 0)? geturl(hash) : cwdOptions['tmbUrl'],
1090
+ url = file && file.tmb && file.tmb != 1 ? tmbUrl + file.tmb : '';
1091
+
1092
+ return url;
1093
+ }
1094
+
1095
+ /**
1096
+ * Return selected files hashes
1097
+ *
1098
+ * @return Array
1099
+ **/
1100
+ this.selected = function() {
1101
+ return selected.slice(0);
1102
+ }
1103
+
1104
+ /**
1105
+ * Return selected files info
1106
+ *
1107
+ * @return Array
1108
+ */
1109
+ this.selectedFiles = function() {
1110
+ return $.map(selected, function(hash) { return files[hash] ? $.extend({}, files[hash]) : null });
1111
+ };
1112
+
1113
+ /**
1114
+ * Return true if file with required name existsin required folder
1115
+ *
1116
+ * @param String file name
1117
+ * @param String parent folder hash
1118
+ * @return Boolean
1119
+ */
1120
+ this.fileByName = function(name, phash) {
1121
+ var hash;
1122
+
1123
+ for (hash in files) {
1124
+ if (files.hasOwnProperty(hash) && files[hash].phash == phash && files[hash].name == name) {
1125
+ return files[hash];
1126
+ }
1127
+ }
1128
+ };
1129
+
1130
+ /**
1131
+ * Valid data for required command based on rules
1132
+ *
1133
+ * @param String command name
1134
+ * @param Object cammand's data
1135
+ * @return Boolean
1136
+ */
1137
+ this.validResponse = function(cmd, data) {
1138
+ return data.error || this.rules[this.rules[cmd] ? cmd : 'defaults'](data);
1139
+ }
1140
+
1141
+ /**
1142
+ * Return bytes from ini formated size
1143
+ *
1144
+ * @param String ini formated size
1145
+ * @return Integer
1146
+ */
1147
+ this.returnBytes = function(val) {
1148
+ var last;
1149
+ if (isNaN(val)) {
1150
+ // for ex. 1mb, 1KB
1151
+ val = val.replace(/b$/i, '');
1152
+ last = val.charAt(val.length - 1).toLowerCase();
1153
+ val = val.replace(/[tgmk]$/i, '');
1154
+ if (last == 't') {
1155
+ val = val * 1024 * 1024 * 1024 * 1024;
1156
+ } else if (last == 'g') {
1157
+ val = val * 1024 * 1024 * 1024;
1158
+ } else if (last == 'm') {
1159
+ val = val * 1024 * 1024;
1160
+ } else if (last == 'k') {
1161
+ val = val * 1024;
1162
+ }
1163
+ val = isNaN(val)? 0 : parseInt(val);
1164
+ } else {
1165
+ val = parseInt(val);
1166
+ if (val < 1) val = 0;
1167
+ }
1168
+ return val;
1169
+ };
1170
+
1171
+ /**
1172
+ * Proccess ajax request.
1173
+ * Fired events :
1174
+ * @todo
1175
+ * @example
1176
+ * @todo
1177
+ * @return $.Deferred
1178
+ */
1179
+ this.request = function(options) {
1180
+ var self = this,
1181
+ o = this.options,
1182
+ dfrd = $.Deferred(),
1183
+ // request data
1184
+ data = $.extend({}, o.customData, {mimes : o.onlyMimes}, options.data || options),
1185
+ // command name
1186
+ cmd = data.cmd,
1187
+ // call default fail callback (display error dialog) ?
1188
+ deffail = !(options.preventDefault || options.preventFail),
1189
+ // call default success callback ?
1190
+ defdone = !(options.preventDefault || options.preventDone),
1191
+ // options for notify dialog
1192
+ notify = $.extend({}, options.notify),
1193
+ // do not normalize data - return as is
1194
+ raw = !!options.raw,
1195
+ // sync files on request fail
1196
+ syncOnFail = options.syncOnFail,
1197
+ // open notify dialog timeout
1198
+ timeout,
1199
+ // request options
1200
+ options = $.extend({
1201
+ url : o.url,
1202
+ async : true,
1203
+ type : this.requestType,
1204
+ dataType : 'json',
1205
+ cache : false,
1206
+ // timeout : 100,
1207
+ data : data,
1208
+ headers : this.customHeaders,
1209
+ xhrFields: this.xhrFields
1210
+ }, options.options || {}),
1211
+ /**
1212
+ * Default success handler.
1213
+ * Call default data handlers and fire event with command name.
1214
+ *
1215
+ * @param Object normalized response data
1216
+ * @return void
1217
+ **/
1218
+ done = function(data) {
1219
+ data.warning && self.error(data.warning);
1220
+
1221
+ cmd == 'open' && open($.extend(true, {}, data));
1222
+
1223
+ // fire some event to update cache/ui
1224
+ data.removed && data.removed.length && self.remove(data);
1225
+ data.added && data.added.length && self.add(data);
1226
+ data.changed && data.changed.length && self.change(data);
1227
+
1228
+ // fire event with command name
1229
+ self.trigger(cmd, data);
1230
+
1231
+ // force update content
1232
+ data.sync && self.sync();
1233
+ },
1234
+ /**
1235
+ * Request error handler. Reject dfrd with correct error message.
1236
+ *
1237
+ * @param jqxhr request object
1238
+ * @param String request status
1239
+ * @return void
1240
+ **/
1241
+ error = function(xhr, status) {
1242
+ var error;
1243
+
1244
+ switch (status) {
1245
+ case 'abort':
1246
+ error = xhr.quiet ? '' : ['errConnect', 'errAbort'];
1247
+ break;
1248
+ case 'timeout':
1249
+ error = ['errConnect', 'errTimeout'];
1250
+ break;
1251
+ case 'parsererror':
1252
+ error = ['errResponse', 'errDataNotJSON'];
1253
+ break;
1254
+ default:
1255
+ if (xhr.status == 403) {
1256
+ error = ['errConnect', 'errAccess'];
1257
+ } else if (xhr.status == 404) {
1258
+ error = ['errConnect', 'errNotFound'];
1259
+ } else {
1260
+ error = 'errConnect';
1261
+ }
1262
+ }
1263
+
1264
+ dfrd.reject(error, xhr, status);
1265
+ },
1266
+ /**
1267
+ * Request success handler. Valid response data and reject/resolve dfrd.
1268
+ *
1269
+ * @param Object response data
1270
+ * @param String request status
1271
+ * @return void
1272
+ **/
1273
+ success = function(response) {
1274
+ // Set currrent request command name
1275
+ self.currentReqCmd = cmd;
1276
+
1277
+ if (raw) {
1278
+ return dfrd.resolve(response);
1279
+ }
1280
+
1281
+ if (!response) {
1282
+ return dfrd.reject(['errResponse', 'errDataEmpty'], xhr);
1283
+ } else if (!$.isPlainObject(response)) {
1284
+ return dfrd.reject(['errResponse', 'errDataNotJSON'], xhr);
1285
+ } else if (response.error) {
1286
+ return dfrd.reject(response.error, xhr);
1287
+ } else if (!self.validResponse(cmd, response)) {
1288
+ return dfrd.reject('errResponse', xhr);
1289
+ }
1290
+
1291
+ response = self.normalize(response);
1292
+
1293
+ if (!self.api) {
1294
+ self.api = response.api || 1;
1295
+ self.newAPI = self.api >= 2;
1296
+ self.oldAPI = !self.newAPI;
1297
+ }
1298
+
1299
+ if (response.options) {
1300
+ cwdOptions = $.extend({}, cwdOptions, response.options);
1301
+ }
1302
+
1303
+ if (response.netDrivers) {
1304
+ self.netDrivers = response.netDrivers;
1305
+ }
1306
+
1307
+ if (cmd == 'open' && !!data.init) {
1308
+ self.uplMaxSize = self.returnBytes(response.uplMaxSize);
1309
+ self.uplMaxFile = !!response.uplMaxFile? parseInt(response.uplMaxFile) : 20;
1310
+ }
1311
+
1312
+ dfrd.resolve(response);
1313
+ response.debug && self.debug('backend-debug', response.debug);
1314
+ },
1315
+ xhr, _xhr,
1316
+ abort = function(e){
1317
+ if (e.type == 'autosync') {
1318
+ if (e.data.action != 'stop') return;
1319
+ } else {
1320
+ if (!e.data.added || !e.data.added.length) {
1321
+ return;
1322
+ }
1323
+ }
1324
+ if (xhr.state() == 'pending') {
1325
+ xhr.quiet = true;
1326
+ xhr.abort();
1327
+ if (e.type != 'unload' && e.type != 'destroy') {
1328
+ self.autoSync();
1329
+ }
1330
+ }
1331
+ };
1332
+
1333
+ defdone && dfrd.done(done);
1334
+ dfrd.fail(function(error) {
1335
+ if (error) {
1336
+ deffail ? self.error(error) : self.debug('error', self.i18n(error));
1337
+ }
1338
+ })
1339
+
1340
+ if (!cmd) {
1341
+ return dfrd.reject('errCmdReq');
1342
+ }
1343
+
1344
+ if (syncOnFail) {
1345
+ dfrd.fail(function(error) {
1346
+ error && self.sync();
1347
+ });
1348
+ }
1349
+
1350
+ if (notify.type && notify.cnt) {
1351
+ timeout = setTimeout(function() {
1352
+ self.notify(notify);
1353
+ dfrd.always(function() {
1354
+ notify.cnt = -(parseInt(notify.cnt)||0);
1355
+ self.notify(notify);
1356
+ })
1357
+ }, self.notifyDelay)
1358
+
1359
+ dfrd.always(function() {
1360
+ clearTimeout(timeout);
1361
+ });
1362
+ }
1363
+
1364
+ // quiet abort not completed "open" requests
1365
+ if (cmd == 'open') {
1366
+ while ((_xhr = queue.pop())) {
1367
+ if (_xhr.state() == 'pending') {
1368
+ _xhr.quiet = true;
1369
+ _xhr.abort();
1370
+ }
1371
+ }
1372
+ }
1373
+
1374
+ delete options.preventFail
1375
+
1376
+ xhr = this.transport.send(options).fail(error).done(success);
1377
+
1378
+ // add "open" xhr into queue
1379
+ if (cmd == 'open' || (cmd == 'info' && data.compare)) {
1380
+ queue.unshift(xhr);
1381
+ self.bind(self.cmdsToAdd + ' autosync', abort);
1382
+ dfrd.always(function() {
1383
+ var ndx = $.inArray(xhr, queue);
1384
+ self.unbind(self.cmdsToAdd + ' autosync', abort);
1385
+ ndx !== -1 && queue.splice(ndx, 1);
1386
+ });
1387
+ }
1388
+
1389
+ // abort pending xhr on window unload or elFinder destroy
1390
+ self.bind('unload destroy', abort);
1391
+ dfrd.always(function() {
1392
+ self.unbind('unload destroy', abort);
1393
+ });
1394
+
1395
+ return dfrd;
1396
+ };
1397
+
1398
+ /**
1399
+ * Compare current files cache with new files and return diff
1400
+ *
1401
+ * @param Array new files
1402
+ * @return Object
1403
+ */
1404
+ this.diff = function(incoming, onlydir) {
1405
+ var raw = {},
1406
+ added = [],
1407
+ removed = [],
1408
+ changed = [],
1409
+ isChanged = function(hash) {
1410
+ var l = changed.length;
1411
+
1412
+ while (l--) {
1413
+ if (changed[l].hash == hash) {
1414
+ return true;
1415
+ }
1416
+ }
1417
+ };
1418
+
1419
+ $.each(incoming, function(i, f) {
1420
+ raw[f.hash] = f;
1421
+ });
1422
+
1423
+ // find removed
1424
+ $.each(files, function(hash, f) {
1425
+ if (!onlydir || f.phash === onlydir) {
1426
+ !raw[hash] && removed.push(hash);
1427
+ }
1428
+ });
1429
+
1430
+ // compare files
1431
+ $.each(raw, function(hash, file) {
1432
+ var origin = files[hash];
1433
+
1434
+ if (!origin) {
1435
+ added.push(file);
1436
+ } else {
1437
+ $.each(file, function(prop) {
1438
+ if (file[prop] != origin[prop]) {
1439
+ changed.push(file)
1440
+ return false;
1441
+ }
1442
+ });
1443
+ }
1444
+ });
1445
+
1446
+ // parents of removed dirs mark as changed (required for tree correct work)
1447
+ $.each(removed, function(i, hash) {
1448
+ var file = files[hash],
1449
+ phash = file.phash;
1450
+
1451
+ if (phash
1452
+ && file.mime == 'directory'
1453
+ && $.inArray(phash, removed) === -1
1454
+ && raw[phash]
1455
+ && !isChanged(phash)) {
1456
+ changed.push(raw[phash]);
1457
+ }
1458
+ });
1459
+
1460
+ return {
1461
+ added : added,
1462
+ removed : removed,
1463
+ changed : changed
1464
+ };
1465
+ }
1466
+
1467
+ /**
1468
+ * Sync content
1469
+ *
1470
+ * @return jQuery.Deferred
1471
+ */
1472
+ this.sync = function(onlydir, polling) {
1473
+ this.autoSync('stop');
1474
+ var self = this,
1475
+ compare = function(){
1476
+ var c = '', cnt = 0, mtime = 0;
1477
+ if (onlydir && polling) {
1478
+ $.each(files, function(h, f) {
1479
+ if (f.phash && f.phash === onlydir) {
1480
+ ++cnt;
1481
+ mtime = Math.max(mtime, f.ts);
1482
+ }
1483
+ c = cnt+':'+mtime;
1484
+ });
1485
+ }
1486
+ return c;
1487
+ },
1488
+ comp = compare(),
1489
+ dfrd = $.Deferred().done(function() { self.trigger('sync'); }),
1490
+ opts1 = {
1491
+ data : {cmd : 'open', reload : 1, target : cwd, tree : (! onlydir && this.ui.tree) ? 1 : 0, compare : comp},
1492
+ preventDefault : true
1493
+ },
1494
+ opts2 = {
1495
+ data : {cmd : 'parents', target : cwd},
1496
+ preventDefault : true
1497
+ };
1498
+
1499
+ $.when(
1500
+ this.request(opts1),
1501
+ onlydir? null : this.request(opts2)
1502
+ )
1503
+ .fail(function(error) {
1504
+ dfrd.reject(error);
1505
+ error && self.request({
1506
+ data : {cmd : 'open', target : (self.lastDir('') || self.root()), tree : 1, init : 1},
1507
+ notify : {type : 'open', cnt : 1, hideCnt : true}
1508
+ });
1509
+ })
1510
+ .done(function(odata, pdata) {
1511
+ if (odata.cwd.compare) {
1512
+ if (comp === odata.cwd.compare) {
1513
+ return dfrd.reject();
1514
+ }
1515
+ }
1516
+
1517
+ var diff = self.diff(odata.files.concat(pdata && pdata.tree ? pdata.tree : []), onlydir);
1518
+
1519
+ diff.added.push(odata.cwd)
1520
+ diff.removed.length && self.remove(diff);
1521
+ diff.added.length && self.add(diff);
1522
+ diff.changed.length && self.change(diff);
1523
+ return dfrd.resolve(diff);
1524
+ })
1525
+ .always(function() {
1526
+ self.autoSync();
1527
+ });
1528
+
1529
+ return dfrd;
1530
+ }
1531
+
1532
+ this.upload = function(files) {
1533
+ return this.transport.upload(files, this);
1534
+ }
1535
+
1536
+ /**
1537
+ * Attach listener to events
1538
+ * To bind to multiply events at once, separate events names by space
1539
+ *
1540
+ * @param String event(s) name(s)
1541
+ * @param Object event handler
1542
+ * @return elFinder
1543
+ */
1544
+ this.bind = function(event, callback) {
1545
+ var i;
1546
+
1547
+ if (typeof(callback) == 'function') {
1548
+ event = ('' + event).toLowerCase().split(/\s+/);
1549
+
1550
+ for (i = 0; i < event.length; i++) {
1551
+ if (listeners[event[i]] === void(0)) {
1552
+ listeners[event[i]] = [];
1553
+ }
1554
+ listeners[event[i]].push(callback);
1555
+ }
1556
+ }
1557
+ return this;
1558
+ };
1559
+
1560
+ /**
1561
+ * Remove event listener if exists
1562
+ *
1563
+ * @param String event name
1564
+ * @param Function callback
1565
+ * @return elFinder
1566
+ */
1567
+ this.unbind = function(event, callback) {
1568
+ var l = listeners[('' + event).toLowerCase()] || [],
1569
+ i = l.indexOf(callback);
1570
+
1571
+ i > -1 && l.splice(i, 1);
1572
+ //delete callback; // need this?
1573
+ callback = null
1574
+ return this;
1575
+ };
1576
+
1577
+ /**
1578
+ * Fire event - send notification to all event listeners
1579
+ *
1580
+ * @param String event type
1581
+ * @param Object data to send across event
1582
+ * @return elFinder
1583
+ */
1584
+ this.trigger = function(event, data) {
1585
+ var event = event.toLowerCase(),
1586
+ isopen = (event === 'open'),
1587
+ handlers = listeners[event] || [], i, l, jst;
1588
+
1589
+ this.debug('event-'+event, data);
1590
+
1591
+ if (isopen) {
1592
+ // for performance tuning
1593
+ jst = JSON.stringify(data);
1594
+ }
1595
+ if (handlers.length) {
1596
+ event = $.Event(event);
1597
+
1598
+ l = handlers.length;
1599
+ for (i = 0; i < l; i++) {
1600
+ // only callback has argument
1601
+ if (handlers[i].length) {
1602
+ // to avoid data modifications. remember about "sharing" passing arguments in js :)
1603
+ event.data = isopen? JSON.parse(jst) : $.extend(true, {}, data);
1604
+ }
1605
+
1606
+ try {
1607
+ if (handlers[i](event, this) === false
1608
+ || event.isDefaultPrevented()) {
1609
+ this.debug('event-stoped', event.type);
1610
+ break;
1611
+ }
1612
+ } catch (ex) {
1613
+ window.console && window.console.log && window.console.log(ex);
1614
+ }
1615
+
1616
+ }
1617
+ }
1618
+ return this;
1619
+ }
1620
+
1621
+ /**
1622
+ * Bind keybord shortcut to keydown event
1623
+ *
1624
+ * @example
1625
+ * elfinder.shortcut({
1626
+ * pattern : 'ctrl+a',
1627
+ * description : 'Select all files',
1628
+ * callback : function(e) { ... },
1629
+ * keypress : true|false (bind to keypress instead of keydown)
1630
+ * })
1631
+ *
1632
+ * @param Object shortcut config
1633
+ * @return elFinder
1634
+ */
1635
+ this.shortcut = function(s) {
1636
+ var patterns, pattern, code, i, parts;
1637
+
1638
+ if (this.options.allowShortcuts && s.pattern && $.isFunction(s.callback)) {
1639
+ patterns = s.pattern.toUpperCase().split(/\s+/);
1640
+
1641
+ for (i= 0; i < patterns.length; i++) {
1642
+ pattern = patterns[i]
1643
+ parts = pattern.split('+');
1644
+ code = (code = parts.pop()).length == 1
1645
+ ? code > 0 ? code : code.charCodeAt(0)
1646
+ : $.ui.keyCode[code];
1647
+
1648
+ if (code && !shortcuts[pattern]) {
1649
+ shortcuts[pattern] = {
1650
+ keyCode : code,
1651
+ altKey : $.inArray('ALT', parts) != -1,
1652
+ ctrlKey : $.inArray('CTRL', parts) != -1,
1653
+ shiftKey : $.inArray('SHIFT', parts) != -1,
1654
+ type : s.type || 'keydown',
1655
+ callback : s.callback,
1656
+ description : s.description,
1657
+ pattern : pattern
1658
+ };
1659
+ }
1660
+ }
1661
+ }
1662
+ return this;
1663
+ }
1664
+
1665
+ /**
1666
+ * Registered shortcuts
1667
+ *
1668
+ * @type Object
1669
+ **/
1670
+ this.shortcuts = function() {
1671
+ var ret = [];
1672
+
1673
+ $.each(shortcuts, function(i, s) {
1674
+ ret.push([s.pattern, self.i18n(s.description)]);
1675
+ });
1676
+ return ret;
1677
+ };
1678
+
1679
+ /**
1680
+ * Get/set clipboard content.
1681
+ * Return new clipboard content.
1682
+ *
1683
+ * @example
1684
+ * this.clipboard([]) - clean clipboard
1685
+ * this.clipboard([{...}, {...}], true) - put 2 files in clipboard and mark it as cutted
1686
+ *
1687
+ * @param Array new files hashes
1688
+ * @param Boolean cut files?
1689
+ * @return Array
1690
+ */
1691
+ this.clipboard = function(hashes, cut) {
1692
+ var map = function() { return $.map(clipboard, function(f) { return f.hash }); }
1693
+
1694
+ if (hashes !== void(0)) {
1695
+ clipboard.length && this.trigger('unlockfiles', {files : map()});
1696
+ remember = [];
1697
+
1698
+ clipboard = $.map(hashes||[], function(hash) {
1699
+ var file = files[hash];
1700
+ if (file) {
1701
+
1702
+ remember.push(hash);
1703
+
1704
+ return {
1705
+ hash : hash,
1706
+ phash : file.phash,
1707
+ name : file.name,
1708
+ mime : file.mime,
1709
+ read : file.read,
1710
+ locked : file.locked,
1711
+ cut : !!cut
1712
+ }
1713
+ }
1714
+ return null;
1715
+ });
1716
+ this.trigger('changeclipboard', {clipboard : clipboard.slice(0, clipboard.length)});
1717
+ cut && this.trigger('lockfiles', {files : map()});
1718
+ }
1719
+
1720
+ // return copy of clipboard instead of refrence
1721
+ return clipboard.slice(0, clipboard.length);
1722
+ }
1723
+
1724
+ /**
1725
+ * Return true if command enabled
1726
+ *
1727
+ * @param String command name
1728
+ * @param String|void hash for check of own volume's disabled cmds
1729
+ * @return Boolean
1730
+ */
1731
+ this.isCommandEnabled = function(name, dstHash) {
1732
+ var disabled;
1733
+ if (dstHash && self.root(dstHash) !== cwd) {
1734
+ $.each(self.disabledCmds, function(i, v){
1735
+ if (dstHash.indexOf(i, 0) == 0) {
1736
+ disabled = v;
1737
+ return false;
1738
+ }
1739
+ });
1740
+ }
1741
+ if (!disabled) {
1742
+ disabled = cwdOptions.disabled;
1743
+ }
1744
+ return this._commands[name] ? $.inArray(name, disabled) === -1 : false;
1745
+ }
1746
+
1747
+ /**
1748
+ * Exec command and return result;
1749
+ *
1750
+ * @param String command name
1751
+ * @param String|Array usualy files hashes
1752
+ * @param String|Array command options
1753
+ * @param String|void hash for enabled check of own volume's disabled cmds
1754
+ * @return $.Deferred
1755
+ */
1756
+ this.exec = function(cmd, files, opts, dstHash) {
1757
+ if (cmd === 'open') {
1758
+ this.autoSync('stop');
1759
+ }
1760
+ return this._commands[cmd] && this.isCommandEnabled(cmd, dstHash)
1761
+ ? this._commands[cmd].exec(files, opts)
1762
+ : $.Deferred().reject('No such command');
1763
+ }
1764
+
1765
+ /**
1766
+ * Create and return dialog.
1767
+ *
1768
+ * @param String|DOMElement dialog content
1769
+ * @param Object dialog options
1770
+ * @return jQuery
1771
+ */
1772
+ this.dialog = function(content, options) {
1773
+ var dialog = $('<div/>').append(content).appendTo(node).elfinderdialog(options);
1774
+ this.bind('resize', function(){
1775
+ dialog.elfinderdialog('posInit');
1776
+ });
1777
+ return dialog;
1778
+ }
1779
+
1780
+ /**
1781
+ * Return UI widget or node
1782
+ *
1783
+ * @param String ui name
1784
+ * @return jQuery
1785
+ */
1786
+ this.getUI = function(ui) {
1787
+ return this.ui[ui] || node;
1788
+ }
1789
+
1790
+ this.command = function(name) {
1791
+ return name === void(0) ? this._commands : this._commands[name];
1792
+ }
1793
+
1794
+ /**
1795
+ * Resize elfinder node
1796
+ *
1797
+ * @param String|Number width
1798
+ * @param Number height
1799
+ * @return void
1800
+ */
1801
+ this.resize = function(w, h) {
1802
+ node.css('width', w).height(h).trigger('resize');
1803
+ this.trigger('resize', {width : node.width(), height : node.height()});
1804
+ }
1805
+
1806
+ /**
1807
+ * Restore elfinder node size
1808
+ *
1809
+ * @return elFinder
1810
+ */
1811
+ this.restoreSize = function() {
1812
+ this.resize(width, height);
1813
+ }
1814
+
1815
+ this.show = function() {
1816
+ node.show();
1817
+ this.enable().trigger('show');
1818
+ }
1819
+
1820
+ this.hide = function() {
1821
+ this.disable().trigger('hide');
1822
+ node.hide();
1823
+ }
1824
+
1825
+ /**
1826
+ * Destroy this elFinder instance
1827
+ *
1828
+ * @return void
1829
+ **/
1830
+ this.destroy = function() {
1831
+ if (node && node[0].elfinder) {
1832
+ this.autoSync('stop');
1833
+ this.trigger('destroy').disable();
1834
+ listeners = {};
1835
+ shortcuts = {};
1836
+ $(document).add(node).off('.'+this.namespace);
1837
+ self.trigger = function() { }
1838
+ node.children().remove();
1839
+ node.append(prevContent.contents()).removeClass(this.cssClass).attr('style', prevStyle);
1840
+ node[0].elfinder = null;
1841
+ }
1842
+ }
1843
+
1844
+ /**
1845
+ * Start or stop auto sync
1846
+ *
1847
+ * @param String|Bool stop
1848
+ * @return void
1849
+ */
1850
+ this.autoSync = function(stop) {
1851
+ var sync;
1852
+ if (self.options.sync >= 1000) {
1853
+ if (syncInterval) {
1854
+ clearTimeout(syncInterval);
1855
+ syncInterval = null;
1856
+ self.trigger('autosync', {action : 'stop'});
1857
+ }
1858
+ if (stop || !self.options.syncStart) {
1859
+ return;
1860
+ }
1861
+ // run interval sync
1862
+ sync = function(start){
1863
+ var timeout;
1864
+ if (cwdOptions.syncMinMs && (start || syncInterval)) {
1865
+ start && self.trigger('autosync', {action : 'start'});
1866
+ timeout = Math.max(self.options.sync, cwdOptions.syncMinMs);
1867
+ syncInterval && clearTimeout(syncInterval);
1868
+ syncInterval = setTimeout(function() {
1869
+ var dosync = true, hash = cwd;
1870
+ if (cwdOptions.syncChkAsTs) {
1871
+ self.request({
1872
+ data : {cmd : 'info', targets : [hash], compare : files[hash].ts, reload : 1},
1873
+ preventDefault : true
1874
+ })
1875
+ .done(function(data){
1876
+ var ts;
1877
+ dosync = true;
1878
+ if (data.compare) {
1879
+ ts = data.compare;
1880
+ if (files[hash] && ts == files[hash].ts) {
1881
+ dosync = false;
1882
+ }
1883
+ }
1884
+ if (dosync) {
1885
+ self.sync(hash).always(function(){
1886
+ if (ts) {
1887
+ // update ts for cache clear etc.
1888
+ files[hash].ts = ts;
1889
+ }
1890
+ sync();
1891
+ });
1892
+ } else {
1893
+ sync();
1894
+ }
1895
+ })
1896
+ .fail(function(error){
1897
+ if (error && error != 'errConnect') {
1898
+ self.error(error);
1899
+ } else {
1900
+ syncInterval = setTimeout(function() {
1901
+ sync();
1902
+ }, timeout);
1903
+ }
1904
+ });
1905
+ } else {
1906
+ self.sync(cwd, true).always(function(){
1907
+ sync();
1908
+ });
1909
+ }
1910
+ }, timeout);
1911
+ }
1912
+ };
1913
+ sync(true);
1914
+ }
1915
+ };
1916
+
1917
+ /************* init stuffs ****************/
1918
+
1919
+ // check jquery ui
1920
+ if (!($.fn.selectable && $.fn.draggable && $.fn.droppable)) {
1921
+ return alert(this.i18n('errJqui'));
1922
+ }
1923
+
1924
+ // check node
1925
+ if (!node.length) {
1926
+ return alert(this.i18n('errNode'));
1927
+ }
1928
+ // check connector url
1929
+ if (!this.options.url) {
1930
+ return alert(this.i18n('errURL'));
1931
+ }
1932
+
1933
+ $.extend($.ui.keyCode, {
1934
+ 'F1' : 112,
1935
+ 'F2' : 113,
1936
+ 'F3' : 114,
1937
+ 'F4' : 115,
1938
+ 'F5' : 116,
1939
+ 'F6' : 117,
1940
+ 'F7' : 118,
1941
+ 'F8' : 119,
1942
+ 'F9' : 120
1943
+ });
1944
+
1945
+ this.dragUpload = false;
1946
+ this.xhrUpload = (typeof XMLHttpRequestUpload != 'undefined' || typeof XMLHttpRequestEventTarget != 'undefined') && typeof File != 'undefined' && typeof FormData != 'undefined';
1947
+
1948
+ // configure transport object
1949
+ this.transport = {}
1950
+
1951
+ if (typeof(this.options.transport) == 'object') {
1952
+ this.transport = this.options.transport;
1953
+ if (typeof(this.transport.init) == 'function') {
1954
+ this.transport.init(this)
1955
+ }
1956
+ }
1957
+
1958
+ if (typeof(this.transport.send) != 'function') {
1959
+ this.transport.send = function(opts) { return $.ajax(opts); }
1960
+ }
1961
+
1962
+ if (this.transport.upload == 'iframe') {
1963
+ this.transport.upload = $.proxy(this.uploads.iframe, this);
1964
+ } else if (typeof(this.transport.upload) == 'function') {
1965
+ this.dragUpload = !!this.options.dragUploadAllow;
1966
+ } else if (this.xhrUpload && !!this.options.dragUploadAllow) {
1967
+ this.transport.upload = $.proxy(this.uploads.xhr, this);
1968
+ this.dragUpload = true;
1969
+ } else {
1970
+ this.transport.upload = $.proxy(this.uploads.iframe, this);
1971
+ }
1972
+
1973
+ /**
1974
+ * Alias for this.trigger('error', {error : 'message'})
1975
+ *
1976
+ * @param String error message
1977
+ * @return elFinder
1978
+ **/
1979
+ this.error = function() {
1980
+ var arg = arguments[0];
1981
+ return arguments.length == 1 && typeof(arg) == 'function'
1982
+ ? self.bind('error', arg)
1983
+ : self.trigger('error', {error : arg});
1984
+ }
1985
+
1986
+ // create bind/trigger aliases for build-in events
1987
+ $.each(['enable', 'disable', 'load', 'open', 'reload', 'select', 'add', 'remove', 'change', 'dblclick', 'getfile', 'lockfiles', 'unlockfiles', 'selectfiles', 'unselectfiles', 'dragstart', 'dragstop', 'search', 'searchend', 'viewchange'], function(i, name) {
1988
+ self[name] = function() {
1989
+ var arg = arguments[0];
1990
+ return arguments.length == 1 && typeof(arg) == 'function'
1991
+ ? self.bind(name, arg)
1992
+ : self.trigger(name, $.isPlainObject(arg) ? arg : {});
1993
+ }
1994
+ });
1995
+
1996
+ // bind core event handlers
1997
+ this
1998
+ .enable(function() {
1999
+ if (!enabled && self.visible() && self.ui.overlay.is(':hidden')) {
2000
+ enabled = true;
2001
+ document.activeElement && document.activeElement.blur();
2002
+ node.removeClass('elfinder-disabled');
2003
+ }
2004
+ })
2005
+ .disable(function() {
2006
+ prevEnabled = enabled;
2007
+ enabled = false;
2008
+ node.addClass('elfinder-disabled');
2009
+ })
2010
+ .open(function() {
2011
+ selected = [];
2012
+ })
2013
+ .select(function(e) {
2014
+ selected = $.map(e.data.selected || e.data.value|| [], function(hash) { return files[hash] ? hash : null; });
2015
+ })
2016
+ .error(function(e) {
2017
+ var opts = {
2018
+ cssClass : 'elfinder-dialog-error',
2019
+ title : self.i18n(self.i18n('error')),
2020
+ resizable : false,
2021
+ destroyOnClose : true,
2022
+ buttons : {}
2023
+ };
2024
+
2025
+ opts.buttons[self.i18n(self.i18n('btnClose'))] = function() { $(this).elfinderdialog('close'); };
2026
+
2027
+ self.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-error"/>'+self.i18n(e.data.error), opts);
2028
+ })
2029
+ .bind('tree parents', function(e) {
2030
+ cache(e.data.tree || []);
2031
+ })
2032
+ .bind('tmb', function(e) {
2033
+ $.each(e.data.images||[], function(hash, tmb) {
2034
+ if (files[hash]) {
2035
+ files[hash].tmb = tmb;
2036
+ }
2037
+ })
2038
+ })
2039
+ .add(function(e) {
2040
+ cache(e.data.added||[]);
2041
+ })
2042
+ .change(function(e) {
2043
+ $.each(e.data.changed||[], function(i, file) {
2044
+ var hash = file.hash;
2045
+ if (files[hash]) {
2046
+ $.each(['locked', 'hidden', 'width', 'height'], function(i, v){
2047
+ if (files[hash][v] && !file[v]) {
2048
+ delete files[hash][v];
2049
+ }
2050
+ });
2051
+ }
2052
+ files[hash] = files[hash] ? $.extend(files[hash], file) : file;
2053
+ });
2054
+ })
2055
+ .remove(function(e) {
2056
+ var removed = e.data.removed||[],
2057
+ l = removed.length,
2058
+ rm = function(hash) {
2059
+ var file = files[hash];
2060
+ if (file) {
2061
+ if (file.mime == 'directory' && file.dirs) {
2062
+ $.each(files, function(h, f) {
2063
+ f.phash == hash && rm(h);
2064
+ });
2065
+ }
2066
+ delete files[hash];
2067
+ }
2068
+ };
2069
+
2070
+ while (l--) {
2071
+ rm(removed[l]);
2072
+ }
2073
+
2074
+ })
2075
+ .bind('search', function(e) {
2076
+ cache(e.data.files);
2077
+ self.tmbUrls._search = true;
2078
+ })
2079
+ .bind('searchend', function() {
2080
+ self.tmbUrls._search = false;
2081
+ })
2082
+ .bind('rm', function(e) {
2083
+ var play = beeper.canPlayType && beeper.canPlayType('audio/wav; codecs="1"');
2084
+
2085
+ play && play != '' && play != 'no' && $(beeper).html('<source src="' + soundPath + 'rm.wav" type="audio/wav">')[0].play()
2086
+ })
2087
+
2088
+ ;
2089
+
2090
+ // bind external event handlers
2091
+ $.each(this.options.handlers, function(event, callback) {
2092
+ self.bind(event, callback);
2093
+ });
2094
+
2095
+ /**
2096
+ * History object. Store visited folders
2097
+ *
2098
+ * @type Object
2099
+ **/
2100
+ this.history = new this.history(this);
2101
+
2102
+ // in getFileCallback set - change default actions on double click/enter/ctrl+enter
2103
+ if (typeof(this.options.getFileCallback) == 'function' && this.commands.getfile) {
2104
+ this.bind('dblclick', function(e) {
2105
+ e.preventDefault();
2106
+ self.exec('getfile').fail(function() {
2107
+ self.exec('open');
2108
+ });
2109
+ });
2110
+ this.shortcut({
2111
+ pattern : 'enter',
2112
+ description : this.i18n('cmdgetfile'),
2113
+ callback : function() { self.exec('getfile').fail(function() { self.exec(self.OS == 'mac' ? 'rename' : 'open') }) }
2114
+ })
2115
+ .shortcut({
2116
+ pattern : 'ctrl+enter',
2117
+ description : this.i18n(this.OS == 'mac' ? 'cmdrename' : 'cmdopen'),
2118
+ callback : function() { self.exec(self.OS == 'mac' ? 'rename' : 'open') }
2119
+ });
2120
+
2121
+ }
2122
+
2123
+ /**
2124
+ * Loaded commands
2125
+ *
2126
+ * @type Object
2127
+ **/
2128
+ this._commands = {};
2129
+
2130
+ if (!$.isArray(this.options.commands)) {
2131
+ this.options.commands = [];
2132
+ }
2133
+ // check required commands
2134
+ $.each(['open', 'reload', 'back', 'forward', 'up', 'home', 'info', 'quicklook', 'getfile', 'help'], function(i, cmd) {
2135
+ $.inArray(cmd, self.options.commands) === -1 && self.options.commands.push(cmd);
2136
+ });
2137
+
2138
+ // load commands
2139
+ $.each(this.options.commands, function(i, name) {
2140
+ var cmd = self.commands[name];
2141
+ if ($.isFunction(cmd) && !self._commands[name]) {
2142
+ cmd.prototype = base;
2143
+ self._commands[name] = new cmd();
2144
+ self._commands[name].setup(name, self.options.commandsOptions[name]||{});
2145
+ }
2146
+ });
2147
+
2148
+ /**
2149
+ * UI command map of cwd volume ( That volume driver option `uiCmdMap` )
2150
+ *
2151
+ * @type Object
2152
+ **/
2153
+ this.commandMap = {};
2154
+
2155
+ /**
2156
+ * Disabled commands Array of each volume
2157
+ *
2158
+ * @type Object
2159
+ */
2160
+ this.disabledCmds = {};
2161
+
2162
+ /**
2163
+ * tmbUrls Array of each volume
2164
+ *
2165
+ * @type Object
2166
+ */
2167
+ this.tmbUrls = {};
2168
+
2169
+ // prepare node
2170
+ node.addClass(this.cssClass)
2171
+ .on(mousedown, function() {
2172
+ !enabled && self.enable();
2173
+ });
2174
+
2175
+ /**
2176
+ * UI nodes
2177
+ *
2178
+ * @type Object
2179
+ **/
2180
+ this.ui = {
2181
+ // container for nav panel and current folder container
2182
+ workzone : $('<div/>').appendTo(node).elfinderworkzone(this),
2183
+ // container for folders tree / places
2184
+ navbar : $('<div/>').appendTo(node).elfindernavbar(this, this.options.uiOptions.navbar || {}),
2185
+ // contextmenu
2186
+ contextmenu : $('<div/>').appendTo(node).elfindercontextmenu(this),
2187
+ // overlay
2188
+ overlay : $('<div/>').appendTo(node).elfinderoverlay({
2189
+ show : function() { self.disable(); },
2190
+ hide : function() { prevEnabled && self.enable(); }
2191
+ }),
2192
+ // current folder container
2193
+ cwd : $('<div/>').appendTo(node).elfindercwd(this, this.options.uiOptions.cwd || {}),
2194
+ // notification dialog window
2195
+ notify : this.dialog('', {
2196
+ cssClass : 'elfinder-dialog-notify',
2197
+ position : this.options.notifyDialog.position,
2198
+ resizable : false,
2199
+ autoOpen : false,
2200
+ title : '&nbsp;',
2201
+ width : parseInt(this.options.notifyDialog.width)
2202
+ }),
2203
+ statusbar : $('<div class="ui-widget-header ui-helper-clearfix ui-corner-bottom elfinder-statusbar"/>').hide().appendTo(node)
2204
+ }
2205
+
2206
+ // load required ui
2207
+ $.each(this.options.ui || [], function(i, ui) {
2208
+ var name = 'elfinder'+ui,
2209
+ opts = self.options.uiOptions[ui] || {};
2210
+
2211
+ if (!self.ui[ui] && $.fn[name]) {
2212
+ self.ui[ui] = $('<'+(opts.tag || 'div')+'/>').appendTo(node)[name](self, opts);
2213
+ }
2214
+ });
2215
+
2216
+
2217
+
2218
+ // store instance in node
2219
+ node[0].elfinder = this;
2220
+
2221
+ // make node resizable
2222
+ this.options.resizable
2223
+ && !this.UA.Touch
2224
+ && $.fn.resizable
2225
+ && node.resizable({
2226
+ handles : 'se',
2227
+ minWidth : 300,
2228
+ minHeight : 200
2229
+ });
2230
+
2231
+ if (this.options.width) {
2232
+ width = this.options.width;
2233
+ }
2234
+
2235
+ if (this.options.height) {
2236
+ height = parseInt(this.options.height);
2237
+ }
2238
+
2239
+ if (this.options.soundPath) {
2240
+ soundPath = this.options.soundPath.replace(/\/+$/, '') + '/';
2241
+ }
2242
+
2243
+ // update size
2244
+ self.resize(width, height);
2245
+
2246
+ // attach events to document
2247
+ $(document)
2248
+ // disable elfinder on click outside elfinder
2249
+ .on('click.'+this.namespace, function(e) { enabled && !$(e.target).closest(node).length && self.disable(); })
2250
+ // exec shortcuts
2251
+ .on(keydown+' '+keypress, execShortcut);
2252
+
2253
+ // attach events to window
2254
+ self.options.useBrowserHistory && $(window)
2255
+ .on('popstate', function(ev) {
2256
+ var target = ev.originalEvent.state && ev.originalEvent.state.thash;
2257
+ target && !$.isEmptyObject(self.files()) && self.request({
2258
+ data : {cmd : 'open', target : target, onhistory : 1},
2259
+ notify : {type : 'open', cnt : 1, hideCnt : true},
2260
+ syncOnFail : true
2261
+ });
2262
+ });
2263
+
2264
+ // send initial request and start to pray >_<
2265
+ this.trigger('init')
2266
+ .request({
2267
+ data : {cmd : 'open', target : self.startDir(), init : 1, tree : this.ui.tree ? 1 : 0},
2268
+ preventDone : true,
2269
+ notify : {type : 'open', cnt : 1, hideCnt : true},
2270
+ freeze : true
2271
+ })
2272
+ .fail(function() {
2273
+ self.trigger('fail').disable().lastDir('');
2274
+ listeners = {};
2275
+ shortcuts = {};
2276
+ $(document).add(node).off('.'+this.namespace);
2277
+ self.trigger = function() { };
2278
+ })
2279
+ .done(function(data) {
2280
+ self.load().debug('api', self.api);
2281
+ data = $.extend(true, {}, data);
2282
+ open(data);
2283
+ self.trigger('open', data);
2284
+ });
2285
+
2286
+ // update ui's size after init
2287
+ this.one('load', function() {
2288
+ node.trigger('resize');
2289
+ });
2290
+
2291
+ (function(){
2292
+ var tm;
2293
+ $(window).on('resize', function(){
2294
+ tm && clearTimeout(tm);
2295
+ tm = setTimeout(function() {
2296
+ self.trigger('resize', {width : node.width(), height : node.height()});
2297
+ }, 200);
2298
+ })
2299
+ .on('beforeunload',function(){
2300
+ if (self.ui.notify.children().length) {
2301
+ return self.i18n('ntfsmth');
2302
+ }
2303
+ self.trigger('unload');
2304
+ });
2305
+ })();
2306
+
2307
+ // bind window onmessage for CORS
2308
+ $(window).on('message', function(e){
2309
+ var res = e.originalEvent || null,
2310
+ obj, data;
2311
+ if (res && self.uploadURL.indexOf(res.origin) === 0) {
2312
+ try {
2313
+ obj = JSON.parse(res.data);
2314
+ data = obj.data || null;
2315
+ if (data) {
2316
+ if (data.error) {
2317
+ self.error(data.error);
2318
+ } else {
2319
+ data.warning && self.error(data.warning);
2320
+ data.removed && data.removed.length && self.remove(data);
2321
+ data.added && data.added.length && self.add(data);
2322
+ data.changed && data.changed.length && self.change(data);
2323
+ if (obj.bind) {
2324
+ self.trigger(obj.bind, data);
2325
+ }
2326
+ data.sync && self.sync();
2327
+ }
2328
+ }
2329
+ } catch (e) {
2330
+ self.sync();
2331
+ }
2332
+ }
2333
+ });
2334
+
2335
+ if (self.dragUpload) {
2336
+ node[0].addEventListener('dragenter', function(e) {
2337
+ if (e.target.nodeName !== 'TEXTAREA' && e.target.nodeName !== 'INPUT') {
2338
+ e.preventDefault();
2339
+ e.stopPropagation();
2340
+ }
2341
+ }, false);
2342
+ node[0].addEventListener('dragleave', function(e) {
2343
+ if (e.target.nodeName !== 'TEXTAREA' && e.target.nodeName !== 'INPUT') {
2344
+ e.preventDefault();
2345
+ e.stopPropagation();
2346
+ }
2347
+ }, false);
2348
+ node[0].addEventListener('dragover', function(e) {
2349
+ if (e.target.nodeName !== 'TEXTAREA' && e.target.nodeName !== 'INPUT') {
2350
+ e.preventDefault();
2351
+ e.stopPropagation();
2352
+ e.dataTransfer.dropEffect = 'none';
2353
+ }
2354
+ }, false);
2355
+ node[0].addEventListener('drop', function(e) {
2356
+ if (e.target.nodeName !== 'TEXTAREA' && e.target.nodeName !== 'INPUT') {
2357
+ e.stopPropagation();
2358
+ e.preventDefault();
2359
+ }
2360
+ }, false);
2361
+
2362
+ // add event listener for HTML5 DnD upload
2363
+ (function() {
2364
+ var ent = 'native-drag-enter',
2365
+ disable = 'native-drag-disable',
2366
+ c = 'class',
2367
+ navdir = self.res(c, 'navdir'),
2368
+ droppable = self.res(c, 'droppable'),
2369
+ collapsed = self.res(c, 'navcollapse'),
2370
+ expanded = self.res(c, 'navexpand'),
2371
+ dropover = self.res(c, 'adroppable'),
2372
+ arrow = self.res(c, 'navarrow'),
2373
+ clDropActive = self.res(c, 'adroppable');
2374
+ node.on('dragenter', '.native-droppable', function(e){
2375
+ if (e.originalEvent.dataTransfer) {
2376
+ var $elm = $(e.currentTarget),
2377
+ id = e.currentTarget.id || null,
2378
+ cwd = null,
2379
+ elfFrom;
2380
+ if (!id) { // target is cwd
2381
+ cwd = self.cwd();
2382
+ $elm.data(disable, false);
2383
+ try {
2384
+ $.each(e.originalEvent.dataTransfer.types, function(i, v){
2385
+ if (v.substr(0, 13) === 'elfinderfrom:') {
2386
+ elfFrom = v.substr(13).toLowerCase();
2387
+ }
2388
+ });
2389
+ } catch(e) {}
2390
+ } else {
2391
+ if (!$elm.data(ent) && $elm.hasClass(navdir) && $elm.is('.'+collapsed+':not(.'+expanded+')')) {
2392
+ setTimeout(function() {
2393
+ $elm.is('.'+collapsed+'.'+dropover) && $elm.children('.'+arrow).click();
2394
+ }, 500);
2395
+ }
2396
+ }
2397
+ if (!cwd || (cwd.write && (!elfFrom || elfFrom !== (window.location.href + cwd.hash).toLowerCase()))) {
2398
+ e.preventDefault();
2399
+ e.stopPropagation();
2400
+ $elm.data(ent, true);
2401
+ $elm.addClass(clDropActive);
2402
+ } else {
2403
+ $elm.data(disable, true);
2404
+ }
2405
+ }
2406
+ })
2407
+ .on('dragleave', '.native-droppable', function(e){
2408
+ if (e.originalEvent.dataTransfer) {
2409
+ var $elm = $(e.currentTarget);
2410
+ e.preventDefault();
2411
+ e.stopPropagation();
2412
+ if ($elm.data(ent)) {
2413
+ $elm.data(ent, false);
2414
+ } else {
2415
+ $elm.removeClass(clDropActive);
2416
+ }
2417
+ }
2418
+ })
2419
+ .on('dragover', '.native-droppable', function(e){
2420
+ if (e.originalEvent.dataTransfer) {
2421
+ var $elm = $(e.currentTarget);
2422
+ e.preventDefault();
2423
+ e.stopPropagation();
2424
+ e.originalEvent.dataTransfer.dropEffect = $elm.data(disable)? 'none' : 'copy';
2425
+ $elm.data(ent, false);
2426
+ }
2427
+ })
2428
+ .on('drop', '.native-droppable', function(e){
2429
+ if (e.originalEvent.dataTransfer) {
2430
+ var $elm = $(e.currentTarget)
2431
+ id;
2432
+ e.preventDefault();
2433
+ e.stopPropagation();
2434
+ $elm.removeClass(clDropActive);
2435
+ if (e.currentTarget.id) {
2436
+ id = $elm.hasClass(navdir)? self.navId2Hash(e.currentTarget.id) : self.cwdId2Hash(e.currentTarget.id);
2437
+ } else {
2438
+ id = self.cwd().hash;
2439
+ }
2440
+ e.originalEvent._target = id;
2441
+ self.directUploadTarget = id;
2442
+ self.exec('upload', {dropEvt: e.originalEvent, target: id});
2443
+ self.directUploadTarget = null;
2444
+ }
2445
+ });
2446
+ })();
2447
+ }
2448
+
2449
+ // self.timeEnd('load');
2450
+
2451
+ }
2452
+
2453
+ /**
2454
+ * Prototype
2455
+ *
2456
+ * @type Object
2457
+ */
2458
+ elFinder.prototype = {
2459
+
2460
+ uniqueid : 0,
2461
+
2462
+ res : function(type, id) {
2463
+ return this.resources[type] && this.resources[type][id];
2464
+ },
2465
+
2466
+ /**
2467
+ * Current request command
2468
+ *
2469
+ * @type String
2470
+ */
2471
+ currentReqCmd : '',
2472
+
2473
+ /**
2474
+ * Internationalization object
2475
+ *
2476
+ * @type Object
2477
+ */
2478
+ i18 : {
2479
+ en : {
2480
+ translator : '',
2481
+ language : 'English',
2482
+ direction : 'ltr',
2483
+ dateFormat : 'd.m.Y H:i',
2484
+ fancyDateFormat : '$1 H:i',
2485
+ messages : {}
2486
+ },
2487
+ months : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
2488
+ monthsShort : ['msJan', 'msFeb', 'msMar', 'msApr', 'msMay', 'msJun', 'msJul', 'msAug', 'msSep', 'msOct', 'msNov', 'msDec'],
2489
+
2490
+ days : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
2491
+ daysShort : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
2492
+ },
2493
+
2494
+ /**
2495
+ * File mimetype to kind mapping
2496
+ *
2497
+ * @type Object
2498
+ */
2499
+ kinds : {
2500
+ 'unknown' : 'Unknown',
2501
+ 'directory' : 'Folder',
2502
+ 'symlink' : 'Alias',
2503
+ 'symlink-broken' : 'AliasBroken',
2504
+ 'application/x-empty' : 'TextPlain',
2505
+ 'application/postscript' : 'Postscript',
2506
+ 'application/vnd.ms-office' : 'MsOffice',
2507
+ 'application/msword' : 'MsWord',
2508
+ 'application/vnd.ms-word' : 'MsWord',
2509
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' : 'MsWord',
2510
+ 'application/vnd.ms-word.document.macroEnabled.12' : 'MsWord',
2511
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' : 'MsWord',
2512
+ 'application/vnd.ms-word.template.macroEnabled.12' : 'MsWord',
2513
+ 'application/vnd.ms-excel' : 'MsExcel',
2514
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' : 'MsExcel',
2515
+ 'application/vnd.ms-excel.sheet.macroEnabled.12' : 'MsExcel',
2516
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' : 'MsExcel',
2517
+ 'application/vnd.ms-excel.template.macroEnabled.12' : 'MsExcel',
2518
+ 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' : 'MsExcel',
2519
+ 'application/vnd.ms-excel.addin.macroEnabled.12' : 'MsExcel',
2520
+ 'application/vnd.ms-powerpoint' : 'MsPP',
2521
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' : 'MsPP',
2522
+ 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' : 'MsPP',
2523
+ 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' : 'MsPP',
2524
+ 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' : 'MsPP',
2525
+ 'application/vnd.openxmlformats-officedocument.presentationml.template' : 'MsPP',
2526
+ 'application/vnd.ms-powerpoint.template.macroEnabled.12' : 'MsPP',
2527
+ 'application/vnd.ms-powerpoint.addin.macroEnabled.12' : 'MsPP',
2528
+ 'application/vnd.openxmlformats-officedocument.presentationml.slide' : 'MsPP',
2529
+ 'application/vnd.ms-powerpoint.slide.macroEnabled.12' : 'MsPP',
2530
+ 'application/pdf' : 'PDF',
2531
+ 'application/xml' : 'XML',
2532
+ 'application/vnd.oasis.opendocument.text' : 'OO',
2533
+ 'application/vnd.oasis.opendocument.text-template' : 'OO',
2534
+ 'application/vnd.oasis.opendocument.text-web' : 'OO',
2535
+ 'application/vnd.oasis.opendocument.text-master' : 'OO',
2536
+ 'application/vnd.oasis.opendocument.graphics' : 'OO',
2537
+ 'application/vnd.oasis.opendocument.graphics-template' : 'OO',
2538
+ 'application/vnd.oasis.opendocument.presentation' : 'OO',
2539
+ 'application/vnd.oasis.opendocument.presentation-template' : 'OO',
2540
+ 'application/vnd.oasis.opendocument.spreadsheet' : 'OO',
2541
+ 'application/vnd.oasis.opendocument.spreadsheet-template' : 'OO',
2542
+ 'application/vnd.oasis.opendocument.chart' : 'OO',
2543
+ 'application/vnd.oasis.opendocument.formula' : 'OO',
2544
+ 'application/vnd.oasis.opendocument.database' : 'OO',
2545
+ 'application/vnd.oasis.opendocument.image' : 'OO',
2546
+ 'application/vnd.openofficeorg.extension' : 'OO',
2547
+ 'application/x-shockwave-flash' : 'AppFlash',
2548
+ 'application/flash-video' : 'Flash video',
2549
+ 'application/x-bittorrent' : 'Torrent',
2550
+ 'application/javascript' : 'JS',
2551
+ 'application/rtf' : 'RTF',
2552
+ 'application/rtfd' : 'RTF',
2553
+ 'application/x-font-ttf' : 'TTF',
2554
+ 'application/x-font-otf' : 'OTF',
2555
+ 'application/x-rpm' : 'RPM',
2556
+ 'application/x-web-config' : 'TextPlain',
2557
+ 'application/xhtml+xml' : 'HTML',
2558
+ 'application/docbook+xml' : 'DOCBOOK',
2559
+ 'application/x-awk' : 'AWK',
2560
+ 'application/x-gzip' : 'GZIP',
2561
+ 'application/x-bzip2' : 'BZIP',
2562
+ 'application/x-xz' : 'XZ',
2563
+ 'application/zip' : 'ZIP',
2564
+ 'application/x-zip' : 'ZIP',
2565
+ 'application/x-rar' : 'RAR',
2566
+ 'application/x-tar' : 'TAR',
2567
+ 'application/x-7z-compressed' : '7z',
2568
+ 'application/x-jar' : 'JAR',
2569
+ 'text/plain' : 'TextPlain',
2570
+ 'text/x-php' : 'PHP',
2571
+ 'text/html' : 'HTML',
2572
+ 'text/javascript' : 'JS',
2573
+ 'text/css' : 'CSS',
2574
+ 'text/rtf' : 'RTF',
2575
+ 'text/rtfd' : 'RTF',
2576
+ 'text/x-c' : 'C',
2577
+ 'text/x-csrc' : 'C',
2578
+ 'text/x-chdr' : 'CHeader',
2579
+ 'text/x-c++' : 'CPP',
2580
+ 'text/x-c++src' : 'CPP',
2581
+ 'text/x-c++hdr' : 'CPPHeader',
2582
+ 'text/x-shellscript' : 'Shell',
2583
+ 'application/x-csh' : 'Shell',
2584
+ 'text/x-python' : 'Python',
2585
+ 'text/x-java' : 'Java',
2586
+ 'text/x-java-source' : 'Java',
2587
+ 'text/x-ruby' : 'Ruby',
2588
+ 'text/x-perl' : 'Perl',
2589
+ 'text/x-sql' : 'SQL',
2590
+ 'text/xml' : 'XML',
2591
+ 'text/x-comma-separated-values' : 'CSV',
2592
+ 'text/x-markdown' : 'Markdown',
2593
+ 'image/x-ms-bmp' : 'BMP',
2594
+ 'image/jpeg' : 'JPEG',
2595
+ 'image/gif' : 'GIF',
2596
+ 'image/png' : 'PNG',
2597
+ 'image/tiff' : 'TIFF',
2598
+ 'image/x-targa' : 'TGA',
2599
+ 'image/vnd.adobe.photoshop' : 'PSD',
2600
+ 'image/xbm' : 'XBITMAP',
2601
+ 'image/pxm' : 'PXM',
2602
+ 'audio/mpeg' : 'AudioMPEG',
2603
+ 'audio/midi' : 'AudioMIDI',
2604
+ 'audio/ogg' : 'AudioOGG',
2605
+ 'audio/mp4' : 'AudioMPEG4',
2606
+ 'audio/x-m4a' : 'AudioMPEG4',
2607
+ 'audio/wav' : 'AudioWAV',
2608
+ 'audio/x-mp3-playlist' : 'AudioPlaylist',
2609
+ 'video/x-dv' : 'VideoDV',
2610
+ 'video/mp4' : 'VideoMPEG4',
2611
+ 'video/mpeg' : 'VideoMPEG',
2612
+ 'video/x-msvideo' : 'VideoAVI',
2613
+ 'video/quicktime' : 'VideoMOV',
2614
+ 'video/x-ms-wmv' : 'VideoWM',
2615
+ 'video/x-flv' : 'VideoFlash',
2616
+ 'video/x-matroska' : 'VideoMKV',
2617
+ 'video/ogg' : 'VideoOGG'
2618
+ },
2619
+
2620
+ /**
2621
+ * Ajax request data validation rules
2622
+ *
2623
+ * @type Object
2624
+ */
2625
+ rules : {
2626
+ defaults : function(data) {
2627
+ if (!data
2628
+ || (data.added && !$.isArray(data.added))
2629
+ || (data.removed && !$.isArray(data.removed))
2630
+ || (data.changed && !$.isArray(data.changed))) {
2631
+ return false;
2632
+ }
2633
+ return true;
2634
+ },
2635
+ open : function(data) { return data && data.cwd && data.files && $.isPlainObject(data.cwd) && $.isArray(data.files); },
2636
+ tree : function(data) { return data && data.tree && $.isArray(data.tree); },
2637
+ parents : function(data) { return data && data.tree && $.isArray(data.tree); },
2638
+ tmb : function(data) { return data && data.images && ($.isPlainObject(data.images) || $.isArray(data.images)); },
2639
+ upload : function(data) { return data && ($.isPlainObject(data.added) || $.isArray(data.added));},
2640
+ search : function(data) { return data && data.files && $.isArray(data.files)}
2641
+ },
2642
+
2643
+ /**
2644
+ * Commands costructors
2645
+ *
2646
+ * @type Object
2647
+ */
2648
+ commands : {},
2649
+
2650
+ /**
2651
+ * Commands to add the item (space delimited)
2652
+ *
2653
+ * @type String
2654
+ */
2655
+ cmdsToAdd : 'archive duplicate extract mkdir mkfile paste rm upload',
2656
+
2657
+ parseUploadData : function(text) {
2658
+ var data;
2659
+
2660
+ if (!$.trim(text)) {
2661
+ return {error : ['errResponse', 'errDataEmpty']};
2662
+ }
2663
+
2664
+ try {
2665
+ data = $.parseJSON(text);
2666
+ } catch (e) {
2667
+ return {error : ['errResponse', 'errDataNotJSON']};
2668
+ }
2669
+
2670
+ if (!this.validResponse('upload', data)) {
2671
+ return {error : ['errResponse']};
2672
+ }
2673
+ data = this.normalize(data);
2674
+ data.removed = $.merge((data.removed || []), $.map(data.added||[], function(f) { return f.hash; }));
2675
+ return data;
2676
+
2677
+ },
2678
+
2679
+ iframeCnt : 0,
2680
+
2681
+ uploads : {
2682
+ // xhr muiti uploading flag
2683
+ xhrUploading: false,
2684
+
2685
+ // check file/dir exists
2686
+ checkExists: function(files, target, fm) {
2687
+ var dfrd = $.Deferred(),
2688
+ names, name,
2689
+ cancel = function() {
2690
+ var i = files.length;
2691
+ while (--i > -1) {
2692
+ files[i]._remove = true;
2693
+ }
2694
+ },
2695
+ check = function() {
2696
+ var renames = [], existed = [], exists = [], i, c;
2697
+
2698
+ var confirm = function(ndx) {
2699
+ var last = ndx == exists.length-1,
2700
+ opts = {
2701
+ title : fm.i18n('cmdupload'),
2702
+ text : ['errExists', exists[ndx].name, 'confirmRepl'],
2703
+ all : !last,
2704
+ accept : {
2705
+ label : 'btnYes',
2706
+ callback : function(all) {
2707
+ !last && !all
2708
+ ? confirm(++ndx)
2709
+ : dfrd.resolve(renames);
2710
+ }
2711
+ },
2712
+ reject : {
2713
+ label : 'btnNo',
2714
+ callback : function(all) {
2715
+ var i;
2716
+
2717
+ if (all) {
2718
+ i = exists.length;
2719
+ while (ndx < i--) {
2720
+ files[exists[i].i]._remove = true;
2721
+ }
2722
+ } else {
2723
+ files[exists[ndx].i]._remove = true;
2724
+ }
2725
+
2726
+ !last && !all
2727
+ ? confirm(++ndx)
2728
+ : dfrd.resolve(renames);
2729
+ }
2730
+ },
2731
+ cancel : {
2732
+ label : 'btnCancel',
2733
+ callback : function() {
2734
+ cancel();
2735
+ dfrd.resolve(renames);
2736
+ }
2737
+ },
2738
+ buttons : [
2739
+ {
2740
+ label : 'btnBackup',
2741
+ callback : function(all) {
2742
+ var i;
2743
+ if (all) {
2744
+ i = exists.length;
2745
+ while (ndx < i--) {
2746
+ renames.push(exists[i].name);
2747
+ }
2748
+ } else {
2749
+ renames.push(exists[ndx].name);
2750
+ }
2751
+ !last && !all
2752
+ ? confirm(++ndx)
2753
+ : dfrd.resolve(renames);
2754
+ }
2755
+ }
2756
+ ]
2757
+ };
2758
+ if (fm.iframeCnt > 0) {
2759
+ delete opts.reject;
2760
+ }
2761
+ fm.confirm(opts);
2762
+ };
2763
+
2764
+ names = $.map(files, function(file, i) { return file.name? {i: i, name: file.name} : null ;});
2765
+
2766
+ name = $.map(names, function(item) { return item.name;});
2767
+ fm.request({
2768
+ data : {cmd : 'upload', target : target, name : name , FILES : ''},
2769
+ notify : {type : 'preupload', cnt : 1, hideCnt : true},
2770
+ preventFail : true
2771
+ })
2772
+ .done(function(data) {
2773
+ if (data) {
2774
+ if (data.error) {
2775
+ cancel();
2776
+ } else {
2777
+ if (data.name) {
2778
+ existed = data.name || [];
2779
+ exists = $.map(names, function(name){ return $.inArray(name.name, existed) !== -1 ? name : null ;});
2780
+ }
2781
+ if (data.list && target == fm.cwd().hash
2782
+ && data.list.length != $.map(fm.files(), function(file) { return file.phash == target ? file.name : null ;}).length) {
2783
+ fm.sync();
2784
+ }
2785
+ }
2786
+ }
2787
+ if (exists.length > 0) {
2788
+ confirm(0);
2789
+ } else {
2790
+ dfrd.resolve([]);
2791
+ }
2792
+ })
2793
+ .fail(function(error) {
2794
+ cancel();
2795
+ dfrd.resolve([]);
2796
+ error && fm.error(error);
2797
+ });
2798
+ };
2799
+ if (fm.option('uploadOverwrite') && typeof files[0] == 'object') {
2800
+ check();
2801
+ return dfrd;
2802
+ } else {
2803
+ return dfrd.resolve([]);
2804
+ }
2805
+ },
2806
+
2807
+ // check droped contents
2808
+ checkFile : function(data, fm, target) {
2809
+ if (!!data.checked || data.type == 'files') {
2810
+ return data.files;
2811
+ } else if (data.type == 'data') {
2812
+ var dfrd = $.Deferred(),
2813
+ files = [],
2814
+ paths = [],
2815
+ dirctorys = [],
2816
+ entries = [],
2817
+ processing = 0,
2818
+ items,
2819
+
2820
+ readEntries = function(dirReader) {
2821
+ var toArray = function(list) {
2822
+ return Array.prototype.slice.call(list || []);
2823
+ };
2824
+ var readFile = function(fileEntry, callback) {
2825
+ var dfrd = $.Deferred();
2826
+ if (typeof fileEntry == 'undefined') {
2827
+ dfrd.reject('empty');
2828
+ } else if (fileEntry.isFile) {
2829
+ fileEntry.file(function (file) {
2830
+ dfrd.resolve(file);
2831
+ }, function(e){
2832
+ dfrd.reject();
2833
+ });
2834
+ } else {
2835
+ dfrd.reject('dirctory');
2836
+ }
2837
+ return dfrd.promise();
2838
+ };
2839
+
2840
+ dirReader.readEntries(function (results) {
2841
+ if (!results.length) {
2842
+ var len = entries.length - 1;
2843
+ var read = function(i) {
2844
+ readFile(entries[i]).done(function(file){
2845
+ if (! (fm.OS == 'win' && file.name.match(/^(?:desktop\.ini|thumbs\.db)$/i))
2846
+ &&
2847
+ ! (fm.OS == 'mac' && file.name.match(/^\.ds_store$/i))) {
2848
+ paths.push(entries[i].fullPath);
2849
+ files.push(file);
2850
+ }
2851
+ }).fail(function(e){
2852
+ if (e == 'dirctory') {
2853
+ // dirctory
2854
+ dirctorys.push(entries[i]);
2855
+ } else if (e == 'empty') {
2856
+ // dirctory is empty
2857
+ } else {
2858
+ // why fail?
2859
+ }
2860
+ }).always(function(){
2861
+ processing--;
2862
+ if (i < len) {
2863
+ processing++;
2864
+ read(++i);
2865
+ }
2866
+ });
2867
+ };
2868
+ processing++;
2869
+ read(0);
2870
+ processing--;
2871
+ } else {
2872
+ entries = entries.concat(toArray(results));
2873
+ readEntries(dirReader);
2874
+ }
2875
+ });
2876
+ },
2877
+
2878
+ doScan = function(items, isEntry) {
2879
+ var dirReader, entry;
2880
+ entries = [];
2881
+ var length = items.length;
2882
+ for (var i = 0; i < length; i++) {
2883
+ if (! isEntry) {
2884
+ entry = !!items[i].getAsEntry? items[i].getAsEntry() : items[i].webkitGetAsEntry();
2885
+ } else {
2886
+ entry = items[i];
2887
+ }
2888
+ if (entry) {
2889
+ if (entry.isFile) {
2890
+ processing++;
2891
+ entry.file(function (file) {
2892
+ paths.push('');
2893
+ files.push(file);
2894
+ processing--;
2895
+ });
2896
+ } else if (entry.isDirectory) {
2897
+ if (processing > 0) {
2898
+ dirctorys.push(entry);
2899
+ } else {
2900
+ processing = 0;
2901
+ dirReader = entry.createReader();
2902
+ processing++;
2903
+ readEntries(dirReader);
2904
+ }
2905
+ }
2906
+ }
2907
+ }
2908
+ };
2909
+
2910
+ items = $.map(data.files.items, function(item){
2911
+ return item.getAsEntry? item.getAsEntry() : item.webkitGetAsEntry();
2912
+ });
2913
+ if (items.length > 0) {
2914
+ fm.uploads.checkExists(items, target, fm).done(function(renames){
2915
+ var notifyto, dfds = [];
2916
+ if (fm.option('uploadOverwrite')) {
2917
+ items = $.map(items, function(item){
2918
+ var i, bak, file, dfd;
2919
+ if (item.isDirectory) {
2920
+ i = $.inArray(item.name, renames);
2921
+ if (i !== -1) {
2922
+ renames.splice(i, 1);
2923
+ bak = fm.uniqueName(item.name + fm.options.backupSuffix , null, '');
2924
+ file = fm.fileByName(item.name, target);
2925
+ fm.lockfiles({files : [file.hash]});
2926
+ dfd = fm.request({
2927
+ data : {cmd : 'rename', target : file.hash, name : bak},
2928
+ notify : {type : 'rename', cnt : 1}
2929
+ })
2930
+ .fail(function(error) {
2931
+ item._remove = true;
2932
+ fm.sync();
2933
+ })
2934
+ .always(function() {
2935
+ fm.unlockfiles({files : [file.hash]})
2936
+ });
2937
+ dfds.push(dfd);
2938
+ }
2939
+ }
2940
+ return !item._remove? item : null;
2941
+ });
2942
+ }
2943
+ $.when.apply($, dfds).done(function(){
2944
+ if (items.length > 0) {
2945
+ notifyto = setTimeout(function() {
2946
+ fm.notify({type : 'readdir', cnt : 1, hideCnt: true});
2947
+ }, fm.options.notifyDelay);
2948
+ doScan(items, true);
2949
+ setTimeout(function wait() {
2950
+ if (processing > 0) {
2951
+ setTimeout(wait, 10);
2952
+ } else {
2953
+ if (dirctorys.length > 0) {
2954
+ doScan([dirctorys.shift()], true);
2955
+ setTimeout(wait, 10);
2956
+ } else {
2957
+ notifyto && clearTimeout(notifyto);
2958
+ fm.notify({type : 'readdir', cnt : -1});
2959
+ dfrd.resolve([files, paths, renames]);
2960
+ }
2961
+ }
2962
+ }, 10);
2963
+ } else {
2964
+ dfrd.reject();
2965
+ }
2966
+ });
2967
+ });
2968
+ return dfrd.promise();
2969
+ } else {
2970
+ return dfrd.reject();
2971
+ }
2972
+ } else {
2973
+ var ret = [];
2974
+ var check = [];
2975
+ var str = data.files[0];
2976
+ if (data.type == 'html') {
2977
+ var tmp = $("<html/>").append($.parseHTML(str)),
2978
+ atag;
2979
+ $('img[src]', tmp).each(function(){
2980
+ var url, purl,
2981
+ self = $(this),
2982
+ pa = self.closest('a');
2983
+ if (pa && pa.attr('href') && pa.attr('href').match(/\.(?:jpe?g|gif|bmp|png)/i)) {
2984
+ purl = pa.attr('href');
2985
+ }
2986
+ url = self.attr('src');
2987
+ if (url) {
2988
+ if (purl) {
2989
+ $.inArray(purl, ret) == -1 && ret.push(purl);
2990
+ $.inArray(url, check) == -1 && check.push(url);
2991
+ } else {
2992
+ $.inArray(url, ret) == -1 && ret.push(url);
2993
+ }
2994
+ }
2995
+ });
2996
+ atag = $('a[href]', tmp);
2997
+ atag.each(function(){
2998
+ var loc,
2999
+ parseUrl = function(url) {
3000
+ var a = document.createElement('a');
3001
+ a.href = url;
3002
+ return a;
3003
+ };
3004
+ if ($(this).text()) {
3005
+ loc = parseUrl($(this).attr('href'));
3006
+ if (loc.href && (atag.length === 1 || ! loc.pathname.match(/(?:\.html?|\/[^\/.]*)$/i))) {
3007
+ if ($.inArray(loc.href, ret) == -1 && $.inArray(loc.href, check) == -1) ret.push(loc.href);
3008
+ }
3009
+ }
3010
+ });
3011
+ } else {
3012
+ var regex, m, url;
3013
+ regex = /(http[^<>"{}|\\^\[\]`\s]+)/ig;
3014
+ while (m = regex.exec(str)) {
3015
+ url = m[1].replace(/&amp;/g, '&');
3016
+ if ($.inArray(url, ret) == -1) ret.push(url);
3017
+ }
3018
+ }
3019
+ return ret;
3020
+ }
3021
+ },
3022
+
3023
+ // upload transport using XMLHttpRequest
3024
+ xhr : function(data, fm) {
3025
+ var self = fm ? fm : this,
3026
+ xhr = new XMLHttpRequest(),
3027
+ notifyto = null, notifyto2 = null,
3028
+ dataChecked = data.checked,
3029
+ isDataType = (data.isDataType || data.type == 'data'),
3030
+ retry = 0,
3031
+ cancelBtn = 'div.elfinder-notify-upload div.elfinder-notify-cancel button',
3032
+ dfrd = $.Deferred()
3033
+ .fail(function(error) {
3034
+ var file = files.length? (isDataType? files[0][0] : files[0]) : {};
3035
+ if (file._cid) {
3036
+ formData = new FormData();
3037
+ files = [{_chunkfail: true}];
3038
+ formData.append('chunk', file._chunk);
3039
+ formData.append('cid' , file._cid);
3040
+ isDataType = false;
3041
+ send(files);
3042
+ }
3043
+ files = null;
3044
+ error && self.error(error);
3045
+ })
3046
+ .done(function(data) {
3047
+ xhr = null;
3048
+ files = null;
3049
+ if (data) {
3050
+ data.warning && self.error(data.warning);
3051
+ data.removed && self.remove(data);
3052
+ data.added && self.add(data);
3053
+ data.changed && self.change(data);
3054
+ self.trigger('upload', data);
3055
+ data.sync && self.sync();
3056
+ }
3057
+ })
3058
+ .always(function() {
3059
+ notifyto && clearTimeout(notifyto);
3060
+ notifyto2 && clearTimeout(notifyto2);
3061
+ dataChecked && !data.multiupload && checkNotify() && self.notify({type : 'upload', cnt : -cnt, progress : 0, size : 0});
3062
+ chunkMerge && self.ui.notify.children('.elfinder-notify-chunkmerge').length && self.notify({type : 'chunkmerge', cnt : -1});
3063
+ self.ui.notify.off('click', cancelBtn, fnAbort);
3064
+ $(document).off('keydown', fnAbort);
3065
+ }),
3066
+ formData = new FormData(),
3067
+ target = (data.target || self.cwd().hash),
3068
+ files = data.input ? data.input.files : self.uploads.checkFile(data, self, target),
3069
+ cnt = data.checked? (isDataType? files[0].length : files.length) : files.length,
3070
+ loaded = 0, prev,
3071
+ filesize = 0,
3072
+ notify = false,
3073
+ abort = false,
3074
+ checkNotify = function() {
3075
+ return notify = (notify || self.ui.notify.children('.elfinder-notify-upload').length);
3076
+ },
3077
+ startNotify = function(size) {
3078
+ if (!size) size = filesize;
3079
+ return setTimeout(function() {
3080
+ notify = true;
3081
+ self.notify({type : 'upload', cnt : cnt, progress : loaded - prev, size : size, cancel: true});
3082
+ prev = loaded;
3083
+ }, self.options.notifyDelay);
3084
+ },
3085
+ fnAbort = function(e) {
3086
+ if (e.type == 'keydown' && e.keyCode != $.ui.keyCode.ESCAPE) {
3087
+ return;
3088
+ }
3089
+ e.preventDefault();
3090
+ e.stopPropagation();
3091
+ abort = true;
3092
+ xhr.abort();
3093
+ dfrd.reject();
3094
+ self.sync();
3095
+ },
3096
+ renames = (data.renames || null),
3097
+ chunkMerge = false;
3098
+
3099
+ // regist abort event
3100
+ self.ui.notify.one('click', cancelBtn, fnAbort);
3101
+ $(document).on('keydown', fnAbort);
3102
+ $(window).on('unload', function(e){
3103
+ (dfrd.state() == 'pending') && dfrd.reject();
3104
+ });
3105
+
3106
+ !chunkMerge && (prev = loaded);
3107
+
3108
+ if (!isDataType && !cnt) {
3109
+ return dfrd.reject(['errUploadNoFiles']);
3110
+ }
3111
+
3112
+ xhr.addEventListener('error', function() {
3113
+ dfrd.reject('errConnect');
3114
+ }, false);
3115
+
3116
+ xhr.addEventListener('abort', function() {
3117
+ dfrd.reject(['errConnect', 'errAbort']);
3118
+ }, false);
3119
+
3120
+ xhr.addEventListener('load', function(e) {
3121
+ var status = xhr.status, res, curr = 0, error = '';
3122
+
3123
+ if (status >= 400) {
3124
+ if (status > 500) {
3125
+ error = 'errResponse';
3126
+ } else {
3127
+ error = 'errConnect';
3128
+ }
3129
+ } else {
3130
+ if (xhr.readyState != 4) {
3131
+ error = ['errConnect', 'errTimeout']; // am i right?
3132
+ }
3133
+ if (!xhr.responseText) {
3134
+ error = ['errResponse', 'errDataEmpty'];
3135
+ }
3136
+ }
3137
+
3138
+ if (error) {
3139
+ if (chunkMerge || retry++ > 3) {
3140
+ var file = isDataType? files[0][0] : files[0];
3141
+ if (file._cid) {
3142
+ formData = new FormData();
3143
+ files = [{_chunkfail: true}];
3144
+ formData.append('chunk', file._chunk);
3145
+ formData.append('cid' , file._cid);
3146
+ formData.append('range', file._range);
3147
+ isDataType = false;
3148
+ send(files);
3149
+ return;
3150
+ }
3151
+ return dfrd.reject(error);
3152
+ } else {
3153
+ filesize = 0;
3154
+ xhr.open('POST', self.uploadURL, true);
3155
+ xhr.send(formData);
3156
+ return;
3157
+ }
3158
+ }
3159
+
3160
+ loaded = filesize;
3161
+
3162
+ if (checkNotify() && (curr = loaded - prev)) {
3163
+ self.notify({type : 'upload', cnt : 0, progress : curr, size : 0});
3164
+ }
3165
+
3166
+ res = self.parseUploadData(xhr.responseText);
3167
+
3168
+ // chunked upload commit
3169
+ if (res._chunkmerged) {
3170
+ formData = new FormData();
3171
+ var _file = [{_chunkmerged: res._chunkmerged, _name: res._name}];
3172
+ chunkMerge = true;
3173
+ notifyto2 = setTimeout(function() {
3174
+ self.notify({type : 'chunkmerge', cnt : 1});
3175
+ }, self.options.notifyDelay);
3176
+ isDataType? send(_file, files[1]) : send(_file);
3177
+ return;
3178
+ }
3179
+
3180
+ res._multiupload = data.multiupload? true : false;
3181
+ if (res.error) {
3182
+ if (res._chunkfailure) {
3183
+ abort = true;
3184
+ self.uploads.xhrUploading = false;
3185
+ notifyto && clearTimeout(notifyto);
3186
+ if (self.ui.notify.children('.elfinder-notify-upload').length) {
3187
+ self.notify({type : 'upload', cnt : -cnt, progress : 0, size : 0});
3188
+ dfrd.reject(res.error);
3189
+ } else {
3190
+ // for multi connection
3191
+ dfrd.reject();
3192
+ }
3193
+ } else {
3194
+ dfrd.reject(res.error);
3195
+ }
3196
+ } else {
3197
+ dfrd.resolve(res);
3198
+ }
3199
+ }, false);
3200
+
3201
+ xhr.upload.addEventListener('loadstart', function(e) {
3202
+ if (!chunkMerge && e.lengthComputable) {
3203
+ loaded = e.loaded;
3204
+ retry && (loaded = 0);
3205
+ filesize = e.total;
3206
+ if (!loaded) {
3207
+ loaded = parseInt(filesize * 0.05);
3208
+ }
3209
+ if (checkNotify()) {
3210
+ self.notify({type : 'upload', cnt : 0, progress : loaded - prev, size : data.multiupload? 0 : filesize});
3211
+ prev = loaded;
3212
+ }
3213
+ }
3214
+ }, false);
3215
+
3216
+ xhr.upload.addEventListener('progress', function(e) {
3217
+ var curr;
3218
+
3219
+ if (e.lengthComputable && !chunkMerge) {
3220
+
3221
+ loaded = e.loaded;
3222
+
3223
+ // to avoid strange bug in safari (not in chrome) with drag&drop.
3224
+ // bug: macos finder opened in any folder,
3225
+ // reset safari cache (option+command+e), reload elfinder page,
3226
+ // drop file from finder
3227
+ // on first attempt request starts (progress callback called ones) but never ends.
3228
+ // any next drop - successfull.
3229
+ if (!data.checked && loaded > 0 && !notifyto) {
3230
+ notifyto = startNotify(xhr._totalSize - loaded);
3231
+ }
3232
+
3233
+ if (!filesize) {
3234
+ retry && (loaded = 0);
3235
+ filesize = e.total;
3236
+ if (!loaded) {
3237
+ loaded = parseInt(filesize * 0.05);
3238
+ }
3239
+ }
3240
+
3241
+ curr = loaded - prev;
3242
+ if (checkNotify() && (curr/e.total) >= 0.05) {
3243
+ self.notify({type : 'upload', cnt : 0, progress : curr, size : 0});
3244
+ prev = loaded;
3245
+ }
3246
+ }
3247
+ }, false);
3248
+
3249
+ var send = function(files, paths){
3250
+ var size = 0,
3251
+ fcnt = 1,
3252
+ sfiles = [],
3253
+ c = 0,
3254
+ total = cnt,
3255
+ maxFileSize,
3256
+ totalSize = 0,
3257
+ chunked = [],
3258
+ chunkID = +new Date(),
3259
+ BYTES_PER_CHUNK = Math.min((fm.uplMaxSize? fm.uplMaxSize : 2097152) - 8190, fm.options.uploadMaxChunkSize), // uplMaxSize margin 8kb or options.uploadMaxChunkSize
3260
+ blobSlice = false,
3261
+ blobSize, i, start, end, chunks, blob, chunk, added, done, last, failChunk,
3262
+ multi = function(files, num){
3263
+ var sfiles = [], cid;
3264
+ if (!abort) {
3265
+ while(files.length && sfiles.length < num) {
3266
+ sfiles.push(files.shift());
3267
+ }
3268
+ }
3269
+ if (sfiles.length) {
3270
+ for (var i=0; i < sfiles.length; i++) {
3271
+ if (abort) {
3272
+ break;
3273
+ }
3274
+ cid = isDataType? (sfiles[i][0][0]._cid || null) : (sfiles[i][0]._cid || null);
3275
+ if (!!failChunk[cid]) {
3276
+ last--;
3277
+ continue;
3278
+ }
3279
+ fm.exec('upload', {
3280
+ type: data.type,
3281
+ isDataType: isDataType,
3282
+ files: sfiles[i],
3283
+ checked: true,
3284
+ target: target,
3285
+ renames: renames,
3286
+ multiupload: true})
3287
+ .fail(function(error) {
3288
+ if (cid) {
3289
+ failChunk[cid] = true;
3290
+ }
3291
+ //error && self.error(error);
3292
+ })
3293
+ .always(function(e) {
3294
+ if (e && e.added) added = $.merge(added, e.added);
3295
+ if (last <= ++done) {
3296
+ fm.trigger('multiupload', {added: added});
3297
+ notifyto && clearTimeout(notifyto);
3298
+ if (checkNotify()) {
3299
+ self.notify({type : 'upload', cnt : -cnt, progress : 0, size : 0});
3300
+ }
3301
+ }
3302
+ multi(files, 1); // Next one
3303
+ });
3304
+ }
3305
+ } else {
3306
+ self.uploads.xhrUploading = false;
3307
+ if (abort) {
3308
+ notifyto && clearTimeout(notifyto);
3309
+ if (checkNotify()) {
3310
+ self.notify({type : 'upload', cnt : -cnt, progress : 0, size : 0});
3311
+ }
3312
+ if (cid) {
3313
+ failChunk[cid] = true;
3314
+ }
3315
+ }
3316
+ dfrd.resolve();
3317
+ }
3318
+ },
3319
+ check = function(){
3320
+ if (!self.uploads.xhrUploading) {
3321
+ self.uploads.xhrUploading = true;
3322
+ multi(sfiles, 3); // Max connection: 3
3323
+ } else {
3324
+ setTimeout(function(){ check(); }, 100);
3325
+ }
3326
+ };
3327
+
3328
+ if (! dataChecked && (isDataType || data.type == 'files')) {
3329
+ maxFileSize = fm.option('uploadMaxSize')? fm.option('uploadMaxSize') : 0;
3330
+ for (i=0; i < files.length; i++) {
3331
+ blob = files[i];
3332
+ blobSize = blob.size;
3333
+ if (blobSlice === false) {
3334
+ if ('slice' in blob) {
3335
+ blobSlice = 'slice';
3336
+ } else if ('mozSlice' in blob) {
3337
+ blobSlice = 'mozSlice';
3338
+ } else if ('webkitSlice' in blob) {
3339
+ blobSlice = 'webkitSlice';
3340
+ } else {
3341
+ blobSlice = '';
3342
+ }
3343
+ }
3344
+
3345
+ if ((maxFileSize && blobSize > maxFileSize) || (!blobSlice && fm.uplMaxSize && blobSize > fm.uplMaxSize)) {
3346
+ self.error(self.i18n('errUploadFile', blob.name) + ' ' + self.i18n('errUploadFileSize'));
3347
+ cnt--;
3348
+ total--;
3349
+ continue;
3350
+ }
3351
+
3352
+ if (blobSlice && blobSize > BYTES_PER_CHUNK) {
3353
+ start = 0;
3354
+ end = BYTES_PER_CHUNK;
3355
+ chunks = -1;
3356
+ total = Math.floor(blobSize / BYTES_PER_CHUNK);
3357
+
3358
+ totalSize += blobSize;
3359
+ chunked[chunkID] = 0;
3360
+ while(start <= blobSize) {
3361
+ chunk = blob[blobSlice](start, end);
3362
+ chunk._chunk = blob.name + '.' + ++chunks + '_' + total + '.part';
3363
+ chunk._cid = chunkID;
3364
+ chunk._range = start + ',' + chunk.size + ',' + blobSize;
3365
+ chunked[chunkID]++;
3366
+
3367
+ if (size) {
3368
+ c++;
3369
+ }
3370
+ if (typeof sfiles[c] == 'undefined') {
3371
+ sfiles[c] = [];
3372
+ if (isDataType) {
3373
+ sfiles[c][0] = [];
3374
+ sfiles[c][1] = [];
3375
+ }
3376
+ }
3377
+ size = BYTES_PER_CHUNK;
3378
+ fcnt = 1;
3379
+ if (isDataType) {
3380
+ sfiles[c][0].push(chunk);
3381
+ sfiles[c][1].push(paths[i]);
3382
+ } else {
3383
+ sfiles[c].push(chunk);
3384
+ }
3385
+
3386
+ start = end;
3387
+ end = start + BYTES_PER_CHUNK;
3388
+ }
3389
+ if (chunk == null) {
3390
+ self.error(self.i18n('errUploadFile', blob.name) + ' ' + self.i18n('errUploadFileSize'));
3391
+ cnt--;
3392
+ total--;
3393
+ } else {
3394
+ total += chunks;
3395
+ }
3396
+ continue;
3397
+ }
3398
+ if ((fm.uplMaxSize && size + blobSize >= fm.uplMaxSize) || fcnt > fm.uplMaxFile) {
3399
+ size = 0;
3400
+ fcnt = 1;
3401
+ c++;
3402
+ }
3403
+ if (typeof sfiles[c] == 'undefined') {
3404
+ sfiles[c] = [];
3405
+ if (isDataType) {
3406
+ sfiles[c][0] = [];
3407
+ sfiles[c][1] = [];
3408
+ }
3409
+ }
3410
+ if (isDataType) {
3411
+ sfiles[c][0].push(blob);
3412
+ sfiles[c][1].push(paths[i]);
3413
+ } else {
3414
+ sfiles[c].push(blob);
3415
+ }
3416
+ size += blobSize;
3417
+ totalSize += blobSize;
3418
+ fcnt++;
3419
+ }
3420
+
3421
+ if (sfiles.length == 0) {
3422
+ // no data
3423
+ data.checked = true;
3424
+ return false;
3425
+ }
3426
+
3427
+ if (sfiles.length > 1) {
3428
+ // multi upload
3429
+ notifyto = startNotify(totalSize);
3430
+ added = [];
3431
+ done = 0;
3432
+ last = sfiles.length;
3433
+ failChunk = [];
3434
+ check();
3435
+ return true;
3436
+ }
3437
+
3438
+ // single upload
3439
+ if (isDataType) {
3440
+ files = sfiles[0][0];
3441
+ paths = sfiles[0][1];
3442
+ } else {
3443
+ files = sfiles[0];
3444
+ }
3445
+ }
3446
+
3447
+ if (!dataChecked) {
3448
+ if (!fm.UA.Safari || !data.files) {
3449
+ notifyto = startNotify(totalSize);
3450
+ } else {
3451
+ xhr._totalSize = totalSize;
3452
+ }
3453
+ }
3454
+
3455
+ dataChecked = true;
3456
+
3457
+ if (! files.length) {
3458
+ dfrd.reject(['errUploadNoFiles']);
3459
+ }
3460
+
3461
+ xhr.open('POST', self.uploadURL, true);
3462
+
3463
+ // set request headers
3464
+ if (fm.customHeaders) {
3465
+ $.each(fm.customHeaders, function(key) {
3466
+ xhr.setRequestHeader(key, this);
3467
+ });
3468
+ }
3469
+
3470
+ // set xhrFields
3471
+ if (fm.xhrFields) {
3472
+ $.each(fm.xhrFields, function(key) {
3473
+ if (key in xhr) {
3474
+ xhr[key] = this;
3475
+ }
3476
+ });
3477
+ }
3478
+
3479
+ formData.append('cmd', 'upload');
3480
+ formData.append(self.newAPI ? 'target' : 'current', target);
3481
+ if (renames) {
3482
+ $.each(renames, function(i, v){
3483
+ formData.append('renames[]', v);
3484
+ });
3485
+ formData.append('suffix', fm.options.backupSuffix);
3486
+ }
3487
+ $.each(self.options.customData, function(key, val) {
3488
+ formData.append(key, val);
3489
+ });
3490
+ $.each(self.options.onlyMimes, function(i, mime) {
3491
+ formData.append('mimes['+i+']', mime);
3492
+ });
3493
+
3494
+ $.each(files, function(i, file) {
3495
+ if (file._chunkmerged) {
3496
+ formData.append('chunk', file._chunkmerged);
3497
+ formData.append('upload[]', file._name);
3498
+ } else {
3499
+ if (file._chunkfail) {
3500
+ formData.append('upload[]', 'chunkfail');
3501
+ formData.append('mimes', 'chunkfail');
3502
+ } else {
3503
+ formData.append('upload[]', file);
3504
+ }
3505
+ if (file._chunk) {
3506
+ formData.append('chunk', file._chunk);
3507
+ formData.append('cid' , file._cid);
3508
+ formData.append('range', file._range);
3509
+ }
3510
+ }
3511
+ });
3512
+
3513
+ if (isDataType) {
3514
+ $.each(paths, function(i, path) {
3515
+ formData.append('upload_path[]', path);
3516
+ });
3517
+ }
3518
+
3519
+
3520
+ xhr.onreadystatechange = function() {
3521
+ if (xhr.readyState == 4 && xhr.status == 0) {
3522
+ if (abort) {
3523
+ dfrd.reject();
3524
+ } else {
3525
+ var errors = ['errAbort'];
3526
+ // ff bug while send zero sized file
3527
+ // for safari - send directory
3528
+ if (!isDataType && data.files && $.map(data.files, function(f){return f.size === 0? f : null;}).length) {
3529
+ errors.push('errFolderUpload');
3530
+ }
3531
+ dfrd.reject(errors);
3532
+ }
3533
+ }
3534
+ };
3535
+
3536
+ xhr.send(formData);
3537
+
3538
+ return true;
3539
+ };
3540
+
3541
+ if (! isDataType) {
3542
+ if (files.length > 0) {
3543
+ if (renames == null) {
3544
+ renames = [];
3545
+ self.uploads.checkExists(files, target, fm).done(
3546
+ function(res){
3547
+ if (fm.option('uploadOverwrite')) {
3548
+ renames = res;
3549
+ files = $.map(files, function(file){return !file._remove? file : null ;});
3550
+ }
3551
+ cnt = files.length;
3552
+ if (cnt > 0) {
3553
+ if (! send(files)) {
3554
+ dfrd.reject();
3555
+ }
3556
+ } else {
3557
+ dfrd.reject();
3558
+ }
3559
+ }
3560
+ );
3561
+ } else {
3562
+ if (! send(files)) {
3563
+ dfrd.reject();
3564
+ }
3565
+ }
3566
+ } else {
3567
+ dfrd.reject();
3568
+ }
3569
+ } else {
3570
+ if (dataChecked) {
3571
+ send(files[0], files[1]);
3572
+ } else {
3573
+ files.done(function(result){
3574
+ renames = [];
3575
+ cnt = result[0].length;
3576
+ if (cnt) {
3577
+ renames = result[2];
3578
+ send(result[0], result[1]);
3579
+ } else {
3580
+ dfrd.reject(['errUploadNoFiles']);
3581
+ }
3582
+ }).fail(function(){
3583
+ dfrd.reject();
3584
+ });
3585
+ }
3586
+ }
3587
+
3588
+ return dfrd;
3589
+ },
3590
+
3591
+ // upload transport using iframe
3592
+ iframe : function(data, fm) {
3593
+ var self = fm ? fm : this,
3594
+ input = data.input? data.input : false,
3595
+ files = !input ? self.uploads.checkFile(data, self) : false,
3596
+ dfrd = $.Deferred()
3597
+ .fail(function(error) {
3598
+ error && self.error(error);
3599
+ })
3600
+ .done(function(data) {
3601
+ data.warning && self.error(data.warning);
3602
+ data.removed && self.remove(data);
3603
+ data.added && self.add(data);
3604
+ data.changed && self.change(data);
3605
+ self.trigger('upload', data);
3606
+ data.sync && self.sync();
3607
+ }),
3608
+ name = 'iframe-'+self.namespace+(++self.iframeCnt),
3609
+ form = $('<form action="'+self.uploadURL+'" method="post" enctype="multipart/form-data" encoding="multipart/form-data" target="'+name+'" style="display:none"><input type="hidden" name="cmd" value="upload" /></form>'),
3610
+ msie = this.UA.IE,
3611
+ // clear timeouts, close notification dialog, remove form/iframe
3612
+ onload = function() {
3613
+ abortto && clearTimeout(abortto);
3614
+ notifyto && clearTimeout(notifyto);
3615
+ notify && self.notify({type : 'upload', cnt : -cnt});
3616
+
3617
+ setTimeout(function() {
3618
+ msie && $('<iframe src="javascript:false;"/>').appendTo(form);
3619
+ form.remove();
3620
+ iframe.remove();
3621
+ }, 100);
3622
+ },
3623
+ iframe = $('<iframe src="'+(msie ? 'javascript:false;' : 'about:blank')+'" name="'+name+'" style="position:absolute;left:-1000px;top:-1000px" />')
3624
+ .on('load', function() {
3625
+ iframe.off('load')
3626
+ .on('load', function() {
3627
+ //var data = self.parseUploadData(iframe.contents().text());
3628
+
3629
+ onload();
3630
+ dfrd.reject();
3631
+ //data.error ? dfrd.reject(data.error) : dfrd.resolve(data);
3632
+ });
3633
+
3634
+ // notify dialog
3635
+ notifyto = setTimeout(function() {
3636
+ notify = true;
3637
+ self.notify({type : 'upload', cnt : cnt});
3638
+ }, self.options.notifyDelay);
3639
+
3640
+ // emulate abort on timeout
3641
+ if (self.options.iframeTimeout > 0) {
3642
+ abortto = setTimeout(function() {
3643
+ onload();
3644
+ dfrd.reject([errors.connect, errors.timeout]);
3645
+ }, self.options.iframeTimeout);
3646
+ }
3647
+
3648
+ form.submit();
3649
+ }),
3650
+ target = (data.target || self.cwd().hash),
3651
+ names = [],
3652
+ dfds = [],
3653
+ renames = [],
3654
+ cnt, notify, notifyto, abortto;
3655
+
3656
+ if (files && files.length) {
3657
+ $.each(files, function(i, val) {
3658
+ form.append('<input type="hidden" name="upload[]" value="'+val+'"/>');
3659
+ });
3660
+ cnt = 1;
3661
+ } else if (input && $(input).is(':file') && $(input).val()) {
3662
+ if (fm.option('uploadOverwrite')) {
3663
+ names = input.files? input.files : [{ name: $(input).val().replace(/^(?:.+[\\\/])?([^\\\/]+)$/, '$1') }];
3664
+ //names = $.map(names, function(file){return file.name? { name: file.name } : null ;});
3665
+ dfds.push(self.uploads.checkExists(names, target, self).done(
3666
+ function(res){
3667
+ renames = res;
3668
+ cnt = $.map(names, function(file){return !file._remove? file : null ;}).length;
3669
+ if (cnt != names.length) {
3670
+ cnt = 0;
3671
+ }
3672
+ }
3673
+ ));
3674
+ }
3675
+ cnt = input.files ? input.files.length : 1;
3676
+ form.append(input);
3677
+ } else {
3678
+ return dfrd.reject();
3679
+ }
3680
+
3681
+ $.when.apply($, dfds).done(function() {
3682
+ if (cnt < 1) {
3683
+ return dfrd.reject();
3684
+ }
3685
+ form.append('<input type="hidden" name="'+(self.newAPI ? 'target' : 'current')+'" value="'+target+'"/>')
3686
+ .append('<input type="hidden" name="html" value="1"/>')
3687
+ .append('<input type="hidden" name="node" value="'+self.id+'"/>')
3688
+ .append($(input).attr('name', 'upload[]'));
3689
+
3690
+ if (renames.length > 0) {
3691
+ $.each(renames, function(i, rename) {
3692
+ form.append('<input type="hidden" name="renames[]" value="'+rename+'"/>');
3693
+ });
3694
+ form.append('<input type="hidden" name="suffix" value="'+fm.options.backupSuffix+'"/>');
3695
+ }
3696
+
3697
+ $.each(self.options.onlyMimes||[], function(i, mime) {
3698
+ form.append('<input type="hidden" name="mimes[]" value="'+mime+'"/>');
3699
+ });
3700
+
3701
+ $.each(self.options.customData, function(key, val) {
3702
+ form.append('<input type="hidden" name="'+key+'" value="'+val+'"/>');
3703
+ });
3704
+
3705
+ form.appendTo('body');
3706
+ iframe.appendTo('body');
3707
+ });
3708
+
3709
+ return dfrd;
3710
+ }
3711
+ },
3712
+
3713
+
3714
+ /**
3715
+ * Bind callback to event(s) The callback is executed at most once per event.
3716
+ * To bind to multiply events at once, separate events names by space
3717
+ *
3718
+ * @param String event name
3719
+ * @param Function callback
3720
+ * @return elFinder
3721
+ */
3722
+ one : function(event, callback) {
3723
+ var self = this,
3724
+ h = $.proxy(callback, function(event) {
3725
+ setTimeout(function() {self.unbind(event.type, h);}, 3);
3726
+ return callback.apply(this, arguments);
3727
+ });
3728
+ return this.bind(event, h);
3729
+ },
3730
+
3731
+ /**
3732
+ * Set/get data into/from localStorage
3733
+ *
3734
+ * @param String key
3735
+ * @param String|void value
3736
+ * @return String
3737
+ */
3738
+ localStorage : function(key, val) {
3739
+ var s = window.localStorage,
3740
+ oldkey = 'elfinder-'+key+this.id, // old key of elFinder < 2.1.6
3741
+ retval, oldval;
3742
+
3743
+ // new key of elFinder >= 2.1.6
3744
+ key = window.location.pathname+'-elfinder-'+key+this.id;
3745
+
3746
+ if (val === null) {
3747
+ return s.removeItem(key);
3748
+ }
3749
+
3750
+ if (val === void(0) && !(retval = s.getItem(key)) && (oldval = s.getItem(oldkey))) {
3751
+ val = oldval;
3752
+ s.removeItem(oldkey);
3753
+ }
3754
+
3755
+ if (val !== void(0)) {
3756
+ try {
3757
+ s.setItem(key, val);
3758
+ } catch (e) {
3759
+ s.clear();
3760
+ s.setItem(key, val);
3761
+ }
3762
+ retval = s.getItem(key);
3763
+ }
3764
+
3765
+ return retval;
3766
+ },
3767
+
3768
+ /**
3769
+ * Get/set cookie
3770
+ *
3771
+ * @param String cookie name
3772
+ * @param String|void cookie value
3773
+ * @return String
3774
+ */
3775
+ cookie : function(name, value) {
3776
+ var d, o, c, i;
3777
+
3778
+ name = 'elfinder-'+name+this.id;
3779
+
3780
+ if (value === void(0)) {
3781
+ if (document.cookie && document.cookie != '') {
3782
+ c = document.cookie.split(';');
3783
+ name += '=';
3784
+ for (i=0; i<c.length; i++) {
3785
+ c[i] = $.trim(c[i]);
3786
+ if (c[i].substring(0, name.length) == name) {
3787
+ return decodeURIComponent(c[i].substring(name.length));
3788
+ }
3789
+ }
3790
+ }
3791
+ return '';
3792
+ }
3793
+
3794
+ o = $.extend({}, this.options.cookie);
3795
+ if (value === null) {
3796
+ value = '';
3797
+ o.expires = -1;
3798
+ }
3799
+ if (typeof(o.expires) == 'number') {
3800
+ d = new Date();
3801
+ d.setTime(d.getTime()+(o.expires * 86400000));
3802
+ o.expires = d;
3803
+ }
3804
+ document.cookie = name+'='+encodeURIComponent(value)+'; expires='+o.expires.toUTCString()+(o.path ? '; path='+o.path : '')+(o.domain ? '; domain='+o.domain : '')+(o.secure ? '; secure' : '');
3805
+ return value;
3806
+ },
3807
+
3808
+ /**
3809
+ * Get start directory (by location.hash or last opened directory)
3810
+ *
3811
+ * @return String
3812
+ */
3813
+ startDir : function() {
3814
+ var locHash = window.location.hash;
3815
+ if (locHash && locHash.match(/^#elf_/)) {
3816
+ return locHash.replace(/^#elf_/, '');
3817
+ } else if (this.options.startPathHash) {
3818
+ return this.options.startPathHash;
3819
+ } else {
3820
+ return this.lastDir();
3821
+ }
3822
+ },
3823
+
3824
+ /**
3825
+ * Get/set last opened directory
3826
+ *
3827
+ * @param String|undefined dir hash
3828
+ * @return String
3829
+ */
3830
+ lastDir : function(hash) {
3831
+ return this.options.rememberLastDir ? this.storage('lastdir', hash) : '';
3832
+ },
3833
+
3834
+ /**
3835
+ * Node for escape html entities in texts
3836
+ *
3837
+ * @type jQuery
3838
+ */
3839
+ _node : $('<span/>'),
3840
+
3841
+ /**
3842
+ * Replace not html-safe symbols to html entities
3843
+ *
3844
+ * @param String text to escape
3845
+ * @return String
3846
+ */
3847
+ escape : function(name) {
3848
+ return this._node.text(name).html().replace(/"/g, '&quot;').replace(/'/g, '&#039;');
3849
+ },
3850
+
3851
+ /**
3852
+ * Cleanup ajax data.
3853
+ * For old api convert data into new api format
3854
+ *
3855
+ * @param String command name
3856
+ * @param Object data from backend
3857
+ * @return Object
3858
+ */
3859
+ normalize : function(data) {
3860
+ var filter = function(file) {
3861
+
3862
+ if (file && file.hash && file.name && file.mime) {
3863
+ if (file.mime == 'application/x-empty') {
3864
+ file.mime = 'text/plain';
3865
+ }
3866
+ return file;
3867
+ }
3868
+ return null;
3869
+ };
3870
+
3871
+
3872
+ if (data.files) {
3873
+ data.files = $.map(data.files, filter);
3874
+ }
3875
+ if (data.tree) {
3876
+ data.tree = $.map(data.tree, filter);
3877
+ }
3878
+ if (data.added) {
3879
+ data.added = $.map(data.added, filter);
3880
+ }
3881
+ if (data.changed) {
3882
+ data.changed = $.map(data.changed, filter);
3883
+ }
3884
+ if (data.api) {
3885
+ data.init = true;
3886
+ }
3887
+ return data;
3888
+ },
3889
+
3890
+ /**
3891
+ * Update sort options
3892
+ *
3893
+ * @param {String} sort type
3894
+ * @param {String} sort order
3895
+ * @param {Boolean} show folder first
3896
+ */
3897
+ setSort : function(type, order, stickFolders) {
3898
+ this.storage('sortType', (this.sortType = this.sortRules[type] ? type : 'name'));
3899
+ this.storage('sortOrder', (this.sortOrder = /asc|desc/.test(order) ? order : 'asc'));
3900
+ this.storage('sortStickFolders', (this.sortStickFolders = !!stickFolders) ? 1 : '');
3901
+ this.trigger('sortchange');
3902
+ },
3903
+
3904
+ _sortRules : {
3905
+ name : function(file1, file2) {
3906
+ var n1 = file1.name.toLowerCase(),
3907
+ n2 = file2.name.toLowerCase(),
3908
+ e1 = '',
3909
+ e2 = '',
3910
+ so = elFinder.prototype.naturalCompare,
3911
+ m, ret;
3912
+ if (m = n1.match(/^(.+)(\.[0-9a-z.]+)$/)) {
3913
+ n1 = m[1];
3914
+ e1 = m[2];
3915
+ }
3916
+ if (m = n2.match(/^(.+)(\.[0-9a-z.]+)$/)) {
3917
+ n2 = m[1];
3918
+ e2 = m[2];
3919
+ }
3920
+ ret = so(n1, n2);
3921
+ if (ret == 0 && (e1 || e2) && e1 != e2) {
3922
+ ret = so(e1, e2);
3923
+ }
3924
+ return ret;
3925
+ },
3926
+ size : function(file1, file2) {
3927
+ var size1 = parseInt(file1.size) || 0,
3928
+ size2 = parseInt(file2.size) || 0;
3929
+
3930
+ return size1 == size2 ? 0 : size1 > size2 ? 1 : -1;
3931
+ },
3932
+ kind : function(file1, file2) {
3933
+ return elFinder.prototype.naturalCompare(file1.mime, file2.mime);
3934
+ },
3935
+ date : function(file1, file2) {
3936
+ var date1 = file1.ts || file1.date,
3937
+ date2 = file2.ts || file2.date;
3938
+
3939
+ return date1 == date2 ? 0 : date1 > date2 ? 1 : -1
3940
+ }
3941
+ },
3942
+
3943
+ /**
3944
+ * Compare strings for natural sort
3945
+ *
3946
+ * @param String
3947
+ * @param String
3948
+ * @return Number
3949
+ */
3950
+ naturalCompare : function(a, b) {
3951
+ var self = elFinder.prototype.naturalCompare;
3952
+ if (typeof self.loc == 'undefined') {
3953
+ self.loc = (navigator.userLanguage || navigator.browserLanguage || navigator.language || 'en-US');
3954
+ }
3955
+ if (typeof self.sort == 'undefined') {
3956
+ if ('11'.localeCompare('2', self.loc, {numeric: true}) > 0) {
3957
+ // Native support
3958
+ if (window.Intl && window.Intl.Collator) {
3959
+ self.sort = new Intl.Collator(self.loc, {numeric: true}).compare;
3960
+ } else {
3961
+ self.sort = function(a, b) {
3962
+ return a.localeCompare(b, self.loc, {numeric: true});
3963
+ };
3964
+ }
3965
+ } else {
3966
+ /*
3967
+ * Edited for elFinder (emulates localeCompare() by numeric) by Naoki Sawada aka nao-pon
3968
+ */
3969
+ /*
3970
+ * Huddle/javascript-natural-sort (https://github.com/Huddle/javascript-natural-sort)
3971
+ */
3972
+ /*
3973
+ * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license
3974
+ * Author: Jim Palmer (based on chunking idea from Dave Koelle)
3975
+ * http://opensource.org/licenses/mit-license.php
3976
+ */
3977
+ self.sort = function(a, b) {
3978
+ var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
3979
+ sre = /(^[ ]*|[ ]*$)/g,
3980
+ dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
3981
+ hre = /^0x[0-9a-f]+$/i,
3982
+ ore = /^0/,
3983
+ syre = /^[\x01\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/, // symbol first - (Naoki Sawada)
3984
+ i = function(s) { return self.sort.insensitive && (''+s).toLowerCase() || ''+s },
3985
+ // convert all to strings strip whitespace
3986
+ // first character is "_", it's smallest - (Naoki Sawada)
3987
+ x = i(a).replace(sre, '').replace(/^_/, "\x01") || '',
3988
+ y = i(b).replace(sre, '').replace(/^_/, "\x01") || '',
3989
+ // chunk/tokenize
3990
+ xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
3991
+ yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
3992
+ // numeric, hex or date detection
3993
+ xD = parseInt(x.match(hre)) || (xN.length != 1 && x.match(dre) && Date.parse(x)),
3994
+ yD = parseInt(y.match(hre)) || xD && y.match(dre) && Date.parse(y) || null,
3995
+ oFxNcL, oFyNcL,
3996
+ locRes = 0;
3997
+
3998
+ // first try and sort Hex codes or Dates
3999
+ if (yD) {
4000
+ if ( xD < yD ) return -1;
4001
+ else if ( xD > yD ) return 1;
4002
+ }
4003
+ // natural sorting through split numeric strings and default strings
4004
+ for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
4005
+
4006
+ // find floats not starting with '0', string or 0 if not defined (Clint Priest)
4007
+ oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
4008
+ oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
4009
+
4010
+ // handle numeric vs string comparison - number < string - (Kyle Adams)
4011
+ // but symbol first < number - (Naoki Sawada)
4012
+ if (isNaN(oFxNcL) !== isNaN(oFyNcL)) {
4013
+ if (isNaN(oFxNcL) && (typeof oFxNcL !== 'string' || ! oFxNcL.match(syre))) {
4014
+ return 1;
4015
+ } else if (typeof oFyNcL !== 'string' || ! oFyNcL.match(syre)) {
4016
+ return -1;
4017
+ }
4018
+ }
4019
+
4020
+ // use decimal number comparison if either value is string zero
4021
+ if (parseInt(oFxNcL, 10) === 0) oFxNcL = 0;
4022
+ if (parseInt(oFyNcL, 10) === 0) oFyNcL = 0;
4023
+
4024
+ // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
4025
+ if (typeof oFxNcL !== typeof oFyNcL) {
4026
+ oFxNcL += '';
4027
+ oFyNcL += '';
4028
+ }
4029
+
4030
+ // use locale sensitive sort for strings when case insensitive
4031
+ // note: localeCompare interleaves uppercase with lowercase (e.g. A,a,B,b)
4032
+ if (self.sort.insensitive && typeof oFxNcL === 'string' && typeof oFyNcL === 'string') {
4033
+ locRes = oFxNcL.localeCompare(oFyNcL, self.loc);
4034
+ if (locRes !== 0) return locRes;
4035
+ }
4036
+
4037
+ if (oFxNcL < oFyNcL) return -1;
4038
+ if (oFxNcL > oFyNcL) return 1;
4039
+ }
4040
+ return 0;
4041
+ };
4042
+ self.sort.insensitive = true;
4043
+ }
4044
+ }
4045
+ return self.sort(a, b);
4046
+ },
4047
+
4048
+ /**
4049
+ * Compare files based on elFinder.sort
4050
+ *
4051
+ * @param Object file
4052
+ * @param Object file
4053
+ * @return Number
4054
+ */
4055
+ compare : function(file1, file2) {
4056
+ var self = this,
4057
+ type = self.sortType,
4058
+ asc = self.sortOrder == 'asc',
4059
+ stick = self.sortStickFolders,
4060
+ rules = self.sortRules,
4061
+ sort = rules[type],
4062
+ d1 = file1.mime == 'directory',
4063
+ d2 = file2.mime == 'directory',
4064
+ res;
4065
+
4066
+ if (stick) {
4067
+ if (d1 && !d2) {
4068
+ return -1;
4069
+ } else if (!d1 && d2) {
4070
+ return 1;
4071
+ }
4072
+ }
4073
+
4074
+ res = asc ? sort(file1, file2) : sort(file2, file1);
4075
+
4076
+ return type != 'name' && res == 0
4077
+ ? res = asc ? rules.name(file1, file2) : rules.name(file2, file1)
4078
+ : res;
4079
+ },
4080
+
4081
+ /**
4082
+ * Sort files based on config
4083
+ *
4084
+ * @param Array files
4085
+ * @return Array
4086
+ */
4087
+ sortFiles : function(files) {
4088
+ return files.sort(this.compare);
4089
+ },
4090
+
4091
+ /**
4092
+ * Open notification dialog
4093
+ * and append/update message for required notification type.
4094
+ *
4095
+ * @param Object options
4096
+ * @example
4097
+ * this.notify({
4098
+ * type : 'copy',
4099
+ * msg : 'Copy files', // not required for known types @see this.notifyType
4100
+ * cnt : 3,
4101
+ * hideCnt : false, // true for not show count
4102
+ * progress : 10, // progress bar percents (use cnt : 0 to update progress bar)
4103
+ * cancel : false // show cancel button (should regist event at each caller @see this.uploads.xhr)
4104
+ * })
4105
+ * @return elFinder
4106
+ */
4107
+ notify : function(opts) {
4108
+ var type = opts.type,
4109
+ msg = this.messages['ntf'+type] ? this.i18n('ntf'+type) : this.i18n('ntfsmth'),
4110
+ ndialog = this.ui.notify,
4111
+ notify = ndialog.children('.elfinder-notify-'+type),
4112
+ ntpl = '<div class="elfinder-notify elfinder-notify-{type}"><span class="elfinder-dialog-icon elfinder-dialog-icon-{type}"/><span class="elfinder-notify-msg">{msg}</span> <span class="elfinder-notify-cnt"/><div class="elfinder-notify-progressbar"><div class="elfinder-notify-progress"/></div><div class="elfinder-notify-cancel"/></div></div>',
4113
+ delta = opts.cnt,
4114
+ size = (typeof opts.size != 'undefined')? parseInt(opts.size) : null,
4115
+ progress = (typeof opts.progress != 'undefined' && opts.progress >= 0) ? opts.progress : null,
4116
+ cancel = opts.cancel,
4117
+ clhover = 'ui-state-hover',
4118
+ cnt, total, prc, button;
4119
+
4120
+ if (!type) {
4121
+ return this;
4122
+ }
4123
+
4124
+ if (!notify.length) {
4125
+ notify = $(ntpl.replace(/\{type\}/g, type).replace(/\{msg\}/g, msg))
4126
+ .appendTo(ndialog)
4127
+ .data('cnt', 0);
4128
+
4129
+ if (progress != null) {
4130
+ notify.data({progress : 0, total : 0});
4131
+ }
4132
+
4133
+ if (cancel) {
4134
+ button = $('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text">'+this.i18n('btnCancel')+'</span></button>')
4135
+ .hover(function(e) {
4136
+ $(this).toggleClass(clhover, e.type == 'mouseenter');
4137
+ });
4138
+ notify.children('div.elfinder-notify-cancel').append(button);
4139
+ }
4140
+ }
4141
+
4142
+ cnt = delta + parseInt(notify.data('cnt'));
4143
+
4144
+ if (cnt > 0) {
4145
+ !opts.hideCnt && notify.children('.elfinder-notify-cnt').text('('+cnt+')');
4146
+ ndialog.is(':hidden') && ndialog.elfinderdialog('open');
4147
+ notify.data('cnt', cnt);
4148
+
4149
+ if ((progress != null)
4150
+ && (total = notify.data('total')) >= 0
4151
+ && (prc = notify.data('progress')) >= 0) {
4152
+
4153
+ total += size != null? size : delta;
4154
+ prc += progress;
4155
+ (size == null && delta < 0) && (prc += delta * 100);
4156
+ notify.data({progress : prc, total : total});
4157
+ if (size != null) {
4158
+ prc *= 100;
4159
+ total = Math.max(1, total);
4160
+ }
4161
+ progress = parseInt(prc/total);
4162
+
4163
+ notify.find('.elfinder-notify-progress')
4164
+ .animate({
4165
+ width : (progress < 100 ? progress : 100)+'%'
4166
+ }, 20);
4167
+ }
4168
+
4169
+ } else {
4170
+ notify.remove();
4171
+ !ndialog.children().length && ndialog.elfinderdialog('close');
4172
+ }
4173
+
4174
+ return this;
4175
+ },
4176
+
4177
+ /**
4178
+ * Open confirmation dialog
4179
+ *
4180
+ * @param Object options
4181
+ * @example
4182
+ * this.confirm({
4183
+ * title : 'Remove files',
4184
+ * text : 'Here is question text',
4185
+ * accept : { // accept callback - required
4186
+ * label : 'Continue',
4187
+ * callback : function(applyToAll) { fm.log('Ok') }
4188
+ * },
4189
+ * cancel : { // cancel callback - required
4190
+ * label : 'Cancel',
4191
+ * callback : function() { fm.log('Cancel')}
4192
+ * },
4193
+ * reject : { // reject callback - optionally
4194
+ * label : 'No',
4195
+ * callback : function(applyToAll) { fm.log('No')}
4196
+ * },
4197
+ * buttons : [ // additional buttons callback - optionally
4198
+ * {
4199
+ * label : 'Btn1',
4200
+ * callback : function(applyToAll) { fm.log('Btn1')}
4201
+ * }
4202
+ * ],
4203
+ * all : true // display checkbox "Apply to all"
4204
+ * })
4205
+ * @return elFinder
4206
+ */
4207
+ confirm : function(opts) {
4208
+ var self = this,
4209
+ complete = false,
4210
+ options = {
4211
+ cssClass : 'elfinder-dialog-confirm',
4212
+ modal : true,
4213
+ resizable : false,
4214
+ title : this.i18n(opts.title || 'confirmReq'),
4215
+ buttons : {},
4216
+ close : function() {
4217
+ !complete && opts.cancel.callback();
4218
+ $(this).elfinderdialog('destroy');
4219
+ }
4220
+ },
4221
+ apply = this.i18n('apllyAll'),
4222
+ label, checkbox;
4223
+
4224
+
4225
+ options.buttons[this.i18n(opts.accept.label)] = function() {
4226
+ opts.accept.callback(!!(checkbox && checkbox.prop('checked')))
4227
+ complete = true;
4228
+ $(this).elfinderdialog('close')
4229
+ };
4230
+
4231
+ if (opts.reject) {
4232
+ options.buttons[this.i18n(opts.reject.label)] = function() {
4233
+ opts.reject.callback(!!(checkbox && checkbox.prop('checked')))
4234
+ complete = true;
4235
+ $(this).elfinderdialog('close')
4236
+ };
4237
+ }
4238
+
4239
+ if (opts.buttons && opts.buttons.length > 0) {
4240
+ $.each(opts.buttons, function(i, v){
4241
+ options.buttons[self.i18n(v.label)] = function() {
4242
+ v.callback(!!(checkbox && checkbox.prop('checked')))
4243
+ complete = true;
4244
+ $(this).elfinderdialog('close');
4245
+ };
4246
+ });
4247
+ }
4248
+
4249
+ options.buttons[this.i18n(opts.cancel.label)] = function() {
4250
+ $(this).elfinderdialog('close')
4251
+ };
4252
+
4253
+ if (opts.all) {
4254
+ if (opts.reject) {
4255
+ options.width = 370;
4256
+ }
4257
+ options.create = function() {
4258
+ checkbox = $('<input type="checkbox" />');
4259
+ $(this).next().children().before($('<label>'+apply+'</label>').prepend(checkbox));
4260
+ }
4261
+
4262
+ options.open = function() {
4263
+ var pane = $(this).next(),
4264
+ width = parseInt(pane.children(':first').outerWidth() + pane.children(':last').outerWidth());
4265
+
4266
+ if (width > parseInt(pane.width())) {
4267
+ $(this).closest('.elfinder-dialog').width(width+30);
4268
+ }
4269
+ }
4270
+ }
4271
+
4272
+ return this.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-confirm"/>' + this.i18n(opts.text), options);
4273
+ },
4274
+
4275
+ /**
4276
+ * Create unique file name in required dir
4277
+ *
4278
+ * @param String file name
4279
+ * @param String parent dir hash
4280
+ * @param String glue
4281
+ * @return String
4282
+ */
4283
+ uniqueName : function(prefix, phash, glue) {
4284
+ var i = 0, ext = '', p, name;
4285
+
4286
+ prefix = this.i18n(prefix);
4287
+ phash = phash || this.cwd().hash;
4288
+ glue = (typeof glue === 'undefined')? ' ' : glue;
4289
+
4290
+ if (p = prefix.match(/^(.+)(\.[^.]+)$/)) {
4291
+ ext = p[2];
4292
+ prefix = p[1];
4293
+ }
4294
+
4295
+ name = prefix+ext;
4296
+
4297
+ if (!this.fileByName(name, phash)) {
4298
+ return name;
4299
+ }
4300
+ while (i < 10000) {
4301
+ name = prefix + glue + (++i) + ext;
4302
+ if (!this.fileByName(name, phash)) {
4303
+ return name;
4304
+ }
4305
+ }
4306
+ return prefix + Math.random() + ext;
4307
+ },
4308
+
4309
+ /**
4310
+ * Return message translated onto current language
4311
+ * Allowed accept HTML element that was wrapped in jQuery object
4312
+ * To be careful to XSS vulnerability of HTML element Ex. You should use `fm.escape(file.name)`
4313
+ *
4314
+ * @param String|Array message[s]|Object jQuery
4315
+ * @return String
4316
+ **/
4317
+ i18n : function() {
4318
+ var self = this,
4319
+ messages = this.messages,
4320
+ input = [],
4321
+ ignore = [],
4322
+ message = function(m) {
4323
+ var file;
4324
+ if (m.indexOf('#') === 0) {
4325
+ if ((file = self.file(m.substr(1)))) {
4326
+ return file.name;
4327
+ }
4328
+ }
4329
+ return m;
4330
+ },
4331
+ i, j, m;
4332
+
4333
+ for (i = 0; i< arguments.length; i++) {
4334
+ m = arguments[i];
4335
+
4336
+ if (typeof m == 'string') {
4337
+ input.push(message(m));
4338
+ } else if ($.isArray(m)) {
4339
+ for (j = 0; j < m.length; j++) {
4340
+ if (typeof m[j] == 'string') {
4341
+ input.push(message(m[j]));
4342
+ } else if (m[j] instanceof jQuery) {
4343
+ // jQuery object is HTML element
4344
+ input.push(m[j]);
4345
+ }
4346
+ }
4347
+ } else if (m instanceof jQuery) {
4348
+ // jQuery object is HTML element
4349
+ input.push(m[j]);
4350
+ }
4351
+ }
4352
+
4353
+ for (i = 0; i < input.length; i++) {
4354
+ // dont translate placeholders
4355
+ if ($.inArray(i, ignore) !== -1) {
4356
+ continue;
4357
+ }
4358
+ m = input[i];
4359
+ if (typeof m == 'string') {
4360
+ // translate message
4361
+ m = messages[m] || self.escape(m);
4362
+ // replace placeholders in message
4363
+ m = m.replace(/\$(\d+)/g, function(match, placeholder) {
4364
+ placeholder = i + parseInt(placeholder);
4365
+ if (placeholder > 0 && input[placeholder]) {
4366
+ ignore.push(placeholder)
4367
+ }
4368
+ return self.escape(input[placeholder]) || '';
4369
+ });
4370
+ } else {
4371
+ // get HTML from jQuery object
4372
+ m = m.get(0).outerHTML;
4373
+ }
4374
+
4375
+ input[i] = m;
4376
+ }
4377
+
4378
+ return $.map(input, function(m, i) { return $.inArray(i, ignore) === -1 ? m : null; }).join('<br>');
4379
+ },
4380
+
4381
+ /**
4382
+ * Convert mimetype into css classes
4383
+ *
4384
+ * @param String file mimetype
4385
+ * @return String
4386
+ */
4387
+ mime2class : function(mime) {
4388
+ var prefix = 'elfinder-cwd-icon-';
4389
+
4390
+ mime = mime.split('/');
4391
+
4392
+ return prefix+mime[0]+(mime[0] != 'image' && mime[1] ? ' '+prefix+mime[1].replace(/(\.|\+)/g, '-') : '');
4393
+ },
4394
+
4395
+ /**
4396
+ * Return localized kind of file
4397
+ *
4398
+ * @param Object|String file or file mimetype
4399
+ * @return String
4400
+ */
4401
+ mime2kind : function(f) {
4402
+ var mime = typeof(f) == 'object' ? f.mime : f, kind;
4403
+
4404
+ if (f.alias && f.mime != 'symlink-broken') {
4405
+ kind = 'Alias';
4406
+ } else if (this.kinds[mime]) {
4407
+ kind = this.kinds[mime];
4408
+ } else {
4409
+ if (mime.indexOf('text') === 0) {
4410
+ kind = 'Text';
4411
+ } else if (mime.indexOf('image') === 0) {
4412
+ kind = 'Image';
4413
+ } else if (mime.indexOf('audio') === 0) {
4414
+ kind = 'Audio';
4415
+ } else if (mime.indexOf('video') === 0) {
4416
+ kind = 'Video';
4417
+ } else if (mime.indexOf('application') === 0) {
4418
+ kind = 'App';
4419
+ } else {
4420
+ kind = mime;
4421
+ }
4422
+ }
4423
+
4424
+ return this.messages['kind'+kind] ? this.i18n('kind'+kind) : mime;
4425
+ },
4426
+
4427
+ /**
4428
+ * Return localized date
4429
+ *
4430
+ * @param Object file object
4431
+ * @return String
4432
+ */
4433
+ formatDate : function(file, ts) {
4434
+ var self = this,
4435
+ ts = ts || file.ts,
4436
+ i18 = self.i18,
4437
+ date, format, output, d, dw, m, y, h, g, i, s;
4438
+
4439
+ if (self.options.clientFormatDate && ts > 0) {
4440
+
4441
+ date = new Date(ts*1000);
4442
+
4443
+ h = date[self.getHours]();
4444
+ g = h > 12 ? h - 12 : h;
4445
+ i = date[self.getMinutes]();
4446
+ s = date[self.getSeconds]();
4447
+ d = date[self.getDate]();
4448
+ dw = date[self.getDay]();
4449
+ m = date[self.getMonth]() + 1;
4450
+ y = date[self.getFullYear]();
4451
+
4452
+ format = ts >= this.yesterday
4453
+ ? this.fancyFormat
4454
+ : this.dateFormat;
4455
+
4456
+ output = format.replace(/[a-z]/gi, function(val) {
4457
+ switch (val) {
4458
+ case 'd': return d > 9 ? d : '0'+d;
4459
+ case 'j': return d;
4460
+ case 'D': return self.i18n(i18.daysShort[dw]);
4461
+ case 'l': return self.i18n(i18.days[dw]);
4462
+ case 'm': return m > 9 ? m : '0'+m;
4463
+ case 'n': return m;
4464
+ case 'M': return self.i18n(i18.monthsShort[m-1]);
4465
+ case 'F': return self.i18n(i18.months[m-1]);
4466
+ case 'Y': return y;
4467
+ case 'y': return (''+y).substr(2);
4468
+ case 'H': return h > 9 ? h : '0'+h;
4469
+ case 'G': return h;
4470
+ case 'g': return g;
4471
+ case 'h': return g > 9 ? g : '0'+g;
4472
+ case 'a': return h > 12 ? 'pm' : 'am';
4473
+ case 'A': return h > 12 ? 'PM' : 'AM';
4474
+ case 'i': return i > 9 ? i : '0'+i;
4475
+ case 's': return s > 9 ? s : '0'+s;
4476
+ }
4477
+ return val;
4478
+ });
4479
+
4480
+ return ts >= this.yesterday
4481
+ ? output.replace('$1', this.i18n(ts >= this.today ? 'Today' : 'Yesterday'))
4482
+ : output;
4483
+ } else if (file.date) {
4484
+ return file.date.replace(/([a-z]+)\s/i, function(a1, a2) { return self.i18n(a2)+' '; });
4485
+ }
4486
+
4487
+ return self.i18n('dateUnknown');
4488
+ },
4489
+
4490
+ /**
4491
+ * Return css class marks file permissions
4492
+ *
4493
+ * @param Object file
4494
+ * @return String
4495
+ */
4496
+ perms2class : function(o) {
4497
+ var c = '';
4498
+
4499
+ if (!o.read && !o.write) {
4500
+ c = 'elfinder-na';
4501
+ } else if (!o.read) {
4502
+ c = 'elfinder-wo';
4503
+ } else if (!o.write) {
4504
+ c = 'elfinder-ro';
4505
+ }
4506
+ return c;
4507
+ },
4508
+
4509
+ /**
4510
+ * Return localized string with file permissions
4511
+ *
4512
+ * @param Object file
4513
+ * @return String
4514
+ */
4515
+ formatPermissions : function(f) {
4516
+ var p = [];
4517
+
4518
+ f.read && p.push(this.i18n('read'));
4519
+ f.write && p.push(this.i18n('write'));
4520
+
4521
+ return p.length ? p.join(' '+this.i18n('and')+' ') : this.i18n('noaccess');
4522
+ },
4523
+
4524
+ /**
4525
+ * Return formated file size
4526
+ *
4527
+ * @param Number file size
4528
+ * @return String
4529
+ */
4530
+ formatSize : function(s) {
4531
+ var n = 1, u = 'b';
4532
+
4533
+ if (s == 'unknown') {
4534
+ return this.i18n('unknown');
4535
+ }
4536
+
4537
+ if (s > 1073741824) {
4538
+ n = 1073741824;
4539
+ u = 'GB';
4540
+ } else if (s > 1048576) {
4541
+ n = 1048576;
4542
+ u = 'MB';
4543
+ } else if (s > 1024) {
4544
+ n = 1024;
4545
+ u = 'KB';
4546
+ }
4547
+ s = s/n;
4548
+ return (s > 0 ? n >= 1048576 ? s.toFixed(2) : Math.round(s) : 0) +' '+u;
4549
+ },
4550
+
4551
+ /**
4552
+ * Return formated file mode by options.fileModeStyle
4553
+ *
4554
+ * @param String file mode
4555
+ * @param String format style
4556
+ * @return String
4557
+ */
4558
+ formatFileMode : function(p, style) {
4559
+ var i, o, s, b, sticy, suid, sgid, str, oct;
4560
+
4561
+ if (!style) {
4562
+ style = this.options.fileModeStyle.toLowerCase();
4563
+ }
4564
+ p = $.trim(p);
4565
+ if (p.match(/[rwxs-]{9}$/i)) {
4566
+ str = p = p.substr(-9);
4567
+ if (style == 'string') {
4568
+ return str;;
4569
+ }
4570
+ oct = '';
4571
+ s = 0;
4572
+ for (i=0; i<7; i=i+3) {
4573
+ o = p.substr(i, 3);
4574
+ b = 0;
4575
+ if (o.match(/[r]/i)) {
4576
+ b += 4;
4577
+ }
4578
+ if (o.match(/[w]/i)) {
4579
+ b += 2;
4580
+ }
4581
+ if (o.match(/[xs]/i)) {
4582
+ if (o.match(/[xs]/)) {
4583
+ b += 1;
4584
+ }
4585
+ if (o.match(/[s]/i)) {
4586
+ if (i == 0) {
4587
+ s += 4;
4588
+ } else if (i == 3) {
4589
+ s += 2;
4590
+ }
4591
+ }
4592
+ }
4593
+ oct += b.toString(8);
4594
+ }
4595
+ if (s) {
4596
+ oct = s.toString(8) + oct;
4597
+ }
4598
+ } else {
4599
+ p = parseInt(p, 8);
4600
+ oct = p? p.toString(8) : '';
4601
+ if (!p || style == 'octal') {
4602
+ return oct;
4603
+ }
4604
+ o = p.toString(8);
4605
+ s = 0;
4606
+ if (o.length > 3) {
4607
+ o = o.substr(-4);
4608
+ s = parseInt(o.substr(0, 1), 8);
4609
+ o = o.substr(1);
4610
+ }
4611
+ sticy = ((s & 1) == 1); // not support
4612
+ sgid = ((s & 2) == 2);
4613
+ suid = ((s & 4) == 4);
4614
+ str = '';
4615
+ for(i=0; i<3; i++) {
4616
+ if ((parseInt(o.substr(i, 1), 8) & 4) == 4) {
4617
+ str += 'r';
4618
+ } else {
4619
+ str += '-';
4620
+ }
4621
+ if ((parseInt(o.substr(i, 1), 8) & 2) == 2) {
4622
+ str += 'w';
4623
+ } else {
4624
+ str += '-';
4625
+ }
4626
+ if ((parseInt(o.substr(i, 1), 8) & 1) == 1) {
4627
+ str += ((i==0 && suid)||(i==1 && sgid))? 's' : 'x';
4628
+ } else {
4629
+ str += '-';
4630
+ }
4631
+ }
4632
+ }
4633
+ if (style == 'both') {
4634
+ return str + ' (' + oct + ')';
4635
+ } else if (style == 'string') {
4636
+ return str;
4637
+ } else {
4638
+ return oct;
4639
+ }
4640
+ },
4641
+
4642
+ navHash2Id : function(hash) {
4643
+ return this.navPrefix + hash;
4644
+ },
4645
+
4646
+ navId2Hash : function(id) {
4647
+ return typeof(id) == 'string' ? id.substr(this.navPrefix.length) : false;
4648
+ },
4649
+
4650
+ cwdHash2Id : function(hash) {
4651
+ return this.cwdPrefix + hash;
4652
+ },
4653
+
4654
+ cwdId2Hash : function(id) {
4655
+ return typeof(id) == 'string' ? id.substr(this.cwdPrefix.length) : false;
4656
+ },
4657
+
4658
+ log : function(m) { window.console && window.console.log && window.console.log(m); return this; },
4659
+
4660
+ debug : function(type, m) {
4661
+ var d = this.options.debug;
4662
+
4663
+ if (d == 'all' || d === true || ($.isArray(d) && $.inArray(type, d) != -1)) {
4664
+ window.console && window.console.log && window.console.log('elfinder debug: ['+type+'] ['+this.id+']', m);
4665
+ }
4666
+ return this;
4667
+ },
4668
+ time : function(l) { window.console && window.console.time && window.console.time(l); },
4669
+ timeEnd : function(l) { window.console && window.console.timeEnd && window.console.timeEnd(l); }
4670
+
4671
+
4672
+ }
4673
+
4674
+ /**
4675
+ * for conpat ex. ie8...
4676
+ *
4677
+ * Object.keys() - JavaScript | MDN
4678
+ * https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
4679
+ */
4680
+ if (!Object.keys) {
4681
+ Object.keys = (function () {
4682
+ var hasOwnProperty = Object.prototype.hasOwnProperty,
4683
+ hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
4684
+ dontEnums = [
4685
+ 'toString',
4686
+ 'toLocaleString',
4687
+ 'valueOf',
4688
+ 'hasOwnProperty',
4689
+ 'isPrototypeOf',
4690
+ 'propertyIsEnumerable',
4691
+ 'constructor'
4692
+ ],
4693
+ dontEnumsLength = dontEnums.length
4694
+
4695
+ return function (obj) {
4696
+ if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object')
4697
+
4698
+ var result = []
4699
+
4700
+ for (var prop in obj) {
4701
+ if (hasOwnProperty.call(obj, prop)) result.push(prop)
4702
+ }
4703
+
4704
+ if (hasDontEnumBug) {
4705
+ for (var i=0; i < dontEnumsLength; i++) {
4706
+ if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i])
4707
+ }
4708
+ }
4709
+ return result
4710
+ }
4711
+ })()
4712
+ };
4713
+
4714
+
4715
+ /*
4716
+ * File: /js/elFinder.version.js
4717
+ */
4718
+
4719
+ /**
4720
+ * Application version
4721
+ *
4722
+ * @type String
4723
+ **/
4724
+ elFinder.prototype.version = '2.1.6';
4725
+
4726
+
4727
+
4728
+ /*
4729
+ * File: /js/jquery.elfinder.js
4730
+ */
4731
+
4732
+ /*** jQuery UI droppable performance tune for elFinder ***/
4733
+ (function(){
4734
+ if ($.ui && $.ui.ddmanager) {
4735
+ var origin = $.ui.ddmanager.prepareOffsets;
4736
+ $.ui.ddmanager.prepareOffsets = function( t, event ) {
4737
+ var isOutView = function(elem) {
4738
+ if (elem.is(':hidden')) {
4739
+ return true;
4740
+ }
4741
+ var rect = elem[0].getBoundingClientRect();
4742
+ return document.elementFromPoint(rect.left, rect.top)? false : true;
4743
+ }
4744
+
4745
+ if (event.type === 'mousedown') {
4746
+ var i, d,
4747
+ m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
4748
+ l = m.length;
4749
+ for ( i = 0; i < l; i++ ) {
4750
+ d = m[ i ];
4751
+ if (d.options.autoDisable && (!d.options.disabled || d.options.autoDisable > 1)) {
4752
+ d.options.disabled = isOutView(d.element);
4753
+ d.options.autoDisable = d.options.disabled? 2 : 1;
4754
+ }
4755
+ }
4756
+ }
4757
+
4758
+ // call origin function
4759
+ return origin( t, event );
4760
+ };
4761
+ }
4762
+ })();
4763
+
4764
+ $.fn.elfinder = function(o) {
4765
+
4766
+ if (o == 'instance') {
4767
+ return this.getElFinder();
4768
+ }
4769
+
4770
+ return this.each(function() {
4771
+
4772
+ var cmd = typeof(o) == 'string' ? o : '';
4773
+ if (!this.elfinder) {
4774
+ new elFinder(this, typeof(o) == 'object' ? o : {})
4775
+ }
4776
+
4777
+ switch(cmd) {
4778
+ case 'close':
4779
+ case 'hide':
4780
+ this.elfinder.hide();
4781
+ break;
4782
+
4783
+ case 'open':
4784
+ case 'show':
4785
+ this.elfinder.show();
4786
+ break;
4787
+
4788
+ case'destroy':
4789
+ this.elfinder.destroy();
4790
+ break;
4791
+ }
4792
+
4793
+ })
4794
+ }
4795
+
4796
+ $.fn.getElFinder = function() {
4797
+ var instance;
4798
+
4799
+ this.each(function() {
4800
+ if (this.elfinder) {
4801
+ instance = this.elfinder;
4802
+ return false;
4803
+ }
4804
+ });
4805
+
4806
+ return instance;
4807
+ }
4808
+
4809
+
4810
+ /*
4811
+ * File: /js/elFinder.options.js
4812
+ */
4813
+
4814
+ /**
4815
+ * Default elFinder config
4816
+ *
4817
+ * @type Object
4818
+ * @autor Dmitry (dio) Levashov
4819
+ */
4820
+ elFinder.prototype._options = {
4821
+ /**
4822
+ * Connector url. Required!
4823
+ *
4824
+ * @type String
4825
+ */
4826
+ url : '',
4827
+
4828
+ /**
4829
+ * Ajax request type.
4830
+ *
4831
+ * @type String
4832
+ * @default "get"
4833
+ */
4834
+ requestType : 'get',
4835
+
4836
+ /**
4837
+ * Transport to send request to backend.
4838
+ * Required for future extensions using websockets/webdav etc.
4839
+ * Must be an object with "send" method.
4840
+ * transport.send must return $.Deferred() object
4841
+ *
4842
+ * @type Object
4843
+ * @default null
4844
+ * @example
4845
+ * transport : {
4846
+ * init : function(elfinderInstance) { },
4847
+ * send : function(options) {
4848
+ * var dfrd = $.Deferred();
4849
+ * // connect to backend ...
4850
+ * return dfrd;
4851
+ * },
4852
+ * upload : function(data) {
4853
+ * var dfrd = $.Deferred();
4854
+ * // upload ...
4855
+ * return dfrd;
4856
+ * }
4857
+ *
4858
+ * }
4859
+ **/
4860
+ transport : {},
4861
+
4862
+ /**
4863
+ * URL to upload file to.
4864
+ * If not set - connector URL will be used
4865
+ *
4866
+ * @type String
4867
+ * @default ''
4868
+ */
4869
+ urlUpload : '',
4870
+
4871
+ /**
4872
+ * Allow to drag and drop to upload files
4873
+ *
4874
+ * @type Boolean|String
4875
+ * @default 'auto'
4876
+ */
4877
+ dragUploadAllow : 'auto',
4878
+
4879
+ /**
4880
+ * Max size of chunked data of file upload
4881
+ *
4882
+ * @type Number
4883
+ * @default 10485760(10MB)
4884
+ */
4885
+ uploadMaxChunkSize : 10485760,
4886
+
4887
+ /**
4888
+ * Timeout for upload using iframe
4889
+ *
4890
+ * @type Number
4891
+ * @default 0 - no timeout
4892
+ */
4893
+ iframeTimeout : 0,
4894
+
4895
+ /**
4896
+ * Data to append to all requests and to upload files
4897
+ *
4898
+ * @type Object
4899
+ * @default {}
4900
+ */
4901
+ customData : {},
4902
+
4903
+ /**
4904
+ * Event listeners to bind on elFinder init
4905
+ *
4906
+ * @type Object
4907
+ * @default {}
4908
+ */
4909
+ handlers : {},
4910
+
4911
+ /**
4912
+ * Any custom headers to send across every ajax request
4913
+ *
4914
+ * @type Object
4915
+ * @default {}
4916
+ */
4917
+ customHeaders : {},
4918
+
4919
+ /**
4920
+ * Any custom xhrFields to send across every ajax request
4921
+ *
4922
+ * @type Object
4923
+ * @default {}
4924
+ */
4925
+ xhrFields : {},
4926
+
4927
+ /**
4928
+ * Interface language
4929
+ *
4930
+ * @type String
4931
+ * @default "en"
4932
+ */
4933
+ lang : 'en',
4934
+
4935
+ /**
4936
+ * Additional css class for filemanager node.
4937
+ *
4938
+ * @type String
4939
+ */
4940
+ cssClass : '',
4941
+
4942
+ /**
4943
+ * Active commands list
4944
+ * If some required commands will be missed here, elFinder will add its
4945
+ *
4946
+ * @type Array
4947
+ */
4948
+ commands : [
4949
+ 'open', 'opendir', 'reload', 'home', 'up', 'back', 'forward', 'getfile', 'quicklook',
4950
+ 'download', 'rm', 'duplicate', 'rename', 'mkdir', 'mkfile', 'upload', 'copy',
4951
+ 'cut', 'paste', 'edit', 'extract', 'archive', 'search', 'info', 'view', 'help',
4952
+ 'resize', 'sort', 'netmount', 'netunmount', 'places', 'chmod'
4953
+ ],
4954
+
4955
+ /**
4956
+ * Commands options.
4957
+ *
4958
+ * @type Object
4959
+ **/
4960
+ commandsOptions : {
4961
+ // // configure shortcuts of any command
4962
+ // // add `shortcuts` property into each command
4963
+ // any_command_name : {
4964
+ // shortcuts : [] // for disable this command's shortcuts
4965
+ // },
4966
+ // any_command_name : {
4967
+ // shortcuts : function(fm, shortcuts) {
4968
+ // // for add `CTRL + E` for this command action
4969
+ // shortcuts[0]['pattern'] += ' ctrl+e';
4970
+ // return shortcuts;
4971
+ // }
4972
+ // },
4973
+ // any_command_name : {
4974
+ // shortcuts : function(fm, shortcuts) {
4975
+ // // for full customize of this command's shortcuts
4976
+ // return [ { pattern: 'ctrl+e ctrl+down numpad_enter' + (fm.OS != 'mac' && ' enter') } ];
4977
+ // }
4978
+ // },
4979
+ // "getfile" command options.
4980
+ getfile : {
4981
+ onlyURL : false,
4982
+ // allow to return multiple files info
4983
+ multiple : false,
4984
+ // allow to return filers info
4985
+ folders : false,
4986
+ // action after callback (""/"close"/"destroy")
4987
+ oncomplete : ''
4988
+ },
4989
+ // "upload" command options.
4990
+ upload : {
4991
+ ui : 'uploadbutton'
4992
+ },
4993
+ // "quicklook" command options.
4994
+ quicklook : {
4995
+ autoplay : true,
4996
+ jplayer : 'extensions/jplayer'
4997
+ },
4998
+ // "quicklook" command options.
4999
+ edit : {
5000
+ // list of allowed mimetypes to edit
5001
+ // if empty - any text files can be edited
5002
+ mimes : [],
5003
+ // edit files in wysisyg's
5004
+ editors : [
5005
+ // {
5006
+ // /**
5007
+ // * files mimetypes allowed to edit in current wysisyg
5008
+ // * @type Array
5009
+ // */
5010
+ // mimes : ['text/html'],
5011
+ // /**
5012
+ // * Called when "edit" dialog loaded.
5013
+ // * Place to init wysisyg.
5014
+ // * Can return wysisyg instance
5015
+ // *
5016
+ // * @param DOMElement textarea node
5017
+ // * @return Object
5018
+ // */
5019
+ // load : function(textarea) { },
5020
+ // /**
5021
+ // * Called before "edit" dialog closed.
5022
+ // * Place to destroy wysisyg instance.
5023
+ // *
5024
+ // * @param DOMElement textarea node
5025
+ // * @param Object wysisyg instance (if was returned by "load" callback)
5026
+ // * @return void
5027
+ // */
5028
+ // close : function(textarea, instance) { },
5029
+ // /**
5030
+ // * Called before file content send to backend.
5031
+ // * Place to update textarea content if needed.
5032
+ // *
5033
+ // * @param DOMElement textarea node
5034
+ // * @param Object wysisyg instance (if was returned by "load" callback)
5035
+ // * @return void
5036
+ // */
5037
+ // save : function(textarea, instance) {},
5038
+ // /**
5039
+ // * Called after load() or save().
5040
+ // * Set focus to wysisyg editor.
5041
+ // *
5042
+ // * @param DOMElement textarea node
5043
+ // * @param Object wysisyg instance (if was returned by "load" callback)
5044
+ // * @return void
5045
+ // */
5046
+ // focus : function(textarea, instance) {}
5047
+ //
5048
+ // }
5049
+ ]
5050
+ },
5051
+ // "info" command options.
5052
+ info : {
5053
+ nullUrlDirLinkSelf : true,
5054
+ custom : {
5055
+ // /**
5056
+ // * Example of custom info `desc`
5057
+ // */
5058
+ // desc : {
5059
+ // /**
5060
+ // * Lable (require)
5061
+ // * It is filtered by the `fm.i18n()`
5062
+ // *
5063
+ // * @type String
5064
+ // */
5065
+ // label : 'Description',
5066
+ //
5067
+ // /**
5068
+ // * Template (require)
5069
+ // * `{id}` is replaced in dialog.id
5070
+ // *
5071
+ // * @type String
5072
+ // */
5073
+ // tpl : '<div class="elfinder-info-desc"><span class="elfinder-info-spinner"></span></div>',
5074
+ //
5075
+ // /**
5076
+ // * Restricts to mimetypes (optional)
5077
+ // * Exact match or category match
5078
+ // *
5079
+ // * @type Array
5080
+ // */
5081
+ // mimes : ['text', 'image/jpeg', 'directory'],
5082
+ //
5083
+ // /**
5084
+ // * Restricts to file.hash (optional)
5085
+ // *
5086
+ // * @ type Regex
5087
+ // */
5088
+ // hashRegex : /^l\d+_/,
5089
+ //
5090
+ // /**
5091
+ // * Request that asks for the description and sets the field (optional)
5092
+ // *
5093
+ // * @type Function
5094
+ // */
5095
+ // action : function(file, fm, dialog) {
5096
+ // fm.request({
5097
+ // data : { cmd : 'desc', target: file.hash },
5098
+ // preventDefault: true,
5099
+ // })
5100
+ // .fail(function() {
5101
+ // dialog.find('div.elfinder-info-desc').html(fm.i18n('unknown'));
5102
+ // })
5103
+ // .done(function(data) {
5104
+ // dialog.find('div.elfinder-info-desc').html(data.desc);
5105
+ // });
5106
+ // }
5107
+ // }
5108
+ }
5109
+ },
5110
+
5111
+ netmount: {
5112
+ ftp: {
5113
+ inputs: {
5114
+ host : $('<input type="text"/>'),
5115
+ port : $('<input type="text" placeholder="21"/>'),
5116
+ path : $('<input type="text" value="/"/>'),
5117
+ user : $('<input type="text"/>'),
5118
+ pass : $('<input type="password"/>'),
5119
+ encoding : $('<input type="text" placeholder="Optional"/>'),
5120
+ locale : $('<input type="text" placeholder="Optional"/>')
5121
+ }
5122
+ },
5123
+ dropbox: {
5124
+ inputs: {
5125
+ host : $('<span><span class="elfinder-info-spinner"/></span></span><input type="hidden"/>'),
5126
+ path : $('<input type="text" value="/"/>'),
5127
+ user : $('<input type="hidden"/>'),
5128
+ pass : $('<input type="hidden"/>')
5129
+ },
5130
+ select: function(fm){
5131
+ var self = this;
5132
+ if (self.inputs.host.find('span').length) {
5133
+ fm.request({
5134
+ data : {cmd : 'netmount', protocol: 'dropbox', host: 'dropbox.com', user: 'init', pass: 'init', options: {url: fm.uploadURL, id: fm.id}},
5135
+ preventDefault : true
5136
+ }).done(function(data){
5137
+ self.inputs.host.find('span').removeClass("elfinder-info-spinner");
5138
+ self.inputs.host.find('span').html(data.body.replace(/\{msg:([^}]+)\}/g, function(whole,s1){return fm.i18n(s1,'Dropbox.com');}));
5139
+ }).fail(function(){});
5140
+ }
5141
+ },
5142
+ done: function(fm, data){
5143
+ var self = this;
5144
+ if (data.mode == 'makebtn') {
5145
+ self.inputs.host.find('span').removeClass("elfinder-info-spinner");
5146
+ self.inputs.host.find('input').hover(function(){$(this).toggleClass("ui-state-hover");});
5147
+ self.inputs.host[1].value = "";
5148
+ } else {
5149
+ self.inputs.host.find('span').removeClass("elfinder-info-spinner");
5150
+ self.inputs.host.find('span').html("Dropbox.com");
5151
+ self.inputs.host[1].value = "dropbox";
5152
+ self.inputs.user.val("done");
5153
+ self.inputs.pass.val("done");
5154
+ }
5155
+ }
5156
+ }
5157
+ },
5158
+
5159
+ help : {view : ['about', 'shortcuts', 'help']}
5160
+ },
5161
+
5162
+ /**
5163
+ * Callback for "getfile" commands.
5164
+ * Required to use elFinder with WYSIWYG editors etc..
5165
+ *
5166
+ * @type Function
5167
+ * @default null (command not active)
5168
+ */
5169
+ getFileCallback : null,
5170
+
5171
+ /**
5172
+ * Default directory view. icons/list
5173
+ *
5174
+ * @type String
5175
+ * @default "icons"
5176
+ */
5177
+ defaultView : 'icons',
5178
+
5179
+ /**
5180
+ * Hash of default directory path to open
5181
+ *
5182
+ * @type String
5183
+ * @default ""
5184
+ */
5185
+ startPathHash : '',
5186
+
5187
+ /**
5188
+ * UI plugins to load.
5189
+ * Current dir ui and dialogs loads always.
5190
+ * Here set not required plugins as folders tree/toolbar/statusbar etc.
5191
+ *
5192
+ * @type Array
5193
+ * @default ['toolbar', 'tree', 'path', 'stat']
5194
+ * @full ['toolbar', 'places', 'tree', 'path', 'stat']
5195
+ */
5196
+ ui : ['toolbar', 'tree', 'path', 'stat'],
5197
+
5198
+ /**
5199
+ * Some UI plugins options.
5200
+ * @type Object
5201
+ */
5202
+ uiOptions : {
5203
+ // toolbar configuration
5204
+ toolbar : [
5205
+ ['back', 'forward'],
5206
+ ['netmount'],
5207
+ // ['reload'],
5208
+ // ['home', 'up'],
5209
+ ['mkdir', 'mkfile', 'upload'],
5210
+ ['open', 'download', 'getfile'],
5211
+ ['info', 'chmod'],
5212
+ ['quicklook'],
5213
+ ['copy', 'cut', 'paste'],
5214
+ ['rm'],
5215
+ ['duplicate', 'rename', 'edit', 'resize'],
5216
+ ['extract', 'archive'],
5217
+ ['search'],
5218
+ ['view', 'sort'],
5219
+ ['help']
5220
+ ],
5221
+ // directories tree options
5222
+ tree : {
5223
+ // expand current root on init
5224
+ openRootOnLoad : true,
5225
+ // expand current work directory on open
5226
+ openCwdOnOpen : true,
5227
+ // auto load current dir parents
5228
+ syncTree : true
5229
+ // ,
5230
+ // /**
5231
+ // * Add CSS class name to navbar directories (optional)
5232
+ // * see: https://github.com/Studio-42/elFinder/pull/1061
5233
+ // *
5234
+ // * @type Function
5235
+ // */
5236
+ // getClass: function(dir) {
5237
+ // // ex. This adds the directory's name (lowercase) with prefix as a CSS class
5238
+ // return 'elfinder-tree-' + dir.name.replace(/[ "]/g, '').toLowerCase();
5239
+ // }
5240
+ },
5241
+ // navbar options
5242
+ navbar : {
5243
+ minWidth : 150,
5244
+ maxWidth : 500
5245
+ },
5246
+ cwd : {
5247
+ // display parent folder with ".." name :)
5248
+ oldSchool : false,
5249
+
5250
+ // file info columns displayed
5251
+ listView : {
5252
+ // name is always displayed, cols are ordered
5253
+ // ex. ['perm', 'date', 'size', 'kind', 'owner', 'group', 'mode']
5254
+ // mode: 'mode'(by `fileModeStyle` setting), 'modestr'(rwxr-xr-x) , 'modeoct'(755), 'modeboth'(rwxr-xr-x (755))
5255
+ // 'owner', 'group' and 'mode', It's necessary set volume driver option "statOwner" to `true`
5256
+ columns : ['perm', 'date', 'size', 'kind'],
5257
+ // override this if you want custom columns name
5258
+ // example
5259
+ // columnsCustomName : {
5260
+ // date : 'Last modification',
5261
+ // kind : 'Mime type'
5262
+ // }
5263
+ columnsCustomName : {}
5264
+
5265
+ }
5266
+ }
5267
+ },
5268
+
5269
+ /**
5270
+ * Display only required files by types
5271
+ *
5272
+ * @type Array
5273
+ * @default []
5274
+ * @example
5275
+ * onlyMimes : ["image"] - display all images
5276
+ * onlyMimes : ["image/png", "application/x-shockwave-flash"] - display png and flash
5277
+ */
5278
+ onlyMimes : [],
5279
+
5280
+ /**
5281
+ * Custom files sort rules.
5282
+ * All default rules (name/size/kind/date) set in elFinder._sortRules
5283
+ *
5284
+ * @type {Object}
5285
+ * @example
5286
+ * sortRules : {
5287
+ * name : function(file1, file2) { return file1.name.toLowerCase().localeCompare(file2.name.toLowerCase()); }
5288
+ * }
5289
+ */
5290
+ sortRules : {},
5291
+
5292
+ /**
5293
+ * Default sort type.
5294
+ *
5295
+ * @type {String}
5296
+ */
5297
+ sortType : 'name',
5298
+
5299
+ /**
5300
+ * Default sort order.
5301
+ *
5302
+ * @type {String}
5303
+ * @default "asc"
5304
+ */
5305
+ sortOrder : 'asc',
5306
+
5307
+ /**
5308
+ * Display folders first?
5309
+ *
5310
+ * @type {Boolean}
5311
+ * @default true
5312
+ */
5313
+ sortStickFolders : true,
5314
+
5315
+ /**
5316
+ * If true - elFinder will formating dates itself,
5317
+ * otherwise - backend date will be used.
5318
+ *
5319
+ * @type Boolean
5320
+ */
5321
+ clientFormatDate : true,
5322
+
5323
+ /**
5324
+ * Show UTC dates.
5325
+ * Required set clientFormatDate to true
5326
+ *
5327
+ * @type Boolean
5328
+ */
5329
+ UTCDate : false,
5330
+
5331
+ /**
5332
+ * File modification datetime format.
5333
+ * Value from selected language data is used by default.
5334
+ * Set format here to overwrite it.
5335
+ *
5336
+ * @type String
5337
+ * @default ""
5338
+ */
5339
+ dateFormat : '',
5340
+
5341
+ /**
5342
+ * File modification datetime format in form "Yesterday 12:23:01".
5343
+ * Value from selected language data is used by default.
5344
+ * Set format here to overwrite it.
5345
+ * Use $1 for "Today"/"Yesterday" placeholder
5346
+ *
5347
+ * @type String
5348
+ * @default ""
5349
+ * @example "$1 H:m:i"
5350
+ */
5351
+ fancyDateFormat : '',
5352
+
5353
+ /**
5354
+ * Style of file mode at cwd-list, info dialog
5355
+ * 'string' (ex. rwxr-xr-x) or 'octal' (ex. 755) or 'both' (ex. rwxr-xr-x (755))
5356
+ *
5357
+ * @type {String}
5358
+ * @default 'both'
5359
+ */
5360
+ fileModeStyle : 'both',
5361
+
5362
+ /**
5363
+ * elFinder width
5364
+ *
5365
+ * @type String|Number
5366
+ * @default "auto"
5367
+ */
5368
+ width : 'auto',
5369
+
5370
+ /**
5371
+ * elFinder height
5372
+ *
5373
+ * @type Number
5374
+ * @default "auto"
5375
+ */
5376
+ height : 400,
5377
+
5378
+ /**
5379
+ * Make elFinder resizable if jquery ui resizable available
5380
+ *
5381
+ * @type Boolean
5382
+ * @default true
5383
+ */
5384
+ resizable : true,
5385
+
5386
+ /**
5387
+ * Timeout before open notifications dialogs
5388
+ *
5389
+ * @type Number
5390
+ * @default 500 (.5 sec)
5391
+ */
5392
+ notifyDelay : 500,
5393
+
5394
+ /**
5395
+ * Position CSS, Width of notifications dialogs
5396
+ *
5397
+ * @type Object
5398
+ * @default {position: {top : '12px', right : '12px'}, width : 280}
5399
+ * position: CSS object | null (null: position center & middle)
5400
+ */
5401
+ notifyDialog : {position: {top : '12px', right : '12px'}, width : 280},
5402
+
5403
+ /**
5404
+ * Allow shortcuts
5405
+ *
5406
+ * @type Boolean
5407
+ * @default true
5408
+ */
5409
+ allowShortcuts : true,
5410
+
5411
+ /**
5412
+ * Remeber last opened dir to open it after reload or in next session
5413
+ *
5414
+ * @type Boolean
5415
+ * @default true
5416
+ */
5417
+ rememberLastDir : true,
5418
+
5419
+ /**
5420
+ * Clear historys(elFinder) on reload(not browser) function
5421
+ * Historys was cleared on Reload function on elFinder 2.0 (value is true)
5422
+ *
5423
+ * @type Boolean
5424
+ * @default false
5425
+ */
5426
+ reloadClearHistory : false,
5427
+
5428
+ /**
5429
+ * Use browser native history with supported browsers
5430
+ *
5431
+ * @type Boolean
5432
+ * @default true
5433
+ */
5434
+ useBrowserHistory : true,
5435
+
5436
+ /**
5437
+ * Lazy load config.
5438
+ * How many files display at once?
5439
+ *
5440
+ * @type Number
5441
+ * @default 50
5442
+ */
5443
+ showFiles : 30,
5444
+
5445
+ /**
5446
+ * Lazy load config.
5447
+ * Distance in px to cwd bottom edge to start display files
5448
+ *
5449
+ * @type Number
5450
+ * @default 50
5451
+ */
5452
+ showThreshold : 50,
5453
+
5454
+ /**
5455
+ * Additional rule to valid new file name.
5456
+ * By default not allowed empty names or '..'
5457
+ * This setting does not have a sense of security.
5458
+ *
5459
+ * @type false|RegExp|function
5460
+ * @default false
5461
+ * @example
5462
+ * disable names with spaces:
5463
+ * validName : /^[^\s]+$/,
5464
+ */
5465
+ validName : false,
5466
+
5467
+ /**
5468
+ * Backup name suffix.
5469
+ *
5470
+ * @type String
5471
+ * @default "~"
5472
+ */
5473
+ backupSuffix : '~',
5474
+
5475
+ /**
5476
+ * Sync content interval
5477
+ *
5478
+ * @type Number
5479
+ * @default 0 (do not sync)
5480
+ */
5481
+ sync : 0,
5482
+
5483
+ /**
5484
+ * Sync start on load if sync value >= 1000
5485
+ *
5486
+ * @type Bool
5487
+ * @default true
5488
+ */
5489
+ syncStart : true,
5490
+
5491
+ /**
5492
+ * How many thumbnails create in one request
5493
+ *
5494
+ * @type Number
5495
+ * @default 5
5496
+ */
5497
+ loadTmbs : 5,
5498
+
5499
+ /**
5500
+ * Cookie option for browsersdoes not suppot localStorage
5501
+ *
5502
+ * @type Object
5503
+ */
5504
+ cookie : {
5505
+ expires : 30,
5506
+ domain : '',
5507
+ path : '/',
5508
+ secure : false
5509
+ },
5510
+
5511
+ /**
5512
+ * Contextmenu config
5513
+ *
5514
+ * @type Object
5515
+ */
5516
+ contextmenu : {
5517
+ // navbarfolder menu
5518
+ navbar : ['open', '|', 'upload', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', '|', 'rename', '|', 'places', 'info', 'chmod', 'netunmount'],
5519
+ // current directory menu
5520
+ cwd : ['reload', 'back', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'sort', '|', 'info'],
5521
+ // current directory file menu
5522
+ files : ['getfile', '|' ,'open', 'opendir', 'quicklook', '|', 'download', 'upload', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', '|', 'edit', 'rename', 'resize', '|', 'archive', 'extract', '|', 'places', 'info', 'chmod']
5523
+ },
5524
+
5525
+ /**
5526
+ * Debug config
5527
+ *
5528
+ * @type Array|Boolean
5529
+ */
5530
+ // debug : true
5531
+ debug : ['error', 'warning', 'event-destroy']
5532
+ }
5533
+
5534
+
5535
+ /*
5536
+ * File: /js/elFinder.history.js
5537
+ */
5538
+
5539
+ /**
5540
+ * @class elFinder.history
5541
+ * Store visited folders
5542
+ * and provide "back" and "forward" methods
5543
+ *
5544
+ * @author Dmitry (dio) Levashov
5545
+ */
5546
+ elFinder.prototype.history = function(fm) {
5547
+ var self = this,
5548
+ /**
5549
+ * Update history on "open" event?
5550
+ *
5551
+ * @type Boolean
5552
+ */
5553
+ update = true,
5554
+ /**
5555
+ * Directories hashes storage
5556
+ *
5557
+ * @type Array
5558
+ */
5559
+ history = [],
5560
+ /**
5561
+ * Current directory index in history
5562
+ *
5563
+ * @type Number
5564
+ */
5565
+ current,
5566
+ /**
5567
+ * Clear history
5568
+ *
5569
+ * @return void
5570
+ */
5571
+ reset = function() {
5572
+ history = [fm.cwd().hash];
5573
+ current = 0;
5574
+ update = true;
5575
+ },
5576
+ /**
5577
+ * Browser native history object
5578
+ */
5579
+ nativeHistory = (fm.options.useBrowserHistory && window.history && window.history.pushState)? window.history : null,
5580
+ /**
5581
+ * Open prev/next folder
5582
+ *
5583
+ * @Boolen open next folder?
5584
+ * @return jQuery.Deferred
5585
+ */
5586
+ go = function(fwd) {
5587
+ if ((fwd && self.canForward()) || (!fwd && self.canBack())) {
5588
+ update = false;
5589
+ return fm.exec('open', history[fwd ? ++current : --current]).fail(reset);
5590
+ }
5591
+ return $.Deferred().reject();
5592
+ };
5593
+
5594
+ /**
5595
+ * Return true if there is previous visited directories
5596
+ *
5597
+ * @return Boolen
5598
+ */
5599
+ this.canBack = function() {
5600
+ return current > 0;
5601
+ }
5602
+
5603
+ /**
5604
+ * Return true if can go forward
5605
+ *
5606
+ * @return Boolen
5607
+ */
5608
+ this.canForward = function() {
5609
+ return current < history.length - 1;
5610
+ }
5611
+
5612
+ /**
5613
+ * Go back
5614
+ *
5615
+ * @return void
5616
+ */
5617
+ this.back = go;
5618
+
5619
+ /**
5620
+ * Go forward
5621
+ *
5622
+ * @return void
5623
+ */
5624
+ this.forward = function() {
5625
+ return go(true);
5626
+ }
5627
+
5628
+ // bind to elfinder events
5629
+ fm.open(function() {
5630
+ var l = history.length,
5631
+ cwd = fm.cwd().hash;
5632
+
5633
+ if (update) {
5634
+ current >= 0 && l > current + 1 && history.splice(current+1);
5635
+ history[history.length-1] != cwd && history.push(cwd);
5636
+ current = history.length - 1;
5637
+ }
5638
+ update = true;
5639
+
5640
+ if (nativeHistory) {
5641
+ if (! nativeHistory.state) {
5642
+ nativeHistory.replaceState({thash: cwd}, null, location.pathname + location.search + '#elf_' + cwd);
5643
+ } else {
5644
+ nativeHistory.state.thash != cwd && nativeHistory.pushState({thash: cwd}, null, location.pathname + location.search + '#elf_' + cwd);
5645
+ }
5646
+ }
5647
+ })
5648
+ .reload(fm.options.reloadClearHistory && reset);
5649
+
5650
+ }
5651
+
5652
+ /*
5653
+ * File: /js/elFinder.command.js
5654
+ */
5655
+
5656
+ /**
5657
+ * elFinder command prototype
5658
+ *
5659
+ * @type elFinder.command
5660
+ * @author Dmitry (dio) Levashov
5661
+ */
5662
+ elFinder.prototype.command = function(fm) {
5663
+
5664
+ /**
5665
+ * elFinder instance
5666
+ *
5667
+ * @type elFinder
5668
+ */
5669
+ this.fm = fm;
5670
+
5671
+ /**
5672
+ * Command name, same as class name
5673
+ *
5674
+ * @type String
5675
+ */
5676
+ this.name = '';
5677
+
5678
+ /**
5679
+ * Short command description
5680
+ *
5681
+ * @type String
5682
+ */
5683
+ this.title = '';
5684
+
5685
+ /**
5686
+ * Current command state
5687
+ *
5688
+ * @example
5689
+ * this.state = -1; // command disabled
5690
+ * this.state = 0; // command enabled
5691
+ * this.state = 1; // command active (for example "fullscreen" command while elfinder in fullscreen mode)
5692
+ * @default -1
5693
+ * @type Number
5694
+ */
5695
+ this.state = -1;
5696
+
5697
+ /**
5698
+ * If true, command can not be disabled by connector.
5699
+ * @see this.update()
5700
+ *
5701
+ * @type Boolen
5702
+ */
5703
+ this.alwaysEnabled = false;
5704
+
5705
+ /**
5706
+ * If true, this means command was disabled by connector.
5707
+ * @see this.update()
5708
+ *
5709
+ * @type Boolen
5710
+ */
5711
+ this._disabled = false;
5712
+
5713
+ this.disableOnSearch = false;
5714
+
5715
+ this.updateOnSelect = true;
5716
+
5717
+ /**
5718
+ * elFinder events defaults handlers.
5719
+ * Inside handlers "this" is current command object
5720
+ *
5721
+ * @type Object
5722
+ */
5723
+ this._handlers = {
5724
+ enable : function() { this.update(void(0), this.value); },
5725
+ disable : function() { this.update(-1, this.value); },
5726
+ 'open reload load' : function() {
5727
+ this._disabled = !(this.alwaysEnabled || this.fm.isCommandEnabled(this.name));
5728
+ this.update(void(0), this.value)
5729
+ this.change();
5730
+ }
5731
+ };
5732
+
5733
+ /**
5734
+ * elFinder events handlers.
5735
+ * Inside handlers "this" is current command object
5736
+ *
5737
+ * @type Object
5738
+ */
5739
+ this.handlers = {}
5740
+
5741
+ /**
5742
+ * Shortcuts
5743
+ *
5744
+ * @type Array
5745
+ */
5746
+ this.shortcuts = [];
5747
+
5748
+ /**
5749
+ * Command options
5750
+ *
5751
+ * @type Object
5752
+ */
5753
+ this.options = {ui : 'button'};
5754
+
5755
+ /**
5756
+ * Prepare object -
5757
+ * bind events and shortcuts
5758
+ *
5759
+ * @return void
5760
+ */
5761
+ this.setup = function(name, opts) {
5762
+ var self = this,
5763
+ fm = this.fm, i, s, sc;
5764
+
5765
+ this.name = name;
5766
+ this.title = fm.messages['cmd'+name] ? fm.i18n('cmd'+name) : name,
5767
+ this.options = $.extend({}, this.options, opts);
5768
+ this.listeners = [];
5769
+
5770
+ if (opts.shortcuts) {
5771
+ if (typeof opts.shortcuts === 'function') {
5772
+ sc = opts.shortcuts(this.fm, this.shortcuts);
5773
+ } else if ($.isArray(opts.shortcuts)) {
5774
+ sc = opts.shortcuts;
5775
+ }
5776
+ this.shortcuts = sc || [];
5777
+ }
5778
+
5779
+ if (this.updateOnSelect) {
5780
+ this._handlers.select = function() { this.update(void(0), this.value); }
5781
+ }
5782
+
5783
+ $.each($.extend({}, self._handlers, self.handlers), function(cmd, handler) {
5784
+ fm.bind(cmd, $.proxy(handler, self));
5785
+ });
5786
+
5787
+ for (i = 0; i < this.shortcuts.length; i++) {
5788
+ s = this.shortcuts[i];
5789
+ s.callback = $.proxy(s.callback || function() { this.exec() }, this);
5790
+ !s.description && (s.description = this.title);
5791
+ fm.shortcut(s);
5792
+ }
5793
+
5794
+ if (this.disableOnSearch) {
5795
+ fm.bind('search searchend', function(e) {
5796
+ self._disabled = e.type == 'search';
5797
+ self.update(void(0), self.value);
5798
+ });
5799
+ }
5800
+
5801
+ this.init();
5802
+ }
5803
+
5804
+ /**
5805
+ * Command specific init stuffs
5806
+ *
5807
+ * @return void
5808
+ */
5809
+ this.init = function() { }
5810
+
5811
+ /**
5812
+ * Exec command
5813
+ *
5814
+ * @param Array target files hashes
5815
+ * @param Array|Object command value
5816
+ * @return $.Deferred
5817
+ */
5818
+ this.exec = function(files, opts) {
5819
+ return $.Deferred().reject();
5820
+ }
5821
+
5822
+ /**
5823
+ * Return true if command disabled.
5824
+ *
5825
+ * @return Boolen
5826
+ */
5827
+ this.disabled = function() {
5828
+ return this.state < 0;
5829
+ }
5830
+
5831
+ /**
5832
+ * Return true if command enabled.
5833
+ *
5834
+ * @return Boolen
5835
+ */
5836
+ this.enabled = function() {
5837
+ return this.state > -1;
5838
+ }
5839
+
5840
+ /**
5841
+ * Return true if command active.
5842
+ *
5843
+ * @return Boolen
5844
+ */
5845
+ this.active = function() {
5846
+ return this.state > 0;
5847
+ }
5848
+
5849
+ /**
5850
+ * Return current command state.
5851
+ * Must be overloaded in most commands
5852
+ *
5853
+ * @return Number
5854
+ */
5855
+ this.getstate = function() {
5856
+ return -1;
5857
+ }
5858
+
5859
+ /**
5860
+ * Update command state/value
5861
+ * and rize 'change' event if smth changed
5862
+ *
5863
+ * @param Number new state or undefined to auto update state
5864
+ * @param mixed new value
5865
+ * @return void
5866
+ */
5867
+ this.update = function(s, v) {
5868
+ var state = this.state,
5869
+ value = this.value;
5870
+
5871
+ if (this._disabled) {
5872
+ this.state = -1;
5873
+ } else {
5874
+ this.state = s !== void(0) ? s : this.getstate();
5875
+ }
5876
+
5877
+ this.value = v;
5878
+
5879
+ if (state != this.state || value != this.value) {
5880
+ this.change();
5881
+ }
5882
+ }
5883
+
5884
+ /**
5885
+ * Bind handler / fire 'change' event.
5886
+ *
5887
+ * @param Function|undefined event callback
5888
+ * @return void
5889
+ */
5890
+ this.change = function(c) {
5891
+ var cmd, i;
5892
+
5893
+ if (typeof(c) === 'function') {
5894
+ this.listeners.push(c);
5895
+ } else {
5896
+ for (i = 0; i < this.listeners.length; i++) {
5897
+ cmd = this.listeners[i];
5898
+ try {
5899
+ cmd(this.state, this.value);
5900
+ } catch (e) {
5901
+ this.fm.debug('error', e)
5902
+ }
5903
+ }
5904
+ }
5905
+ return this;
5906
+ }
5907
+
5908
+
5909
+ /**
5910
+ * With argument check given files hashes and return list of existed files hashes.
5911
+ * Without argument return selected files hashes.
5912
+ *
5913
+ * @param Array|String|void hashes
5914
+ * @return Array
5915
+ */
5916
+ this.hashes = function(hashes) {
5917
+ return hashes
5918
+ ? $.map($.isArray(hashes) ? hashes : [hashes], function(hash) { return fm.file(hash) ? hash : null; })
5919
+ : fm.selected();
5920
+ }
5921
+
5922
+ /**
5923
+ * Return only existed files from given fils hashes | selected files
5924
+ *
5925
+ * @param Array|String|void hashes
5926
+ * @return Array
5927
+ */
5928
+ this.files = function(hashes) {
5929
+ var fm = this.fm;
5930
+
5931
+ return hashes
5932
+ ? $.map($.isArray(hashes) ? hashes : [hashes], function(hash) { return fm.file(hash) || null })
5933
+ : fm.selectedFiles();
5934
+ }
5935
+ }
5936
+
5937
+
5938
+
5939
+
5940
+ /*
5941
+ * File: /js/elFinder.resources.js
5942
+ */
5943
+
5944
+ /**
5945
+ * elFinder resources registry.
5946
+ * Store shared data
5947
+ *
5948
+ * @type Object
5949
+ * @author Dmitry (dio) Levashov
5950
+ **/
5951
+ elFinder.prototype.resources = {
5952
+ 'class' : {
5953
+ hover : 'ui-state-hover',
5954
+ active : 'ui-state-active',
5955
+ disabled : 'ui-state-disabled',
5956
+ draggable : 'ui-draggable',
5957
+ droppable : 'ui-droppable',
5958
+ adroppable : 'elfinder-droppable-active',
5959
+ cwdfile : 'elfinder-cwd-file',
5960
+ cwd : 'elfinder-cwd',
5961
+ tree : 'elfinder-tree',
5962
+ treeroot : 'elfinder-navbar-root',
5963
+ navdir : 'elfinder-navbar-dir',
5964
+ navdirwrap : 'elfinder-navbar-dir-wrapper',
5965
+ navarrow : 'elfinder-navbar-arrow',
5966
+ navsubtree : 'elfinder-navbar-subtree',
5967
+ navcollapse : 'elfinder-navbar-collapsed',
5968
+ navexpand : 'elfinder-navbar-expanded',
5969
+ treedir : 'elfinder-tree-dir',
5970
+ placedir : 'elfinder-place-dir',
5971
+ searchbtn : 'elfinder-button-search'
5972
+ },
5973
+ tpl : {
5974
+ perms : '<span class="elfinder-perms"/>',
5975
+ lock : '<span class="elfinder-lock"/>',
5976
+ symlink : '<span class="elfinder-symlink"/>',
5977
+ navicon : '<span class="elfinder-nav-icon"/>',
5978
+ navspinner : '<span class="elfinder-navbar-spinner"/>',
5979
+ navdir : '<div class="elfinder-navbar-wrapper"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}"><span class="elfinder-navbar-arrow"/><span class="elfinder-navbar-icon" {style}/>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree"/></div>',
5980
+ placedir : '<div class="elfinder-navbar-wrapper"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}" title="{title}"><span class="elfinder-navbar-arrow"/><span class="elfinder-navbar-icon" {style}/>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree"/></div>'
5981
+
5982
+ },
5983
+
5984
+ mimes : {
5985
+ text : [
5986
+ 'application/x-empty',
5987
+ 'application/javascript',
5988
+ 'application/xhtml+xml',
5989
+ 'audio/x-mp3-playlist',
5990
+ 'application/x-web-config',
5991
+ 'application/docbook+xml',
5992
+ 'application/x-php',
5993
+ 'application/x-perl',
5994
+ 'application/x-awk',
5995
+ 'application/x-config',
5996
+ 'application/x-csh',
5997
+ 'application/xml'
5998
+ ]
5999
+ },
6000
+
6001
+ mixin : {
6002
+ make : function() {
6003
+ var fm = this.fm,
6004
+ cmd = this.name,
6005
+ cwd = fm.getUI('cwd'),
6006
+ tarea= (fm.storage('view') != 'list'),
6007
+ rest = function(){
6008
+ if (tarea) {
6009
+ node.zIndex('').css('position', '');
6010
+ nnode.css('max-height', '');
6011
+ } else {
6012
+ pnode.css('width', '');
6013
+ pnode.parent('td').css('overflow', '');
6014
+ }
6015
+ }, colwidth,
6016
+ dfrd = $.Deferred()
6017
+ .fail(function(error) {
6018
+ rest();
6019
+ cwd.trigger('unselectall');
6020
+ error && fm.error(error);
6021
+ })
6022
+ .always(function() {
6023
+ input.remove();
6024
+ node.remove();
6025
+ fm.enable();
6026
+ }),
6027
+ id = 'tmp_'+parseInt(Math.random()*100000),
6028
+ phash = fm.cwd().hash,
6029
+ date = new Date(),
6030
+ file = {
6031
+ hash : id,
6032
+ name : fm.uniqueName(this.prefix),
6033
+ mime : this.mime,
6034
+ read : true,
6035
+ write : true,
6036
+ date : 'Today '+date.getHours()+':'+date.getMinutes()
6037
+ },
6038
+ data = this.data || {},
6039
+ node = cwd.trigger('create.'+fm.namespace, file).find('#'+fm.cwdHash2Id(id)),
6040
+ nnode, pnode,
6041
+ input = $(tarea? '<textarea/>' : '<input type="text"/>')
6042
+ .on('keyup text', function(){
6043
+ if (tarea) {
6044
+ this.style.height = '1px';
6045
+ this.style.height = this.scrollHeight + 'px';
6046
+ } else if (colwidth) {
6047
+ this.style.width = colwidth + 'px';
6048
+ if (this.scrollWidth > colwidth) {
6049
+ this.style.width = this.scrollWidth + 10 + 'px';
6050
+ }
6051
+ }
6052
+ })
6053
+ .keydown(function(e) {
6054
+ e.stopImmediatePropagation();
6055
+
6056
+ if (e.keyCode == $.ui.keyCode.ESCAPE) {
6057
+ dfrd.reject();
6058
+ } else if (e.keyCode == $.ui.keyCode.ENTER) {
6059
+ input.blur();
6060
+ }
6061
+ })
6062
+ .mousedown(function(e) {
6063
+ e.stopPropagation();
6064
+ })
6065
+ .blur(function() {
6066
+ var name = $.trim(input.val()),
6067
+ parent = input.parent(),
6068
+ valid = true;
6069
+
6070
+ if (parent.length) {
6071
+
6072
+ if (fm.options.validName && fm.options.validName.test) {
6073
+ try {
6074
+ valid = fm.options.validName.test(name);
6075
+ } catch(e) {
6076
+ valid = false;
6077
+ }
6078
+ }
6079
+ if (!name || name === '..' || !valid) {
6080
+ fm.error('errInvName');
6081
+ return false;
6082
+ }
6083
+ if (fm.fileByName(name, phash)) {
6084
+ fm.error(['errExists', name]);
6085
+ return false;
6086
+ }
6087
+
6088
+ rest();
6089
+ parent.html(fm.escape(name));
6090
+
6091
+ fm.lockfiles({files : [id]});
6092
+
6093
+ fm.request({
6094
+ data : $.extend({cmd : cmd, name : name, target : phash}, data || {}),
6095
+ notify : {type : cmd, cnt : 1},
6096
+ preventFail : true,
6097
+ syncOnFail : true
6098
+ })
6099
+ .fail(function(error) {
6100
+ dfrd.reject(error);
6101
+ })
6102
+ .done(function(data) {
6103
+ dfrd.resolve(data);
6104
+ if (data.added && data.added[0]) {
6105
+ var newItem = cwd.find('#'+fm.cwdHash2Id(data.added[0].hash));
6106
+ if (newItem.length) {
6107
+ newItem.trigger('scrolltoview');
6108
+ }
6109
+ }
6110
+ });
6111
+ }
6112
+ });
6113
+
6114
+
6115
+ if (this.disabled() || !node.length) {
6116
+ return dfrd.reject();
6117
+ }
6118
+
6119
+ fm.disable();
6120
+ nnode = node.find('.elfinder-cwd-filename');
6121
+ pnode = nnode.parent();
6122
+ if (tarea) {
6123
+ node.zIndex((node.parent().zIndex()) + 1).css('position', 'relative');
6124
+ nnode.css('max-height', 'none');
6125
+ } else {
6126
+ colwidth = pnode.width();
6127
+ pnode.width(colwidth - 15);
6128
+ pnode.parent('td').css('overflow', 'visible');
6129
+ }
6130
+ nnode.empty('').append(input.val(file.name));
6131
+ input.trigger('keyup');
6132
+ input.select().focus();
6133
+ input[0].setSelectionRange && input[0].setSelectionRange(0, file.name.replace(/\..+$/, '').length);
6134
+
6135
+ return dfrd;
6136
+
6137
+
6138
+
6139
+ }
6140
+
6141
+ }
6142
+ }
6143
+
6144
+
6145
+
6146
+ /*
6147
+ * File: /js/jquery.dialogelfinder.js
6148
+ */
6149
+
6150
+ /**
6151
+ * @class dialogelfinder - open elFinder in dialog window
6152
+ *
6153
+ * @param Object elFinder options with dialog options
6154
+ * @example
6155
+ * $(selector).dialogelfinder({
6156
+ * // some elfinder options
6157
+ * title : 'My files', // dialog title, default = "Files"
6158
+ * width : 850, // dialog width, default 840
6159
+ * autoOpen : false, // if false - dialog will not be opened after init, default = true
6160
+ * destroyOnClose : true // destroy elFinder on close dialog, default = false
6161
+ * })
6162
+ * @author Dmitry (dio) Levashov
6163
+ **/
6164
+ $.fn.dialogelfinder = function(opts) {
6165
+ var position = 'elfinderPosition',
6166
+ destroy = 'elfinderDestroyOnClose';
6167
+
6168
+ this.not('.elfinder').each(function() {
6169
+
6170
+
6171
+ var doc = $(document),
6172
+ toolbar = $('<div class="ui-widget-header dialogelfinder-drag ui-corner-top">'+(opts.title || 'Files')+'</div>'),
6173
+ button = $('<a href="#" class="dialogelfinder-drag-close ui-corner-all"><span class="ui-icon ui-icon-closethick"/></a>')
6174
+ .appendTo(toolbar)
6175
+ .click(function(e) {
6176
+ e.preventDefault();
6177
+
6178
+ node.dialogelfinder('close');
6179
+ }),
6180
+ node = $(this).addClass('dialogelfinder')
6181
+ .css('position', 'absolute')
6182
+ .hide()
6183
+ .appendTo('body')
6184
+ .draggable({ handle : '.dialogelfinder-drag',
6185
+ containment : 'window' })
6186
+ .elfinder(opts)
6187
+ .prepend(toolbar),
6188
+ elfinder = node.elfinder('instance');
6189
+
6190
+
6191
+ node.width(parseInt(node.width()) || 840) // fix width if set to "auto"
6192
+ .data(destroy, !!opts.destroyOnClose)
6193
+ .find('.elfinder-toolbar').removeClass('ui-corner-top');
6194
+
6195
+ opts.position && node.data(position, opts.position);
6196
+
6197
+ opts.autoOpen !== false && $(this).dialogelfinder('open');
6198
+
6199
+ });
6200
+
6201
+ if (opts == 'open') {
6202
+ var node = $(this),
6203
+ pos = node.data(position) || {
6204
+ top : parseInt($(document).scrollTop() + ($(window).height() < node.height() ? 2 : ($(window).height() - node.height())/2)),
6205
+ left : parseInt($(document).scrollLeft() + ($(window).width() < node.width() ? 2 : ($(window).width() - node.width())/2))
6206
+ },
6207
+ zindex = 100;
6208
+
6209
+ if (node.is(':hidden')) {
6210
+
6211
+ $('body').find(':visible').each(function() {
6212
+ var $this = $(this), z;
6213
+
6214
+ if (this !== node[0] && $this.css('position') == 'absolute' && (z = parseInt($this.zIndex())) > zindex) {
6215
+ zindex = z + 1;
6216
+ }
6217
+ });
6218
+
6219
+ node.zIndex(zindex).css(pos).show().trigger('resize');
6220
+
6221
+ setTimeout(function() {
6222
+ // fix resize icon position and make elfinder active
6223
+ node.trigger('resize').mousedown();
6224
+ }, 200);
6225
+ }
6226
+ } else if (opts == 'close') {
6227
+ var node = $(this);
6228
+
6229
+ if (node.is(':visible')) {
6230
+ !!node.data(destroy)
6231
+ ? node.elfinder('destroy').remove()
6232
+ : node.elfinder('close');
6233
+ }
6234
+ } else if (opts == 'instance') {
6235
+ return $(this).getElFinder();
6236
+ }
6237
+
6238
+ return this;
6239
+ };
6240
+
6241
+
6242
+
6243
+ /*
6244
+ * File: /js/i18n/elfinder.en.js
6245
+ */
6246
+
6247
+ /**
6248
+ * English translation
6249
+ * @author Troex Nevelin <troex@fury.scancode.ru>
6250
+ * @version 2016-01-18
6251
+ */
6252
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
6253
+ elFinder.prototype.i18.en = {
6254
+ translator : 'Troex Nevelin &lt;troex@fury.scancode.ru&gt;',
6255
+ language : 'English',
6256
+ direction : 'ltr',
6257
+ dateFormat : 'M d, Y h:i A', // Mar 13, 2012 05:27 PM
6258
+ fancyDateFormat : '$1 h:i A', // will produce smth like: Today 12:25 PM
6259
+ messages : {
6260
+
6261
+ /********************************** errors **********************************/
6262
+ 'error' : 'Error',
6263
+ 'errUnknown' : 'Unknown error.',
6264
+ 'errUnknownCmd' : 'Unknown command.',
6265
+ 'errJqui' : 'Invalid jQuery UI configuration. Selectable, draggable and droppable components must be included.',
6266
+ 'errNode' : 'elFinder requires DOM Element to be created.',
6267
+ 'errURL' : 'Invalid elFinder configuration! URL option is not set.',
6268
+ 'errAccess' : 'Access denied.',
6269
+ 'errConnect' : 'Unable to connect to backend.',
6270
+ 'errAbort' : 'Connection aborted.',
6271
+ 'errTimeout' : 'Connection timeout.',
6272
+ 'errNotFound' : 'Backend not found.',
6273
+ 'errResponse' : 'Invalid backend response.',
6274
+ 'errConf' : 'Invalid backend configuration.',
6275
+ 'errJSON' : 'PHP JSON module not installed.',
6276
+ 'errNoVolumes' : 'Readable volumes not available.',
6277
+ 'errCmdParams' : 'Invalid parameters for command "$1".',
6278
+ 'errDataNotJSON' : 'Data is not JSON.',
6279
+ 'errDataEmpty' : 'Data is empty.',
6280
+ 'errCmdReq' : 'Backend request requires command name.',
6281
+ 'errOpen' : 'Unable to open "$1".',
6282
+ 'errNotFolder' : 'Object is not a folder.',
6283
+ 'errNotFile' : 'Object is not a file.',
6284
+ 'errRead' : 'Unable to read "$1".',
6285
+ 'errWrite' : 'Unable to write into "$1".',
6286
+ 'errPerm' : 'Permission denied.',
6287
+ 'errLocked' : '"$1" is locked and can not be renamed, moved or removed.',
6288
+ 'errExists' : 'File named "$1" already exists.',
6289
+ 'errInvName' : 'Invalid file name.',
6290
+ 'errFolderNotFound' : 'Folder not found.',
6291
+ 'errFileNotFound' : 'File not found.',
6292
+ 'errTrgFolderNotFound' : 'Target folder "$1" not found.',
6293
+ 'errPopup' : 'Browser prevented opening popup window. To open file enable it in browser options.',
6294
+ 'errMkdir' : 'Unable to create folder "$1".',
6295
+ 'errMkfile' : 'Unable to create file "$1".',
6296
+ 'errRename' : 'Unable to rename "$1".',
6297
+ 'errCopyFrom' : 'Copying files from volume "$1" not allowed.',
6298
+ 'errCopyTo' : 'Copying files to volume "$1" not allowed.',
6299
+ 'errMkOutLink' : 'Unable to create a link to outside the volume root.', // from v2.1 added 03.10.2015
6300
+ 'errUpload' : 'Upload error.', // old name - errUploadCommon
6301
+ 'errUploadFile' : 'Unable to upload "$1".', // old name - errUpload
6302
+ 'errUploadNoFiles' : 'No files found for upload.',
6303
+ 'errUploadTotalSize' : 'Data exceeds the maximum allowed size.', // old name - errMaxSize
6304
+ 'errUploadFileSize' : 'File exceeds maximum allowed size.', // old name - errFileMaxSize
6305
+ 'errUploadMime' : 'File type not allowed.',
6306
+ 'errUploadTransfer' : '"$1" transfer error.',
6307
+ 'errUploadTemp' : 'Unable to make temporary file for upload.', // from v2.1 added 26.09.2015
6308
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.', // new
6309
+ 'errReplace' : 'Unable to replace "$1".',
6310
+ 'errSave' : 'Unable to save "$1".',
6311
+ 'errCopy' : 'Unable to copy "$1".',
6312
+ 'errMove' : 'Unable to move "$1".',
6313
+ 'errCopyInItself' : 'Unable to copy "$1" into itself.',
6314
+ 'errRm' : 'Unable to remove "$1".',
6315
+ 'errRmSrc' : 'Unable remove source file(s).',
6316
+ 'errExtract' : 'Unable to extract files from "$1".',
6317
+ 'errArchive' : 'Unable to create archive.',
6318
+ 'errArcType' : 'Unsupported archive type.',
6319
+ 'errNoArchive' : 'File is not archive or has unsupported archive type.',
6320
+ 'errCmdNoSupport' : 'Backend does not support this command.',
6321
+ 'errReplByChild' : 'The folder "$1" can\'t be replaced by an item it contains.',
6322
+ 'errArcSymlinks' : 'For security reason denied to unpack archives contains symlinks or files with not allowed names.', // edited 24.06.2012
6323
+ 'errArcMaxSize' : 'Archive files exceeds maximum allowed size.',
6324
+ 'errResize' : 'Unable to resize "$1".',
6325
+ 'errResizeDegree' : 'Invalid rotate degree.', // added 7.3.2013
6326
+ 'errResizeRotate' : 'Unable to rotate image.', // added 7.3.2013
6327
+ 'errResizeSize' : 'Invalid image size.', // added 7.3.2013
6328
+ 'errResizeNoChange' : 'Image size not changed.', // added 7.3.2013
6329
+ 'errUsupportType' : 'Unsupported file type.',
6330
+ 'errNotUTF8Content' : 'File "$1" is not in UTF-8 and cannot be edited.', // added 9.11.2011
6331
+ 'errNetMount' : 'Unable to mount "$1".', // added 17.04.2012
6332
+ 'errNetMountNoDriver' : 'Unsupported protocol.', // added 17.04.2012
6333
+ 'errNetMountFailed' : 'Mount failed.', // added 17.04.2012
6334
+ 'errNetMountHostReq' : 'Host required.', // added 18.04.2012
6335
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
6336
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
6337
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
6338
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
6339
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
6340
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
6341
+ 'errExtractExec' : 'Error while extracting files: "$1"',
6342
+ 'errNetUnMount' : 'Unable to unmount', // from v2.1 added 30.04.2012
6343
+ 'errConvUTF8' : 'Not convertible to UTF-8', // from v2.1 added 08.04.2014
6344
+ 'errFolderUpload' : 'Try Google Chrome, If you\'d like to upload the folder.', // from v2.1 added 26.6.2015
6345
+ 'errSearchTimeout' : 'Timed out while searching "$1". Search result is partial.', // from v2.1 added 12.1.2016
6346
+
6347
+ /******************************* commands names ********************************/
6348
+ 'cmdarchive' : 'Create archive',
6349
+ 'cmdback' : 'Back',
6350
+ 'cmdcopy' : 'Copy',
6351
+ 'cmdcut' : 'Cut',
6352
+ 'cmddownload' : 'Download',
6353
+ 'cmdduplicate' : 'Duplicate',
6354
+ 'cmdedit' : 'Edit file',
6355
+ 'cmdextract' : 'Extract files from archive',
6356
+ 'cmdforward' : 'Forward',
6357
+ 'cmdgetfile' : 'Select files',
6358
+ 'cmdhelp' : 'About this software',
6359
+ 'cmdhome' : 'Home',
6360
+ 'cmdinfo' : 'Get info',
6361
+ 'cmdmkdir' : 'New folder',
6362
+ 'cmdmkfile' : 'New text file',
6363
+ 'cmdopen' : 'Open',
6364
+ 'cmdpaste' : 'Paste',
6365
+ 'cmdquicklook' : 'Preview',
6366
+ 'cmdreload' : 'Reload',
6367
+ 'cmdrename' : 'Rename',
6368
+ 'cmdrm' : 'Delete',
6369
+ 'cmdsearch' : 'Find files',
6370
+ 'cmdup' : 'Go to parent directory',
6371
+ 'cmdupload' : 'Upload files',
6372
+ 'cmdview' : 'View',
6373
+ 'cmdresize' : 'Resize & Rotate',
6374
+ 'cmdsort' : 'Sort',
6375
+ 'cmdnetmount' : 'Mount network volume', // added 18.04.2012
6376
+ 'cmdnetunmount': 'Unmount', // from v2.1 added 30.04.2012
6377
+ 'cmdplaces' : 'To Places', // added 28.12.2014
6378
+ 'cmdchmod' : 'Change mode', // from v2.1 added 20.6.2015
6379
+ 'cmdopendir' : 'Open a folder', // from v2.1 added 13.1.2016
6380
+
6381
+ /*********************************** buttons ***********************************/
6382
+ 'btnClose' : 'Close',
6383
+ 'btnSave' : 'Save',
6384
+ 'btnRm' : 'Remove',
6385
+ 'btnApply' : 'Apply',
6386
+ 'btnCancel' : 'Cancel',
6387
+ 'btnNo' : 'No',
6388
+ 'btnYes' : 'Yes',
6389
+ 'btnMount' : 'Mount', // added 18.04.2012
6390
+ 'btnApprove': 'Goto $1 & approve', // from v2.1 added 26.04.2012
6391
+ 'btnUnmount': 'Unmount', // from v2.1 added 30.04.2012
6392
+ 'btnConv' : 'Convert', // from v2.1 added 08.04.2014
6393
+ 'btnCwd' : 'Here', // from v2.1 added 22.5.2015
6394
+ 'btnVolume' : 'Volume', // from v2.1 added 22.5.2015
6395
+ 'btnAll' : 'All', // from v2.1 added 22.5.2015
6396
+ 'btnMime' : 'MIME Type', // from v2.1 added 22.5.2015
6397
+ 'btnFileName':'Filename', // from v2.1 added 22.5.2015
6398
+ 'btnSaveClose': 'Save & Close', // from v2.1 added 12.6.2015
6399
+ 'btnBackup' : 'Backup', // fromv2.1 added 28.11.2015
6400
+
6401
+ /******************************** notifications ********************************/
6402
+ 'ntfopen' : 'Open folder',
6403
+ 'ntffile' : 'Open file',
6404
+ 'ntfreload' : 'Reload folder content',
6405
+ 'ntfmkdir' : 'Creating directory',
6406
+ 'ntfmkfile' : 'Creating files',
6407
+ 'ntfrm' : 'Delete files',
6408
+ 'ntfcopy' : 'Copy files',
6409
+ 'ntfmove' : 'Move files',
6410
+ 'ntfprepare' : 'Prepare to copy files',
6411
+ 'ntfrename' : 'Rename files',
6412
+ 'ntfupload' : 'Uploading files',
6413
+ 'ntfdownload' : 'Downloading files',
6414
+ 'ntfsave' : 'Save files',
6415
+ 'ntfarchive' : 'Creating archive',
6416
+ 'ntfextract' : 'Extracting files from archive',
6417
+ 'ntfsearch' : 'Searching files',
6418
+ 'ntfresize' : 'Resizing images',
6419
+ 'ntfsmth' : 'Doing something',
6420
+ 'ntfloadimg' : 'Loading image',
6421
+ 'ntfnetmount' : 'Mounting network volume', // added 18.04.2012
6422
+ 'ntfnetunmount': 'Unmounting network volume', // from v2.1 added 30.04.2012
6423
+ 'ntfdim' : 'Acquiring image dimension', // added 20.05.2013
6424
+ 'ntfreaddir' : 'Reading folder infomation', // from v2.1 added 01.07.2013
6425
+ 'ntfurl' : 'Getting URL of link', // from v2.1 added 11.03.2014
6426
+ 'ntfchmod' : 'Changing file mode', // from v2.1 added 20.6.2015
6427
+ 'ntfpreupload': 'Verifying upload file name', // from v2.1 added 31.11.2015
6428
+
6429
+ /************************************ dates **********************************/
6430
+ 'dateUnknown' : 'unknown',
6431
+ 'Today' : 'Today',
6432
+ 'Yesterday' : 'Yesterday',
6433
+ 'msJan' : 'Jan',
6434
+ 'msFeb' : 'Feb',
6435
+ 'msMar' : 'Mar',
6436
+ 'msApr' : 'Apr',
6437
+ 'msMay' : 'May',
6438
+ 'msJun' : 'Jun',
6439
+ 'msJul' : 'Jul',
6440
+ 'msAug' : 'Aug',
6441
+ 'msSep' : 'Sep',
6442
+ 'msOct' : 'Oct',
6443
+ 'msNov' : 'Nov',
6444
+ 'msDec' : 'Dec',
6445
+ 'January' : 'January',
6446
+ 'February' : 'February',
6447
+ 'March' : 'March',
6448
+ 'April' : 'April',
6449
+ 'May' : 'May',
6450
+ 'June' : 'June',
6451
+ 'July' : 'July',
6452
+ 'August' : 'August',
6453
+ 'September' : 'September',
6454
+ 'October' : 'October',
6455
+ 'November' : 'November',
6456
+ 'December' : 'December',
6457
+ 'Sunday' : 'Sunday',
6458
+ 'Monday' : 'Monday',
6459
+ 'Tuesday' : 'Tuesday',
6460
+ 'Wednesday' : 'Wednesday',
6461
+ 'Thursday' : 'Thursday',
6462
+ 'Friday' : 'Friday',
6463
+ 'Saturday' : 'Saturday',
6464
+ 'Sun' : 'Sun',
6465
+ 'Mon' : 'Mon',
6466
+ 'Tue' : 'Tue',
6467
+ 'Wed' : 'Wed',
6468
+ 'Thu' : 'Thu',
6469
+ 'Fri' : 'Fri',
6470
+ 'Sat' : 'Sat',
6471
+
6472
+ /******************************** sort variants ********************************/
6473
+ 'sortname' : 'by name',
6474
+ 'sortkind' : 'by kind',
6475
+ 'sortsize' : 'by size',
6476
+ 'sortdate' : 'by date',
6477
+ 'sortFoldersFirst' : 'Folders first',
6478
+
6479
+ /********************************** new items **********************************/
6480
+ 'untitled file.txt' : 'NewFile.txt', // added 10.11.2015
6481
+ 'untitled folder' : 'NewFolder', // added 10.11.2015
6482
+ 'Archive' : 'NewArchive', // from v2.1 added 10.11.2015
6483
+
6484
+ /********************************** messages **********************************/
6485
+ 'confirmReq' : 'Confirmation required',
6486
+ 'confirmRm' : 'Are you sure you want to remove files?<br/>This cannot be undone!',
6487
+ 'confirmRepl' : 'Replace old file with new one?',
6488
+ 'confirmConvUTF8' : 'Not in UTF-8<br/>Convert to UTF-8?<br/>Contents become UTF-8 by saving after conversion.', // from v2.1 added 08.04.2014
6489
+ 'confirmNotSave' : 'It has been modified.<br/>Losing work if you do not save changes.', // from v2.1 added 15.7.2015
6490
+ 'apllyAll' : 'Apply to all',
6491
+ 'name' : 'Name',
6492
+ 'size' : 'Size',
6493
+ 'perms' : 'Permissions',
6494
+ 'modify' : 'Modified',
6495
+ 'kind' : 'Kind',
6496
+ 'read' : 'read',
6497
+ 'write' : 'write',
6498
+ 'noaccess' : 'no access',
6499
+ 'and' : 'and',
6500
+ 'unknown' : 'unknown',
6501
+ 'selectall' : 'Select all files',
6502
+ 'selectfiles' : 'Select file(s)',
6503
+ 'selectffile' : 'Select first file',
6504
+ 'selectlfile' : 'Select last file',
6505
+ 'viewlist' : 'List view',
6506
+ 'viewicons' : 'Icons view',
6507
+ 'places' : 'Places',
6508
+ 'calc' : 'Calculate',
6509
+ 'path' : 'Path',
6510
+ 'aliasfor' : 'Alias for',
6511
+ 'locked' : 'Locked',
6512
+ 'dim' : 'Dimensions',
6513
+ 'files' : 'Files',
6514
+ 'folders' : 'Folders',
6515
+ 'items' : 'Items',
6516
+ 'yes' : 'yes',
6517
+ 'no' : 'no',
6518
+ 'link' : 'Link',
6519
+ 'searcresult' : 'Search results',
6520
+ 'selected' : 'selected items',
6521
+ 'about' : 'About',
6522
+ 'shortcuts' : 'Shortcuts',
6523
+ 'help' : 'Help',
6524
+ 'webfm' : 'Web file manager',
6525
+ 'ver' : 'Version',
6526
+ 'protocolver' : 'protocol version',
6527
+ 'homepage' : 'Project home',
6528
+ 'docs' : 'Documentation',
6529
+ 'github' : 'Fork us on Github',
6530
+ 'twitter' : 'Follow us on twitter',
6531
+ 'facebook' : 'Join us on facebook',
6532
+ 'team' : 'Team',
6533
+ 'chiefdev' : 'chief developer',
6534
+ 'developer' : 'developer',
6535
+ 'contributor' : 'contributor',
6536
+ 'maintainer' : 'maintainer',
6537
+ 'translator' : 'translator',
6538
+ 'icons' : 'Icons',
6539
+ 'dontforget' : 'and don\'t forget to take your towel',
6540
+ 'shortcutsof' : 'Shortcuts disabled',
6541
+ 'dropFiles' : 'Drop files here',
6542
+ 'or' : 'or',
6543
+ 'selectForUpload' : 'Select files to upload',
6544
+ 'moveFiles' : 'Move files',
6545
+ 'copyFiles' : 'Copy files',
6546
+ 'rmFromPlaces' : 'Remove from places',
6547
+ 'aspectRatio' : 'Aspect ratio',
6548
+ 'scale' : 'Scale',
6549
+ 'width' : 'Width',
6550
+ 'height' : 'Height',
6551
+ 'resize' : 'Resize',
6552
+ 'crop' : 'Crop',
6553
+ 'rotate' : 'Rotate',
6554
+ 'rotate-cw' : 'Rotate 90 degrees CW',
6555
+ 'rotate-ccw' : 'Rotate 90 degrees CCW',
6556
+ 'degree' : '°',
6557
+ 'netMountDialogTitle' : 'Mount network volume', // added 18.04.2012
6558
+ 'protocol' : 'Protocol', // added 18.04.2012
6559
+ 'host' : 'Host', // added 18.04.2012
6560
+ 'port' : 'Port', // added 18.04.2012
6561
+ 'user' : 'User', // added 18.04.2012
6562
+ 'pass' : 'Password', // added 18.04.2012
6563
+ 'confirmUnmount' : 'Are you unmount $1?', // from v2.1 added 30.04.2012
6564
+ 'dropFilesBrowser': 'Drop or Paste files from browser', // from v2.1 added 30.05.2012
6565
+ 'dropPasteFiles' : 'Drop or Paste files here', // from v2.1 added 07.04.2014
6566
+ 'encoding' : 'Encoding', // from v2.1 added 19.12.2014
6567
+ 'locale' : 'Locale', // from v2.1 added 19.12.2014
6568
+ 'searchTarget' : 'Target: $1', // from v2.1 added 22.5.2015
6569
+ 'searchMime' : 'Search by input MIME Type', // from v2.1 added 22.5.2015
6570
+ 'owner' : 'Owner', // from v2.1 added 20.6.2015
6571
+ 'group' : 'Group', // from v2.1 added 20.6.2015
6572
+ 'other' : 'Other', // from v2.1 added 20.6.2015
6573
+ 'execute' : 'Execute', // from v2.1 added 20.6.2015
6574
+ 'perm' : 'Permission', // from v2.1 added 20.6.2015
6575
+ 'mode' : 'Mode', // from v2.1 added 20.6.2015
6576
+ 'emptyFolder' : 'Folder is empty', // from v2.1.6 added 30.12.2015
6577
+ 'emptyFolderDrop' : 'Folder is empty\\A Drop to add items', // from v2.1.6 added 30.12.2015
6578
+ 'emptyFolderLTap' : 'Folder is empty\\A Long tap to add items', // from v2.1.6 added 30.12.2015
6579
+ 'quality' : 'Quality', // from v2.1.6 added 5.1.2016
6580
+ 'autoSync' : 'Auto sync', // from v2.1.6 added 10.1.2016
6581
+ 'moveUp' : 'Move up', // from v2.1.6 added 18.1.2016
6582
+
6583
+ /********************************** mimetypes **********************************/
6584
+ 'kindUnknown' : 'Unknown',
6585
+ 'kindFolder' : 'Folder',
6586
+ 'kindAlias' : 'Alias',
6587
+ 'kindAliasBroken' : 'Broken alias',
6588
+ // applications
6589
+ 'kindApp' : 'Application',
6590
+ 'kindPostscript' : 'Postscript document',
6591
+ 'kindMsOffice' : 'Microsoft Office document',
6592
+ 'kindMsWord' : 'Microsoft Word document',
6593
+ 'kindMsExcel' : 'Microsoft Excel document',
6594
+ 'kindMsPP' : 'Microsoft Powerpoint presentation',
6595
+ 'kindOO' : 'Open Office document',
6596
+ 'kindAppFlash' : 'Flash application',
6597
+ 'kindPDF' : 'Portable Document Format (PDF)',
6598
+ 'kindTorrent' : 'Bittorrent file',
6599
+ 'kind7z' : '7z archive',
6600
+ 'kindTAR' : 'TAR archive',
6601
+ 'kindGZIP' : 'GZIP archive',
6602
+ 'kindBZIP' : 'BZIP archive',
6603
+ 'kindXZ' : 'XZ archive',
6604
+ 'kindZIP' : 'ZIP archive',
6605
+ 'kindRAR' : 'RAR archive',
6606
+ 'kindJAR' : 'Java JAR file',
6607
+ 'kindTTF' : 'True Type font',
6608
+ 'kindOTF' : 'Open Type font',
6609
+ 'kindRPM' : 'RPM package',
6610
+ // texts
6611
+ 'kindText' : 'Text document',
6612
+ 'kindTextPlain' : 'Plain text',
6613
+ 'kindPHP' : 'PHP source',
6614
+ 'kindCSS' : 'Cascading style sheet',
6615
+ 'kindHTML' : 'HTML document',
6616
+ 'kindJS' : 'Javascript source',
6617
+ 'kindRTF' : 'Rich Text Format',
6618
+ 'kindC' : 'C source',
6619
+ 'kindCHeader' : 'C header source',
6620
+ 'kindCPP' : 'C++ source',
6621
+ 'kindCPPHeader' : 'C++ header source',
6622
+ 'kindShell' : 'Unix shell script',
6623
+ 'kindPython' : 'Python source',
6624
+ 'kindJava' : 'Java source',
6625
+ 'kindRuby' : 'Ruby source',
6626
+ 'kindPerl' : 'Perl script',
6627
+ 'kindSQL' : 'SQL source',
6628
+ 'kindXML' : 'XML document',
6629
+ 'kindAWK' : 'AWK source',
6630
+ 'kindCSV' : 'Comma separated values',
6631
+ 'kindDOCBOOK' : 'Docbook XML document',
6632
+ 'kindMarkdown' : 'Markdown text', // added 20.7.2015
6633
+ // images
6634
+ 'kindImage' : 'Image',
6635
+ 'kindBMP' : 'BMP image',
6636
+ 'kindJPEG' : 'JPEG image',
6637
+ 'kindGIF' : 'GIF Image',
6638
+ 'kindPNG' : 'PNG Image',
6639
+ 'kindTIFF' : 'TIFF image',
6640
+ 'kindTGA' : 'TGA image',
6641
+ 'kindPSD' : 'Adobe Photoshop image',
6642
+ 'kindXBITMAP' : 'X bitmap image',
6643
+ 'kindPXM' : 'Pixelmator image',
6644
+ // media
6645
+ 'kindAudio' : 'Audio media',
6646
+ 'kindAudioMPEG' : 'MPEG audio',
6647
+ 'kindAudioMPEG4' : 'MPEG-4 audio',
6648
+ 'kindAudioMIDI' : 'MIDI audio',
6649
+ 'kindAudioOGG' : 'Ogg Vorbis audio',
6650
+ 'kindAudioWAV' : 'WAV audio',
6651
+ 'AudioPlaylist' : 'MP3 playlist',
6652
+ 'kindVideo' : 'Video media',
6653
+ 'kindVideoDV' : 'DV movie',
6654
+ 'kindVideoMPEG' : 'MPEG movie',
6655
+ 'kindVideoMPEG4' : 'MPEG-4 movie',
6656
+ 'kindVideoAVI' : 'AVI movie',
6657
+ 'kindVideoMOV' : 'Quick Time movie',
6658
+ 'kindVideoWM' : 'Windows Media movie',
6659
+ 'kindVideoFlash' : 'Flash movie',
6660
+ 'kindVideoMKV' : 'Matroska movie',
6661
+ 'kindVideoOGG' : 'Ogg movie'
6662
+ }
6663
+ };
6664
+ }
6665
+
6666
+
6667
+
6668
+ /*
6669
+ * File: /js/ui/button.js
6670
+ */
6671
+
6672
+ /**
6673
+ * @class elFinder toolbar button widget.
6674
+ * If command has variants - create menu
6675
+ *
6676
+ * @author Dmitry (dio) Levashov
6677
+ **/
6678
+ $.fn.elfinderbutton = function(cmd) {
6679
+ return this.each(function() {
6680
+
6681
+ var c = 'class',
6682
+ fm = cmd.fm,
6683
+ disabled = fm.res(c, 'disabled'),
6684
+ active = fm.res(c, 'active'),
6685
+ hover = fm.res(c, 'hover'),
6686
+ item = 'elfinder-button-menu-item',
6687
+ selected = 'elfinder-button-menu-item-selected',
6688
+ menu,
6689
+ button = $(this).addClass('ui-state-default elfinder-button')
6690
+ .attr('title', cmd.title)
6691
+ .append('<span class="elfinder-button-icon elfinder-button-icon-'+cmd.name+'"/>')
6692
+ .hover(function(e) { !button.hasClass(disabled) && button[e.type == 'mouseleave' ? 'removeClass' : 'addClass'](hover) /**button.toggleClass(hover);*/ })
6693
+ .click(function(e) {
6694
+ if (!button.hasClass(disabled)) {
6695
+ if (menu && cmd.variants.length > 1) {
6696
+ // close other menus
6697
+ menu.is(':hidden') && cmd.fm.getUI().click();
6698
+ e.stopPropagation();
6699
+ menu.slideToggle(100);
6700
+ } else {
6701
+ cmd.exec();
6702
+ }
6703
+
6704
+ }
6705
+ }),
6706
+ hideMenu = function() {
6707
+ menu.hide();
6708
+ };
6709
+
6710
+ // if command has variants create menu
6711
+ if ($.isArray(cmd.variants)) {
6712
+ button.addClass('elfinder-menubutton');
6713
+
6714
+ menu = $('<div class="ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>')
6715
+ .hide()
6716
+ .appendTo(button)
6717
+ .zIndex(12+button.zIndex())
6718
+ .on('mouseenter mouseleave', '.'+item, function() { $(this).toggleClass(hover) })
6719
+ .on('click', '.'+item, function(e) {
6720
+ e.preventDefault();
6721
+ e.stopPropagation();
6722
+ button.removeClass(hover);
6723
+ menu.hide();
6724
+ cmd.exec(cmd.fm.selected(), $(this).data('value'));
6725
+ });
6726
+
6727
+ cmd.fm.bind('disable select', hideMenu).getUI().click(hideMenu);
6728
+
6729
+ cmd.change(function() {
6730
+ menu.html('');
6731
+ $.each(cmd.variants, function(i, variant) {
6732
+ menu.append($('<div class="'+item+'">'+variant[1]+'</div>').data('value', variant[0]).addClass(variant[0] == cmd.value ? selected : ''));
6733
+ });
6734
+ });
6735
+ }
6736
+
6737
+ cmd.change(function() {
6738
+ if (cmd.disabled()) {
6739
+ button.removeClass(active+' '+hover).addClass(disabled);
6740
+ } else {
6741
+ button.removeClass(disabled);
6742
+ button[cmd.active() ? 'addClass' : 'removeClass'](active);
6743
+ }
6744
+ })
6745
+ .change();
6746
+ });
6747
+ }
6748
+
6749
+
6750
+ /*
6751
+ * File: /js/ui/contextmenu.js
6752
+ */
6753
+
6754
+ /**
6755
+ * @class elFinder contextmenu
6756
+ *
6757
+ * @author Dmitry (dio) Levashov
6758
+ **/
6759
+ $.fn.elfindercontextmenu = function(fm) {
6760
+
6761
+ return this.each(function() {
6762
+ var self = $(this),
6763
+ cmItem = 'elfinder-contextmenu-item',
6764
+ smItem = 'elfinder-contextsubmenu-item',
6765
+ exIcon = 'elfinder-contextmenu-extra-icon',
6766
+ menu = self.addClass('ui-helper-reset ui-widget ui-state-default ui-corner-all elfinder-contextmenu elfinder-contextmenu-'+fm.direction)
6767
+ .hide()
6768
+ .appendTo('body')
6769
+ .on('mouseenter mouseleave', '.'+cmItem, function(e) {
6770
+ $(this).toggleClass('ui-state-hover', e.type === 'mouseenter');
6771
+ })
6772
+ .on('mouseenter mouseleave', '.'+exIcon, function(e) {
6773
+ $(this).parent().toggleClass('ui-state-hover', e.type === 'mouseleave');
6774
+ })
6775
+ .on('contextmenu', function(){return false;}),
6776
+ subpos = fm.direction == 'ltr' ? 'left' : 'right',
6777
+ types = $.extend({}, fm.options.contextmenu),
6778
+ clItem = cmItem + (fm.UA.Touch ? ' elfinder-touch' : ''),
6779
+ tpl = '<div class="'+clItem+'"><span class="elfinder-button-icon {icon} elfinder-contextmenu-icon"/><span>{label}</span></div>',
6780
+ item = function(label, icon, callback) {
6781
+ return $(tpl.replace('{icon}', icon ? 'elfinder-button-icon-'+icon : '').replace('{label}', label))
6782
+ .click(function(e) {
6783
+ e.stopPropagation();
6784
+ e.preventDefault();
6785
+ callback();
6786
+ })
6787
+ },
6788
+
6789
+ open = function(x, y) {
6790
+ var win = $(window),
6791
+ width = menu.outerWidth(),
6792
+ height = menu.outerHeight(),
6793
+ wwidth = win.width(),
6794
+ wheight = win.height(),
6795
+ scrolltop = win.scrollTop(),
6796
+ scrollleft = win.scrollLeft(),
6797
+ m = fm.UA.Touch? 10 : 0,
6798
+ css = {
6799
+ top : y - scrolltop + m + height < wheight ? y + m : (y - m - height > 0 ? y - m - height : y + m),
6800
+ left : x - scrollleft + m + width < wwidth ? x + m : x - m - width,
6801
+ 'z-index' : 100 + fm.getUI('workzone').zIndex()
6802
+ };
6803
+
6804
+ menu.css(css)
6805
+ .show();
6806
+
6807
+ css = {'z-index' : css['z-index']+10};
6808
+ css[subpos] = parseInt(menu.width());
6809
+ menu.find('.elfinder-contextmenu-sub').css(css);
6810
+ },
6811
+
6812
+ close = function() {
6813
+ menu.hide().empty();
6814
+ fm.trigger('closecontextmenu');
6815
+ },
6816
+
6817
+ create = function(type, targets) {
6818
+ var sep = false,
6819
+ cmdMap = {}, disabled = [], isCwd = (targets[0].indexOf(fm.cwd().volumeid, 0) === 0);
6820
+
6821
+ if (self.data('cmdMaps')) {
6822
+ $.each(self.data('cmdMaps'), function(i, v){
6823
+ if (targets[0].indexOf(i, 0) == 0) {
6824
+ cmdMap = v;
6825
+ return false;
6826
+ }
6827
+ });
6828
+ }
6829
+ if (!isCwd) {
6830
+ if (fm.disabledCmds) {
6831
+ $.each(fm.disabledCmds, function(i, v){
6832
+ if (targets[0].indexOf(i, 0) == 0) {
6833
+ disabled = v;
6834
+ return false;
6835
+ }
6836
+ });
6837
+ }
6838
+ }
6839
+
6840
+ $.each(types[type]||[], function(i, name) {
6841
+ var cmd, node, submenu, hover, _disabled;
6842
+
6843
+ if (name == '|' && sep) {
6844
+ menu.append('<div class="elfinder-contextmenu-separator"/>');
6845
+ sep = false;
6846
+ return;
6847
+ }
6848
+
6849
+ if (cmdMap[name]) {
6850
+ name = cmdMap[name];
6851
+ }
6852
+ cmd = fm.command(name);
6853
+
6854
+ if (cmd && !isCwd) {
6855
+ _disabled = cmd._disabled;
6856
+ cmd._disabled = !(cmd.alwaysEnabled || (fm._commands[name] ? $.inArray(name, disabled) === -1 : false));
6857
+ }
6858
+
6859
+ if (cmd && cmd.getstate(targets) != -1) {
6860
+ targets._type = type;
6861
+ if (cmd.variants) {
6862
+ if (!cmd.variants.length) {
6863
+ return;
6864
+ }
6865
+ node = item(cmd.title, cmd.name, function(){})
6866
+ .on('touchend', function(e){
6867
+ node.data('touching', true);
6868
+ setTimeout(function(){node.data('touching', false);}, 50);
6869
+ })
6870
+ .on('click touchend', '.'+smItem, function(e){
6871
+ e.stopPropagation();
6872
+ if (node.data('touching')) {
6873
+ node.data('touching', false);
6874
+ $(this).removeClass('ui-state-hover');
6875
+ e.preventDefault();
6876
+ } else if (e.type == 'click') {
6877
+ menu.hide();
6878
+ cmd.exec(targets, $(this).data('exec'));
6879
+ }
6880
+ });
6881
+
6882
+ submenu = $('<div class="ui-corner-all elfinder-contextmenu-sub"/>')
6883
+ .appendTo(node.append('<span class="elfinder-contextmenu-arrow"/>'));
6884
+
6885
+ hover = function(){
6886
+ var win = $(window),
6887
+ baseleft = $(node).offset().left,
6888
+ basetop = $(node).offset().top,
6889
+ basewidth = $(node).outerWidth(),
6890
+ width = submenu.outerWidth(),
6891
+ height = submenu.outerHeight(),
6892
+ wwidth = win.scrollLeft() + win.width(),
6893
+ wheight = win.scrollTop() + win.height(),
6894
+ margin = 5, x, y, over;
6895
+
6896
+ over = (baseleft + basewidth + width + margin) - wwidth;
6897
+ x = (over > 0)? basewidth - over : basewidth;
6898
+ over = (basetop + 5 + height + margin) - wheight;
6899
+ y = (over > 0)? 5 - over : 5;
6900
+
6901
+ var css = {
6902
+ left : x,
6903
+ top : y
6904
+ };
6905
+ submenu.css(css).toggle();
6906
+ };
6907
+
6908
+ node.addClass('elfinder-contextmenu-group').hover(function(){ hover(); });
6909
+
6910
+ $.each(cmd.variants, function(i, variant) {
6911
+ submenu.append(
6912
+ $('<div class="'+clItem+' '+smItem+'"><span>'+variant[1]+'</span></div>').data('exec', variant[0])
6913
+ );
6914
+ });
6915
+
6916
+ } else {
6917
+ node = item(cmd.title, cmd.name, function() {
6918
+ close();
6919
+ cmd.exec(targets);
6920
+ });
6921
+ if (cmd.extra && cmd.extra.node) {
6922
+ node.append(
6923
+ $('<span class="elfinder-button-icon elfinder-button-icon-'+(cmd.extra.icon || '')+' elfinder-contextmenu-extra-icon"/>')
6924
+ .append(cmd.extra.node)
6925
+ );
6926
+ } else {
6927
+ node.remove('.elfinder-contextmenu-extra-icon');
6928
+ }
6929
+ }
6930
+
6931
+ menu.append(node)
6932
+ sep = true;
6933
+ }
6934
+
6935
+ cmd && !isCwd && (cmd._disabled = _disabled);
6936
+ });
6937
+ },
6938
+
6939
+ createFromRaw = function(raw) {
6940
+ $.each(raw, function(i, data) {
6941
+ var node;
6942
+
6943
+ if (data === '|') {
6944
+ menu.append('<div class="elfinder-contextmenu-separator"/>');
6945
+ } else if (data.label && typeof data.callback == 'function') {
6946
+ node = item(data.label, data.icon, function() {
6947
+ !data.remain && close();
6948
+ data.callback();
6949
+ });
6950
+ menu.append(node);
6951
+ }
6952
+ });
6953
+ };
6954
+
6955
+ fm.one('load', function() {
6956
+ fm.bind('contextmenu', function(e) {
6957
+ var data = e.data;
6958
+
6959
+ close();
6960
+
6961
+ if (data.type && data.targets) {
6962
+ create(data.type, data.targets);
6963
+ } else if (data.raw) {
6964
+ createFromRaw(data.raw);
6965
+ }
6966
+
6967
+ menu.children().length && open(data.x, data.y);
6968
+ })
6969
+ .one('destroy', function() { menu.remove(); })
6970
+ .bind('disable select', function(){
6971
+ // 'mouseEvInternal' for Firefox's bug (maybe)
6972
+ !self.data('mouseEvInternal') && close();
6973
+ self.data('mouseEvInternal', false);
6974
+ })
6975
+ .getUI().click(close);
6976
+ });
6977
+
6978
+ });
6979
+
6980
+ }
6981
+
6982
+
6983
+ /*
6984
+ * File: /js/ui/cwd.js
6985
+ */
6986
+
6987
+ /**
6988
+ * elFinder current working directory ui.
6989
+ *
6990
+ * @author Dmitry (dio) Levashov
6991
+ **/
6992
+ $.fn.elfindercwd = function(fm, options) {
6993
+
6994
+ this.not('.elfinder-cwd').each(function() {
6995
+ // fm.time('cwdLoad');
6996
+
6997
+ var mobile = fm.UA.Mobile,
6998
+ list = fm.viewType == 'list',
6999
+
7000
+ undef = 'undefined',
7001
+ /**
7002
+ * Select event full name
7003
+ *
7004
+ * @type String
7005
+ **/
7006
+ evtSelect = 'select.'+fm.namespace,
7007
+
7008
+ /**
7009
+ * Unselect event full name
7010
+ *
7011
+ * @type String
7012
+ **/
7013
+ evtUnselect = 'unselect.'+fm.namespace,
7014
+
7015
+ /**
7016
+ * Disable event full name
7017
+ *
7018
+ * @type String
7019
+ **/
7020
+ evtDisable = 'disable.'+fm.namespace,
7021
+
7022
+ /**
7023
+ * Disable event full name
7024
+ *
7025
+ * @type String
7026
+ **/
7027
+ evtEnable = 'enable.'+fm.namespace,
7028
+
7029
+ c = 'class',
7030
+ /**
7031
+ * File css class
7032
+ *
7033
+ * @type String
7034
+ **/
7035
+ clFile = fm.res(c, 'cwdfile'),
7036
+
7037
+ /**
7038
+ * Selected css class
7039
+ *
7040
+ * @type String
7041
+ **/
7042
+ fileSelector = '.'+clFile,
7043
+
7044
+ /**
7045
+ * Selected css class
7046
+ *
7047
+ * @type String
7048
+ **/
7049
+ clSelected = 'ui-selected',
7050
+
7051
+ /**
7052
+ * Disabled css class
7053
+ *
7054
+ * @type String
7055
+ **/
7056
+ clDisabled = fm.res(c, 'disabled'),
7057
+
7058
+ /**
7059
+ * Draggable css class
7060
+ *
7061
+ * @type String
7062
+ **/
7063
+ clDraggable = fm.res(c, 'draggable'),
7064
+
7065
+ /**
7066
+ * Droppable css class
7067
+ *
7068
+ * @type String
7069
+ **/
7070
+ clDroppable = fm.res(c, 'droppable'),
7071
+
7072
+ /**
7073
+ * Hover css class
7074
+ *
7075
+ * @type String
7076
+ **/
7077
+ clHover = fm.res(c, 'hover'),
7078
+
7079
+ /**
7080
+ * Hover css class
7081
+ *
7082
+ * @type String
7083
+ **/
7084
+ clDropActive = fm.res(c, 'adroppable'),
7085
+
7086
+ /**
7087
+ * Css class for temporary nodes (for mkdir/mkfile) commands
7088
+ *
7089
+ * @type String
7090
+ **/
7091
+ clTmp = clFile+'-tmp',
7092
+
7093
+ /**
7094
+ * Number of thumbnails to load in one request (new api only)
7095
+ *
7096
+ * @type Number
7097
+ **/
7098
+ tmbNum = fm.options.loadTmbs > 0 ? fm.options.loadTmbs : 5,
7099
+
7100
+ /**
7101
+ * Current search query.
7102
+ *
7103
+ * @type String
7104
+ */
7105
+ query = '',
7106
+
7107
+ lastSearch = [],
7108
+
7109
+ /**
7110
+ * Parents hashes of cwd
7111
+ *
7112
+ * @type Array
7113
+ */
7114
+ cwdParents = [],
7115
+
7116
+ customColsBuild = function() {
7117
+ var customCols = '';
7118
+ var columns = fm.options.uiOptions.cwd.listView.columns;
7119
+ for (var i = 0; i < columns.length; i++) {
7120
+ customCols += '<td>{' + columns[i] + '}</td>';
7121
+ }
7122
+ return customCols;
7123
+ },
7124
+
7125
+ /**
7126
+ * File templates
7127
+ *
7128
+ * @type Object
7129
+ **/
7130
+ templates = {
7131
+ icon : '<div id="{id}" class="'+clFile+(fm.UA.Touch ? ' '+'elfinder-touch' : '')+' {permsclass} {dirclass} ui-corner-all" title="{tooltip}"><div class="elfinder-cwd-file-wrapper ui-corner-all"><div class="elfinder-cwd-icon {mime} ui-corner-all" unselectable="on" {style}/>{marker}</div><div class="elfinder-cwd-filename" title="{nametitle}">{name}</div></div>',
7132
+ row : '<tr id="{id}" class="'+clFile+(fm.UA.Touch ? ' '+'elfinder-touch' : '')+' {permsclass} {dirclass}" title="{tooltip}"><td><div class="elfinder-cwd-file-wrapper"><span class="elfinder-cwd-icon {mime}"/>{marker}<span class="elfinder-cwd-filename">{name}</span></div></td>'+customColsBuild()+'</tr>',
7133
+ },
7134
+
7135
+ permsTpl = fm.res('tpl', 'perms'),
7136
+
7137
+ lockTpl = fm.res('tpl', 'lock'),
7138
+
7139
+ symlinkTpl = fm.res('tpl', 'symlink'),
7140
+
7141
+ /**
7142
+ * Template placeholders replacement rules
7143
+ *
7144
+ * @type Object
7145
+ **/
7146
+ replacement = {
7147
+ id : function(f) {
7148
+ return fm.cwdHash2Id(f.hash);
7149
+ },
7150
+ name : function(f) {
7151
+ name = fm.escape(f.name);
7152
+ !list && (name = name.replace(/([_.])/g, '&#8203;$1'));
7153
+ return name;
7154
+ },
7155
+ nametitle : function(f) {
7156
+ return fm.escape(f.name);
7157
+ },
7158
+ permsclass : function(f) {
7159
+ return fm.perms2class(f);
7160
+ },
7161
+ perm : function(f) {
7162
+ return fm.formatPermissions(f);
7163
+ },
7164
+ dirclass : function(f) {
7165
+ return f.mime == 'directory' ? 'directory' : '';
7166
+ },
7167
+ mime : function(f) {
7168
+ return fm.mime2class(f.mime);
7169
+ },
7170
+ size : function(f) {
7171
+ return fm.formatSize(f.size);
7172
+ },
7173
+ date : function(f) {
7174
+ return fm.formatDate(f);
7175
+ },
7176
+ kind : function(f) {
7177
+ return fm.mime2kind(f);
7178
+ },
7179
+ mode : function(f) {
7180
+ return f.perm? fm.formatFileMode(f.perm) : '';
7181
+ },
7182
+ modestr : function(f) {
7183
+ return f.perm? fm.formatFileMode(f.perm, 'string') : '';
7184
+ },
7185
+ modeoct : function(f) {
7186
+ return f.perm? fm.formatFileMode(f.perm, 'octal') : '';
7187
+ },
7188
+ modeboth : function(f) {
7189
+ return f.perm? fm.formatFileMode(f.perm, 'both') : '';
7190
+ },
7191
+ marker : function(f) {
7192
+ return (f.alias || f.mime == 'symlink-broken' ? symlinkTpl : '')+(!f.read || !f.write ? permsTpl : '')+(f.locked ? lockTpl : '');
7193
+ },
7194
+ tooltip : function(f) {
7195
+ var title = fm.formatDate(f) + (f.size > 0 ? ' ('+fm.formatSize(f.size)+')' : ''),
7196
+ info = '';
7197
+ if (query && f.path) {
7198
+ info = fm.escape(f.path.replace(/\/[^\/]*$/, ''));
7199
+ } else {
7200
+ info = f.tooltip? fm.escape(f.tooltip).replace(/\r/g, '&#13;') : '';
7201
+ }
7202
+ return info? info + '&#13;' + title : title;
7203
+ }
7204
+ },
7205
+
7206
+ /**
7207
+ * Return file html
7208
+ *
7209
+ * @param Object file info
7210
+ * @return String
7211
+ **/
7212
+ itemhtml = function(f) {
7213
+ return templates[list ? 'row' : 'icon']
7214
+ .replace(/\{([a-z]+)\}/g, function(s, e) {
7215
+ return replacement[e] ? replacement[e](f) : (f[e] ? f[e] : '');
7216
+ });
7217
+ },
7218
+
7219
+ /**
7220
+ * Flag. Required for msie to avoid unselect files on dragstart
7221
+ *
7222
+ * @type Boolean
7223
+ **/
7224
+ selectLock = false,
7225
+
7226
+ /**
7227
+ * Move selection to prev/next file
7228
+ *
7229
+ * @param String move direction
7230
+ * @param Boolean append to current selection
7231
+ * @return void
7232
+ * @rise select
7233
+ */
7234
+ select = function(keyCode, append) {
7235
+ var code = $.ui.keyCode,
7236
+ prev = keyCode == code.LEFT || keyCode == code.UP,
7237
+ sel = cwd.find('[id].'+clSelected),
7238
+ selector = prev ? 'first:' : 'last',
7239
+ s, n, sib, top, left;
7240
+
7241
+ function sibling(n, direction) {
7242
+ return n[direction+'All']('[id]:not(.'+clDisabled+'):not(.elfinder-cwd-parent):first');
7243
+ }
7244
+
7245
+ if (sel.length) {
7246
+ s = sel.filter(prev ? ':first' : ':last');
7247
+ sib = sibling(s, prev ? 'prev' : 'next');
7248
+
7249
+ if (!sib.length) {
7250
+ // there is no sibling on required side - do not move selection
7251
+ n = s;
7252
+ } else if (list || keyCode == code.LEFT || keyCode == code.RIGHT) {
7253
+ // find real prevoius file
7254
+ n = sib;
7255
+ } else {
7256
+ // find up/down side file in icons view
7257
+ top = s.position().top;
7258
+ left = s.position().left;
7259
+
7260
+ n = s;
7261
+ if (prev) {
7262
+ do {
7263
+ n = n.prev('[id]');
7264
+ } while (n.length && !(n.position().top < top && n.position().left <= left));
7265
+
7266
+ if (n.hasClass(clDisabled)) {
7267
+ n = sibling(n, 'next');
7268
+ }
7269
+ } else {
7270
+ do {
7271
+ n = n.next('[id]');
7272
+ } while (n.length && !(n.position().top > top && n.position().left >= left));
7273
+
7274
+ if (n.hasClass(clDisabled)) {
7275
+ n = sibling(n, 'prev');
7276
+ }
7277
+ // there is row before last one - select last file
7278
+ if (!n.length) {
7279
+ sib = cwd.find('[id]:not(.'+clDisabled+'):last');
7280
+ if (sib.position().top > top) {
7281
+ n = sib;
7282
+ }
7283
+ }
7284
+ }
7285
+ }
7286
+ // !append && unselectAll();
7287
+ } else {
7288
+ // there are no selected file - select first/last one
7289
+ n = cwd.find('[id]:not(.'+clDisabled+'):not(.elfinder-cwd-parent):'+(prev ? 'last' : 'first'));
7290
+ }
7291
+
7292
+ if (n && n.length && !n.hasClass('elfinder-cwd-parent')) {
7293
+ if (append) {
7294
+ // append new files to selected
7295
+ n = s.add(s[prev ? 'prevUntil' : 'nextUntil']('#'+n.attr('id'))).add(n);
7296
+ } else {
7297
+ // unselect selected files
7298
+ sel.trigger(evtUnselect);
7299
+ }
7300
+ // select file(s)
7301
+ n.trigger(evtSelect);
7302
+ // set its visible
7303
+ scrollToView(n.filter(prev ? ':first' : ':last'));
7304
+ // update cache/view
7305
+ trigger();
7306
+ }
7307
+ },
7308
+
7309
+ selectedFiles = [],
7310
+
7311
+ selectFile = function(hash) {
7312
+ $('#'+fm.cwdHash2Id(hash)).trigger(evtSelect);
7313
+ },
7314
+
7315
+ selectAll = function() {
7316
+ var phash = fm.cwd().hash;
7317
+
7318
+ cwd.find('[id]:not(.'+clSelected+'):not(.elfinder-cwd-parent)').trigger(evtSelect);
7319
+ selectedFiles = $.map(fm.files(), function(f) { return f.phash == phash ? f.hash : null ;});
7320
+ trigger();
7321
+ },
7322
+
7323
+ /**
7324
+ * Unselect all files
7325
+ *
7326
+ * @return void
7327
+ */
7328
+ unselectAll = function() {
7329
+ selectLock = false;
7330
+ selectedFiles = [];
7331
+ cwd.find('[id].'+clSelected).trigger(evtUnselect);
7332
+ trigger();
7333
+ },
7334
+
7335
+ /**
7336
+ * Return selected files hashes list
7337
+ *
7338
+ * @return Array
7339
+ */
7340
+ selected = function() {
7341
+ return selectedFiles;
7342
+ },
7343
+
7344
+ /**
7345
+ * Fire elfinder "select" event and pass selected files to it
7346
+ *
7347
+ * @return void
7348
+ */
7349
+ trigger = function() {
7350
+ fm.trigger('select', {selected : selectedFiles});
7351
+ },
7352
+
7353
+ /**
7354
+ * Scroll file to set it visible
7355
+ *
7356
+ * @param DOMElement file/dir node
7357
+ * @return void
7358
+ */
7359
+ scrollToView = function(o) {
7360
+ var ftop = o.position().top,
7361
+ fheight = o.outerHeight(true),
7362
+ wtop = wrapper.scrollTop(),
7363
+ wheight = wrapper.innerHeight();
7364
+
7365
+ if (ftop + fheight > wtop + wheight) {
7366
+ wrapper.scrollTop(parseInt(ftop + fheight - wheight));
7367
+ } else if (ftop < wtop) {
7368
+ wrapper.scrollTop(ftop);
7369
+ }
7370
+ },
7371
+
7372
+ /**
7373
+ * Files we get from server but not show yet
7374
+ *
7375
+ * @type Array
7376
+ **/
7377
+ buffer = [],
7378
+
7379
+ /**
7380
+ * Return index of elements with required hash in buffer
7381
+ *
7382
+ * @param String file hash
7383
+ * @return Number
7384
+ */
7385
+ index = function(hash) {
7386
+ var l = buffer.length;
7387
+
7388
+ while (l--) {
7389
+ if (buffer[l].hash == hash) {
7390
+ return l;
7391
+ }
7392
+ }
7393
+ return -1;
7394
+ },
7395
+
7396
+ /**
7397
+ * Scroll event name
7398
+ *
7399
+ * @type String
7400
+ **/
7401
+ scrollEvent = 'scroll.'+fm.namespace,
7402
+
7403
+ /**
7404
+ * jQuery UI selectable option
7405
+ *
7406
+ * @type Object
7407
+ */
7408
+ selectableOption = {
7409
+ filter : fileSelector,
7410
+ stop : trigger,
7411
+ delay : 250,
7412
+ selected : function(e, ui) { $(ui.selected).trigger(evtSelect); },
7413
+ unselected : function(e, ui) { $(ui.unselected).trigger(evtUnselect); }
7414
+ },
7415
+
7416
+ /**
7417
+ * Cwd scroll event handler.
7418
+ * Lazy load - append to cwd not shown files
7419
+ *
7420
+ * @return void
7421
+ */
7422
+ render = function() {
7423
+ var go = function(){
7424
+ var html = [],
7425
+ dirs = false,
7426
+ ltmb = [],
7427
+ atmb = {},
7428
+ last = buffer._last || cwd.find('[id]:last'),
7429
+ top = !last.length,
7430
+ place = buffer._place || (list ? cwd.children('table').children('tbody') : cwd),
7431
+ chk, files;
7432
+
7433
+ // check draging scroll bar
7434
+ top && (wrapper._top = 0);
7435
+ if (!!wrapper._mousedown && wrapper._top != wrapper.scrollTop()) {
7436
+ wrapper._top = wrapper.scrollTop();
7437
+ setTimeout(function(){
7438
+ go();
7439
+ }, 50);
7440
+ return;
7441
+ }
7442
+
7443
+ delete buffer._timer;
7444
+
7445
+ if (!buffer.length) {
7446
+ bottomMarker.hide();
7447
+ return wrapper.off(scrollEvent);
7448
+ }
7449
+
7450
+ //progress.show();
7451
+ while ((!last.length || (chk = last.position().top - (wrapper.height() + wrapper.scrollTop() + fm.options.showThreshold)) <= 0)
7452
+ && (files = buffer.splice(0, fm.options.showFiles - (chk || 0) / (buffer._hpi || 1))).length) {
7453
+
7454
+ html = $.map(files, function(f) {
7455
+ if (f.hash && f.name) {
7456
+ if (f.mime == 'directory') {
7457
+ dirs = true;
7458
+ }
7459
+ if (f.tmb) {
7460
+ f.tmb === 1 ? ltmb.push(f.hash) : (atmb[f.hash] = f.tmb);
7461
+ }
7462
+ return itemhtml(f);
7463
+ }
7464
+ return null;
7465
+ });
7466
+
7467
+ (top || !buffer.length) && bottomMarker.hide();
7468
+ place.append(html.join(''));
7469
+ last = cwd.find('[id]:last');
7470
+ // scroll top on dir load to avoid scroll after page reload
7471
+ top && wrapper.scrollTop(0);
7472
+ (top || !buffer._hpi) && bottomMarkerShow(place, files.length);
7473
+ if (top) { break; }
7474
+ }
7475
+
7476
+ // cache last
7477
+ buffer._last = last;
7478
+
7479
+ // load/attach thumbnails
7480
+ attachThumbnails(atmb);
7481
+ ltmb.length && loadThumbnails(ltmb);
7482
+
7483
+ // make directory droppable
7484
+ dirs && !mobile && makeDroppable();
7485
+
7486
+ if (selectedFiles.length) {
7487
+ place.find('[id]:not(.'+clSelected+'):not(.elfinder-cwd-parent)').each(function() {
7488
+ var id = fm.cwdId2Hash(this.id);
7489
+
7490
+ $.inArray(id, selectedFiles) !== -1 && $(this).trigger(evtSelect);
7491
+ });
7492
+ }
7493
+ };
7494
+
7495
+ // stop while scrolling
7496
+ buffer._timer && clearTimeout(buffer._timer);
7497
+ // first time to go()
7498
+ !buffer._timer && go();
7499
+ // regist next go()
7500
+ buffer._timer = setTimeout(function(){
7501
+ go();
7502
+ }, 100);
7503
+ },
7504
+
7505
+ /**
7506
+ * Droppable options for cwd.
7507
+ * Drop target is `wrapper`
7508
+ * Do not add class on childs file over
7509
+ *
7510
+ * @type Object
7511
+ */
7512
+ droppable = $.extend({}, fm.droppable, {
7513
+ over : function(e, ui) {
7514
+ var dst = $(this),
7515
+ helper = ui.helper,
7516
+ ctr = (e.shiftKey || e.ctrlKey || e.metaKey),
7517
+ hash, status, inParent;
7518
+ e.stopPropagation();
7519
+ helper.data('dropover', helper.data('dropover') + 1);
7520
+ dst.data('dropover', true);
7521
+ if (helper.data('namespace') !== fm.namespace) {
7522
+ dst.removeClass(clDropActive);
7523
+ return false;
7524
+ }
7525
+ if (dst.hasClass(fm.res(c, 'cwdfile'))) {
7526
+ hash = fm.cwdId2Hash(dst.attr('id'));
7527
+ dst.data('dropover', hash);
7528
+ } else {
7529
+ hash = fm.cwd().hash;
7530
+ fm.cwd().write && dst.data('dropover', hash);
7531
+ }
7532
+ inParent = (fm.file(helper.data('files')[0]).phash === hash);
7533
+ if (dst.data('dropover') === hash) {
7534
+ $.each(helper.data('files'), function(i, h) {
7535
+ if (h === hash || (inParent && !ctr && !helper.hasClass('elfinder-drag-helper-plus'))) {
7536
+ dst.removeClass(clDropActive);
7537
+ return false; // break $.each
7538
+ }
7539
+ });
7540
+ } else {
7541
+ dst.removeClass(clDropActive);
7542
+ }
7543
+ if (helper.data('locked') || inParent) {
7544
+ status = 'elfinder-drag-helper-plus';
7545
+ } else {
7546
+ status = 'elfinder-drag-helper-move';
7547
+ if (ctr) {
7548
+ status += ' elfinder-drag-helper-plus';
7549
+ }
7550
+ }
7551
+ dst.hasClass(clDropActive) && helper.addClass(status);
7552
+ setTimeout(function(){ dst.hasClass(clDropActive) && helper.addClass(status); }, 20);
7553
+ },
7554
+ out : function(e, ui) {
7555
+ var helper = ui.helper;
7556
+ e.stopPropagation();
7557
+ helper.removeClass('elfinder-drag-helper-move elfinder-drag-helper-plus').data('dropover', Math.max(helper.data('dropover') - 1, 0));
7558
+ $(this).removeData('dropover')
7559
+ .removeClass(clDropActive);
7560
+ },
7561
+ deactivate : function() {
7562
+ $(this).removeData('dropover')
7563
+ .removeClass(clDropActive);
7564
+ }
7565
+ }),
7566
+
7567
+ /**
7568
+ * Make directory droppable
7569
+ *
7570
+ * @return void
7571
+ */
7572
+ makeDroppable = function() {
7573
+ var targets = cwd.find('.directory:not(.'+clDroppable+',.elfinder-na,.elfinder-ro)');
7574
+ if (fm.isCommandEnabled('paste')) {
7575
+ targets.droppable(droppable);
7576
+ }
7577
+ if (fm.isCommandEnabled('upload')) {
7578
+ targets.addClass('native-droppable');
7579
+ }
7580
+ },
7581
+
7582
+ /**
7583
+ * Preload required thumbnails and on load add css to files.
7584
+ * Return false if required file is not visible yet (in buffer) -
7585
+ * required for old api to stop loading thumbnails.
7586
+ *
7587
+ * @param Object file hash -> thumbnail map
7588
+ * @return Boolean
7589
+ */
7590
+ attachThumbnails = function(images) {
7591
+ var url = fm.option('tmbUrl'),
7592
+ ret = true,
7593
+ ndx;
7594
+
7595
+ $.each(images, function(hash, tmb) {
7596
+ var node = $('#'+fm.cwdHash2Id(hash));
7597
+
7598
+ if (node.length) {
7599
+
7600
+ (function(node, tmb) {
7601
+ $('<img/>')
7602
+ .load(function() { node.find('.elfinder-cwd-icon').css('background', "url('"+tmb+"') center center no-repeat"); })
7603
+ .attr('src', tmb);
7604
+ })(node, fm.tmbUrls._search? fm.tmb(hash) : (url + tmb));
7605
+ } else {
7606
+ ret = false;
7607
+ if ((ndx = index(hash)) != -1) {
7608
+ buffer[ndx].tmb = tmb;
7609
+ }
7610
+ }
7611
+ });
7612
+ return ret;
7613
+ },
7614
+
7615
+ /**
7616
+ * Load thumbnails from backend.
7617
+ *
7618
+ * @param Array|Boolean files hashes list for new api | true for old api
7619
+ * @return void
7620
+ */
7621
+ loadThumbnails = function(files) {
7622
+ var tmbs = [];
7623
+
7624
+ if (fm.oldAPI) {
7625
+ fm.request({
7626
+ data : {cmd : 'tmb', current : fm.cwd().hash},
7627
+ preventFail : true
7628
+ })
7629
+ .done(function(data) {
7630
+ if (attachThumbnails(data.images||[]) && data.tmb) {
7631
+ loadThumbnails();
7632
+ }
7633
+ });
7634
+ return;
7635
+ }
7636
+
7637
+ tmbs = tmbs = files.splice(0, tmbNum);
7638
+ if (tmbs.length) {
7639
+ fm.request({
7640
+ data : {cmd : 'tmb', targets : tmbs},
7641
+ preventFail : true
7642
+ })
7643
+ .done(function(data) {
7644
+ if (attachThumbnails(data.images||[])) {
7645
+ loadThumbnails(files);
7646
+ }
7647
+ });
7648
+ }
7649
+ },
7650
+
7651
+ /**
7652
+ * Add new files to cwd/buffer
7653
+ *
7654
+ * @param Array new files
7655
+ * @return void
7656
+ */
7657
+ add = function(files) {
7658
+ var place = list ? cwd.find('tbody') : cwd,
7659
+ l = files.length,
7660
+ ltmb = [],
7661
+ atmb = {},
7662
+ dirs = false,
7663
+ findNode = function(file) {
7664
+ var pointer = cwd.find('[id]:first'), file2;
7665
+
7666
+ while (pointer.length) {
7667
+ file2 = fm.file(fm.cwdId2Hash(pointer.attr('id')));
7668
+ if (!pointer.hasClass('elfinder-cwd-parent') && file2 && fm.compare(file, file2) < 0) {
7669
+ return pointer;
7670
+ }
7671
+ pointer = pointer.next('[id]');
7672
+ }
7673
+ },
7674
+ findIndex = function(file) {
7675
+ var l = buffer.length, i;
7676
+
7677
+ for (i =0; i < l; i++) {
7678
+ if (fm.compare(file, buffer[i]) < 0) {
7679
+ return i;
7680
+ }
7681
+ }
7682
+ return l || -1;
7683
+ },
7684
+ file, hash, node, ndx;
7685
+
7686
+ l && wrapper.removeClass('elfinder-cwd-wrapper-empty');
7687
+
7688
+ while (l--) {
7689
+ file = files[l];
7690
+ hash = file.hash;
7691
+
7692
+ if ($('#'+fm.cwdHash2Id(hash)).length) {
7693
+ continue;
7694
+ }
7695
+
7696
+ if ((node = findNode(file)) && node.length) {
7697
+ node.before(itemhtml(file));
7698
+ } else if ((ndx = findIndex(file)) >= 0) {
7699
+ buffer.splice(ndx, 0, file);
7700
+ } else {
7701
+ place.append(itemhtml(file));
7702
+ }
7703
+
7704
+ if ($('#'+fm.cwdHash2Id(hash)).length) {
7705
+ if (file.mime == 'directory') {
7706
+ dirs = true;
7707
+ } else if (file.tmb) {
7708
+ file.tmb === 1 ? ltmb.push(hash) : (atmb[hash] = file.tmb);
7709
+ }
7710
+ }
7711
+ }
7712
+
7713
+ bottomMarkerShow(place);
7714
+ attachThumbnails(atmb);
7715
+ ltmb.length && loadThumbnails(ltmb);
7716
+ dirs && !mobile && makeDroppable();
7717
+ },
7718
+
7719
+ /**
7720
+ * Remove files from cwd/buffer
7721
+ *
7722
+ * @param Array files hashes
7723
+ * @return void
7724
+ */
7725
+ remove = function(files) {
7726
+ var l = files.length, hash, n, ndx;
7727
+
7728
+ // removed cwd
7729
+ if (!fm.cwd().hash && fm.currentReqCmd !== 'open') {
7730
+ $.each(cwdParents.reverse(), function(i, h) {
7731
+ if (fm.files()[h]) {
7732
+ fm.one(fm.currentReqCmd, function() {
7733
+ fm.exec('open', h);
7734
+ });
7735
+ return false;
7736
+ }
7737
+ });
7738
+ return;
7739
+ }
7740
+
7741
+ while (l--) {
7742
+ hash = files[l];
7743
+ if ((n = $('#'+fm.cwdHash2Id(hash))).length) {
7744
+ try {
7745
+ n.remove();
7746
+ } catch(e) {
7747
+ fm.debug('error', e);
7748
+ }
7749
+ } else if ((ndx = index(hash)) != -1) {
7750
+ buffer.splice(ndx, 1);
7751
+ }
7752
+ }
7753
+
7754
+ // refresh cwd if empty for a bug of browser (ex. Android Chrome 43.0.2357.93)
7755
+ if (cwd.children().length < 1) {
7756
+ wrapper.addClass('elfinder-cwd-wrapper-empty');
7757
+ cwd.hide();
7758
+ setTimeout(function(){ cwd.show(); }, 0);
7759
+ }
7760
+ },
7761
+
7762
+ msg = {
7763
+ name : fm.i18n('name'),
7764
+ perm : fm.i18n('perms'),
7765
+ date : fm.i18n('modify'),
7766
+ size : fm.i18n('size'),
7767
+ kind : fm.i18n('kind'),
7768
+ modestr : fm.i18n('mode'),
7769
+ modeoct : fm.i18n('mode'),
7770
+ modeboth : fm.i18n('mode'),
7771
+ },
7772
+
7773
+ customColsNameBuild = function() {
7774
+ var name = '',
7775
+ customColsName = '',
7776
+ columns = fm.options.uiOptions.cwd.listView.columns,
7777
+ names = $.extend({}, msg, fm.options.uiOptions.cwd.listView.columnsCustomName);
7778
+ for (var i = 0; i < columns.length; i++) {
7779
+ if (typeof names[columns[i]] !== 'undefined') {
7780
+ name = names[columns[i]];
7781
+ } else {
7782
+ name = fm.i18n(columns[i]);
7783
+ }
7784
+ customColsName +='<td class="elfinder-cwd-view-th-'+columns[i]+'">'+name+'</td>';
7785
+ }
7786
+ return customColsName;
7787
+ },
7788
+
7789
+ bottomMarkerShow = function(place, cnt) {
7790
+ var ph;
7791
+ place = place || (list ? cwd.find('tbody') : cwd);
7792
+
7793
+ if (buffer.length > 0) {
7794
+ place.css({height: 'auto'});
7795
+ ph = place.height();
7796
+ cnt && (buffer._hpi = ph / cnt);
7797
+ bottomMarker.css({top: (buffer._hpi * buffer.length + ph) + 'px'}).show();
7798
+ }
7799
+ },
7800
+
7801
+ /**
7802
+ * Update directory content
7803
+ *
7804
+ * @param Array files
7805
+ * @return void
7806
+ */
7807
+ content = function(files, any) {
7808
+ var phash = fm.cwd().hash;
7809
+
7810
+ cwdParents = fm.parents(phash);
7811
+
7812
+ unselectAll();
7813
+
7814
+ try {
7815
+ // to avoid problem with draggable
7816
+ cwd.empty();
7817
+ } catch (e) {
7818
+ cwd.html('');
7819
+ }
7820
+
7821
+ cwd.removeClass('elfinder-cwd-view-icons elfinder-cwd-view-list')
7822
+ .addClass('elfinder-cwd-view-'+(list ? 'list' :'icons'));
7823
+ cwd.css('height', 'auto');
7824
+ bottomMarker.hide();
7825
+
7826
+ wrapper[list ? 'addClass' : 'removeClass']('elfinder-cwd-wrapper-list');
7827
+ wrapper._padding = parseInt(wrapper.css('padding-top')) + parseInt(wrapper.css('padding-bottom'));
7828
+
7829
+ list && cwd.html('<table><thead><tr class="ui-state-default'+(fm.UA.Touch? ' elfinder-touch' : '')+'"><td class="elfinder-cwd-view-th-name">'+msg.name+'</td>'+customColsNameBuild()+'</tr></thead><tbody/></table>');
7830
+
7831
+ buffer = $.map(files, function(f) { return any || f.phash == phash ? f : null; });
7832
+
7833
+ buffer = fm.sortFiles(buffer);
7834
+
7835
+ wrapper[(!any && buffer.length < 1) ? 'addClass' : 'removeClass']('elfinder-cwd-wrapper-empty').on(scrollEvent, render).trigger(scrollEvent);
7836
+
7837
+ phash = fm.cwd().phash;
7838
+
7839
+ if (options.oldSchool && phash && !query) {
7840
+ var parent = $.extend(true, {}, fm.file(phash), {name : '..', mime : 'directory'});
7841
+ parent = $(itemhtml(parent))
7842
+ .addClass('elfinder-cwd-parent')
7843
+ .bind('mousedown click mouseup touchstart touchmove touchend dblclick mouseenter', function(e) {
7844
+ e.preventDefault();
7845
+ e.stopPropagation();
7846
+ })
7847
+ .dblclick(function() {
7848
+ fm.exec('open', fm.cwdId2Hash(this.id));
7849
+ });
7850
+
7851
+ (list ? cwd.find('tbody') : cwd).prepend(parent);
7852
+ }
7853
+
7854
+ // set droppable
7855
+ if (any || !fm.cwd().write) {
7856
+ wrapper.removeClass('native-droppable')
7857
+ .droppable('disable');
7858
+ } else {
7859
+ wrapper[fm.isCommandEnabled('upload')? 'addClass' : 'removeClass']('native-droppable');
7860
+ wrapper.droppable('enable');
7861
+ }
7862
+ },
7863
+
7864
+ /**
7865
+ * CWD node itself
7866
+ *
7867
+ * @type JQuery
7868
+ **/
7869
+ cwd = $(this)
7870
+ .addClass('ui-helper-clearfix elfinder-cwd')
7871
+ .attr('unselectable', 'on')
7872
+ // fix ui.selectable bugs and add shift+click support
7873
+ .on('click.'+fm.namespace, fileSelector, function(e) {
7874
+ var p = this.id ? $(this) : $(this).parents('[id]:first'),
7875
+ prev = p.prevAll('.'+clSelected+':first'),
7876
+ next = p.nextAll('.'+clSelected+':first'),
7877
+ pl = prev.length,
7878
+ nl = next.length,
7879
+ sib;
7880
+
7881
+ if (cwd.data('longtap')) {
7882
+ e.stopPropagation();
7883
+ return;
7884
+ }
7885
+
7886
+ e.stopImmediatePropagation();
7887
+
7888
+ if (e.shiftKey && (pl || nl)) {
7889
+ sib = pl ? p.prevUntil('#'+prev.attr('id')) : p.nextUntil('#'+next.attr('id'));
7890
+ sib.add(p).trigger(evtSelect);
7891
+ } else if (e.ctrlKey || e.metaKey) {
7892
+ p.trigger(p.hasClass(clSelected) ? evtUnselect : evtSelect);
7893
+ } else {
7894
+ if (p.data('touching') && p.hasClass(clSelected)) {
7895
+ p.data('touching', null);
7896
+ fm.dblclick({file : fm.cwdId2Hash(this.id)});
7897
+ unselectAll();
7898
+ return;
7899
+ } else {
7900
+ unselectAll();
7901
+ p.trigger(evtSelect);
7902
+ }
7903
+ }
7904
+
7905
+ trigger();
7906
+ })
7907
+ // call fm.open()
7908
+ .on('dblclick.'+fm.namespace, fileSelector, function(e) {
7909
+ fm.dblclick({file : fm.cwdId2Hash(this.id)});
7910
+ })
7911
+ // for touch device
7912
+ .on('touchstart.'+fm.namespace, fileSelector, function(e) {
7913
+ e.stopPropagation();
7914
+ if (e.target.nodeName == 'INPUT' || e.target.nodeName == 'TEXTAREA') {
7915
+ return;
7916
+ }
7917
+ var p = this.id ? $(this) : $(this).parents('[id]:first'),
7918
+ sel = p.prevAll('.'+clSelected+':first').length +
7919
+ p.nextAll('.'+clSelected+':first').length;
7920
+ cwd.data('longtap', null);
7921
+ p.addClass(clHover)
7922
+ .data('touching', true)
7923
+ .data('tmlongtap', setTimeout(function(){
7924
+ // long tap
7925
+ cwd.data('longtap', true);
7926
+ if (p.hasClass(clSelected) && sel > 0) {
7927
+ p.trigger(evtUnselect);
7928
+ trigger();
7929
+ } else {
7930
+ if (e.target.nodeName != 'TD' || fm.selected().length > 0) {
7931
+ p.trigger(evtSelect);
7932
+ trigger();
7933
+ fm.trigger('contextmenu', {
7934
+ 'type' : 'files',
7935
+ 'targets' : fm.selected(),
7936
+ 'x' : e.originalEvent.touches[0].pageX,
7937
+ 'y' : e.originalEvent.touches[0].pageY
7938
+ });
7939
+ }
7940
+ }
7941
+ }, 500));
7942
+ })
7943
+ .on('touchmove.'+fm.namespace+' touchend.'+fm.namespace, fileSelector, function(e) {
7944
+ e.stopPropagation();
7945
+ if (e.target.nodeName == 'INPUT' || e.target.nodeName == 'TEXTAREA') {
7946
+ return;
7947
+ }
7948
+ var p = this.id ? $(this) : $(this).parents('[id]:first');
7949
+ clearTimeout(p.data('tmlongtap'));
7950
+ if (e.type == 'touchmove') {
7951
+ p.removeClass(clHover);
7952
+ }
7953
+ })
7954
+ // attach draggable
7955
+ .on('mouseenter.'+fm.namespace, fileSelector, function(e) {
7956
+ var $this = $(this), helper = null,
7957
+ target = list ? $this : $this.children('div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename');
7958
+
7959
+ if (!mobile && !$this.hasClass(clTmp) && !target.hasClass(clDraggable+' '+clDisabled)) {
7960
+ target.on('mousedown', function(e) {
7961
+ // shiftKey + drag start for HTML5 native drag function
7962
+ if (e.shiftKey && !fm.UA.IE && cwd.data('selectable')) {
7963
+ // destroy jQuery-ui selectable while trigger native drag
7964
+ cwd.selectable('destroy').data('selectable', false);
7965
+ setTimeout(function(){
7966
+ cwd.selectable(selectableOption).data('selectable', true);
7967
+ }, 10);
7968
+ }
7969
+ target.draggable('option', 'disabled', e.shiftKey);
7970
+ if (e.shiftKey) {
7971
+ target.attr('draggable', 'true');
7972
+ } else {
7973
+ target.attr('draggable', 'false')
7974
+ .draggable('option', 'cursorAt', {left: 50 - parseInt($(e.currentTarget).css('margin-left')), top: 47});
7975
+ }
7976
+ })
7977
+ .on('dragstart', function(e) {
7978
+ var dt = e.dataTransfer || e.originalEvent.dataTransfer || null;
7979
+ helper = null;
7980
+ if (dt && !fm.UA.IE) {
7981
+ var p = this.id ? $(this) : $(this).parents('[id]:first'),
7982
+ elm = $('<span>'),
7983
+ url = '',
7984
+ durl = null,
7985
+ murl = null,
7986
+ files = [],
7987
+ icon = function(f) {
7988
+ var mime = f.mime, i;
7989
+ i = '<div class="elfinder-cwd-icon '+fm.mime2class(mime)+' ui-corner-all"/>';
7990
+ if (f.tmb && f.tmb !== 1) {
7991
+ i = $(i).css('background', "url('"+fm.option('tmbUrl')+f.tmb+"') center center no-repeat").get(0).outerHTML;
7992
+ }
7993
+ return i;
7994
+ }, l, geturl = [];
7995
+ p.trigger(evtSelect);
7996
+ trigger();
7997
+ $.each(selectedFiles, function(i, v){
7998
+ var file = fm.file(v),
7999
+ furl = file.url;
8000
+ if (file && file.mime !== 'directory') {
8001
+ if (!furl) {
8002
+ furl = fm.url(file.hash);
8003
+ } else if (furl == '1') {
8004
+ geturl.push(v);
8005
+ return true;
8006
+ }
8007
+ if (furl) {
8008
+ furl = fm.convAbsUrl(furl);
8009
+ files.push(v);
8010
+ $('<a>').attr('href', furl).text(furl).appendTo(elm);
8011
+ url += furl + "\n";
8012
+ if (!durl) {
8013
+ durl = file.mime + ':' + file.name + ':' + furl;
8014
+ }
8015
+ if (!murl) {
8016
+ murl = furl + "\n" + file.name;
8017
+ }
8018
+ }
8019
+ }
8020
+ });
8021
+ if (geturl.length) {
8022
+ $.each(geturl, function(i, v){
8023
+ var rfile = fm.file(v);
8024
+ rfile.url = '';
8025
+ fm.request({
8026
+ data : {cmd : 'url', target : v},
8027
+ notify : {type : 'url', cnt : 1},
8028
+ preventDefault : true
8029
+ })
8030
+ .always(function(data) {
8031
+ rfile.url = data.url? data.url : '1';
8032
+ });
8033
+ });
8034
+ return false;
8035
+ } else if (url) {
8036
+ if (dt.setDragImage) {
8037
+ helper = $('<div class="elfinder-drag-helper html5-native"></div>').append(icon(fm.file(files[0]))).appendTo($(document.body));
8038
+ if ((l = files.length) > 1) {
8039
+ helper.append(icon(fm.file(files[l-1])) + '<span class="elfinder-drag-num">'+l+'</span>');
8040
+ }
8041
+ dt.setDragImage(helper.get(0), 50, 47);
8042
+ }
8043
+ dt.effectAllowed = 'copyLink';
8044
+ dt.setData('DownloadURL', durl);
8045
+ dt.setData('text/x-moz-url', murl);
8046
+ dt.setData('text/uri-list', url);
8047
+ dt.setData('text/plain', url);
8048
+ dt.setData('text/html', elm.html());
8049
+ dt.setData('elfinderfrom', window.location.href + fm.cwd().hash);
8050
+ dt.setData('elfinderfrom:' + dt.getData('elfinderfrom'), '');
8051
+ } else {
8052
+ return false;
8053
+ }
8054
+ }
8055
+ })
8056
+ .on('dragend', function(e){
8057
+ unselectAll();
8058
+ helper && helper.remove();
8059
+ })
8060
+ .draggable(fm.draggable);
8061
+ }
8062
+ })
8063
+ // add hover class to selected file
8064
+ .on(evtSelect, fileSelector, function(e) {
8065
+ var $this = $(this),
8066
+ id = fm.cwdId2Hash($this.attr('id'));
8067
+
8068
+ if (!selectLock && !$this.hasClass(clDisabled)) {
8069
+ $this.addClass(clSelected).children().addClass(clHover);
8070
+ if ($.inArray(id, selectedFiles) === -1) {
8071
+ selectedFiles.push(id);
8072
+ }
8073
+ }
8074
+ })
8075
+ // remove hover class from unselected file
8076
+ .on(evtUnselect, fileSelector, function(e) {
8077
+ var $this = $(this),
8078
+ id = fm.cwdId2Hash($this.attr('id')),
8079
+ ndx;
8080
+
8081
+ if (!selectLock) {
8082
+ $(this).removeClass(clSelected).children().removeClass(clHover);
8083
+ ndx = $.inArray(id, selectedFiles);
8084
+ if (ndx !== -1) {
8085
+ selectedFiles.splice(ndx, 1);
8086
+ }
8087
+ }
8088
+
8089
+ })
8090
+ // disable files wich removing or moving
8091
+ .on(evtDisable, fileSelector, function() {
8092
+ var $this = $(this).removeClass(clHover+' '+clSelected).addClass(clDisabled),
8093
+ child = $this.children(),
8094
+ target = (list ? $this : child);
8095
+
8096
+ child.removeClass(clHover+' '+clSelected);
8097
+
8098
+ $this.hasClass(clDroppable) && $this.droppable('disable');
8099
+ target.hasClass(clDraggable) && target.draggable('disable');
8100
+ })
8101
+ // if any files was not removed/moved - unlock its
8102
+ .on(evtEnable, fileSelector, function() {
8103
+ var $this = $(this).removeClass(clDisabled),
8104
+ target = list ? $this : $this.children();
8105
+
8106
+ $this.hasClass(clDroppable) && $this.droppable('enable');
8107
+ target.hasClass(clDraggable) && target.draggable('enable');
8108
+ })
8109
+ .on('scrolltoview', fileSelector, function() {
8110
+ scrollToView($(this));
8111
+ })
8112
+ .on('mouseenter.'+fm.namespace+' mouseleave.'+fm.namespace, fileSelector, function(e) {
8113
+ fm.trigger('hover', {hash : fm.cwdId2Hash($(this).attr('id')), type : e.type});
8114
+ $(this).toggleClass(clHover, (e.type == 'mouseenter'));
8115
+ })
8116
+ .on('contextmenu.'+fm.namespace, function(e) {
8117
+ var file = $(e.target).closest('.'+clFile);
8118
+
8119
+ if (file.length && (e.target.nodeName != 'TD' || $.inArray(fm.cwdId2Hash(file.get(0).id), fm.selected()) > -1)) {
8120
+ e.stopPropagation();
8121
+ e.preventDefault();
8122
+ if (!file.hasClass(clDisabled) && !file.data('touching')) {
8123
+ if (!file.hasClass(clSelected)) {
8124
+ // cwd.trigger('unselectall');
8125
+ unselectAll();
8126
+ file.trigger(evtSelect);
8127
+ trigger();
8128
+ }
8129
+ fm.trigger('contextmenu', {
8130
+ 'type' : 'files',
8131
+ 'targets' : fm.selected(),
8132
+ 'x' : e.pageX,
8133
+ 'y' : e.pageY
8134
+ });
8135
+
8136
+ }
8137
+
8138
+ }
8139
+ // e.preventDefault();
8140
+
8141
+
8142
+ })
8143
+ // unselect all on cwd click
8144
+ .on('click.'+fm.namespace, function(e) {
8145
+ if (cwd.data('longtap')) {
8146
+ e.stopPropagation();
8147
+ return;
8148
+ }
8149
+ !e.shiftKey && !e.ctrlKey && !e.metaKey && unselectAll();
8150
+ })
8151
+
8152
+ // make files selectable
8153
+ .selectable(selectableOption)
8154
+ .data('selectable', true)
8155
+ // prepend fake file/dir
8156
+ .on('create.'+fm.namespace, function(e, file) {
8157
+ var parent = list ? cwd.find('tbody') : cwd,
8158
+ p = parent.find('.elfinder-cwd-parent'),
8159
+ file = $(itemhtml(file)).addClass(clTmp);
8160
+
8161
+ unselectAll();
8162
+
8163
+ if (p.length) {
8164
+ p.after(file);
8165
+ } else {
8166
+ parent.prepend(file);
8167
+ }
8168
+
8169
+ cwd.parent().scrollTop(0);
8170
+ })
8171
+ // unselect all selected files
8172
+ .on('unselectall', unselectAll)
8173
+ .on('selectfile', function(e, id) {
8174
+ $('#'+fm.cwdHash2Id(id)).trigger(evtSelect);
8175
+ trigger();
8176
+ }),
8177
+ wrapper = $('<div class="elfinder-cwd-wrapper"/>')
8178
+ // make cwd itself droppable for folders from nav panel
8179
+ .droppable($.extend({}, droppable, {autoDisable: false}))
8180
+ .on('contextmenu', function(e) {
8181
+ e.preventDefault();
8182
+ fm.trigger('contextmenu', {
8183
+ 'type' : 'cwd',
8184
+ 'targets' : [fm.cwd().hash],
8185
+ 'x' : e.pageX,
8186
+ 'y' : e.pageY
8187
+ });
8188
+
8189
+ })
8190
+ // for touch device
8191
+ .on('touchstart.'+fm.namespace, function(e) {
8192
+ var p = $(this);
8193
+ cwd.data('longtap', null);
8194
+ p.data('touching', true);
8195
+ p.data('tmlongtap', setTimeout(function(){
8196
+ // long tap
8197
+ cwd.data('longtap', true);
8198
+ fm.trigger('contextmenu', {
8199
+ 'type' : 'cwd',
8200
+ 'targets' : [fm.cwd().hash],
8201
+ 'x' : e.originalEvent.touches[0].pageX,
8202
+ 'y' : e.originalEvent.touches[0].pageY
8203
+ });
8204
+ }, 500));
8205
+ })
8206
+ .on('touchmove.'+fm.namespace+' touchend.'+fm.namespace, function(e) {
8207
+ clearTimeout($(this).data('tmlongtap'));
8208
+ })
8209
+ .on('mousedown', function(){wrapper._mousedown = true;})
8210
+ .on('mouseup', function(){wrapper._mousedown = false;}),
8211
+
8212
+ bottomMarker = $('<div>&nbsp;</div>')
8213
+ .css({position: 'absolute', width: '1px', height: '1px'})
8214
+ .hide(),
8215
+
8216
+ restm = null,
8217
+ resize = function(init) {
8218
+ var initHeight = function() {
8219
+ var h = 0;
8220
+ wrapper.siblings('div.elfinder-panel:visible').each(function() {
8221
+ h += $(this).outerHeight(true);
8222
+ });
8223
+ wrapper.height(wz.height() - h - wrapper._padding);
8224
+ };
8225
+
8226
+ init && initHeight();
8227
+
8228
+ restm && clearTimeout(restm);
8229
+ restm = setTimeout(function(){
8230
+ !init && initHeight();
8231
+ var wph, cwdoh;
8232
+ // fix cwd height if it less then wrapper
8233
+ cwd.css('height', 'auto');
8234
+ wph = wrapper[0].clientHeight - parseInt(wrapper.css('padding-top')) - parseInt(wrapper.css('padding-bottom')),
8235
+ cwdoh = cwd.outerHeight(true);
8236
+ if (cwdoh < wph) {
8237
+ cwd.height(wph);
8238
+ }
8239
+ }, 20);
8240
+ },
8241
+
8242
+ // elfinder node
8243
+ parent = $(this).parent().resize(resize),
8244
+
8245
+ // workzone node
8246
+ wz = parent.children('.elfinder-workzone').append(wrapper.append(this).append(bottomMarker))
8247
+ ;
8248
+
8249
+
8250
+ // for iOS5 bug
8251
+ $('body').on('touchstart touchmove touchend', function(e){});
8252
+
8253
+ fm
8254
+ .one('init', function(){
8255
+ var style = document.createElement('style'),
8256
+ sheet;
8257
+ document.head.appendChild(style);
8258
+ sheet = style.sheet;
8259
+ sheet.insertRule('.elfinder-cwd-wrapper-empty .elfinder-cwd:after{ content:"'+fm.i18n('emptyFolder')+'" }', 0);
8260
+ sheet.insertRule('.ui-droppable.elfinder-cwd-wrapper-empty .elfinder-cwd:after{ content:"'+fm.i18n('emptyFolder'+(mobile? 'LTap' : 'Drop'))+'" }', 1);
8261
+ sheet.insertRule('.ui-droppable.elfinder-cwd-wrapper-empty.ui-droppable-disabled .elfinder-cwd:after{ content:"'+fm.i18n('emptyFolder')+'" }', 2);
8262
+ })
8263
+ .bind('open', function(e) {
8264
+ content(e.data.files);
8265
+ resize();
8266
+ })
8267
+ .bind('search', function(e) {
8268
+ lastSearch = e.data.files;
8269
+ content(lastSearch, true);
8270
+ wrapper.addClass('elfinder-search-result');
8271
+ fm.autoSync('stop');
8272
+ resize();
8273
+ })
8274
+ .bind('searchend', function(e) {
8275
+ lastSearch = [];
8276
+ if (query) {
8277
+ query = '';
8278
+ if (!e.data || !e.data.noupdate) {
8279
+ content(fm.files());
8280
+ }
8281
+ }
8282
+ wrapper.removeClass('elfinder-search-result');
8283
+ fm.autoSync();
8284
+ resize();
8285
+ })
8286
+ .bind('searchstart', function(e) {
8287
+ query = e.data.query;
8288
+ })
8289
+ .bind('sortchange', function() {
8290
+ content(query ? lastSearch : fm.files(), !!query);
8291
+ })
8292
+ .bind('viewchange', function() {
8293
+ var sel = fm.selected(),
8294
+ l = fm.storage('view') == 'list';
8295
+
8296
+ if (l != list) {
8297
+ list = l;
8298
+ content(query ? lastSearch : fm.files(), !!query);
8299
+
8300
+ $.each(sel, function(i, h) {
8301
+ selectFile(h);
8302
+ });
8303
+ trigger();
8304
+ }
8305
+ resize();
8306
+ })
8307
+ .bind('resize', function() {
8308
+ var place = list ? cwd.find('tbody') : cwd;
8309
+ resize(true);
8310
+ bottomMarkerShow(place, place.find('[id]').length);
8311
+ })
8312
+ .bind('add', function() {
8313
+ resize();
8314
+ })
8315
+ .add(function(e) {
8316
+ var phash = fm.cwd().hash,
8317
+ files = query
8318
+ ? $.map(e.data.added || [], function(f) { return f.name.indexOf(query) === -1 ? null : f ;})
8319
+ : $.map(e.data.added || [], function(f) { return f.phash == phash ? f : null; })
8320
+ ;
8321
+ add(files);
8322
+ })
8323
+ .change(function(e) {
8324
+ var phash = fm.cwd().hash,
8325
+ sel = fm.selected(),
8326
+ files;
8327
+
8328
+ if (query) {
8329
+ $.each(e.data.changed || [], function(i, file) {
8330
+ remove([file.hash]);
8331
+ if (file.name.indexOf(query) !== -1) {
8332
+ add([file]);
8333
+ $.inArray(file.hash, sel) !== -1 && selectFile(file.hash);
8334
+ }
8335
+ });
8336
+ } else {
8337
+ $.each($.map(e.data.changed || [], function(f) { return f.phash == phash ? f : null; }), function(i, file) {
8338
+ remove([file.hash]);
8339
+ add([file]);
8340
+ $.inArray(file.hash, sel) !== -1 && selectFile(file.hash);
8341
+ });
8342
+ }
8343
+
8344
+ trigger();
8345
+ })
8346
+ .remove(function(e) {
8347
+ remove(e.data.removed || []);
8348
+ trigger();
8349
+ })
8350
+ // select dragged file if no selected, disable selectable
8351
+ .dragstart(function(e) {
8352
+ var target = $(e.data.target),
8353
+ oe = e.data.originalEvent;
8354
+
8355
+ if (target.hasClass(fileSelector.substr(1))) {
8356
+
8357
+ if (!target.hasClass(clSelected)) {
8358
+ !(oe.ctrlKey || oe.metaKey || oe.shiftKey) && unselectAll();
8359
+ target.trigger(evtSelect);
8360
+ trigger();
8361
+ }
8362
+ }
8363
+
8364
+ cwd.selectable('disable').removeClass(clDisabled);
8365
+ selectLock = true;
8366
+ })
8367
+ // enable selectable
8368
+ .dragstop(function() {
8369
+ cwd.selectable('enable');
8370
+ selectLock = false;
8371
+ })
8372
+ .bind('lockfiles unlockfiles selectfiles unselectfiles', function(e) {
8373
+ var events = {
8374
+ lockfiles : evtDisable ,
8375
+ unlockfiles : evtEnable ,
8376
+ selectfiles : evtSelect,
8377
+ unselectfiles : evtUnselect },
8378
+ event = events[e.type],
8379
+ files = e.data.files || [],
8380
+ l = files.length,
8381
+ helper = e.data.helper || $(),
8382
+ parents, ctr;
8383
+
8384
+ if (l > 0) {
8385
+ parents = fm.parents(files[0]);
8386
+ }
8387
+ if (!helper.data('locked')) {
8388
+ while (l--) {
8389
+ $('#'+fm.cwdHash2Id(files[l])).trigger(event);
8390
+ }
8391
+ trigger();
8392
+ }
8393
+ if (wrapper.data('dropover') && parents.indexOf(wrapper.data('dropover')) !== -1) {
8394
+ ctr = e.type !== 'lockfiles';
8395
+ helper.toggleClass('elfinder-drag-helper-plus', ctr);
8396
+ wrapper.toggleClass(clDropActive, ctr);
8397
+ }
8398
+ })
8399
+ // select new files after some actions
8400
+ .bind('mkdir mkfile duplicate upload rename archive extract paste multiupload', function(e) {
8401
+ if (e.type == 'upload' && e.data._multiupload) return;
8402
+ var phash = fm.cwd().hash, files;
8403
+
8404
+ unselectAll();
8405
+
8406
+ $.each(e.data.added || [], function(i, file) {
8407
+ file && file.phash == phash && selectFile(file.hash);
8408
+ });
8409
+ trigger();
8410
+ })
8411
+ .shortcut({
8412
+ pattern :'ctrl+a',
8413
+ description : 'selectall',
8414
+ callback : selectAll
8415
+ })
8416
+ .shortcut({
8417
+ pattern : 'left right up down shift+left shift+right shift+up shift+down',
8418
+ description : 'selectfiles',
8419
+ type : 'keydown' , //fm.UA.Firefox || fm.UA.Opera ? 'keypress' : 'keydown',
8420
+ callback : function(e) { select(e.keyCode, e.shiftKey); }
8421
+ })
8422
+ .shortcut({
8423
+ pattern : 'home',
8424
+ description : 'selectffile',
8425
+ callback : function(e) {
8426
+ unselectAll();
8427
+ scrollToView(cwd.find('[id]:first').trigger(evtSelect));
8428
+ trigger();
8429
+ }
8430
+ })
8431
+ .shortcut({
8432
+ pattern : 'end',
8433
+ description : 'selectlfile',
8434
+ callback : function(e) {
8435
+ unselectAll();
8436
+ scrollToView(cwd.find('[id]:last').trigger(evtSelect)) ;
8437
+ trigger();
8438
+ }
8439
+ });
8440
+
8441
+ });
8442
+
8443
+ // fm.timeEnd('cwdLoad')
8444
+
8445
+ return this;
8446
+ }
8447
+
8448
+
8449
+ /*
8450
+ * File: /js/ui/dialog.js
8451
+ */
8452
+
8453
+ /**
8454
+ * @class elFinder dialog
8455
+ *
8456
+ * @author Dmitry (dio) Levashov
8457
+ **/
8458
+ $.fn.elfinderdialog = function(opts) {
8459
+ var dialog;
8460
+
8461
+ if (typeof(opts) == 'string' && (dialog = this.closest('.ui-dialog')).length) {
8462
+ if (opts == 'open') {
8463
+ dialog.css('display') == 'none' && dialog.fadeIn(120, function() {
8464
+ dialog.trigger('open');
8465
+ });
8466
+ } else if (opts == 'close') {
8467
+ dialog.css('display') != 'none' && dialog.hide().trigger('close');
8468
+ } else if (opts == 'destroy') {
8469
+ dialog.hide().remove();
8470
+ } else if (opts == 'toTop') {
8471
+ dialog.trigger('totop');
8472
+ } else if (opts == 'posInit') {
8473
+ dialog.trigger('posinit');
8474
+ }
8475
+ }
8476
+
8477
+ opts = $.extend({}, $.fn.elfinderdialog.defaults, opts);
8478
+
8479
+ this.filter(':not(.ui-dialog-content)').each(function() {
8480
+ var self = $(this).addClass('ui-dialog-content ui-widget-content'),
8481
+ parent = self.parent(),
8482
+ clactive = 'elfinder-dialog-active',
8483
+ cldialog = 'elfinder-dialog',
8484
+ clnotify = 'elfinder-dialog-notify',
8485
+ clhover = 'ui-state-hover',
8486
+ id = parseInt(Math.random()*1000000),
8487
+ overlay = parent.children('.elfinder-overlay'),
8488
+ buttonset = $('<div class="ui-dialog-buttonset"/>'),
8489
+ buttonpane = $('<div class=" ui-helper-clearfix ui-dialog-buttonpane ui-widget-content"/>')
8490
+ .append(buttonset),
8491
+ platformWin = (window.navigator.platform.indexOf('Win') != -1),
8492
+
8493
+ dialog = $('<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable std42-dialog '+cldialog+' '+opts.cssClass+'"/>')
8494
+ .hide()
8495
+ .append(self)
8496
+ .appendTo(parent)
8497
+ .draggable({
8498
+ handle : '.ui-dialog-titlebar',
8499
+ containment : 'document',
8500
+ stop : function(e, ui){
8501
+ dialog.css({height : opts.height});
8502
+ }
8503
+ })
8504
+ .css({
8505
+ width : opts.width,
8506
+ height : opts.height//,
8507
+ //maxWidth: opts.maxWidth? opts.maxWidth : $(window).width()-10,
8508
+ //maxHeight: opts.maxHeight? opts.maxHeight : $(window).height()-20
8509
+ })
8510
+ .mousedown(function(e) {
8511
+ e.stopPropagation();
8512
+
8513
+ $(document).mousedown();
8514
+
8515
+ if (!dialog.hasClass(clactive)) {
8516
+ parent.find('.'+cldialog+':visible').removeClass(clactive);
8517
+ dialog.addClass(clactive).zIndex(maxZIndex() + 1);
8518
+ }
8519
+ })
8520
+ .on('open', function() {
8521
+ var d = $(this),
8522
+ maxWinWidth = (d.outerWidth() > parent.width()-10)? parent.width()-10 : null;
8523
+
8524
+ maxWinWidth && d.css({width: maxWinWidth, left: '5px'});
8525
+
8526
+ dialog.trigger('totop');
8527
+
8528
+ typeof(opts.open) == 'function' && $.proxy(opts.open, self[0])();
8529
+
8530
+ if (!dialog.hasClass(clnotify)) {
8531
+
8532
+ parent.find('.'+cldialog+':visible').not('.'+clnotify).each(function() {
8533
+ var d = $(this),
8534
+ top = parseInt(d.css('top')),
8535
+ left = parseInt(d.css('left')),
8536
+ _top = parseInt(dialog.css('top')),
8537
+ _left = parseInt(dialog.css('left'))
8538
+ ;
8539
+
8540
+ if (d[0] != dialog[0] && (top == _top || left == _left)) {
8541
+ dialog.css({
8542
+ top : (top+(maxWinWidth? 15 : 10))+'px',
8543
+ left : (maxWinWidth? 5 : left+10)+'px'
8544
+ });
8545
+ }
8546
+ });
8547
+ }
8548
+ })
8549
+ .on('close', function() {
8550
+ var dialogs = parent.find('.elfinder-dialog:visible'),
8551
+ z = maxZIndex();
8552
+
8553
+ $(this).data('modal') && overlay.elfinderoverlay('hide');
8554
+
8555
+ // get focus to next dialog
8556
+ if (dialogs.length) {
8557
+ dialogs.each(function() {
8558
+ var d = $(this);
8559
+ if (d.zIndex() >= z) {
8560
+ d.trigger('totop');
8561
+ return false;
8562
+ }
8563
+ })
8564
+ } else {
8565
+ // return focus to parent
8566
+ setTimeout(function() {
8567
+ parent.mousedown().click();
8568
+ }, 10);
8569
+
8570
+ }
8571
+
8572
+ if (typeof(opts.close) == 'function') {
8573
+ $.proxy(opts.close, self[0])();
8574
+ } else if (opts.destroyOnClose) {
8575
+ dialog.hide().remove();
8576
+ }
8577
+ })
8578
+ .on('totop', function() {
8579
+ $(this).mousedown().find('.ui-button:'+(platformWin? 'first':'last')).focus().end().find(':text:first').focus();
8580
+ $(this).data('modal') && overlay.is(':hidden') && overlay.elfinderoverlay('show');
8581
+ overlay.zIndex($(this).zIndex());
8582
+ })
8583
+ .on('posinit', function() {
8584
+ var css = opts.position;
8585
+ if (!css) {
8586
+ css = {
8587
+ top : Math.max(0, parseInt((parent.height() - dialog.outerHeight())/2 - 42))+'px',
8588
+ left : Math.max(0, parseInt((parent.width() - dialog.outerWidth())/2))+'px'
8589
+ };
8590
+ }
8591
+ dialog.css(css);
8592
+ })
8593
+ .data({modal: opts.modal}),
8594
+ maxZIndex = function() {
8595
+ var z = parent.zIndex() + 10;
8596
+ parent.find('.'+cldialog+':visible').each(function() {
8597
+ var _z;
8598
+ if (this != dialog[0]) {
8599
+ _z = $(this).zIndex();
8600
+ if (_z > z) {
8601
+ z = _z;
8602
+ }
8603
+ }
8604
+ })
8605
+ return z;
8606
+ },
8607
+ top
8608
+ ;
8609
+
8610
+ dialog.trigger('posinit');
8611
+
8612
+ if (opts.closeOnEscape) {
8613
+ $(document).on('keyup.'+id, function(e) {
8614
+ if (e.keyCode == $.ui.keyCode.ESCAPE && dialog.hasClass(clactive)) {
8615
+ self.elfinderdialog('close');
8616
+ $(document).off('keyup.'+id);
8617
+ }
8618
+ })
8619
+ }
8620
+ dialog.prepend(
8621
+ $('<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">'+opts.title+'</div>')
8622
+ .prepend($('<a href="#" class="ui-dialog-titlebar-close ui-corner-all"><span class="ui-icon ui-icon-closethick"/></a>')
8623
+ .mousedown(function(e) {
8624
+ e.preventDefault();
8625
+ self.elfinderdialog('close');
8626
+ }))
8627
+
8628
+ );
8629
+
8630
+
8631
+
8632
+ $.each(opts.buttons, function(name, cb) {
8633
+ var button = $('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text">'+name+'</span></button>')
8634
+ .click($.proxy(cb, self[0]))
8635
+ .hover(function(e) {
8636
+ if (opts.btnHoverFocus) {
8637
+ $(this)[e.type == 'mouseenter' ? 'focus' : 'blur']();
8638
+ } else {
8639
+ $(this).toggleClass(clhover, e.type == 'mouseenter');
8640
+ }
8641
+ })
8642
+ .focus(function() { $(this).addClass(clhover) })
8643
+ .blur(function() { $(this).removeClass(clhover) })
8644
+ .keydown(function(e) {
8645
+ var next;
8646
+
8647
+ if (e.keyCode == $.ui.keyCode.ENTER) {
8648
+ $(this).click();
8649
+ } else if (e.keyCode == $.ui.keyCode.TAB || e.keyCode == $.ui.keyCode.RIGHT) {
8650
+ e.preventDefault();
8651
+ next = $(this).next('.ui-button');
8652
+ next.length ? next.focus() : $(this).parent().children('.ui-button:first').focus();
8653
+ } else if (e.keyCode == $.ui.keyCode.LEFT) {
8654
+ e.preventDefault();
8655
+ next = $(this).prev('.ui-button');
8656
+ next.length ? next.focus() : $(this).parent().children('.ui-button:last').focus()
8657
+ }
8658
+ })
8659
+ if (platformWin) {
8660
+ buttonset.append(button);
8661
+ } else {
8662
+ buttonset.prepend(button);
8663
+ }
8664
+ })
8665
+
8666
+ buttonset.children().length && dialog.append(buttonpane);
8667
+ if (opts.resizable && $.fn.resizable) {
8668
+ dialog.resizable({
8669
+ minWidth : opts.minWidth,
8670
+ minHeight : opts.minHeight,
8671
+ alsoResize : this
8672
+ });
8673
+ }
8674
+
8675
+ typeof(opts.create) == 'function' && $.proxy(opts.create, this)();
8676
+
8677
+ opts.autoOpen && self.elfinderdialog('open');
8678
+
8679
+ });
8680
+
8681
+ return this;
8682
+ }
8683
+
8684
+ $.fn.elfinderdialog.defaults = {
8685
+ cssClass : '',
8686
+ title : '',
8687
+ modal : false,
8688
+ resizable : true,
8689
+ autoOpen : true,
8690
+ closeOnEscape : true,
8691
+ destroyOnClose : false,
8692
+ buttons : {},
8693
+ btnHoverFocus : true,
8694
+ position : null,
8695
+ width : 320,
8696
+ height : 'auto',
8697
+ minWidth : 200,
8698
+ minHeight : 110
8699
+ }
8700
+
8701
+ /*
8702
+ * File: /js/ui/navbar.js
8703
+ */
8704
+
8705
+ /**
8706
+ * @class elfindernav - elFinder container for diretories tree and places
8707
+ *
8708
+ * @author Dmitry (dio) Levashov
8709
+ **/
8710
+ $.fn.elfindernavbar = function(fm, opts) {
8711
+
8712
+ this.not('.elfinder-navbar').each(function() {
8713
+ var nav = $(this).addClass('ui-state-default elfinder-navbar'),
8714
+ parent = nav.parent()
8715
+ .resize(function() {
8716
+ nav.height(wz.height() - delta);
8717
+ }),
8718
+ wz = parent.children('.elfinder-workzone').append(nav),
8719
+ delta = nav.outerHeight() - nav.height(),
8720
+ ltr = fm.direction == 'ltr',
8721
+ handle;
8722
+
8723
+
8724
+ if ($.fn.resizable) {
8725
+ handle = nav.resizable({
8726
+ handles : ltr ? 'e' : 'w',
8727
+ minWidth : opts.minWidth || 150,
8728
+ maxWidth : opts.maxWidth || 500
8729
+ })
8730
+ .on('resize scroll', function() {
8731
+ var offset = (fm.UA.Opera && nav.scrollLeft())? 20 : 2;
8732
+ handle.css({
8733
+ top : parseInt(nav.scrollTop())+'px',
8734
+ left : ltr ? 'auto' : parseInt(nav.scrollLeft() + offset),
8735
+ right: ltr ? parseInt(nav.scrollLeft() - offset) * -1 : 'auto'
8736
+ });
8737
+ })
8738
+ .find('.ui-resizable-handle').zIndex(nav.zIndex() + 10);
8739
+
8740
+ if (fm.UA.Touch) {
8741
+ var toggle = function(){
8742
+ if (handle.data('closed')) {
8743
+ handle.data('closed', false).css({backgroundColor: 'transparent'});
8744
+ nav.css({width: handle.data('width')}).trigger('resize');
8745
+ } else {
8746
+ handle.data('closed', true).css({backgroundColor: 'inherit'});
8747
+ nav.css({width: 8});
8748
+ }
8749
+ handle.data({startX: null, endX: null});
8750
+ };
8751
+ handle.data({closed: false, width: nav.width()})
8752
+ .on('touchstart', function(e){
8753
+ handle.data('startX', e.originalEvent.touches[0].pageX);
8754
+ })
8755
+ .on('touchmove', function(e){
8756
+ var x = e.originalEvent.touches[0].pageX;
8757
+ var sx = handle.data('startX');
8758
+ var open = ltr? (sx && sx < x) : (sx > x);
8759
+ var close = ltr? (sx > x) : (sx && sx < x);
8760
+ (open || close) && toggle();
8761
+ })
8762
+ .on('touchend', function(e){
8763
+ handle.data('startX') && toggle();
8764
+ });
8765
+ if (fm.UA.Mobile) {
8766
+ handle.data('defWidth', nav.width());
8767
+ $(window).on('resize', function(e){
8768
+ var hw = nav.parent().width() / 2;
8769
+ if (handle.data('defWidth') > hw) {
8770
+ nav.width(hw);
8771
+ } else {
8772
+ nav.width(handle.data('defWidth'));
8773
+ }
8774
+ handle.data('width', nav.width());
8775
+ });
8776
+ }
8777
+ }
8778
+
8779
+ fm.one('open', function() {
8780
+ setTimeout(function() {
8781
+ nav.trigger('resize');
8782
+ }, 150);
8783
+ });
8784
+ }
8785
+ });
8786
+
8787
+ return this;
8788
+ };
8789
+
8790
+
8791
+ /*
8792
+ * File: /js/ui/overlay.js
8793
+ */
8794
+
8795
+
8796
+ $.fn.elfinderoverlay = function(opts) {
8797
+
8798
+ this.filter(':not(.elfinder-overlay)').each(function() {
8799
+ opts = $.extend({}, opts);
8800
+ $(this).addClass('ui-widget-overlay elfinder-overlay')
8801
+ .hide()
8802
+ .mousedown(function(e) {
8803
+ e.preventDefault();
8804
+ e.stopPropagation();
8805
+ })
8806
+ .data({
8807
+ cnt : 0,
8808
+ show : typeof(opts.show) == 'function' ? opts.show : function() { },
8809
+ hide : typeof(opts.hide) == 'function' ? opts.hide : function() { }
8810
+ });
8811
+ });
8812
+
8813
+ if (opts == 'show') {
8814
+ var o = this.eq(0),
8815
+ cnt = o.data('cnt') + 1,
8816
+ show = o.data('show');
8817
+
8818
+ o.data('cnt', cnt);
8819
+
8820
+ if (o.is(':hidden')) {
8821
+ o.zIndex(o.parent().zIndex()+1);
8822
+ o.show();
8823
+ show();
8824
+ }
8825
+ }
8826
+
8827
+ if (opts == 'hide') {
8828
+ var o = this.eq(0),
8829
+ cnt = o.data('cnt') - 1,
8830
+ hide = o.data('hide');
8831
+
8832
+ o.data('cnt', cnt);
8833
+
8834
+ if (cnt == 0 && o.is(':visible')) {
8835
+ o.hide();
8836
+ hide();
8837
+ }
8838
+ }
8839
+
8840
+ return this;
8841
+ }
8842
+
8843
+ /*
8844
+ * File: /js/ui/panel.js
8845
+ */
8846
+
8847
+ $.fn.elfinderpanel = function(fm) {
8848
+
8849
+ return this.each(function() {
8850
+ var panel = $(this).addClass('elfinder-panel ui-state-default ui-corner-all'),
8851
+ margin = 'margin-'+(fm.direction == 'ltr' ? 'left' : 'right');
8852
+
8853
+ fm.one('load', function(e) {
8854
+ var navbar = fm.getUI('navbar');
8855
+
8856
+ panel.css(margin, parseInt(navbar.outerWidth(true)));
8857
+ navbar.on('resize', function() {
8858
+ panel.is(':visible') && panel.css(margin, parseInt(navbar.outerWidth(true)))
8859
+ })
8860
+ })
8861
+ })
8862
+ }
8863
+
8864
+ /*
8865
+ * File: /js/ui/path.js
8866
+ */
8867
+
8868
+ /**
8869
+ * @class elFinder ui
8870
+ * Display current folder path in statusbar.
8871
+ * Click on folder name in path - open folder
8872
+ *
8873
+ * @author Dmitry (dio) Levashov
8874
+ **/
8875
+ $.fn.elfinderpath = function(fm) {
8876
+ return this.each(function() {
8877
+ var query = '',
8878
+ target = '',
8879
+ mimes = [],
8880
+ path = $(this).addClass('elfinder-path').html('&nbsp;')
8881
+ .on('click', 'a', function(e) {
8882
+ var hash = $(this).attr('href').substr(5);
8883
+
8884
+ e.preventDefault();
8885
+ if (hash != fm.cwd().hash) {
8886
+ if (query) {
8887
+ fm.exec('search', query, { target: hash, mime: mimes.join(' ') });
8888
+ } else {
8889
+ fm.exec('open', hash);
8890
+ }
8891
+ }
8892
+ })
8893
+ .prependTo(fm.getUI('statusbar').show())
8894
+
8895
+ fm.bind('open searchend parents', function() {
8896
+ var dirs = [];
8897
+
8898
+ query = '';
8899
+ target = '';
8900
+ mimes = [];
8901
+
8902
+ $.each(fm.parents(fm.cwd().hash), function(i, hash) {
8903
+ dirs.push('<a href="#elf_'+hash+'">'+fm.escape(fm.file(hash).name)+'</a>');
8904
+ });
8905
+
8906
+ path.html(dirs.join(fm.option('separator')));
8907
+ })
8908
+ .bind('searchstart', function(e) {
8909
+ if (e.data) {
8910
+ query = e.data.query || '';
8911
+ target = e.data.target || '';
8912
+ mimes = e.data.mimes || []
8913
+ }
8914
+ })
8915
+ .bind('search', function(e) {
8916
+ var dirs = [],
8917
+ html = '';
8918
+ if (target) {
8919
+ $.each(fm.parents(target), function(i, hash) {
8920
+ dirs.push('<a href="#elf_'+hash+'">'+fm.escape(fm.file(hash).name)+'</a>');
8921
+ });
8922
+ html = dirs.join(fm.option('separator'));
8923
+ } else {
8924
+ html = fm.i18n('btnAll');
8925
+ }
8926
+ path.html(fm.i18n('searcresult') + ': ' + html);
8927
+ });
8928
+ });
8929
+ }
8930
+
8931
+ /*
8932
+ * File: /js/ui/places.js
8933
+ */
8934
+
8935
+ /**
8936
+ * @class elFinder places/favorites ui
8937
+ *
8938
+ * @author Dmitry (dio) Levashov
8939
+ **/
8940
+ $.fn.elfinderplaces = function(fm, opts) {
8941
+ return this.each(function() {
8942
+ var dirs = {},
8943
+ c = 'class',
8944
+ navdir = fm.res(c, 'navdir'),
8945
+ collapsed = fm.res(c, 'navcollapse'),
8946
+ expanded = fm.res(c, 'navexpand'),
8947
+ hover = fm.res(c, 'hover'),
8948
+ clroot = fm.res(c, 'treeroot'),
8949
+ dropover = fm.res(c, 'adroppable'),
8950
+ tpl = fm.res('tpl', 'placedir'),
8951
+ ptpl = fm.res('tpl', 'perms'),
8952
+ spinner = $(fm.res('tpl', 'navspinner')),
8953
+ key = 'places'+(opts.suffix? opts.suffix : ''),
8954
+ menuTimer = null,
8955
+ /**
8956
+ * Convert places dir node into dir hash
8957
+ *
8958
+ * @param String directory id
8959
+ * @return String
8960
+ **/
8961
+ id2hash = function(id) { return id.substr(6); },
8962
+ /**
8963
+ * Convert places dir node into dir hash
8964
+ *
8965
+ * @param String directory id
8966
+ * @return String
8967
+ **/
8968
+ hash2id = function(hash) { return 'place-'+hash; },
8969
+
8970
+ /**
8971
+ * Save current places state
8972
+ *
8973
+ * @return void
8974
+ **/
8975
+ save = function() {
8976
+ var hashes = [], data = [];
8977
+
8978
+ hashes = $.map(subtree.children().find('[id]'), function(n) {
8979
+ return id2hash(n.id);
8980
+ });
8981
+ $.each(hashes.reverse(), function(i, h) {
8982
+ data.push(h + '#' + dirs[h].name);
8983
+ });
8984
+
8985
+
8986
+ fm.storage(key, data.join(','));
8987
+ },
8988
+ /**
8989
+ * Return node for given dir object
8990
+ *
8991
+ * @param Object directory object
8992
+ * @return jQuery
8993
+ **/
8994
+ create = function(dir, hash) {
8995
+ return $(tpl.replace(/\{id\}/, hash2id(dir? dir.hash : hash))
8996
+ .replace(/\{name\}/, fm.escape(dir? dir.name : hash))
8997
+ .replace(/\{cssclass\}/, dir? (fm.UA.Touch ? 'elfinder-touch ' : '')+fm.perms2class(dir) : '')
8998
+ .replace(/\{permissions\}/, (dir && (!dir.read || !dir.write))? ptpl : '')
8999
+ .replace(/\{title\}/, (dir && dir.path)? fm.escape(dir.path) : '')
9000
+ .replace(/\{symlink\}/, '')
9001
+ .replace(/\{style\}/, ''));
9002
+ },
9003
+ /**
9004
+ * Add new node into places
9005
+ *
9006
+ * @param Object directory object
9007
+ * @return void
9008
+ **/
9009
+ add = function(dir) {
9010
+ var node, hash;
9011
+
9012
+ if (dir.mime !== 'directory') {
9013
+ return false;
9014
+ }
9015
+ hash = dir.hash;
9016
+ if (!fm.files().hasOwnProperty(hash)) {
9017
+ // update cache
9018
+ fm.trigger('tree', {tree: [dir]});
9019
+ }
9020
+
9021
+ node = create(dir, hash);
9022
+ if (dir.notfound) {
9023
+ node.addClass('ui-state-disabled');
9024
+ }
9025
+
9026
+ dirs[hash] = dir;
9027
+ subtree.prepend(node);
9028
+ root.addClass(collapsed);
9029
+
9030
+ return true;
9031
+ },
9032
+ /**
9033
+ * Remove dir from places
9034
+ *
9035
+ * @param String directory hash
9036
+ * @return String removed name
9037
+ **/
9038
+ remove = function(hash) {
9039
+ var name = null, tgt;
9040
+
9041
+ if (dirs[hash]) {
9042
+ delete dirs[hash];
9043
+ tgt = $('#'+hash2id(hash));
9044
+ if (tgt.length) {
9045
+ name = tgt.text();
9046
+ tgt.parent().remove();
9047
+ if (!subtree.children().length) {
9048
+ root.removeClass(collapsed);
9049
+ places.removeClass(expanded);
9050
+ subtree.slideToggle(false);
9051
+ }
9052
+ }
9053
+ }
9054
+
9055
+ return name;
9056
+ },
9057
+ /**
9058
+ * Move up dir on places
9059
+ *
9060
+ * @param String directory hash
9061
+ * @return void
9062
+ **/
9063
+ moveup = function(hash) {
9064
+ var self = $('#'+hash2id(hash)),
9065
+ tgt = self.parent(),
9066
+ prev = tgt.prev('div'),
9067
+ cls = 'ui-state-hover',
9068
+ ctm = fm.getUI('contextmenu');
9069
+
9070
+ menuTimer && clearTimeout(menuTimer);
9071
+
9072
+ if (prev.length) {
9073
+ ctm.find(':first').data('placesHash', hash);
9074
+ self.addClass(cls);
9075
+ tgt.insertBefore(prev);
9076
+ prev = tgt.prev('div');
9077
+ menuTimer = setTimeout(function() {
9078
+ self.removeClass(cls);
9079
+ if (ctm.find(':first').data('placesHash') === hash) {
9080
+ ctm.hide().empty();
9081
+ }
9082
+ }, 1500);
9083
+ }
9084
+
9085
+ if(!prev.length) {
9086
+ self.removeClass(cls);
9087
+ ctm.hide().empty();
9088
+ }
9089
+ },
9090
+ /**
9091
+ * Update dir at places
9092
+ *
9093
+ * @param Object directory
9094
+ * @param String previous hash
9095
+ * @return Boolean
9096
+ **/
9097
+ update = function(dir, preHash) {
9098
+ var hash = dir.hash,
9099
+ tgt = $('#'+hash2id(preHash || hash)),
9100
+ node = create(dir, hash);
9101
+
9102
+ if (tgt.length > 0) {
9103
+ if (dir.notfound) {
9104
+ node.addClass('ui-state-disabled');
9105
+ }
9106
+ tgt.parent().replaceWith(node);
9107
+ dirs[hash] = dir;
9108
+ return true
9109
+ } else {
9110
+ return false;
9111
+ }
9112
+ },
9113
+ /**
9114
+ * Remove all dir from places
9115
+ *
9116
+ * @return void
9117
+ **/
9118
+ clear = function() {
9119
+ subtree.empty();
9120
+ root.removeClass(collapsed);
9121
+ places.removeClass(expanded);
9122
+ subtree.slideToggle(false);
9123
+ },
9124
+ /**
9125
+ * Sort places dirs A-Z
9126
+ *
9127
+ * @return void
9128
+ **/
9129
+ sort = function() {
9130
+ $.each(dirs, function(h, f) {
9131
+ var dir = fm.file(h) || f,
9132
+ node = create(dir, h),
9133
+ ret = null;
9134
+ if (!dir) {
9135
+ node.hide();
9136
+ }
9137
+ if (subtree.children().length) {
9138
+ $.each(subtree.children(), function() {
9139
+ var current = $(this);
9140
+ if (dir.name.localeCompare(current.children('.'+navdir).text()) < 0) {
9141
+ ret = !node.insertBefore(current);
9142
+ return ret;
9143
+ }
9144
+ });
9145
+ if (ret !== null) {
9146
+ return true;
9147
+ }
9148
+ }
9149
+ !$('#'+hash2id(h)).length && subtree.append(node);
9150
+ });
9151
+ save();
9152
+ },
9153
+ /**
9154
+ * Node - wrapper for places root
9155
+ *
9156
+ * @type jQuery
9157
+ **/
9158
+ wrapper = create({
9159
+ hash : 'root-'+fm.namespace,
9160
+ name : fm.i18n(opts.name, 'places'),
9161
+ read : true,
9162
+ write : true
9163
+ }),
9164
+ /**
9165
+ * Places root node
9166
+ *
9167
+ * @type jQuery
9168
+ **/
9169
+ root = wrapper.children('.'+navdir)
9170
+ .addClass(clroot)
9171
+ .click(function(e) {
9172
+ e.stopPropagation();
9173
+ if (root.hasClass(collapsed)) {
9174
+ places.toggleClass(expanded);
9175
+ subtree.slideToggle();
9176
+ fm.storage('placesState', places.hasClass(expanded)? 1 : 0);
9177
+ }
9178
+ })
9179
+ .append(
9180
+ // sort button
9181
+ $('<span class="elfinder-button-icon elfinder-button-icon-sort elfinder-places-root-icon" title="'+fm.i18n('cmdsort')+'"/>')
9182
+ .on('click', function(e) {
9183
+ e.stopPropagation();
9184
+ subtree.empty();
9185
+ sort();
9186
+ }
9187
+ )
9188
+ ),
9189
+ /**
9190
+ * Container for dirs
9191
+ *
9192
+ * @type jQuery
9193
+ **/
9194
+ subtree = wrapper.children('.'+fm.res(c, 'navsubtree'))
9195
+ .sortable({
9196
+ appendTo : 'body',
9197
+ revert : false,
9198
+ helper : function(e) {
9199
+ var dir = $(e.target).parent();
9200
+
9201
+ dir.children().removeClass('ui-state-hover');
9202
+
9203
+ return $('<div class="ui-widget elfinder-place-drag elfinder-'+fm.direction+'"/>')
9204
+ .append($('<div class="elfinder-navbar"/>').show().append(dir.clone()));
9205
+
9206
+ },
9207
+ stop : function(e, ui) {
9208
+ var target = $(ui.item[0]),
9209
+ top = places.offset().top,
9210
+ left = places.offset().left,
9211
+ width = places.width(),
9212
+ height = places.height(),
9213
+ x = e.pageX,
9214
+ y = e.pageY;
9215
+
9216
+ if (!(x > left && x < left+width && y > top && y < y+height)) {
9217
+ remove(id2hash(target.children(':first').attr('id')));
9218
+ save();
9219
+ }
9220
+ },
9221
+ update : function(e, ui) {
9222
+ save();
9223
+ }
9224
+ }),
9225
+ /**
9226
+ * Main places container
9227
+ *
9228
+ * @type jQuery
9229
+ **/
9230
+ places = $(this).addClass(fm.res(c, 'tree')+' elfinder-places ui-corner-all')
9231
+ .hide()
9232
+ .append(wrapper)
9233
+ .appendTo(fm.getUI('navbar'))
9234
+ .on('mouseenter mouseleave', '.'+navdir, function(e) {
9235
+ $(this).toggleClass('ui-state-hover', (e.type == 'mouseenter'));
9236
+ })
9237
+ .on('click', '.'+navdir, function(e) {
9238
+ var p = $(this);
9239
+ if (p.data('longtap')) {
9240
+ e.stopPropagation();
9241
+ return;
9242
+ }
9243
+ fm.exec('open', p.attr('id').substr(6));
9244
+ })
9245
+ .on('contextmenu', '.'+navdir+':not(.'+clroot+')', function(e) {
9246
+ var self = $(this),
9247
+ hash = self.attr('id').substr(6);
9248
+
9249
+ e.preventDefault();
9250
+
9251
+ fm.trigger('contextmenu', {
9252
+ raw : [{
9253
+ label : fm.i18n('moveUp'),
9254
+ icon : 'up',
9255
+ remain : true,
9256
+ callback : function() { moveup(hash); save(); }
9257
+ },'|',{
9258
+ label : fm.i18n('rmFromPlaces'),
9259
+ icon : 'rm',
9260
+ callback : function() { remove(hash); save(); }
9261
+ }],
9262
+ 'x' : e.pageX,
9263
+ 'y' : e.pageY
9264
+ });
9265
+
9266
+ self.addClass('ui-state-hover');
9267
+
9268
+ fm.getUI('contextmenu').children().on('mouseenter', function() {
9269
+ self.addClass('ui-state-hover');
9270
+ });
9271
+
9272
+ fm.bind('closecontextmenu', function() {
9273
+ self.removeClass('ui-state-hover');
9274
+ });
9275
+ })
9276
+ .droppable({
9277
+ tolerance : 'pointer',
9278
+ accept : '.elfinder-cwd-file-wrapper,.elfinder-tree-dir,.elfinder-cwd-file',
9279
+ hoverClass : fm.res('class', 'adroppable'),
9280
+ over : function(e, ui) {
9281
+ var helper = ui.helper,
9282
+ dir = $.map(helper.data('files'), function(h) { return (fm.file(h).mime === 'directory' && !dirs[h])? h : null});
9283
+ e.stopPropagation();
9284
+ helper.data('dropover', helper.data('dropover') + 1);
9285
+ if (dir.length > 0) {
9286
+ helper.addClass('elfinder-drag-helper-plus');
9287
+ } else {
9288
+ $(this).removeClass(dropover);
9289
+ }
9290
+ fm.trigger('unlockfiles', {files : helper.data('files'), helper: helper});
9291
+ },
9292
+ out : function(e, ui) {
9293
+ var helper = ui.helper;
9294
+ e.stopPropagation();
9295
+ helper.removeClass('elfinder-drag-helper-move elfinder-drag-helper-plus').data('dropover', Math.max(helper.data('dropover') - 1, 0));
9296
+ $(this).removeData('dropover')
9297
+ .removeClass(dropover);
9298
+ fm.trigger('unlockfiles', {files : helper.data('files'), helper: helper});
9299
+ },
9300
+ drop : function(e, ui) {
9301
+ var helper = ui.helper,
9302
+ resolve = true;
9303
+
9304
+ $.each(helper.data('files'), function(i, hash) {
9305
+ var dir = fm.file(hash);
9306
+
9307
+ if (dir && dir.mime == 'directory' && !dirs[dir.hash]) {
9308
+ add(dir);
9309
+ } else {
9310
+ resolve = false;
9311
+ }
9312
+ })
9313
+ save();
9314
+ resolve && helper.hide();
9315
+ }
9316
+ })
9317
+ // for touch device
9318
+ .on('touchstart', '.'+navdir+':not(.'+clroot+')', function(e) {
9319
+ var hash = $(this).attr('id').substr(6),
9320
+ p = $(this)
9321
+ .addClass(hover)
9322
+ .data('longtap', null)
9323
+ .data('tmlongtap', setTimeout(function(){
9324
+ // long tap
9325
+ p.data('longtap', true);
9326
+ fm.trigger('contextmenu', {
9327
+ raw : [{
9328
+ label : fm.i18n('rmFromPlaces'),
9329
+ icon : 'rm',
9330
+ callback : function() { remove(hash); save(); }
9331
+ }],
9332
+ 'x' : e.originalEvent.touches[0].pageX,
9333
+ 'y' : e.originalEvent.touches[0].pageY
9334
+ });
9335
+ }, 500));
9336
+ })
9337
+ .on('touchmove touchend', '.'+navdir+':not(.'+clroot+')', function(e) {
9338
+ clearTimeout($(this).data('tmlongtap'));
9339
+ if (e.type == 'touchmove') {
9340
+ $(this).removeClass(hover);
9341
+ }
9342
+ });
9343
+
9344
+ // "on regist" for command exec
9345
+ $(this).on('regist', function(e, files){
9346
+ var added = false;
9347
+ $.each(files, function(i, dir) {
9348
+ if (dir && dir.mime == 'directory' && !dirs[dir.hash]) {
9349
+ if (add(dir)) {
9350
+ added = true;
9351
+ }
9352
+ }
9353
+ });
9354
+ added && save();
9355
+ });
9356
+
9357
+
9358
+ // on fm load - show places and load files from backend
9359
+ fm.one('load', function() {
9360
+ var dat, hashes;
9361
+
9362
+ if (fm.oldAPI) {
9363
+ return;
9364
+ }
9365
+
9366
+ places.show().parent().show();
9367
+
9368
+ dirs = {};
9369
+ dat = $.map((fm.storage(key) || '').split(','), function(hash) { return hash || null;});
9370
+ $.each(dat, function(i, d) {
9371
+ var dir = d.split('#')
9372
+ dirs[dir[0]] = dir[1]? dir[1] : { hash: dir[0], name: dir[0] };
9373
+ });
9374
+
9375
+ hashes = Object.keys(dirs);
9376
+ if (hashes.length) {
9377
+ root.prepend(spinner);
9378
+
9379
+ fm.request({
9380
+ data : {cmd : 'info', targets : hashes},
9381
+ preventDefault : true
9382
+ })
9383
+ .done(function(data) {
9384
+ var exists = {};
9385
+ $.each(data.files, function(i, f) {
9386
+ var hash = f.hash;
9387
+ exists[hash] = f;
9388
+ });
9389
+ $.each(dirs, function(h, f) {
9390
+ add(exists[h] || { hash: h, name: f, mime: 'directory', notfound: true });
9391
+ });
9392
+ if (fm.storage('placesState') > 0) {
9393
+ root.click();
9394
+ }
9395
+ })
9396
+ .always(function() {
9397
+ spinner.remove();
9398
+ })
9399
+ }
9400
+
9401
+
9402
+ fm.change(function(e) {
9403
+ var changed = false;
9404
+ $.each(e.data.changed, function(i, file) {
9405
+ if (dirs[file.hash]) {
9406
+ if (file.mime !== 'directory') {
9407
+ if (remove(file.hash)) {
9408
+ changed = true;
9409
+ }
9410
+ } else {
9411
+ if (update(file)) {
9412
+ changed = true;
9413
+ }
9414
+ }
9415
+ }
9416
+ });
9417
+ changed && save();
9418
+ })
9419
+ .bind('rename', function(e) {
9420
+ var changed = false;
9421
+ if (e.data.removed) {
9422
+ $.each(e.data.removed, function(i, hash) {
9423
+ if (e.data.added[i]) {
9424
+ if (update(e.data.added[i], hash)) {
9425
+ changed = true;
9426
+ }
9427
+ }
9428
+ });
9429
+ }
9430
+ changed && save();
9431
+ })
9432
+ .bind('rm paste', function(e) {
9433
+ var names = [],
9434
+ changed = false;
9435
+ if (e.data.removed) {
9436
+ $.each(e.data.removed, function(i, hash) {
9437
+ var name = remove(hash);
9438
+ name && names.push(name);
9439
+ });
9440
+ }
9441
+ if (names.length) {
9442
+ changed = true;
9443
+ }
9444
+ if (e.data.added && names.length) {
9445
+ $.each(e.data.added, function(i, file) {
9446
+ if ($.inArray(file.name, names) !== 1) {
9447
+ file.mime == 'directory' && add(file);
9448
+ }
9449
+ });
9450
+ }
9451
+ changed && save();
9452
+ })
9453
+ .bind('sync', function() {
9454
+ var hashes = Object.keys(dirs);
9455
+ if (hashes.length) {
9456
+ root.prepend(spinner);
9457
+
9458
+ fm.request({
9459
+ data : {cmd : 'info', targets : hashes},
9460
+ preventDefault : true
9461
+ })
9462
+ .done(function(data) {
9463
+ var exists = {},
9464
+ updated = false,
9465
+ cwd = fm.cwd().hash;
9466
+ $.each(data.files || [], function(i, file) {
9467
+ var hash = file.hash;
9468
+ exists[hash] = file;
9469
+ if (!fm.files().hasOwnProperty(file.hash)) {
9470
+ // update cache
9471
+ fm.trigger('tree', {tree: [file]});
9472
+ }
9473
+ });
9474
+ $.each(dirs, function(h, f) {
9475
+ if (!f.notfound != !!exists[h]) {
9476
+ if (f.phash === cwd || (exists[h] && exists[h].mime !== 'directory')) {
9477
+ if (remove(h)) {
9478
+ updated = true;
9479
+ }
9480
+ } else {
9481
+ if (update(exists[h] || { hash: h, name: f.name, mime: 'directory', notfound: true })) {
9482
+ updated = true;
9483
+ }
9484
+ }
9485
+ }
9486
+ });
9487
+ updated && save();
9488
+ })
9489
+ .always(function() {
9490
+ spinner.remove();
9491
+ });
9492
+ }
9493
+ })
9494
+
9495
+ })
9496
+
9497
+ });
9498
+ }
9499
+
9500
+
9501
+ /*
9502
+ * File: /js/ui/searchbutton.js
9503
+ */
9504
+
9505
+ /**
9506
+ * @class elFinder toolbar search button widget.
9507
+ *
9508
+ * @author Dmitry (dio) Levashov
9509
+ **/
9510
+ $.fn.elfindersearchbutton = function(cmd) {
9511
+ return this.each(function() {
9512
+ var result = false,
9513
+ fm = cmd.fm,
9514
+ id = function(name){return fm.namespace + name},
9515
+ toolbar= fm.getUI('toolbar'),
9516
+ btnCls = fm.res('class', 'searchbtn'),
9517
+ button = $(this).hide().addClass('ui-widget-content elfinder-button '+btnCls),
9518
+ search = function() {
9519
+ opts.slideUp();
9520
+ var val = $.trim(input.val()),
9521
+ from = !$('#' + id('SearchFromAll')).prop('checked'),
9522
+ mime = $('#' + id('SearchMime')).prop('checked');
9523
+ if (from) {
9524
+ if ($('#' + id('SearchFromVol')).prop('checked')) {
9525
+ from = fm.root(fm.cwd().hash);
9526
+ } else {
9527
+ from = fm.cwd().hash;
9528
+ }
9529
+ }
9530
+ if (mime) {
9531
+ mime = val;
9532
+ val = '.';
9533
+ }
9534
+ if (val) {
9535
+ cmd.exec(val, from, mime).done(function() {
9536
+ result = true;
9537
+ input.focus();
9538
+ });
9539
+
9540
+ } else {
9541
+ fm.trigger('searchend');
9542
+ }
9543
+ },
9544
+ abort = function() {
9545
+ opts.slideUp();
9546
+ input.val('');
9547
+ if (result) {
9548
+ result = false;
9549
+ fm.trigger('searchend');
9550
+ }
9551
+ },
9552
+ input = $('<input type="text" size="42"/>')
9553
+ .focus(function(){
9554
+ opts.slideDown();
9555
+ })
9556
+ .blur(function(){
9557
+ if (!opts.data('infocus')) {
9558
+ opts.slideUp();
9559
+ } else {
9560
+ opts.data('infocus', false);
9561
+ }
9562
+ })
9563
+ .appendTo(button)
9564
+ // to avoid fm shortcuts on arrows
9565
+ .keypress(function(e) {
9566
+ e.stopPropagation();
9567
+ })
9568
+ .keydown(function(e) {
9569
+ e.stopPropagation();
9570
+
9571
+ e.keyCode == 13 && search();
9572
+
9573
+ if (e.keyCode== 27) {
9574
+ e.preventDefault();
9575
+ abort();
9576
+ }
9577
+ }),
9578
+ opts = $('<div class="ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>')
9579
+ .append($('<div class="buttonset"/>')
9580
+ .append($('<input id="'+id('SearchFromCwd')+'" name="serchfrom" type="radio" checked="checked"/><label for="'+id('SearchFromCwd')+'">'+fm.i18n('btnCwd')+'</label>'))
9581
+ .append($('<input id="'+id('SearchFromVol')+'" name="serchfrom" type="radio"/><label for="'+id('SearchFromVol')+'">'+fm.i18n('btnVolume')+'</label>'))
9582
+ .append($('<input id="'+id('SearchFromAll')+'" name="serchfrom" type="radio"/><label for="'+id('SearchFromAll')+'">'+fm.i18n('btnAll')+'</label>'))
9583
+ )
9584
+ .append($('<div class="buttonset"/>')
9585
+ .append($('<input id="'+id('SearchName')+'" name="serchcol" type="radio" checked="checked"/><label for="'+id('SearchName')+'">'+fm.i18n('btnFileName')+'</label>'))
9586
+ .append($('<input id="'+id('SearchMime')+'" name="serchcol" type="radio"/><label for="'+id('SearchMime')+'">'+fm.i18n('btnMime')+'</label>'))
9587
+ )
9588
+ .hide()
9589
+ .zIndex(12+button.zIndex())
9590
+ .css('overflow', 'hidden')
9591
+ .appendTo(button);
9592
+
9593
+ $('<span class="ui-icon ui-icon-search" title="'+cmd.title+'"/>')
9594
+ .appendTo(button)
9595
+ .click(search);
9596
+
9597
+ $('<span class="ui-icon ui-icon-close"/>')
9598
+ .appendTo(button)
9599
+ .click(abort);
9600
+
9601
+ $(function(){
9602
+ opts.find('div.buttonset').buttonset();
9603
+ //opts.find('div.button input').button();
9604
+ $('#'+id('SearchFromAll')).next('label').attr('title', fm.i18n('searchTarget', fm.i18n('btnAll')));
9605
+ $('#'+id('SearchMime')).next('label').attr('title', fm.i18n('searchMime'));
9606
+ opts.find('input')
9607
+ .on('mousedown', function(){
9608
+ opts.data('infocus', true);
9609
+ })
9610
+ .on('click', function(){
9611
+ $.trim(input.val()) && search();
9612
+ });
9613
+ });
9614
+
9615
+ // wait when button will be added to DOM
9616
+ toolbar.on('load', function(){
9617
+ var parent = button.parent();
9618
+ if (parent.length) {
9619
+ toolbar.children('.'+btnCls).remove();
9620
+ toolbar.prepend(button.show());
9621
+ parent.remove();
9622
+ // position icons for ie7
9623
+ if (fm.UA.ltIE7) {
9624
+ var icon = button.children(fm.direction == 'ltr' ? '.ui-icon-close' : '.ui-icon-search');
9625
+ icon.css({
9626
+ right : '',
9627
+ left : parseInt(button.width())-icon.outerWidth(true)
9628
+ });
9629
+ }
9630
+ fm.resize();
9631
+ }
9632
+ });
9633
+
9634
+ fm
9635
+ .select(function() {
9636
+ input.blur();
9637
+ })
9638
+ .bind('searchend', function() {
9639
+ input.val('');
9640
+ })
9641
+ .bind('open parents', function() {
9642
+ var dirs = [],
9643
+ volroot = fm.file(fm.root(fm.cwd().hash));
9644
+
9645
+ if (volroot) {
9646
+ $.each(fm.parents(fm.cwd().hash), function(i, hash) {
9647
+ dirs.push(fm.file(hash).name);
9648
+ });
9649
+
9650
+ $('#'+id('SearchFromCwd')).next('label').attr('title', fm.i18n('searchTarget', dirs.join(fm.option('separator'))));
9651
+ $('#'+id('SearchFromVol')).next('label').attr('title', fm.i18n('searchTarget', volroot.name));
9652
+ }
9653
+ })
9654
+ .shortcut({
9655
+ pattern : 'ctrl+f f3',
9656
+ description : cmd.title,
9657
+ callback : function() { input.select().focus(); }
9658
+ });
9659
+
9660
+ });
9661
+ };
9662
+
9663
+ /*
9664
+ * File: /js/ui/sortbutton.js
9665
+ */
9666
+
9667
+ /**
9668
+ * @class elFinder toolbar button menu with sort variants.
9669
+ *
9670
+ * @author Dmitry (dio) Levashov
9671
+ **/
9672
+ $.fn.elfindersortbutton = function(cmd) {
9673
+
9674
+ return this.each(function() {
9675
+ var fm = cmd.fm,
9676
+ name = cmd.name,
9677
+ c = 'class',
9678
+ disabled = fm.res(c, 'disabled'),
9679
+ hover = fm.res(c, 'hover'),
9680
+ item = 'elfinder-button-menu-item',
9681
+ selected = item+'-selected',
9682
+ asc = selected+'-asc',
9683
+ desc = selected+'-desc',
9684
+ button = $(this).addClass('ui-state-default elfinder-button elfinder-menubutton elfiner-button-'+name)
9685
+ .attr('title', cmd.title)
9686
+ .append('<span class="elfinder-button-icon elfinder-button-icon-'+name+'"/>')
9687
+ .hover(function(e) { !button.hasClass(disabled) && button.toggleClass(hover); })
9688
+ .click(function(e) {
9689
+ if (!button.hasClass(disabled)) {
9690
+ e.stopPropagation();
9691
+ menu.is(':hidden') && cmd.fm.getUI().click();
9692
+ menu.slideToggle(100);
9693
+ }
9694
+ }),
9695
+ menu = $('<div class="ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>')
9696
+ .hide()
9697
+ .appendTo(button)
9698
+ .zIndex(12+button.zIndex())
9699
+ .on('mouseenter mouseleave', '.'+item, function() { $(this).toggleClass(hover) })
9700
+ .on('click', '.'+item, function(e) {
9701
+ e.preventDefault();
9702
+ e.stopPropagation();
9703
+ hide();
9704
+ }),
9705
+ update = function() {
9706
+ menu.children(':not(:last)').removeClass(selected+' '+asc+' '+desc)
9707
+ .filter('[rel="'+fm.sortType+'"]')
9708
+ .addClass(selected+' '+(fm.sortOrder == 'asc' ? asc : desc));
9709
+
9710
+ menu.children(':last').toggleClass(selected, fm.sortStickFolders);
9711
+ },
9712
+ hide = function() { menu.hide(); };
9713
+
9714
+
9715
+ $.each(fm.sortRules, function(name, value) {
9716
+ menu.append($('<div class="'+item+'" rel="'+name+'"><span class="ui-icon ui-icon-arrowthick-1-n"/><span class="ui-icon ui-icon-arrowthick-1-s"/>'+fm.i18n('sort'+name)+'</div>').data('type', name));
9717
+ });
9718
+
9719
+ menu.children().click(function(e) {
9720
+ var type = $(this).attr('rel');
9721
+
9722
+ cmd.exec([], {
9723
+ type : type,
9724
+ order : type == fm.sortType ? fm.sortOrder == 'asc' ? 'desc' : 'asc' : fm.sortOrder,
9725
+ stick : fm.sortStickFolders
9726
+ });
9727
+ })
9728
+
9729
+ $('<div class="'+item+' '+item+'-separated"><span class="ui-icon ui-icon-check"/>'+fm.i18n('sortFoldersFirst')+'</div>')
9730
+ .appendTo(menu)
9731
+ .click(function() {
9732
+ cmd.exec([], {type : fm.sortType, order : fm.sortOrder, stick : !fm.sortStickFolders});
9733
+ });
9734
+
9735
+ fm.bind('disable select', hide).getUI().click(hide);
9736
+
9737
+ fm.bind('sortchange', update)
9738
+
9739
+ if (menu.children().length > 1) {
9740
+ cmd.change(function() {
9741
+ button.toggleClass(disabled, cmd.disabled());
9742
+ update();
9743
+ })
9744
+ .change();
9745
+
9746
+ } else {
9747
+ button.addClass(disabled);
9748
+ }
9749
+
9750
+ });
9751
+
9752
+ }
9753
+
9754
+
9755
+
9756
+
9757
+ /*
9758
+ * File: /js/ui/stat.js
9759
+ */
9760
+
9761
+ /**
9762
+ * @class elFinder ui
9763
+ * Display number of files/selected files and its size in statusbar
9764
+ *
9765
+ * @author Dmitry (dio) Levashov
9766
+ **/
9767
+ $.fn.elfinderstat = function(fm) {
9768
+ return this.each(function() {
9769
+ var size = $(this).addClass('elfinder-stat-size'),
9770
+ sel = $('<div class="elfinder-stat-selected"/>')
9771
+ .on('click', 'a', function(e) {
9772
+ var hash = $(this).data('hash');
9773
+ e.preventDefault();
9774
+ fm.exec('opendir', [ hash ]);
9775
+ }),
9776
+ titlesize = fm.i18n('size').toLowerCase(),
9777
+ titleitems = fm.i18n('items').toLowerCase(),
9778
+ titlesel = fm.i18n('selected'),
9779
+ setstat = function(files, cwd) {
9780
+ var c = 0,
9781
+ s = 0;
9782
+
9783
+ $.each(files, function(i, file) {
9784
+ if (!cwd || file.phash == cwd) {
9785
+ c++;
9786
+ s += parseInt(file.size)||0;
9787
+ }
9788
+ })
9789
+ size.html(titleitems+': '+c+', '+titlesize+': '+fm.formatSize(s));
9790
+ },
9791
+ search = false;
9792
+
9793
+ fm.getUI('statusbar').prepend(size).append(sel).show();
9794
+
9795
+ fm
9796
+ .bind('open reload add remove change searchend', function() {
9797
+ setstat(fm.files(), fm.cwd().hash);
9798
+ })
9799
+ .bind('searchend', function() {
9800
+ search = false;
9801
+ })
9802
+ .search(function(e) {
9803
+ search = true;
9804
+ setstat(e.data.files);
9805
+ })
9806
+ .select(function() {
9807
+ var s = 0,
9808
+ c = 0,
9809
+ files = fm.selectedFiles(),
9810
+ dirs = [],
9811
+ file;
9812
+
9813
+ if (files.length == 1) {
9814
+ file = files[0];
9815
+ s = file.size;
9816
+ if (search) {
9817
+ dirs.push('<a href="#elf_'+file.phash+'" data-hash="'+file.hash+'">'+(file.path? file.path.replace(/\/[^\/]*$/, '') : '..')+'</a>');
9818
+ }
9819
+ dirs.push(fm.escape(file.name));
9820
+ sel.html(dirs.join('/') + (s > 0 ? ', '+fm.formatSize(s) : ''));
9821
+
9822
+ return;
9823
+ }
9824
+
9825
+ $.each(files, function(i, file) {
9826
+ c++;
9827
+ s += parseInt(file.size)||0;
9828
+ });
9829
+
9830
+ sel.html(c ? titlesel+': '+c+', '+titlesize+': '+fm.formatSize(s) : '&nbsp;');
9831
+ })
9832
+
9833
+ ;
9834
+ })
9835
+ }
9836
+
9837
+ /*
9838
+ * File: /js/ui/toolbar.js
9839
+ */
9840
+
9841
+ /**
9842
+ * @class elFinder toolbar
9843
+ *
9844
+ * @author Dmitry (dio) Levashov
9845
+ **/
9846
+ $.fn.elfindertoolbar = function(fm, opts) {
9847
+ this.not('.elfinder-toolbar').each(function() {
9848
+ var commands = fm._commands,
9849
+ self = $(this).addClass('ui-helper-clearfix ui-widget-header ui-corner-top elfinder-toolbar'),
9850
+ panels = opts || [],
9851
+ dispre = null,
9852
+ uiCmdMapPrev = '',
9853
+ l, i, cmd, panel, button;
9854
+
9855
+ self.prev().length && self.parent().prepend(this);
9856
+
9857
+ var render = function(disabled){
9858
+ var name;
9859
+ self.empty();
9860
+ l = panels.length;
9861
+ while (l--) {
9862
+ if (panels[l]) {
9863
+ panel = $('<div class="ui-widget-content ui-corner-all elfinder-buttonset"/>');
9864
+ i = panels[l].length;
9865
+ while (i--) {
9866
+ name = panels[l][i];
9867
+ if ((!disabled || $.inArray(name, disabled) === -1) && (cmd = commands[name])) {
9868
+ button = 'elfinder'+cmd.options.ui;
9869
+ $.fn[button] && panel.prepend($('<div/>')[button](cmd));
9870
+ }
9871
+ }
9872
+
9873
+ panel.children().length && self.prepend(panel);
9874
+ panel.children(':gt(0)').before('<span class="ui-widget-content elfinder-toolbar-button-separator"/>');
9875
+
9876
+ }
9877
+ }
9878
+
9879
+ self.children().length? self.show() : self.hide();
9880
+ self.trigger('load');
9881
+ };
9882
+
9883
+ render();
9884
+
9885
+ fm.bind('open sync', function(){
9886
+ var repCmds = [],
9887
+ disabled = fm.option('disabled');
9888
+
9889
+ if (!dispre || dispre.toString() !== disabled.sort().toString()) {
9890
+ render(disabled && disabled.length? disabled : null);
9891
+ }
9892
+ dispre = disabled.concat().sort();
9893
+
9894
+ if (uiCmdMapPrev !== JSON.stringify(fm.commandMap)) {
9895
+ uiCmdMapPrev = JSON.stringify(fm.commandMap);
9896
+ if (Object.keys(fm.commandMap).length) {
9897
+ $.each(fm.commandMap, function(from, to){
9898
+ var cmd = fm._commands[to],
9899
+ button = cmd? 'elfinder'+cmd.options.ui : null;
9900
+ if (button && $.fn[button]) {
9901
+ repCmds.push(from);
9902
+ var btn = $('div.elfinder-buttonset div.elfinder-button').has('span.elfinder-button-icon-'+from);
9903
+ if (btn.length && !btn.next().has('span.elfinder-button-icon-'+to).length) {
9904
+ btn.after($('<div/>')[button](fm._commands[to]).data('origin', from));
9905
+ btn.hide();
9906
+ }
9907
+ }
9908
+ });
9909
+ }
9910
+ // reset toolbar
9911
+ $.each($('div.elfinder-button'), function(){
9912
+ var origin = $(this).data('origin');
9913
+ if (origin && $.inArray(origin, repCmds) == -1) {
9914
+ $('span.elfinder-button-icon-'+$(this).data('origin')).parent().show();
9915
+ $(this).remove();
9916
+ }
9917
+ });
9918
+ }
9919
+
9920
+ });
9921
+ });
9922
+
9923
+ return this;
9924
+ }
9925
+
9926
+ /*
9927
+ * File: /js/ui/tree.js
9928
+ */
9929
+
9930
+ /**
9931
+ * @class elFinder folders tree
9932
+ *
9933
+ * @author Dmitry (dio) Levashov
9934
+ **/
9935
+ $.fn.elfindertree = function(fm, opts) {
9936
+ var treeclass = fm.res('class', 'tree');
9937
+
9938
+ this.not('.'+treeclass).each(function() {
9939
+
9940
+ var c = 'class', mobile = fm.UA.Mobile,
9941
+
9942
+ /**
9943
+ * Root directory class name
9944
+ *
9945
+ * @type String
9946
+ */
9947
+ root = fm.res(c, 'treeroot'),
9948
+
9949
+ /**
9950
+ * Open root dir if not opened yet
9951
+ *
9952
+ * @type Boolean
9953
+ */
9954
+ openRoot = opts.openRootOnLoad,
9955
+
9956
+ /**
9957
+ * Open current work dir if not opened yet
9958
+ *
9959
+ * @type Boolean
9960
+ */
9961
+ openCwd = opts.openCwdOnOpen,
9962
+
9963
+ /**
9964
+ * Subtree class name
9965
+ *
9966
+ * @type String
9967
+ */
9968
+ subtree = fm.res(c, 'navsubtree'),
9969
+
9970
+ /**
9971
+ * Directory class name
9972
+ *
9973
+ * @type String
9974
+ */
9975
+ navdir = fm.res(c, 'treedir'),
9976
+
9977
+ /**
9978
+ * Directory CSS selector
9979
+ *
9980
+ * @type String
9981
+ */
9982
+ selNavdir = 'span.' + navdir,
9983
+
9984
+ /**
9985
+ * Collapsed arrow class name
9986
+ *
9987
+ * @type String
9988
+ */
9989
+ collapsed = fm.res(c, 'navcollapse'),
9990
+
9991
+ /**
9992
+ * Expanded arrow class name
9993
+ *
9994
+ * @type String
9995
+ */
9996
+ expanded = fm.res(c, 'navexpand'),
9997
+
9998
+ /**
9999
+ * Class name to mark arrow for directory with already loaded children
10000
+ *
10001
+ * @type String
10002
+ */
10003
+ loaded = 'elfinder-subtree-loaded',
10004
+
10005
+ /**
10006
+ * Arraw class name
10007
+ *
10008
+ * @type String
10009
+ */
10010
+ arrow = fm.res(c, 'navarrow'),
10011
+
10012
+ /**
10013
+ * Current directory class name
10014
+ *
10015
+ * @type String
10016
+ */
10017
+ active = fm.res(c, 'active'),
10018
+
10019
+ /**
10020
+ * Droppable dirs dropover class
10021
+ *
10022
+ * @type String
10023
+ */
10024
+ dropover = fm.res(c, 'adroppable'),
10025
+
10026
+ /**
10027
+ * Hover class name
10028
+ *
10029
+ * @type String
10030
+ */
10031
+ hover = fm.res(c, 'hover'),
10032
+
10033
+ /**
10034
+ * Disabled dir class name
10035
+ *
10036
+ * @type String
10037
+ */
10038
+ disabled = fm.res(c, 'disabled'),
10039
+
10040
+ /**
10041
+ * Draggable dir class name
10042
+ *
10043
+ * @type String
10044
+ */
10045
+ draggable = fm.res(c, 'draggable'),
10046
+
10047
+ /**
10048
+ * Droppable dir class name
10049
+ *
10050
+ * @type String
10051
+ */
10052
+ droppable = fm.res(c, 'droppable'),
10053
+
10054
+ /**
10055
+ * Un-disabled cmd `paste` volume's root wrapper class
10056
+ *
10057
+ * @type String
10058
+ */
10059
+ pastable = 'elfinder-navbar-wrapper-pastable',
10060
+
10061
+ /**
10062
+ * Un-disabled cmd `upload` volume's root wrapper class
10063
+ *
10064
+ * @type String
10065
+ */
10066
+ uploadable = 'elfinder-navbar-wrapper-uploadable',
10067
+
10068
+ insideNavbar = function(x) {
10069
+ var left = navbar.offset().left;
10070
+
10071
+ return left <= x && x <= left + navbar.width();
10072
+ },
10073
+
10074
+ drop = fm.droppable.drop,
10075
+
10076
+ /**
10077
+ * Droppable options
10078
+ *
10079
+ * @type Object
10080
+ */
10081
+ droppableopts = $.extend(true, {}, fm.droppable, {
10082
+ // show subfolders on dropover
10083
+ over : function(e, ui) {
10084
+ var dst = $(this),
10085
+ helper = ui.helper,
10086
+ cl = hover+' '+dropover,
10087
+ hash, status;
10088
+ e.stopPropagation();
10089
+ helper.data('dropover', helper.data('dropover') + 1);
10090
+ dst.data('dropover', true);
10091
+ if (ui.helper.data('namespace') !== fm.namespace) {
10092
+ dst.removeClass(cl);
10093
+ return false;
10094
+ }
10095
+ dst.addClass(hover)
10096
+ if (dst.is('.'+collapsed+':not(.'+expanded+')')) {
10097
+ dst.data('expandTimer', setTimeout(function() {
10098
+ dst.children('.'+arrow).click();
10099
+ }, 500));
10100
+ }
10101
+ hash = fm.navId2Hash(dst.attr('id'));
10102
+ dst.data('dropover', hash);
10103
+ $.each(ui.helper.data('files'), function(i, h) {
10104
+ if (h === hash || (fm.file(h).phash === hash && !ui.helper.hasClass('elfinder-drag-helper-plus'))) {
10105
+ dst.removeClass(cl);
10106
+ return false; // break $.each
10107
+ }
10108
+ });
10109
+ if (helper.data('locked')) {
10110
+ status = 'elfinder-drag-helper-plus';
10111
+ } else {
10112
+ status = 'elfinder-drag-helper-move';
10113
+ if (e.shiftKey || e.ctrlKey || e.metaKey) {
10114
+ status += ' elfinder-drag-helper-plus';
10115
+ }
10116
+ }
10117
+ dst.hasClass(dropover) && helper.addClass(status);
10118
+ setTimeout(function(){ dst.hasClass(dropover) && helper.addClass(status); }, 20);
10119
+ },
10120
+ out : function(e, ui) {
10121
+ var dst = $(this),
10122
+ helper = ui.helper;
10123
+ e.stopPropagation();
10124
+ helper.removeClass('elfinder-drag-helper-move elfinder-drag-helper-plus').data('dropover', Math.max(helper.data('dropover') - 1, 0));
10125
+ dst.data('expandTimer') && clearTimeout(dst.data('expandTimer'));
10126
+ dst.removeData('dropover')
10127
+ .removeClass(hover+' '+dropover);
10128
+ },
10129
+ deactivate : function() {
10130
+ $(this).removeData('dropover')
10131
+ .removeClass(hover+' '+dropover);
10132
+ },
10133
+ drop : function(e, ui) { insideNavbar(e.clientX) && drop.call(this, e, ui); }
10134
+ }),
10135
+
10136
+ spinner = $(fm.res('tpl', 'navspinner')),
10137
+
10138
+ /**
10139
+ * Directory html template
10140
+ *
10141
+ * @type String
10142
+ */
10143
+ tpl = fm.res('tpl', 'navdir'),
10144
+
10145
+ /**
10146
+ * Permissions marker html template
10147
+ *
10148
+ * @type String
10149
+ */
10150
+ ptpl = fm.res('tpl', 'perms'),
10151
+
10152
+ /**
10153
+ * Lock marker html template
10154
+ *
10155
+ * @type String
10156
+ */
10157
+ ltpl = fm.res('tpl', 'lock'),
10158
+
10159
+ /**
10160
+ * Symlink marker html template
10161
+ *
10162
+ * @type String
10163
+ */
10164
+ stpl = fm.res('tpl', 'symlink'),
10165
+
10166
+ /**
10167
+ * Html template replacement methods
10168
+ *
10169
+ * @type Object
10170
+ */
10171
+ replace = {
10172
+ id : function(dir) { return fm.navHash2Id(dir.hash) },
10173
+ cssclass : function(dir) {
10174
+ var cname = (fm.UA.Touch ? 'elfinder-touch ' : '')+(dir.phash ? '' : root)+' '+navdir+' '+fm.perms2class(dir);
10175
+ dir.dirs && !dir.link && (cname += ' ' + collapsed);
10176
+ opts.getClass && (cname += ' ' + opts.getClass(dir));
10177
+ dir.csscls && (cname += ' ' + fm.escape(dir.csscls));
10178
+ return cname;
10179
+ },
10180
+ permissions : function(dir) { return !dir.read || !dir.write ? ptpl : ''; },
10181
+ symlink : function(dir) { return dir.alias ? stpl : ''; },
10182
+ style : function(dir) { return dir.icon ? 'style="background-image:url(\''+fm.escape(dir.icon)+'\')"' : ''; }
10183
+ },
10184
+
10185
+ /**
10186
+ * Return html for given dir
10187
+ *
10188
+ * @param Object directory
10189
+ * @return String
10190
+ */
10191
+ itemhtml = function(dir) {
10192
+ dir.name = fm.escape(dir.i18 || dir.name);
10193
+
10194
+ return tpl.replace(/(?:\{([a-z]+)\})/ig, function(m, key) {
10195
+ return dir[key] || (replace[key] ? replace[key](dir) : '');
10196
+ });
10197
+ },
10198
+
10199
+ /**
10200
+ * Return only dirs from files list
10201
+ *
10202
+ * @param Array files list
10203
+ * @return Array
10204
+ */
10205
+ filter = function(files) {
10206
+ return $.map(files||[], function(f) { return f.mime == 'directory' ? f : null });
10207
+ },
10208
+
10209
+ /**
10210
+ * Find parent subtree for required directory
10211
+ *
10212
+ * @param String dir hash
10213
+ * @return jQuery
10214
+ */
10215
+ findSubtree = function(hash) {
10216
+ return hash ? $('#'+fm.navHash2Id(hash)).next('.'+subtree) : tree;
10217
+ },
10218
+
10219
+ /**
10220
+ * Find directory (wrapper) in required node
10221
+ * before which we can insert new directory
10222
+ *
10223
+ * @param jQuery parent directory
10224
+ * @param Object new directory
10225
+ * @return jQuery
10226
+ */
10227
+ findSibling = function(subtree, dir) {
10228
+ var node = subtree.children(':first'),
10229
+ info, compare;
10230
+
10231
+ compare = fm.naturalCompare;
10232
+ while (node.length) {
10233
+ info = fm.file(fm.navId2Hash(node.children('[id]').attr('id')));
10234
+
10235
+ if ((info = fm.file(fm.navId2Hash(node.children('[id]').attr('id'))))
10236
+ && compare(dir.name, info.name) < 0) {
10237
+ return node;
10238
+ }
10239
+ node = node.next();
10240
+ }
10241
+ return $('');
10242
+ },
10243
+
10244
+ /**
10245
+ * Add new dirs in tree
10246
+ *
10247
+ * @param Array dirs list
10248
+ * @return void
10249
+ */
10250
+ updateTree = function(dirs) {
10251
+ var length = dirs.length,
10252
+ orphans = [],
10253
+ i = dirs.length,
10254
+ dir, html, parent, sibling, init, atonce = {}, base;
10255
+
10256
+ var firstVol = true; // check for netmount volume
10257
+ while (i--) {
10258
+ dir = dirs[i];
10259
+
10260
+ if ($('#'+fm.navHash2Id(dir.hash)).length) {
10261
+ continue;
10262
+ }
10263
+
10264
+ if ((parent = findSubtree(dir.phash)).length) {
10265
+ if (dir.phash && ((init = !parent.children().length) || (sibling = findSibling(parent, dir)).length)) {
10266
+ if (init) {
10267
+ if (!atonce[dir.phash]) {
10268
+ atonce[dir.phash] = [];
10269
+ }
10270
+ atonce[dir.phash].push(dir);
10271
+ } else {
10272
+ sibling.before(itemhtml(dir));
10273
+ }
10274
+ } else {
10275
+ parent[firstVol || dir.phash ? 'append' : 'prepend'](itemhtml(dir));
10276
+ firstVol = false;
10277
+ if (!dir.phash) {
10278
+ base = $('#'+fm.navHash2Id(dir.hash)).parent();
10279
+ if (!dir.disabled || dir.disabled.length < 1) {
10280
+ base.addClass(pastable+' '+uploadable);
10281
+ } else {
10282
+ if ($.inArray('paste', dir.disabled) === -1) {
10283
+ base.addClass(pastable);
10284
+ }
10285
+ if ($.inArray('upload', dir.disabled) === -1) {
10286
+ base.addClass(uploadable);
10287
+ }
10288
+ }
10289
+ }
10290
+ }
10291
+ } else {
10292
+ orphans.push(dir);
10293
+ }
10294
+ }
10295
+
10296
+ // When init, html append at once
10297
+ if (Object.keys(atonce).length){
10298
+ $.each(atonce, function(p, dirs){
10299
+ var parent = findSubtree(p),
10300
+ html = [];
10301
+ dirs.sort(compare);
10302
+ $.each(dirs, function(i, d){
10303
+ html.push(itemhtml(d));
10304
+ });
10305
+ parent.append(html.join(''));
10306
+ });
10307
+ }
10308
+
10309
+ if (orphans.length && orphans.length < length) {
10310
+ return updateTree(orphans);
10311
+ }
10312
+
10313
+ if (length && !mobile) {
10314
+ updateDroppable();
10315
+ }
10316
+
10317
+ },
10318
+
10319
+ /**
10320
+ * sort function by dir.name
10321
+ *
10322
+ */
10323
+ compare = function(dir1, dir2) {
10324
+ return fm.naturalCompare(dir1.name, dir2.name);
10325
+ },
10326
+
10327
+ /**
10328
+ * Auto scroll to cwd
10329
+ *
10330
+ * @return void
10331
+ */
10332
+ autoScroll = function() {
10333
+ var current = $('#'+fm.navHash2Id(fm.cwd().hash));
10334
+
10335
+ if (current.length) {
10336
+ var parent = tree.parent().stop(false, true),
10337
+ top = parent.offset().top,
10338
+ treeH = parent.height(),
10339
+ bottom = top + treeH - current.outerHeight(),
10340
+ tgtTop = current.offset().top;
10341
+
10342
+ if (tgtTop < top || tgtTop > bottom) {
10343
+ parent.animate({ scrollTop : parent.scrollTop() + tgtTop - top - treeH / 3 }, { duration : 'fast' });
10344
+ }
10345
+ }
10346
+ },
10347
+
10348
+ /**
10349
+ * Mark current directory as active
10350
+ * If current directory is not in tree - load it and its parents
10351
+ *
10352
+ * @param {Boolean} do not expand cwd
10353
+ * @return void
10354
+ */
10355
+ sync = function(noCwd, dirs) {
10356
+ var cwd = fm.cwd(),
10357
+ cwdhash = cwd.hash,
10358
+ current = $('#'+fm.navHash2Id(cwdhash)),
10359
+ noCwd = noCwd || false,
10360
+ dirs = dirs || [],
10361
+ rootNode, dir, link, subs, subsLen, cnt;
10362
+
10363
+ if (openRoot) {
10364
+ rootNode = $('#'+fm.navHash2Id(fm.root()));
10365
+ rootNode.hasClass(loaded) && rootNode.addClass(expanded).next('.'+subtree).show();
10366
+ openRoot = false;
10367
+ }
10368
+
10369
+ if (!current.hasClass(active)) {
10370
+ tree.find(selNavdir+'.'+active).removeClass(active);
10371
+ current.addClass(active);
10372
+ }
10373
+
10374
+ if (opts.syncTree || !current.length) {
10375
+ if (current.length) {
10376
+ if (!noCwd) {
10377
+ current.addClass(loaded);
10378
+ if (openCwd && current.hasClass(collapsed)) {
10379
+ current.addClass(expanded).next('.'+subtree).slideDown();
10380
+ }
10381
+ }
10382
+ subs = current.parentsUntil('.'+root).filter('.'+subtree);
10383
+ subsLen = subs.length;
10384
+ cnt = 1;
10385
+ subs.show().prev(selNavdir).addClass(expanded, function(){
10386
+ !noCwd && subsLen == cnt++ && autoScroll();
10387
+ });
10388
+ !subsLen && !noCwd && autoScroll();
10389
+ return;
10390
+ }
10391
+ if (fm.newAPI) {
10392
+ dir = fm.file(cwdhash);
10393
+ if (dir && dir.phash) {
10394
+ link = $('#'+fm.navHash2Id(dir.phash));
10395
+ if (link.length && link.hasClass(loaded)) {
10396
+ updateTree([dir]);
10397
+ sync(noCwd);
10398
+ return;
10399
+ }
10400
+ }
10401
+ link = cwd.root? $('#'+fm.navHash2Id(cwd.root)) : null;
10402
+ if (link) {
10403
+ spinner.insertBefore(link.children('.'+arrow));
10404
+ link.removeClass(collapsed);
10405
+ }
10406
+ fm.request({
10407
+ data : {cmd : 'parents', target : cwdhash},
10408
+ preventFail : true
10409
+ })
10410
+ .done(function(data) {
10411
+ dirs = $.merge(dirs, filter(data.tree));
10412
+ updateTree(dirs);
10413
+ updateArrows(dirs, loaded);
10414
+ cwdhash == fm.cwd().hash && sync(noCwd);
10415
+ })
10416
+ .always(function(data) {
10417
+ if (link) {
10418
+ spinner.remove();
10419
+ link.addClass(collapsed+' '+loaded);
10420
+ }
10421
+ });
10422
+ }
10423
+
10424
+ }
10425
+ },
10426
+
10427
+ /**
10428
+ * Make writable and not root dirs droppable
10429
+ *
10430
+ * @return void
10431
+ */
10432
+ updateDroppable = function(target) {
10433
+ var limit = 100,
10434
+ next;
10435
+
10436
+ if (!target) {
10437
+ tree.find('div.'+uploadable).find(selNavdir+':not(.elfinder-ro,.elfinder-na)').addClass('native-droppable');
10438
+ target = tree.find('div.'+pastable).find(selNavdir+':not(.'+droppable+',.elfinder-ro,.elfinder-na)');
10439
+ }
10440
+
10441
+ if (target.length > limit) {
10442
+ next = target.slice(limit);
10443
+ target = target.slice(0, limit);
10444
+ }
10445
+
10446
+ target.droppable(droppableopts);
10447
+
10448
+ if (next) {
10449
+ setTimeout(function(){
10450
+ updateDroppable(next);
10451
+ }, 20);
10452
+ }
10453
+ },
10454
+
10455
+ /**
10456
+ * Check required folders for subfolders and update arrow classes
10457
+ *
10458
+ * @param Array folders to check
10459
+ * @param String css class
10460
+ * @return void
10461
+ */
10462
+ updateArrows = function(dirs, cls) {
10463
+ var sel = cls == loaded
10464
+ ? '.'+collapsed+':not(.'+loaded+')'
10465
+ : ':not(.'+collapsed+')';
10466
+
10467
+
10468
+ //tree.find('.'+subtree+':has(*)').prev(':not(.'+collapsed+')').addClass(collapsed)
10469
+
10470
+ $.each(dirs, function(i, dir) {
10471
+ $('#'+fm.navHash2Id(dir.phash)+sel)
10472
+ .filter(function() { return $(this).next('.'+subtree).children().length > 0 })
10473
+ .addClass(cls);
10474
+ })
10475
+ },
10476
+
10477
+
10478
+
10479
+ /**
10480
+ * Navigation tree
10481
+ *
10482
+ * @type JQuery
10483
+ */
10484
+ tree = $(this).addClass(treeclass)
10485
+ // make dirs draggable and toggle hover class
10486
+ .on('mouseenter mouseleave', selNavdir, function(e) {
10487
+ var link = $(this),
10488
+ enter = e.type == 'mouseenter';
10489
+
10490
+ if (!link.hasClass(dropover+' '+disabled)) {
10491
+ !mobile && enter && !link.hasClass(root+' '+draggable+' elfinder-na elfinder-wo') && link.draggable(fm.draggable);
10492
+ link.toggleClass(hover, enter);
10493
+ }
10494
+ })
10495
+ // add/remove dropover css class
10496
+ .on('dropover dropout drop', selNavdir, function(e) {
10497
+ $(this)[e.type == 'dropover' ? 'addClass' : 'removeClass'](dropover+' '+hover);
10498
+ })
10499
+ // open dir or open subfolders in tree
10500
+ .on('click', selNavdir, function(e) {
10501
+ var link = $(this),
10502
+ hash = fm.navId2Hash(link.attr('id')),
10503
+ file = fm.file(hash);
10504
+
10505
+ if (link.data('longtap')) {
10506
+ e.stopPropagation();
10507
+ return;
10508
+ }
10509
+
10510
+ fm.trigger('searchend', { noupdate: true });
10511
+
10512
+ if (hash != fm.cwd().hash && !link.hasClass(disabled)) {
10513
+ fm.exec('open', hash);
10514
+ } else if (link.hasClass(collapsed)) {
10515
+ link.children('.'+arrow).click();
10516
+ }
10517
+ })
10518
+ // for touch device
10519
+ .on('touchstart', selNavdir, function(e) {
10520
+ e.stopPropagation();
10521
+ var evt = e.originalEvent,
10522
+ p = $(this)
10523
+ .addClass(hover)
10524
+ .data('longtap', null)
10525
+ .data('tmlongtap', setTimeout(function(e){
10526
+ // long tap
10527
+ p.data('longtap', true);
10528
+ fm.trigger('contextmenu', {
10529
+ 'type' : 'navbar',
10530
+ 'targets' : [fm.navId2Hash(p.attr('id'))],
10531
+ 'x' : evt.touches[0].pageX,
10532
+ 'y' : evt.touches[0].pageY
10533
+ });
10534
+ }, 500));
10535
+ })
10536
+ .on('touchmove touchend', selNavdir, function(e) {
10537
+ e.stopPropagation();
10538
+ clearTimeout($(this).data('tmlongtap'));
10539
+ if (e.type == 'touchmove') {
10540
+ $(this).removeClass(hover);
10541
+ }
10542
+ })
10543
+ // toggle subfolders in tree
10544
+ .on('click', selNavdir+'.'+collapsed+' .'+arrow, function(e) {
10545
+ var arrow = $(this),
10546
+ link = arrow.parent(selNavdir),
10547
+ stree = link.next('.'+subtree),
10548
+ slideTH = 30, cnt;
10549
+
10550
+ e.stopPropagation();
10551
+
10552
+ if (link.hasClass(loaded)) {
10553
+ link.toggleClass(expanded);
10554
+ cnt = link.hasClass(expanded)? stree.children().length + stree.find('div.elfinder-navbar-subtree[style*=block]').children().length : stree.find('div:visible').length;
10555
+ if (cnt > slideTH) {
10556
+ stree.toggle();
10557
+ fm.draggingUiHelper && fm.draggingUiHelper.data('refreshPositions', 1);
10558
+ } else {
10559
+ stree.stop(true, true).slideToggle('normal', function(){
10560
+ fm.draggingUiHelper && fm.draggingUiHelper.data('refreshPositions', 1);
10561
+ });
10562
+ }
10563
+ } else {
10564
+ spinner.insertBefore(arrow);
10565
+ link.removeClass(collapsed);
10566
+
10567
+ fm.request({cmd : 'tree', target : fm.navId2Hash(link.attr('id'))})
10568
+ .done(function(data) {
10569
+ updateTree(filter(data.tree));
10570
+
10571
+ if (stree.children().length) {
10572
+ link.addClass(collapsed+' '+expanded);
10573
+ if (stree.children().length > slideTH) {
10574
+ stree.show();
10575
+ fm.draggingUiHelper && fm.draggingUiHelper.data('refreshPositions', 1);
10576
+ } else {
10577
+ stree.stop(true, true).slideDown('normal', function(){
10578
+ fm.draggingUiHelper && fm.draggingUiHelper.data('refreshPositions', 1);
10579
+ });
10580
+ }
10581
+ }
10582
+ sync(true);
10583
+ })
10584
+ .always(function(data) {
10585
+ spinner.remove();
10586
+ link.addClass(loaded);
10587
+ });
10588
+ }
10589
+ })
10590
+ .on('contextmenu', selNavdir, function(e) {
10591
+ var self = $(this);
10592
+ e.preventDefault();
10593
+
10594
+ fm.trigger('contextmenu', {
10595
+ 'type' : 'navbar',
10596
+ 'targets' : [fm.navId2Hash($(this).attr('id'))],
10597
+ 'x' : e.pageX,
10598
+ 'y' : e.pageY
10599
+ });
10600
+
10601
+ self.addClass('ui-state-hover');
10602
+
10603
+ fm.getUI('contextmenu').children().on('mouseenter', function() {
10604
+ self.addClass('ui-state-hover');
10605
+ });
10606
+
10607
+ fm.bind('closecontextmenu', function() {
10608
+ self.removeClass('ui-state-hover');
10609
+ });
10610
+ }),
10611
+ // move tree into navbar
10612
+ navbar = fm.getUI('navbar').append(tree).show()
10613
+
10614
+ ;
10615
+
10616
+ fm.open(function(e) {
10617
+ var data = e.data,
10618
+ dirs = filter(data.files),
10619
+ contextmenu = fm.getUI('contextmenu');
10620
+
10621
+ data.init && tree.empty();
10622
+
10623
+ if (dirs.length) {
10624
+ if (!contextmenu.data('cmdMaps')) {
10625
+ contextmenu.data('cmdMaps', {});
10626
+ }
10627
+ updateTree(dirs);
10628
+ updateArrows(dirs, loaded);
10629
+ // support volume driver option `uiCmdMap`
10630
+ $.each(dirs, function(k, v){
10631
+ if (v.volumeid) {
10632
+ if (v.uiCmdMap && Object.keys(v.uiCmdMap).length && !contextmenu.data('cmdMaps')[v.volumeid]) {
10633
+ contextmenu.data('cmdMaps')[v.volumeid] = v.uiCmdMap;
10634
+ }
10635
+ }
10636
+ });
10637
+ }
10638
+ sync(false, dirs);
10639
+ })
10640
+ // add new dirs
10641
+ .add(function(e) {
10642
+ var dirs = filter(e.data.added);
10643
+
10644
+ if (dirs.length) {
10645
+ updateTree(dirs);
10646
+ updateArrows(dirs, collapsed);
10647
+ }
10648
+ })
10649
+ // update changed dirs
10650
+ .change(function(e) {
10651
+ var dirs = filter(e.data.changed),
10652
+ length = dirs.length,
10653
+ l = length,
10654
+ dir, node, tmp, realParent, reqParent, realSibling, reqSibling, isExpanded, isLoaded;
10655
+
10656
+ while (l--) {
10657
+ dir = dirs[l];
10658
+ if ((node = $('#'+fm.navHash2Id(dir.hash))).length) {
10659
+ if (dir.phash) {
10660
+ realParent = node.closest('.'+subtree);
10661
+ reqParent = findSubtree(dir.phash);
10662
+ realSibling = node.parent().next();
10663
+ reqSibling = findSibling(reqParent, dir);
10664
+
10665
+ if (!reqParent.length) {
10666
+ continue;
10667
+ }
10668
+
10669
+ if (reqParent[0] !== realParent[0] || realSibling.get(0) !== reqSibling.get(0)) {
10670
+ reqSibling.length ? reqSibling.before(node) : reqParent.append(node);
10671
+ }
10672
+ }
10673
+ isExpanded = node.hasClass(expanded);
10674
+ isLoaded = node.hasClass(loaded);
10675
+ tmp = $(itemhtml(dir));
10676
+ node.replaceWith(tmp.children(selNavdir));
10677
+
10678
+ if (dir.dirs
10679
+ && (isExpanded || isLoaded)
10680
+ && (node = $('#'+fm.navHash2Id(dir.hash)))
10681
+ && node.next('.'+subtree).children().length) {
10682
+ isExpanded && node.addClass(expanded);
10683
+ isLoaded && node.addClass(loaded);
10684
+ }
10685
+ }
10686
+ }
10687
+
10688
+ sync();
10689
+ length && !mobile && updateDroppable();
10690
+ })
10691
+ // remove dirs
10692
+ .remove(function(e) {
10693
+ var dirs = e.data.removed,
10694
+ l = dirs.length,
10695
+ node, stree;
10696
+
10697
+ while (l--) {
10698
+ if ((node = $('#'+fm.navHash2Id(dirs[l]))).length) {
10699
+ stree = node.closest('.'+subtree);
10700
+ node.parent().detach();
10701
+ if (!stree.children().length) {
10702
+ stree.hide().prev(selNavdir).removeClass(collapsed+' '+expanded+' '+loaded);
10703
+ }
10704
+ }
10705
+ }
10706
+ })
10707
+ // lock/unlock dirs while moving
10708
+ .bind('lockfiles unlockfiles', function(e) {
10709
+ var lock = e.type == 'lockfiles',
10710
+ helperLocked = e.data.helper? e.data.helper.data('locked') : false,
10711
+ act = (lock && !helperLocked) ? 'disable' : 'enable',
10712
+ dirs = $.map(e.data.files||[], function(h) {
10713
+ var dir = fm.file(h);
10714
+ return dir && dir.mime == 'directory' ? h : null;
10715
+ });
10716
+
10717
+ $.each(dirs, function(i, hash) {
10718
+ var dir = $('#'+fm.navHash2Id(hash));
10719
+
10720
+ if (dir.length && !helperLocked) {
10721
+ dir.hasClass(draggable) && dir.draggable(act);
10722
+ dir.hasClass(droppable) && dir.droppable(act);
10723
+ dir[lock ? 'addClass' : 'removeClass'](disabled);
10724
+ }
10725
+ });
10726
+ });
10727
+
10728
+ });
10729
+
10730
+ return this;
10731
+ }
10732
+
10733
+
10734
+ /*
10735
+ * File: /js/ui/uploadButton.js
10736
+ */
10737
+
10738
+ /**
10739
+ * @class elFinder toolbar's button tor upload file
10740
+ *
10741
+ * @author Dmitry (dio) Levashov
10742
+ **/
10743
+ $.fn.elfinderuploadbutton = function(cmd) {
10744
+ return this.each(function() {
10745
+ var button = $(this).elfinderbutton(cmd)
10746
+ .off('click'),
10747
+ form = $('<form/>').appendTo(button),
10748
+ input = $('<input type="file" multiple="true" title="'+cmd.fm.i18n('selectForUpload')+'"/>')
10749
+ .change(function() {
10750
+ var _input = $(this);
10751
+ if (_input.val()) {
10752
+ cmd.exec({input : _input.remove()[0]});
10753
+ input.clone(true).appendTo(form);
10754
+ }
10755
+ })
10756
+ .on('dragover', function(e) {
10757
+ e.originalEvent.dataTransfer.dropEffect = 'copy';
10758
+ });
10759
+
10760
+ form.append(input.clone(true));
10761
+
10762
+ cmd.change(function() {
10763
+ form[cmd.disabled() ? 'hide' : 'show']();
10764
+ })
10765
+ .change();
10766
+ });
10767
+ }
10768
+
10769
+
10770
+ /*
10771
+ * File: /js/ui/viewbutton.js
10772
+ */
10773
+
10774
+ /**
10775
+ * @class elFinder toolbar button to switch current directory view.
10776
+ *
10777
+ * @author Dmitry (dio) Levashov
10778
+ **/
10779
+ $.fn.elfinderviewbutton = function(cmd) {
10780
+ return this.each(function() {
10781
+ var button = $(this).elfinderbutton(cmd),
10782
+ icon = button.children('.elfinder-button-icon');
10783
+
10784
+ cmd.change(function() {
10785
+ var icons = cmd.value == 'icons';
10786
+
10787
+ icon.toggleClass('elfinder-button-icon-view-list', icons);
10788
+ button.attr('title', cmd.fm.i18n(icons ? 'viewlist' : 'viewicons'));
10789
+ });
10790
+ });
10791
+ }
10792
+
10793
+ /*
10794
+ * File: /js/ui/workzone.js
10795
+ */
10796
+
10797
+ /**
10798
+ * @class elfinderworkzone - elFinder container for nav and current directory
10799
+ * @author Dmitry (dio) Levashov
10800
+ **/
10801
+ $.fn.elfinderworkzone = function(fm) {
10802
+ var cl = 'elfinder-workzone';
10803
+
10804
+ this.not('.'+cl).each(function() {
10805
+ var wz = $(this).addClass(cl),
10806
+ wdelta = wz.outerHeight(true) - wz.height(),
10807
+ parent = wz.parent();
10808
+
10809
+ parent.add(window).on('resize', function() {
10810
+ var height = parent.height();
10811
+
10812
+ parent.children(':visible:not(.'+cl+')').each(function() {
10813
+ var ch = $(this);
10814
+
10815
+ if (ch.css('position') != 'absolute' && ch.css('position') != 'fixed') {
10816
+ height -= ch.outerHeight(true);
10817
+ }
10818
+ });
10819
+
10820
+ wz.height(height - wdelta);
10821
+ });
10822
+ });
10823
+ return this;
10824
+ }
10825
+
10826
+
10827
+
10828
+
10829
+ /*
10830
+ * File: /js/commands/archive.js
10831
+ */
10832
+
10833
+ /**
10834
+ * @class elFinder command "archive"
10835
+ * Archive selected files
10836
+ *
10837
+ * @author Dmitry (dio) Levashov
10838
+ **/
10839
+ elFinder.prototype.commands.archive = function() {
10840
+ var self = this,
10841
+ fm = self.fm,
10842
+ mimes = [],
10843
+ dfrd;
10844
+
10845
+ this.variants = [];
10846
+
10847
+ this.disableOnSearch = true;
10848
+
10849
+ /**
10850
+ * Update mimes on open/reload
10851
+ *
10852
+ * @return void
10853
+ **/
10854
+ fm.bind('open reload', function() {
10855
+ self.variants = [];
10856
+ $.each((mimes = fm.option('archivers')['create'] || []), function(i, mime) {
10857
+ self.variants.push([mime, fm.mime2kind(mime)])
10858
+ });
10859
+ self.change();
10860
+ });
10861
+
10862
+ this.getstate = function() {
10863
+ return !this._disabled && mimes.length && (fm.selected().length || (dfrd && dfrd.state() == 'pending')) && fm.cwd().write ? 0 : -1;
10864
+ }
10865
+
10866
+ this.exec = function(hashes, type) {
10867
+ var files = this.files(hashes),
10868
+ cnt = files.length,
10869
+ mime = type || mimes[0],
10870
+ cwd = fm.cwd(),
10871
+ error = ['errArchive', 'errPerm', 'errCreatingTempDir', 'errFtpDownloadFile', 'errFtpUploadFile', 'errFtpMkdir', 'errArchiveExec', 'errExtractExec', 'errRm'],
10872
+ i, makeDfrd;
10873
+
10874
+ dfrd = $.Deferred().fail(function(error) {
10875
+ error && fm.error(error);
10876
+ });
10877
+
10878
+ if (!(this.enabled() && cnt && mimes.length && $.inArray(mime, mimes) !== -1)) {
10879
+ return dfrd.reject();
10880
+ }
10881
+
10882
+ if (!cwd.write) {
10883
+ return dfrd.reject(error);
10884
+ }
10885
+
10886
+ for (i = 0; i < cnt; i++) {
10887
+ if (!files[i].read) {
10888
+ return dfrd.reject(error);
10889
+ }
10890
+ }
10891
+
10892
+ self.mime = mime;
10893
+ self.prefix = ((cnt > 1)? 'Archive' : files[0].name) + '.' + fm.option('archivers')['createext'][mime];
10894
+ self.data = {targets : self.hashes(hashes), type : mime};
10895
+ makeDfrd = $.proxy(fm.res('mixin', 'make'), self)();
10896
+ dfrd.reject();
10897
+ return makeDfrd;
10898
+ }
10899
+
10900
+ }
10901
+
10902
+ /*
10903
+ * File: /js/commands/back.js
10904
+ */
10905
+
10906
+ /**
10907
+ * @class elFinder command "back"
10908
+ * Open last visited folder
10909
+ *
10910
+ * @author Dmitry (dio) Levashov
10911
+ **/
10912
+ elFinder.prototype.commands.back = function() {
10913
+ this.alwaysEnabled = true;
10914
+ this.updateOnSelect = false;
10915
+ this.shortcuts = [{
10916
+ pattern : 'ctrl+left backspace'
10917
+ }];
10918
+
10919
+ this.getstate = function() {
10920
+ return this.fm.history.canBack() ? 0 : -1;
10921
+ }
10922
+
10923
+ this.exec = function() {
10924
+ return this.fm.history.back();
10925
+ }
10926
+
10927
+ }
10928
+
10929
+ /*
10930
+ * File: /js/commands/chmod.js
10931
+ */
10932
+
10933
+ /**
10934
+ * @class elFinder command "chmod".
10935
+ * Chmod files.
10936
+ *
10937
+ * @type elFinder.command
10938
+ * @author Naoki Sawada
10939
+ */
10940
+ elFinder.prototype.commands.chmod = function() {
10941
+ this.updateOnSelect = false;
10942
+ var self = this;
10943
+ var fm = this.fm,
10944
+ level = {
10945
+ 0 : 'owner',
10946
+ 1 : 'group',
10947
+ 2 : 'other'
10948
+ },
10949
+ msg = {
10950
+ read : fm.i18n('read'),
10951
+ write : fm.i18n('write'),
10952
+ execute : fm.i18n('execute'),
10953
+ perm : fm.i18n('perm'),
10954
+ kind : fm.i18n('kind'),
10955
+ files : fm.i18n('files')
10956
+ },
10957
+ isPerm = function(perm){
10958
+ return (!isNaN(parseInt(perm, 8) && parseInt(perm, 8) <= 511) || perm.match(/^([r-][w-][x-]){3}$/i));
10959
+ };
10960
+
10961
+ this.tpl = {
10962
+ main : '<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div>'
10963
+ +'{dataTable}',
10964
+ itemTitle : '<strong>{name}</strong><span id="elfinder-info-kind">{kind}</span>',
10965
+ groupTitle : '<strong>{items}: {num}</strong>',
10966
+ dataTable : '<table id="{id}-table-perm"><tr><td>{0}</td><td>{1}</td><td>{2}</td></tr></table>'
10967
+ +'<div class="">'+msg.perm+': <input id="{id}-perm" type="text" size="4" maxlength="3" value="{value}"></div>',
10968
+ fieldset : '<fieldset id="{id}-fieldset-{level}"><legend>{f_title}{name}</legend>'
10969
+ +'<input type="checkbox" value="4" id="{id}-read-{level}-perm"{checked-r}> <label for="{id}-read-{level}-perm">'+msg.read+'</label><br>'
10970
+ +'<input type="checkbox" value="6" id="{id}-write-{level}-perm"{checked-w}> <label for="{id}-write-{level}-perm">'+msg.write+'</label><br>'
10971
+ +'<input type="checkbox" value="5" id="{id}-execute-{level}-perm"{checked-x}> <label for="{id}-execute-{level}-perm">'+msg.execute+'</label><br>'
10972
+ };
10973
+
10974
+ this.shortcuts = [{
10975
+ //pattern : 'ctrl+p'
10976
+ }];
10977
+
10978
+ this.getstate = function(sel) {
10979
+ var fm = this.fm;
10980
+ sel = sel || fm.selected();
10981
+ if (sel.length == 0) {
10982
+ sel = [ fm.cwd().hash ];
10983
+ }
10984
+ return !this._disabled && self.checkstate(this.files(sel)) ? 0 : -1;
10985
+ };
10986
+
10987
+ this.checkstate = function(sel) {
10988
+ var cnt = sel.length;
10989
+ if (!cnt) return false;
10990
+ var chk = $.map(sel, function(f) {
10991
+ return (f.isowner && f.perm && isPerm(f.perm) && (cnt == 1 || f.mime != 'directory')) ? f : null;
10992
+ }).length;
10993
+ return (cnt == chk)? true : false;
10994
+ };
10995
+
10996
+ this.exec = function(hashes) {
10997
+ var files = this.files(hashes);
10998
+ if (! files.length) {
10999
+ hashes = [ this.fm.cwd().hash ];
11000
+ files = this.files(hashes);
11001
+ }
11002
+ var fm = this.fm,
11003
+ dfrd = $.Deferred().always(function() {
11004
+ fm.enable();
11005
+ }),
11006
+ tpl = this.tpl,
11007
+ hashes = this.hashes(hashes),
11008
+ cnt = files.length,
11009
+ file = files[0],
11010
+ id = fm.namespace + '-perm-' + file.hash,
11011
+ view = tpl.main,
11012
+ checked = ' checked="checked"',
11013
+ buttons = function() {
11014
+ var buttons = {};
11015
+ buttons[fm.i18n('btnApply')] = save;
11016
+ buttons[fm.i18n('btnCancel')] = function() { dialog.elfinderdialog('close'); };
11017
+ return buttons;
11018
+ },
11019
+ save = function() {
11020
+ var perm = $.trim($('#'+id+'-perm').val());
11021
+
11022
+ if (!isPerm(perm)) return false;
11023
+
11024
+ dialog.elfinderdialog('close');
11025
+
11026
+ fm.request({
11027
+ data : {
11028
+ cmd : 'chmod',
11029
+ targets : hashes,
11030
+ mode : perm
11031
+ },
11032
+ notify : {type : 'chmod', cnt : cnt}
11033
+ })
11034
+ .fail(function(error) {
11035
+ dfrd.reject(error);
11036
+ })
11037
+ .done(function(data) {
11038
+ dfrd.resolve(data);
11039
+ });
11040
+ },
11041
+ setperm = function() {
11042
+ var perm = '';
11043
+ var _perm;
11044
+ for (var i = 0; i < 3; i++){
11045
+ _perm = 0;
11046
+ if ($("#"+id+"-read-"+level[i]+'-perm').is(':checked')) {
11047
+ _perm = (_perm | 4);
11048
+ }
11049
+ if ($("#"+id+"-write-"+level[i]+'-perm').is(':checked')) {
11050
+ _perm = (_perm | 2);
11051
+ }
11052
+ if ($("#"+id+"-execute-"+level[i]+'-perm').is(':checked')) {
11053
+ _perm = (_perm | 1);
11054
+ }
11055
+ perm += _perm.toString(8);
11056
+ }
11057
+ $('#'+id+'-perm').val(perm);
11058
+ },
11059
+ setcheck = function(perm) {
11060
+ var _perm;
11061
+ for (var i = 0; i < 3; i++){
11062
+ _perm = parseInt(perm.slice(i, i+1), 8);
11063
+ $("#"+id+"-read-"+level[i]+'-perm').prop("checked", false);
11064
+ $("#"+id+"-write-"+level[i]+'-perm').prop("checked", false);
11065
+ $("#"+id+"-execute-"+level[i]+'-perm').prop("checked", false);
11066
+ if ((_perm & 4) == 4) {
11067
+ $("#"+id+"-read-"+level[i]+'-perm').prop("checked", true);
11068
+ }
11069
+ if ((_perm & 2) == 2) {
11070
+ $("#"+id+"-write-"+level[i]+'-perm').prop("checked", true);
11071
+ }
11072
+ if ((_perm & 1) == 1) {
11073
+ $("#"+id+"-execute-"+level[i]+'-perm').prop("checked", true);
11074
+ }
11075
+ }
11076
+ setperm();
11077
+ },
11078
+ makeperm = function(files) {
11079
+ var perm = '777', ret = '', chk, _chk, _perm;
11080
+ var len = files.length;
11081
+ for (var i2 = 0; i2 < len; i2++) {
11082
+ chk = getPerm(files[i2].perm);;
11083
+ ret = '';
11084
+ for (var i = 0; i < 3; i++){
11085
+ _chk = parseInt(chk.slice(i, i+1), 8);
11086
+ _perm = parseInt(perm.slice(i, i+1), 8);
11087
+ if ((_chk & 4) != 4 && (_perm & 4) == 4) {
11088
+ _perm -= 4;
11089
+ }
11090
+ if ((_chk & 2) != 2 && (_perm & 2) == 2) {
11091
+ _perm -= 2;
11092
+ }
11093
+ if ((_chk & 1) != 1 && (_perm & 1) == 1) {
11094
+ _perm -= 1;
11095
+ }
11096
+ ret += _perm.toString(8);
11097
+ }
11098
+ perm = ret;
11099
+ }
11100
+ return perm;
11101
+ },
11102
+ makeName = function(name) {
11103
+ return name? ':'+name : '';
11104
+ },
11105
+ makeDataTable = function(perm, f) {
11106
+ var _perm, fieldset;
11107
+ var value = '';
11108
+ var dataTable = tpl.dataTable;
11109
+ for (var i = 0; i < 3; i++){
11110
+ _perm = parseInt(perm.slice(i, i+1), 8);
11111
+ value += _perm.toString(8);
11112
+ fieldset = tpl.fieldset.replace('{f_title}', fm.i18n(level[i])).replace('{name}', makeName(f[level[i]])).replace(/\{level\}/g, level[i]);
11113
+ dataTable = dataTable.replace('{'+i+'}', fieldset)
11114
+ .replace('{checked-r}', ((_perm & 4) == 4)? checked : '')
11115
+ .replace('{checked-w}', ((_perm & 2) == 2)? checked : '')
11116
+ .replace('{checked-x}', ((_perm & 1) == 1)? checked : '');
11117
+ }
11118
+ dataTable = dataTable.replace('{value}', value).replace('{valueCaption}', msg['perm']);
11119
+ return dataTable;
11120
+ },
11121
+ getPerm = function(perm){
11122
+ if (isNaN(parseInt(perm, 8))) {
11123
+ var mode_array = perm.split('');
11124
+ var a = [];
11125
+
11126
+ for (var i = 0, l = mode_array.length; i < l; i++) {
11127
+ if (i === 0 || i === 3 || i === 6) {
11128
+ if (mode_array[i].match(/[r]/i)) {
11129
+ a.push(1);
11130
+ } else if (mode_array[i].match(/[-]/)) {
11131
+ a.push(0);
11132
+ }
11133
+ } else if ( i === 1 || i === 4 || i === 7) {
11134
+ if (mode_array[i].match(/[w]/i)) {
11135
+ a.push(1);
11136
+ } else if (mode_array[i].match(/[-]/)) {
11137
+ a.push(0);
11138
+ }
11139
+ } else {
11140
+ if (mode_array[i].match(/[x]/i)) {
11141
+ a.push(1);
11142
+ } else if (mode_array[i].match(/[-]/)) {
11143
+ a.push(0);
11144
+ }
11145
+ }
11146
+ }
11147
+
11148
+ a.splice(3, 0, ",");
11149
+ a.splice(7, 0, ",");
11150
+
11151
+ var b = a.join("");
11152
+ var b_array = b.split(",");
11153
+ var c = [];
11154
+
11155
+ for (var j = 0, m = b_array.length; j < m; j++) {
11156
+ var p = parseInt(b_array[j], 2).toString(8);
11157
+ c.push(p)
11158
+ }
11159
+
11160
+ perm = c.join('');
11161
+ } else {
11162
+ perm = parseInt(perm, 8).toString(8);
11163
+ }
11164
+ return perm;
11165
+ },
11166
+ opts = {
11167
+ title : this.title,
11168
+ width : 'auto',
11169
+ buttons : buttons(),
11170
+ close : function() { $(this).elfinderdialog('destroy'); }
11171
+ },
11172
+ dialog = fm.getUI().find('#'+id),
11173
+ tmb = '', title, dataTable;
11174
+
11175
+ if (dialog.length) {
11176
+ dialog.elfinderdialog('toTop');
11177
+ return $.Deferred().resolve();
11178
+ }
11179
+
11180
+ view = view.replace('{class}', cnt > 1 ? 'elfinder-cwd-icon-group' : fm.mime2class(file.mime));
11181
+ if (cnt > 1) {
11182
+ title = tpl.groupTitle.replace('{items}', fm.i18n('items')).replace('{num}', cnt);
11183
+ } else {
11184
+ title = tpl.itemTitle.replace('{name}', file.name).replace('{kind}', fm.mime2kind(file));
11185
+ if (file.tmb) {
11186
+ tmb = fm.option('tmbUrl')+file.tmb;
11187
+ }
11188
+ }
11189
+
11190
+ dataTable = makeDataTable(makeperm(files), files.length == 1? files[0] : {});
11191
+
11192
+ view = view.replace('{title}', title).replace('{dataTable}', dataTable).replace(/{id}/g, id);
11193
+
11194
+ dialog = fm.dialog(view, opts);
11195
+ dialog.attr('id', id);
11196
+
11197
+ // load thumbnail
11198
+ if (tmb) {
11199
+ $('<img/>')
11200
+ .on('load', function() { dialog.find('.elfinder-cwd-icon').css('background', 'url("'+tmb+'") center center no-repeat'); })
11201
+ .attr('src', tmb);
11202
+ }
11203
+
11204
+ $('#' + id + '-table-perm :checkbox').on('click', function(){setperm('perm');});
11205
+ $('#' + id + '-perm').on('keydown', function(e) {
11206
+ var c = e.keyCode;
11207
+ e.stopPropagation();
11208
+ if (c == 13) {
11209
+ save();
11210
+ return;
11211
+ }
11212
+ }).on('focus', function(e){
11213
+ $(this).select();
11214
+ }).on('keyup', function(e) {
11215
+ if ($(this).val().length == 3) {
11216
+ $(this).select();
11217
+ setcheck($(this).val());
11218
+ }
11219
+ });
11220
+
11221
+ return dfrd;
11222
+ };
11223
+ };
11224
+
11225
+
11226
+ /*
11227
+ * File: /js/commands/copy.js
11228
+ */
11229
+
11230
+ /**
11231
+ * @class elFinder command "copy".
11232
+ * Put files in filemanager clipboard.
11233
+ *
11234
+ * @type elFinder.command
11235
+ * @author Dmitry (dio) Levashov
11236
+ */
11237
+ elFinder.prototype.commands.copy = function() {
11238
+
11239
+ this.shortcuts = [{
11240
+ pattern : 'ctrl+c ctrl+insert'
11241
+ }];
11242
+
11243
+ this.getstate = function(sel) {
11244
+ var sel = this.files(sel),
11245
+ cnt = sel.length;
11246
+
11247
+ return !this._disabled && cnt && $.map(sel, function(f) { return f.phash && f.read ? f : null }).length == cnt ? 0 : -1;
11248
+ }
11249
+
11250
+ this.exec = function(hashes) {
11251
+ var fm = this.fm,
11252
+ dfrd = $.Deferred()
11253
+ .fail(function(error) {
11254
+ fm.error(error);
11255
+ });
11256
+
11257
+ $.each(this.files(hashes), function(i, file) {
11258
+ if (!(file.read && file.phash)) {
11259
+ return !dfrd.reject(['errCopy', file.name, 'errPerm']);
11260
+ }
11261
+ });
11262
+
11263
+ return dfrd.state() == 'rejected' ? dfrd : dfrd.resolve(fm.clipboard(this.hashes(hashes)));
11264
+ }
11265
+
11266
+ }
11267
+
11268
+ /*
11269
+ * File: /js/commands/cut.js
11270
+ */
11271
+
11272
+ /**
11273
+ * @class elFinder command "copy".
11274
+ * Put files in filemanager clipboard.
11275
+ *
11276
+ * @type elFinder.command
11277
+ * @author Dmitry (dio) Levashov
11278
+ */
11279
+ elFinder.prototype.commands.cut = function() {
11280
+
11281
+ this.shortcuts = [{
11282
+ pattern : 'ctrl+x shift+insert'
11283
+ }];
11284
+
11285
+ this.getstate = function(sel) {
11286
+ var sel = this.files(sel),
11287
+ cnt = sel.length;
11288
+
11289
+ return !this._disabled && cnt && $.map(sel, function(f) { return f.phash && f.read && !f.locked ? f : null }).length == cnt ? 0 : -1;
11290
+ }
11291
+
11292
+ this.exec = function(hashes) {
11293
+ var fm = this.fm,
11294
+ dfrd = $.Deferred()
11295
+ .fail(function(error) {
11296
+ fm.error(error);
11297
+ });
11298
+
11299
+ $.each(this.files(hashes), function(i, file) {
11300
+ if (!(file.read && file.phash) ) {
11301
+ return !dfrd.reject(['errCopy', file.name, 'errPerm']);
11302
+ }
11303
+ if (file.locked) {
11304
+ return !dfrd.reject(['errLocked', file.name]);
11305
+ }
11306
+ });
11307
+
11308
+ return dfrd.state() == 'rejected' ? dfrd : dfrd.resolve(fm.clipboard(this.hashes(hashes), true));
11309
+ }
11310
+
11311
+ }
11312
+
11313
+ /*
11314
+ * File: /js/commands/download.js
11315
+ */
11316
+
11317
+ /**
11318
+ * @class elFinder command "download".
11319
+ * Download selected files.
11320
+ * Only for new api
11321
+ *
11322
+ * @author Dmitry (dio) Levashov, dio@std42.ru
11323
+ **/
11324
+ elFinder.prototype.commands.download = function() {
11325
+ var self = this,
11326
+ fm = this.fm,
11327
+ filter = function(hashes) {
11328
+ return $.map(self.files(hashes), function(f) { return f.mime == 'directory' ? null : f; });
11329
+ };
11330
+
11331
+ this.shortcuts = [{
11332
+ pattern : 'shift+enter'
11333
+ }];
11334
+
11335
+ this.getstate = function() {
11336
+ var sel = this.fm.selected(),
11337
+ cnt = sel.length;
11338
+
11339
+ return !this._disabled && cnt && ((!fm.UA.IE && !fm.UA.Mobile) || cnt == 1) && cnt == filter(sel).length ? 0 : -1;
11340
+ };
11341
+
11342
+ this.fm.bind('contextmenu', function(e){
11343
+ var fm = self.fm,
11344
+ helper = null,
11345
+ targets, file, link,
11346
+ getExtra = function(file) {
11347
+ var link = file.url || fm.url(file.hash);
11348
+ return {
11349
+ icon: 'link',
11350
+ node: $('<a/>')
11351
+ .attr({href: link, target: '_blank', title: fm.i18n('link')})
11352
+ .text(file.name)
11353
+ .on('mousedown click touchstart touchmove touchend contextmenu', function(e){
11354
+ var cm = fm.getUI('contextmenu');
11355
+ e.stopPropagation();
11356
+ // 'mouseEvInternal' for Firefox's bug (maybe)
11357
+ cm.data('mouseEvInternal', true);
11358
+ setTimeout(function(){
11359
+ cm.data('mouseEvInternal', false);
11360
+ }, 500);
11361
+ })
11362
+ .on('dragstart', function(e) {
11363
+ var dt = e.dataTransfer || e.originalEvent.dataTransfer || null;
11364
+ helper = null;
11365
+ if (dt) {
11366
+ var icon = function(f) {
11367
+ var mime = f.mime, i;
11368
+ i = '<div class="elfinder-cwd-icon '+fm.mime2class(mime)+' ui-corner-all"/>';
11369
+ if (f.tmb && f.tmb !== 1) {
11370
+ i = $(i).css('background', "url('"+fm.option('tmbUrl')+f.tmb+"') center center no-repeat").get(0).outerHTML;
11371
+ }
11372
+ return i;
11373
+ };
11374
+ dt.effectAllowed = 'copyLink';
11375
+ if (dt.setDragImage) {
11376
+ helper = $('<div class="elfinder-drag-helper html5-native">').append(icon(file)).appendTo($(document.body));
11377
+ dt.setDragImage(helper.get(0), 50, 47);
11378
+ }
11379
+ if (!fm.UA.IE) {
11380
+ dt.setData('elfinderfrom', window.location.href + file.phash);
11381
+ dt.setData('elfinderfrom:' + dt.getData('elfinderfrom'), '');
11382
+ }
11383
+ }
11384
+ })
11385
+ .on('dragend', function(e) {
11386
+ helper && helper.remove();
11387
+ })
11388
+ };
11389
+ };
11390
+ self.extra = null;
11391
+ if (e.data) {
11392
+ targets = e.data.targets || [];
11393
+ if (targets.length === 1 && (file = fm.file(targets[0])) && file.mime !== 'directory') {
11394
+ if (file.url != '1') {
11395
+ self.extra = getExtra(file);
11396
+ } else {
11397
+ // Get URL ondemand
11398
+ var node;
11399
+ self.extra = {
11400
+ icon: 'link',
11401
+ node: $('<a/>')
11402
+ .attr({href: '#', title: fm.i18n('link'), draggable: 'false'})
11403
+ .text(file.name)
11404
+ .on('click', function(e){
11405
+ var parent = node.parent();
11406
+ e.stopPropagation();
11407
+ e.preventDefault();
11408
+ parent.removeClass('ui-state-disabled').addClass('elfinder-button-icon-spinner');
11409
+ fm.request({
11410
+ data : {cmd : 'url', target : file.hash},
11411
+ preventDefault : true
11412
+ })
11413
+ .always(function(data) {
11414
+ if (data.url) {
11415
+ var rfile = fm.file(file.hash);
11416
+ rfile.url = data.url;
11417
+ parent.removeClass('elfinder-button-icon-spinner');
11418
+ node.replaceWith(getExtra(file).node);
11419
+ } else {
11420
+ parent.addClass('ui-state-disabled');
11421
+ }
11422
+ });
11423
+
11424
+ })
11425
+ };
11426
+ node = self.extra.node;
11427
+ node.ready(function(){
11428
+ setTimeout(function(){
11429
+ node.parent().addClass('ui-state-disabled');
11430
+ }, 10);
11431
+ });
11432
+ }
11433
+ }
11434
+ }
11435
+ });
11436
+
11437
+
11438
+ this.exec = function(hashes) {
11439
+ var fm = this.fm,
11440
+ base = fm.options.url,
11441
+ files = filter(hashes),
11442
+ dfrd = $.Deferred(),
11443
+ iframes = '',
11444
+ cdata = '',
11445
+ i, url;
11446
+
11447
+ if (this.disabled()) {
11448
+ return dfrd.reject();
11449
+ }
11450
+
11451
+ var url,
11452
+ link = $('<a>').hide().appendTo($('body')),
11453
+ html5dl = (typeof link.get(0).download === 'string');
11454
+ for (i = 0; i < files.length; i++) {
11455
+ url = fm.openUrl(files[i].hash, true);
11456
+ if (html5dl) {
11457
+ link.attr('href', url)
11458
+ .attr('download', files[i].name)
11459
+ .attr('target', '_blank')
11460
+ .get(0).click();
11461
+ } else {
11462
+ if (fm.UA.Mobile) {
11463
+ setTimeout(function(){
11464
+ if (! window.open(url)) {
11465
+ fm.error('errPopup');
11466
+ }
11467
+ }, 100);
11468
+ } else {
11469
+ iframes += '<iframe class="downloader" id="downloader-' + files[i].hash+'" style="display:none" src="'+url+'"/>';
11470
+ }
11471
+ }
11472
+ }
11473
+ link.remove();
11474
+ $(iframes)
11475
+ .appendTo('body')
11476
+ .ready(function() {
11477
+ setTimeout(function() {
11478
+ $(iframes).each(function() {
11479
+ $('#' + $(this).attr('id')).remove();
11480
+ });
11481
+ }, fm.UA.Firefox? (20000 + (10000 * i)) : 1000); // give mozilla 20 sec + 10 sec for each file to be saved
11482
+ });
11483
+ fm.trigger('download', {files : files});
11484
+ return dfrd.resolve(hashes);
11485
+ };
11486
+
11487
+ };
11488
+
11489
+ /*
11490
+ * File: /js/commands/duplicate.js
11491
+ */
11492
+
11493
+ /**
11494
+ * @class elFinder command "duplicate"
11495
+ * Create file/folder copy with suffix "copy Number"
11496
+ *
11497
+ * @type elFinder.command
11498
+ * @author Dmitry (dio) Levashov
11499
+ */
11500
+ elFinder.prototype.commands.duplicate = function() {
11501
+ var fm = this.fm;
11502
+
11503
+ this.getstate = function(sel) {
11504
+ var sel = this.files(sel),
11505
+ cnt = sel.length;
11506
+
11507
+ return !this._disabled && cnt && fm.cwd().write && $.map(sel, function(f) { return f.phash && f.read ? f : null }).length == cnt ? 0 : -1;
11508
+ }
11509
+
11510
+ this.exec = function(hashes) {
11511
+ var fm = this.fm,
11512
+ files = this.files(hashes),
11513
+ cnt = files.length,
11514
+ dfrd = $.Deferred()
11515
+ .fail(function(error) {
11516
+ error && fm.error(error);
11517
+ }),
11518
+ args = [];
11519
+
11520
+ if (!cnt || this._disabled) {
11521
+ return dfrd.reject();
11522
+ }
11523
+
11524
+ $.each(files, function(i, file) {
11525
+ if (!file.read || !fm.file(file.phash).write) {
11526
+ return !dfrd.reject(['errCopy', file.name, 'errPerm']);
11527
+ }
11528
+ });
11529
+
11530
+ if (dfrd.state() == 'rejected') {
11531
+ return dfrd;
11532
+ }
11533
+
11534
+ return fm.request({
11535
+ data : {cmd : 'duplicate', targets : this.hashes(hashes)},
11536
+ notify : {type : 'copy', cnt : cnt}
11537
+ });
11538
+
11539
+ }
11540
+
11541
+ }
11542
+
11543
+ /*
11544
+ * File: /js/commands/edit.js
11545
+ */
11546
+
11547
+ /**
11548
+ * @class elFinder command "edit".
11549
+ * Edit text file in dialog window
11550
+ *
11551
+ * @author Dmitry (dio) Levashov, dio@std42.ru
11552
+ **/
11553
+ elFinder.prototype.commands.edit = function() {
11554
+ var self = this,
11555
+ fm = this.fm,
11556
+ mimes = fm.res('mimes', 'text') || [],
11557
+ rtrim = function(str){
11558
+ return str.replace(/\s+$/, '');
11559
+ },
11560
+
11561
+ /**
11562
+ * Return files acceptable to edit
11563
+ *
11564
+ * @param Array files hashes
11565
+ * @return Array
11566
+ **/
11567
+ filter = function(files) {
11568
+ return $.map(files, function(file) {
11569
+ return (file.mime.indexOf('text/') === 0 || $.inArray(file.mime, mimes) !== -1)
11570
+ && file.mime.indexOf('text/rtf')
11571
+ && (!self.onlyMimes.length || $.inArray(file.mime, self.onlyMimes) !== -1)
11572
+ && file.read && file.write ? file : null;
11573
+ });
11574
+ },
11575
+
11576
+ /**
11577
+ * Open dialog with textarea to edit file
11578
+ *
11579
+ * @param String id dialog id
11580
+ * @param Object file file object
11581
+ * @param String content file content
11582
+ * @return $.Deferred
11583
+ **/
11584
+ dialog = function(id, file, content) {
11585
+
11586
+ var dfrd = $.Deferred(),
11587
+ ta = $('<textarea class="elfinder-file-edit" rows="20" id="'+id+'-ta">'+fm.escape(content)+'</textarea>'),
11588
+ old = ta.val(),
11589
+ save = function() {
11590
+ ta.editor && ta.editor.save(ta[0], ta.editor.instance);
11591
+ old = ta.val();
11592
+ dfrd.notifyWith(ta);
11593
+ },
11594
+ cancel = function() {
11595
+ var close = function(){
11596
+ dfrd.reject();
11597
+ ta.elfinderdialog('close');
11598
+ };
11599
+ ta.editor && ta.editor.save(ta[0], ta.editor.instance);
11600
+ if (rtrim(old) !== rtrim(ta.val())) {
11601
+ old = ta.val();
11602
+ fm.confirm({
11603
+ title : self.title,
11604
+ text : 'confirmNotSave',
11605
+ accept : {
11606
+ label : 'btnSaveClose',
11607
+ callback : function() {
11608
+ save();
11609
+ close();
11610
+ }
11611
+ },
11612
+ cancel : {
11613
+ label : 'btnClose',
11614
+ callback : close
11615
+ }
11616
+ });
11617
+ } else {
11618
+ close();
11619
+ }
11620
+ },
11621
+ savecl = function() {
11622
+ save();
11623
+ cancel();
11624
+ },
11625
+ opts = {
11626
+ title : fm.escape(file.name),
11627
+ width : self.options.dialogWidth || 450,
11628
+ buttons : {},
11629
+ btnHoverFocus : false,
11630
+ closeOnEscape : false,
11631
+ close : function() {
11632
+ var $this = $(this),
11633
+ close = function(){
11634
+ ta.editor && ta.editor.close(ta[0], ta.editor.instance);
11635
+ $this.elfinderdialog('destroy');
11636
+ };
11637
+ ta.editor && ta.editor.save(ta[0], ta.editor.instance);
11638
+ if (rtrim(old) !== rtrim(ta.val())) {
11639
+ fm.confirm({
11640
+ title : self.title,
11641
+ text : 'confirmNotSave',
11642
+ accept : {
11643
+ label : 'btnSaveClose',
11644
+ callback : function() {
11645
+ save();
11646
+ close();
11647
+ }
11648
+ },
11649
+ cancel : {
11650
+ label : 'btnClose',
11651
+ callback : close
11652
+ }
11653
+ });
11654
+ } else {
11655
+ close();
11656
+ }
11657
+ },
11658
+ open : function() {
11659
+ fm.disable();
11660
+ ta.focus();
11661
+ ta[0].setSelectionRange && ta[0].setSelectionRange(0, 0);
11662
+ if (ta.editor) {
11663
+ ta.editor.instance = ta.editor.load(ta[0]) || null;
11664
+ ta.editor.focus(ta[0], ta.editor.instance);
11665
+ }
11666
+ }
11667
+
11668
+ },
11669
+ mimeMatch = function(fileMime, editorMimes){
11670
+ editorMimes = editorMimes || mimes.concat('text/');
11671
+ if ($.inArray(fileMime, editorMimes) !== -1 ) {
11672
+ return true;
11673
+ }
11674
+ var i, l;
11675
+ l = editorMimes.length;
11676
+ for (i = 0; i < l; i++) {
11677
+ if (fileMime.indexOf(editorMimes[i]) === 0) {
11678
+ return true;
11679
+ }
11680
+ }
11681
+ return false;
11682
+ },
11683
+ extMatch = function(fileName, editorExts){
11684
+ if (!editorExts || !editorExts.length) {
11685
+ return true;
11686
+ }
11687
+ var ext = fileName.replace(/^.+\.([^.]+)|(.+)$/, '$1$2').toLowerCase(),
11688
+ i, l;
11689
+ l = editorExts.length;
11690
+ for (i = 0; i < l; i++) {
11691
+ if (ext === editorExts[i].toLowerCase()) {
11692
+ return true;
11693
+ }
11694
+ }
11695
+ return false;
11696
+ };
11697
+
11698
+ ta.getContent = function() {
11699
+ return ta.val();
11700
+ };
11701
+
11702
+ $.each(self.options.editors || [], function(i, editor) {
11703
+ if (mimeMatch(file.mime, editor.mimes || null)
11704
+ && extMatch(file.name, editor.exts || null)
11705
+ && typeof editor.load == 'function'
11706
+ && typeof editor.save == 'function') {
11707
+ ta.editor = {
11708
+ load : editor.load,
11709
+ save : editor.save,
11710
+ close : typeof editor.close == 'function' ? editor.close : function() {},
11711
+ focus : typeof editor.focus == 'function' ? editor.focus : function() {},
11712
+ instance : null,
11713
+ doSave : save,
11714
+ doCancel : cancel,
11715
+ doClose : savecl,
11716
+ file : file
11717
+ };
11718
+
11719
+ return false;
11720
+ }
11721
+ });
11722
+
11723
+ if (!ta.editor) {
11724
+ ta.keydown(function(e) {
11725
+ var code = e.keyCode,
11726
+ value, start;
11727
+
11728
+ e.stopPropagation();
11729
+ if (code == 9) {
11730
+ e.preventDefault();
11731
+ // insert tab on tab press
11732
+ if (this.setSelectionRange) {
11733
+ value = this.value;
11734
+ start = this.selectionStart;
11735
+ this.value = value.substr(0, start) + "\t" + value.substr(this.selectionEnd);
11736
+ start += 1;
11737
+ this.setSelectionRange(start, start);
11738
+ }
11739
+ }
11740
+
11741
+ if (e.ctrlKey || e.metaKey) {
11742
+ // close on ctrl+w/q
11743
+ if (code == 81 || code == 87) {
11744
+ e.preventDefault();
11745
+ cancel();
11746
+ }
11747
+ if (code == 83) {
11748
+ e.preventDefault();
11749
+ save();
11750
+ }
11751
+ }
11752
+
11753
+ }).on('mouseenter', function(){this.focus();});
11754
+ }
11755
+
11756
+ opts.buttons[fm.i18n('btnSave')] = save;
11757
+ opts.buttons[fm.i18n('btnSaveClose')] = savecl;
11758
+ opts.buttons[fm.i18n('btnCancel')] = cancel;
11759
+
11760
+ fm.dialog(ta, opts).attr('id', id);
11761
+ return dfrd.promise();
11762
+ },
11763
+
11764
+ /**
11765
+ * Get file content and
11766
+ * open dialog with textarea to edit file content
11767
+ *
11768
+ * @param String file hash
11769
+ * @return jQuery.Deferred
11770
+ **/
11771
+ edit = function(file, doconv) {
11772
+ var hash = file.hash,
11773
+ opts = fm.options,
11774
+ dfrd = $.Deferred(),
11775
+ data = {cmd : 'file', target : hash},
11776
+ id = 'edit-'+fm.namespace+'-'+file.hash,
11777
+ d = fm.getUI().find('#'+id),
11778
+ conv = !doconv? 0 : 1,
11779
+ error;
11780
+
11781
+
11782
+ if (d.length) {
11783
+ d.elfinderdialog('toTop');
11784
+ return dfrd.resolve();
11785
+ }
11786
+
11787
+ if (!file.read || !file.write) {
11788
+ error = ['errOpen', file.name, 'errPerm'];
11789
+ fm.error(error);
11790
+ return dfrd.reject(error);
11791
+ }
11792
+
11793
+ fm.request({
11794
+ data : {cmd : 'get', target : hash, conv : conv},
11795
+ notify : {type : 'file', cnt : 1},
11796
+ syncOnFail : true
11797
+ })
11798
+ .done(function(data) {
11799
+ if (data.doconv) {
11800
+ fm.confirm({
11801
+ title : self.title,
11802
+ text : 'confirmConvUTF8',
11803
+ accept : {
11804
+ label : 'btnConv',
11805
+ callback : function() {
11806
+ dfrd = edit(file, 1);
11807
+ }
11808
+ },
11809
+ cancel : {
11810
+ label : 'btnCancel',
11811
+ callback : function() { dfrd.reject(); }
11812
+ }
11813
+ });
11814
+ } else {
11815
+ dialog(id, file, data.content)
11816
+ .progress(function() {
11817
+ var ta = this;
11818
+ fm.request({
11819
+ options : {type : 'post'},
11820
+ data : {
11821
+ cmd : 'put',
11822
+ target : hash,
11823
+ content : ta.getContent()
11824
+ },
11825
+ notify : {type : 'save', cnt : 1},
11826
+ syncOnFail : true
11827
+ })
11828
+ .fail(function(error) {
11829
+ dfrd.reject(error);
11830
+ })
11831
+ .done(function(data) {
11832
+ data.changed && data.changed.length && fm.change(data);
11833
+ dfrd.resolve(data);
11834
+ setTimeout(function(){
11835
+ ta.focus();
11836
+ ta.editor && ta.editor.focus(ta[0], ta.editor.instance);
11837
+ }, 50);
11838
+ });
11839
+ });
11840
+ }
11841
+ })
11842
+ .fail(function(error) {
11843
+ dfrd.reject(error);
11844
+ });
11845
+
11846
+ return dfrd.promise();
11847
+ };
11848
+
11849
+
11850
+
11851
+ this.shortcuts = [{
11852
+ pattern : 'ctrl+e'
11853
+ }];
11854
+
11855
+ this.init = function() {
11856
+ this.onlyMimes = this.options.mimes || [];
11857
+ };
11858
+
11859
+ this.getstate = function(sel) {
11860
+ var sel = this.files(sel),
11861
+ cnt = sel.length;
11862
+
11863
+ return !this._disabled && cnt && filter(sel).length == cnt ? 0 : -1;
11864
+ };
11865
+
11866
+ this.exec = function(hashes) {
11867
+ var files = filter(this.files(hashes)),
11868
+ list = [],
11869
+ file;
11870
+
11871
+ if (this.disabled()) {
11872
+ return $.Deferred().reject();
11873
+ }
11874
+
11875
+ while ((file = files.shift())) {
11876
+ list.push(edit(file));
11877
+ }
11878
+
11879
+ return list.length
11880
+ ? $.when.apply(null, list)
11881
+ : $.Deferred().reject();
11882
+ };
11883
+
11884
+ };
11885
+
11886
+ /*
11887
+ * File: /js/commands/extract.js
11888
+ */
11889
+
11890
+ /**
11891
+ * @class elFinder command "extract"
11892
+ * Extract files from archive
11893
+ *
11894
+ * @author Dmitry (dio) Levashov
11895
+ **/
11896
+ elFinder.prototype.commands.extract = function() {
11897
+ var self = this,
11898
+ fm = self.fm,
11899
+ mimes = [],
11900
+ filter = function(files) {
11901
+ return $.map(files, function(file) {
11902
+ return file.read && $.inArray(file.mime, mimes) !== -1 ? file : null
11903
+
11904
+ })
11905
+ };
11906
+
11907
+ this.variants = [];
11908
+ this.disableOnSearch = true;
11909
+
11910
+ // Update mimes list on open/reload
11911
+ fm.bind('open reload', function() {
11912
+ mimes = fm.option('archivers')['extract'] || [];
11913
+ self.variants = [['makedir', fm.i18n('cmdmkdir')], ['intohere', fm.i18n('btnCwd')]];
11914
+ self.change();
11915
+ });
11916
+
11917
+ this.getstate = function(sel) {
11918
+ var sel = this.files(sel),
11919
+ cnt = sel.length;
11920
+
11921
+ return !this._disabled && cnt && this.fm.cwd().write && filter(sel).length == cnt ? 0 : -1;
11922
+ }
11923
+
11924
+ this.exec = function(hashes, extractTo) {
11925
+ var files = this.files(hashes),
11926
+ dfrd = $.Deferred(),
11927
+ cnt = files.length,
11928
+ makedir = (extractTo == 'makedir')? 1 : 0,
11929
+ i, error,
11930
+ decision;
11931
+
11932
+ var overwriteAll = false;
11933
+ var omitAll = false;
11934
+ var mkdirAll = 0;
11935
+
11936
+ var names = $.map(fm.files(hashes), function(file) { return file.name; });
11937
+ var map = {};
11938
+ $.map(fm.files(hashes), function(file) { map[file.name] = file; });
11939
+
11940
+ var decide = function(decision) {
11941
+ switch (decision) {
11942
+ case 'overwrite_all' :
11943
+ overwriteAll = true;
11944
+ break;
11945
+ case 'omit_all':
11946
+ omitAll = true;
11947
+ break;
11948
+ }
11949
+ };
11950
+
11951
+ var unpack = function(file) {
11952
+ if (!(file.read && fm.file(file.phash).write)) {
11953
+ error = ['errExtract', file.name, 'errPerm'];
11954
+ fm.error(error);
11955
+ dfrd.reject(error);
11956
+ } else if ($.inArray(file.mime, mimes) === -1) {
11957
+ error = ['errExtract', file.name, 'errNoArchive'];
11958
+ fm.error(error);
11959
+ dfrd.reject(error);
11960
+ } else {
11961
+ fm.request({
11962
+ data:{cmd:'extract', target:file.hash, makedir:makedir},
11963
+ notify:{type:'extract', cnt:1},
11964
+ syncOnFail:true
11965
+ })
11966
+ .fail(function (error) {
11967
+ if (dfrd.state() != 'rejected') {
11968
+ dfrd.reject(error);
11969
+ }
11970
+ })
11971
+ .done(function () {
11972
+ });
11973
+ }
11974
+ };
11975
+
11976
+ var confirm = function(files, index) {
11977
+ var file = files[index],
11978
+ name = file.name.replace(/\.((tar\.(gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(gz|bz2)|[a-z0-9]{1,4})$/ig, ''),
11979
+ existed = ($.inArray(name, names) >= 0),
11980
+ next = function(){
11981
+ if((index+1) < cnt) {
11982
+ confirm(files, index+1);
11983
+ } else {
11984
+ dfrd.resolve();
11985
+ }
11986
+ };
11987
+ if (!makedir && existed && map[name].mime != 'directory') {
11988
+ fm.confirm(
11989
+ {
11990
+ title : fm.i18n('ntfextract'),
11991
+ text : ['errExists', name, 'confirmRepl'],
11992
+ accept:{
11993
+ label : 'btnYes',
11994
+ callback:function (all) {
11995
+ decision = all ? 'overwrite_all' : 'overwrite';
11996
+ decide(decision);
11997
+ if(!overwriteAll && !omitAll) {
11998
+ if('overwrite' == decision) {
11999
+ unpack(file);
12000
+ }
12001
+ if((index+1) < cnt) {
12002
+ confirm(files, index+1);
12003
+ } else {
12004
+ dfrd.resolve();
12005
+ }
12006
+ } else if(overwriteAll) {
12007
+ for (i = index; i < cnt; i++) {
12008
+ unpack(files[i]);
12009
+ }
12010
+ dfrd.resolve();
12011
+ }
12012
+ }
12013
+ },
12014
+ reject : {
12015
+ label : 'btnNo',
12016
+ callback:function (all) {
12017
+ decision = all ? 'omit_all' : 'omit';
12018
+ decide(decision);
12019
+ if(!overwriteAll && !omitAll && (index+1) < cnt) {
12020
+ confirm(files, index+1);
12021
+ } else if (omitAll) {
12022
+ dfrd.resolve();
12023
+ }
12024
+ }
12025
+ },
12026
+ cancel : {
12027
+ label : 'btnCancel',
12028
+ callback:function () {
12029
+ dfrd.resolve();
12030
+ }
12031
+ },
12032
+ all : ((index+1) < cnt)
12033
+ }
12034
+ );
12035
+ } else if (!makedir) {
12036
+ if (mkdirAll == 0) {
12037
+ fm.confirm({
12038
+ title : fm.i18n('cmdextract'),
12039
+ text : [fm.i18n('cmdextract')+' "'+file.name+'"', 'confirmRepl'],
12040
+ accept:{
12041
+ label : 'btnYes',
12042
+ callback:function (all) {
12043
+ all && (mkdirAll = 1);
12044
+ unpack(file);
12045
+ next();
12046
+ }
12047
+ },
12048
+ reject : {
12049
+ label : 'btnNo',
12050
+ callback:function (all) {
12051
+ all && (mkdirAll = -1);
12052
+ next();
12053
+ }
12054
+ },
12055
+ cancel : {
12056
+ label : 'btnCancel',
12057
+ callback:function () {
12058
+ dfrd.resolve();
12059
+ }
12060
+ },
12061
+ all : ((index+1) < cnt)
12062
+ });
12063
+ } else {
12064
+ (mkdirAll > 0) && unpack(file);
12065
+ next();
12066
+ }
12067
+ } else {
12068
+ unpack(file);
12069
+ next();
12070
+ }
12071
+ };
12072
+
12073
+ if (!(this.enabled() && cnt && mimes.length)) {
12074
+ return dfrd.reject();
12075
+ }
12076
+
12077
+ if(cnt > 0) {
12078
+ confirm(files, 0);
12079
+ }
12080
+
12081
+ return dfrd;
12082
+ }
12083
+
12084
+ }
12085
+
12086
+ /*
12087
+ * File: /js/commands/forward.js
12088
+ */
12089
+
12090
+ /**
12091
+ * @class elFinder command "forward"
12092
+ * Open next visited folder
12093
+ *
12094
+ * @author Dmitry (dio) Levashov
12095
+ **/
12096
+ elFinder.prototype.commands.forward = function() {
12097
+ this.alwaysEnabled = true;
12098
+ this.updateOnSelect = true;
12099
+ this.shortcuts = [{
12100
+ pattern : 'ctrl+right'
12101
+ }];
12102
+
12103
+ this.getstate = function() {
12104
+ return this.fm.history.canForward() ? 0 : -1;
12105
+ }
12106
+
12107
+ this.exec = function() {
12108
+ return this.fm.history.forward();
12109
+ }
12110
+
12111
+ }
12112
+
12113
+ /*
12114
+ * File: /js/commands/getfile.js
12115
+ */
12116
+
12117
+ /**
12118
+ * @class elFinder command "getfile".
12119
+ * Return selected files info into outer callback.
12120
+ * For use elFinder with wysiwyg editors etc.
12121
+ *
12122
+ * @author Dmitry (dio) Levashov, dio@std42.ru
12123
+ **/
12124
+ elFinder.prototype.commands.getfile = function() {
12125
+ var self = this,
12126
+ fm = this.fm,
12127
+ filter = function(files) {
12128
+ var o = self.options;
12129
+
12130
+ files = $.map(files, function(file) {
12131
+ return file.mime != 'directory' || o.folders ? file : null;
12132
+ });
12133
+
12134
+ return o.multiple || files.length == 1 ? files : [];
12135
+ };
12136
+
12137
+ this.alwaysEnabled = true;
12138
+ this.callback = fm.options.getFileCallback;
12139
+ this._disabled = typeof(this.callback) == 'function';
12140
+
12141
+ this.getstate = function(sel) {
12142
+ var sel = this.files(sel),
12143
+ cnt = sel.length;
12144
+
12145
+ return this.callback && cnt && filter(sel).length == cnt ? 0 : -1;
12146
+ }
12147
+
12148
+ this.exec = function(hashes) {
12149
+ var fm = this.fm,
12150
+ opts = this.options,
12151
+ files = this.files(hashes),
12152
+ cnt = files.length,
12153
+ url = fm.option('url'),
12154
+ tmb = fm.option('tmbUrl'),
12155
+ dfrd = $.Deferred()
12156
+ .done(function(data) {
12157
+ fm.trigger('getfile', {files : data});
12158
+ self.callback(data, fm);
12159
+
12160
+ if (opts.oncomplete == 'close') {
12161
+ fm.hide();
12162
+ } else if (opts.oncomplete == 'destroy') {
12163
+ fm.destroy();
12164
+ }
12165
+ }),
12166
+ result = function(file) {
12167
+ return opts.onlyURL
12168
+ ? opts.multiple ? $.map(files, function(f) { return f.url; }) : files[0].url
12169
+ : opts.multiple ? files : files[0];
12170
+ },
12171
+ req = [],
12172
+ i, file, dim;
12173
+
12174
+ if (this.getstate(hashes) == -1) {
12175
+ return dfrd.reject();
12176
+ }
12177
+
12178
+ for (i = 0; i < cnt; i++) {
12179
+ file = files[i];
12180
+ if (file.mime == 'directory' && !opts.folders) {
12181
+ return dfrd.reject();
12182
+ }
12183
+ file.baseUrl = url;
12184
+ if (file.url == '1') {
12185
+ req.push(fm.request({
12186
+ data : {cmd : 'url', target : file.hash},
12187
+ notify : {type : 'url', cnt : 1, hideCnt : true},
12188
+ preventDefault : true
12189
+ })
12190
+ .done(function(data) {
12191
+ if (data.url) {
12192
+ var rfile = fm.file(this.hash);
12193
+ rfile.url = this.url = data.url;
12194
+ }
12195
+ }.bind(file)));
12196
+ } else {
12197
+ file.url = fm.url(file.hash);
12198
+ }
12199
+ file.path = fm.path(file.hash);
12200
+ if (file.tmb && file.tmb != 1) {
12201
+ file.tmb = tmb + file.tmb;
12202
+ }
12203
+ if (!file.width && !file.height) {
12204
+ if (file.dim) {
12205
+ dim = file.dim.split('x');
12206
+ file.width = dim[0];
12207
+ file.height = dim[1];
12208
+ } else if (file.mime.indexOf('image') !== -1) {
12209
+ req.push(fm.request({
12210
+ data : {cmd : 'dim', target : file.hash},
12211
+ notify : {type : 'dim', cnt : 1, hideCnt : true},
12212
+ preventDefault : true
12213
+ })
12214
+ .done(function(data) {
12215
+ if (data.dim) {
12216
+ var dim = data.dim.split('x');
12217
+ var rfile = fm.file(this.hash);
12218
+ rfile.width = this.width = dim[0];
12219
+ rfile.height = this.height = dim[1];
12220
+ }
12221
+ }.bind(file)));
12222
+ }
12223
+ }
12224
+ }
12225
+
12226
+ if (req.length) {
12227
+ $.when.apply(null, req).always(function() {
12228
+ dfrd.resolve(result(files));
12229
+ })
12230
+ return dfrd;
12231
+ }
12232
+
12233
+ return dfrd.resolve(result(files));
12234
+ }
12235
+
12236
+ }
12237
+
12238
+ /*
12239
+ * File: /js/commands/help.js
12240
+ */
12241
+
12242
+ /**
12243
+ * @class elFinder command "help"
12244
+ * "About" dialog
12245
+ *
12246
+ * @author Dmitry (dio) Levashov
12247
+ **/
12248
+ elFinder.prototype.commands.help = function() {
12249
+ var fm = this.fm,
12250
+ self = this,
12251
+ linktpl = '<div class="elfinder-help-link"> <a href="{url}">{link}</a></div>',
12252
+ linktpltgt = '<div class="elfinder-help-link"> <a href="{url}" target="_blank">{link}</a></div>',
12253
+ atpl = '<div class="elfinder-help-team"><div>{author}</div>{work}</div>',
12254
+ url = /\{url\}/,
12255
+ link = /\{link\}/,
12256
+ author = /\{author\}/,
12257
+ work = /\{work\}/,
12258
+ r = 'replace',
12259
+ prim = 'ui-priority-primary',
12260
+ sec = 'ui-priority-secondary',
12261
+ lic = 'elfinder-help-license',
12262
+ tab = '<li class="ui-state-default ui-corner-top"><a href="#{id}">{title}</a></li>',
12263
+ html = ['<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-help">',
12264
+ '<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">'],
12265
+ stpl = '<div class="elfinder-help-shortcut"><div class="elfinder-help-shortcut-pattern">{pattern}</div> {descrip}</div>',
12266
+ sep = '<div class="elfinder-help-separator"/>',
12267
+
12268
+
12269
+ about = function() {
12270
+ html.push('<div id="about" class="ui-tabs-panel ui-widget-content ui-corner-bottom"><div class="elfinder-help-logo"/>');
12271
+ html.push('<h3>elFinder</h3>');
12272
+ html.push('<div class="'+prim+'">'+fm.i18n('webfm')+'</div>');
12273
+ html.push('<div class="'+sec+'">'+fm.i18n('ver')+': '+fm.version+', '+fm.i18n('protocolver')+': <span id="apiver"></span></div>');
12274
+ html.push('<div class="'+sec+'">jQuery/jQuery UI: '+$().jquery+'/'+$.ui.version+'</div>');
12275
+
12276
+ html.push(sep);
12277
+
12278
+ html.push(linktpltgt[r](url, 'http://elfinder.org/')[r](link, fm.i18n('homepage')));
12279
+ html.push(linktpltgt[r](url, 'https://github.com/Studio-42/elFinder/wiki')[r](link, fm.i18n('docs')));
12280
+ html.push(linktpltgt[r](url, 'https://github.com/Studio-42/elFinder')[r](link, fm.i18n('github')));
12281
+ html.push(linktpltgt[r](url, 'http://twitter.com/elrte_elfinder')[r](link, fm.i18n('twitter')));
12282
+
12283
+ html.push(sep);
12284
+
12285
+ html.push('<div class="'+prim+'">'+fm.i18n('team')+'</div>');
12286
+
12287
+ html.push(atpl[r](author, 'Dmitry "dio" Levashov &lt;dio@std42.ru&gt;')[r](work, fm.i18n('chiefdev')));
12288
+ html.push(atpl[r](author, 'Troex Nevelin &lt;troex@fury.scancode.ru&gt;')[r](work, fm.i18n('maintainer')));
12289
+ html.push(atpl[r](author, 'Alexey Sukhotin &lt;strogg@yandex.ru&gt;')[r](work, fm.i18n('contributor')));
12290
+ html.push(atpl[r](author, 'Naoki Sawada &lt;hypweb@gmail.com&gt;')[r](work, fm.i18n('contributor')));
12291
+
12292
+ fm.i18[fm.lang].translator && html.push(atpl[r](author, fm.i18[fm.lang].translator)[r](work, fm.i18n('translator')+' ('+fm.i18[fm.lang].language+')'));
12293
+
12294
+ html.push(sep);
12295
+ html.push('<div class="'+lic+'">'+fm.i18n('icons')+': Pixelmixer, <a href="http://p.yusukekamiyamane.com" target="_blank">Fugue</a></div>');
12296
+
12297
+ html.push(sep);
12298
+ html.push('<div class="'+lic+'">Licence: BSD Licence</div>');
12299
+ html.push('<div class="'+lic+'">Copyright © 2009-2015, Studio 42</div>');
12300
+ html.push('<div class="'+lic+'">„ …'+fm.i18n('dontforget')+' ”</div>');
12301
+ html.push('</div>');
12302
+ },
12303
+ shortcuts = function() {
12304
+ var sh = fm.shortcuts();
12305
+ // shortcuts tab
12306
+ html.push('<div id="shortcuts" class="ui-tabs-panel ui-widget-content ui-corner-bottom">');
12307
+
12308
+ if (sh.length) {
12309
+ html.push('<div class="ui-widget-content elfinder-help-shortcuts">');
12310
+ $.each(sh, function(i, s) {
12311
+ html.push(stpl.replace(/\{pattern\}/, s[0]).replace(/\{descrip\}/, s[1]));
12312
+ });
12313
+
12314
+ html.push('</div>');
12315
+ } else {
12316
+ html.push('<div class="elfinder-help-disabled">'+fm.i18n('shortcutsof')+'</div>');
12317
+ }
12318
+
12319
+
12320
+ html.push('</div>');
12321
+
12322
+ },
12323
+ help = function() {
12324
+ // help tab
12325
+ html.push('<div id="help" class="ui-tabs-panel ui-widget-content ui-corner-bottom">');
12326
+ html.push('<a href="http://elfinder.org/forum/" target="_blank" class="elfinder-dont-panic"><span>DON\'T PANIC</span></a>');
12327
+ html.push('</div>');
12328
+ // end help
12329
+ },
12330
+ content = '';
12331
+
12332
+ this.alwaysEnabled = true;
12333
+ this.updateOnSelect = false;
12334
+ this.state = 0;
12335
+
12336
+ this.shortcuts = [{
12337
+ pattern : 'f1',
12338
+ description : this.title
12339
+ }];
12340
+
12341
+ setTimeout(function() {
12342
+ var parts = self.options.view || ['about', 'shortcuts', 'help'];
12343
+
12344
+ $.each(parts, function(i, title) {
12345
+ html.push(tab[r](/\{id\}/, title)[r](/\{title\}/, fm.i18n(title)));
12346
+ });
12347
+
12348
+ html.push('</ul>');
12349
+
12350
+ $.inArray('about', parts) !== -1 && about();
12351
+ $.inArray('shortcuts', parts) !== -1 && shortcuts();
12352
+ $.inArray('help', parts) !== -1 && help();
12353
+
12354
+ html.push('</div>');
12355
+ content = $(html.join(''));
12356
+
12357
+ content.find('.ui-tabs-nav li')
12358
+ .hover(function() {
12359
+ $(this).toggleClass('ui-state-hover');
12360
+ })
12361
+ .children()
12362
+ .click(function(e) {
12363
+ var link = $(this);
12364
+
12365
+ e.preventDefault();
12366
+ e.stopPropagation();
12367
+
12368
+ if (!link.hasClass('ui-tabs-selected')) {
12369
+ link.parent().addClass('ui-tabs-selected ui-state-active').siblings().removeClass('ui-tabs-selected').removeClass('ui-state-active');
12370
+ content.find('.ui-tabs-panel').hide().filter(link.attr('href')).show();
12371
+ }
12372
+
12373
+ })
12374
+ .filter(':first').click();
12375
+
12376
+ }, 200);
12377
+
12378
+ this.getstate = function() {
12379
+ return 0;
12380
+ };
12381
+
12382
+ this.exec = function() {
12383
+ if (!this.dialog) {
12384
+ content.find('#apiver').text(this.fm.api);
12385
+ this.dialog = this.fm.dialog(content, {title : this.title, width : 530, autoOpen : false, destroyOnClose : false});
12386
+ }
12387
+
12388
+ this.dialog.elfinderdialog('open').find('.ui-tabs-nav li a:first').click();
12389
+ };
12390
+
12391
+ };
12392
+
12393
+
12394
+ /*
12395
+ * File: /js/commands/home.js
12396
+ */
12397
+
12398
+
12399
+ elFinder.prototype.commands.home = function() {
12400
+ this.title = 'Home';
12401
+ this.alwaysEnabled = true;
12402
+ this.updateOnSelect = false;
12403
+ this.shortcuts = [{
12404
+ pattern : 'ctrl+home ctrl+shift+up',
12405
+ description : 'Home'
12406
+ }];
12407
+
12408
+ this.getstate = function() {
12409
+ var root = this.fm.root(),
12410
+ cwd = this.fm.cwd().hash;
12411
+
12412
+ return root && cwd && root != cwd ? 0: -1;
12413
+ }
12414
+
12415
+ this.exec = function() {
12416
+ return this.fm.exec('open', this.fm.root());
12417
+ }
12418
+
12419
+
12420
+ }
12421
+
12422
+ /*
12423
+ * File: /js/commands/info.js
12424
+ */
12425
+
12426
+ /**
12427
+ * @class elFinder command "info".
12428
+ * Display dialog with file properties.
12429
+ *
12430
+ * @author Dmitry (dio) Levashov, dio@std42.ru
12431
+ **/
12432
+ elFinder.prototype.commands.info = function() {
12433
+ var m = 'msg',
12434
+ fm = this.fm,
12435
+ spclass = 'elfinder-info-spinner',
12436
+ msg = {
12437
+ calc : fm.i18n('calc'),
12438
+ size : fm.i18n('size'),
12439
+ unknown : fm.i18n('unknown'),
12440
+ path : fm.i18n('path'),
12441
+ aliasfor : fm.i18n('aliasfor'),
12442
+ modify : fm.i18n('modify'),
12443
+ perms : fm.i18n('perms'),
12444
+ locked : fm.i18n('locked'),
12445
+ dim : fm.i18n('dim'),
12446
+ kind : fm.i18n('kind'),
12447
+ files : fm.i18n('files'),
12448
+ folders : fm.i18n('folders'),
12449
+ items : fm.i18n('items'),
12450
+ yes : fm.i18n('yes'),
12451
+ no : fm.i18n('no'),
12452
+ link : fm.i18n('link'),
12453
+ owner : fm.i18n('owner'),
12454
+ group : fm.i18n('group'),
12455
+ perm : fm.i18n('perm')
12456
+ };
12457
+
12458
+ this.tpl = {
12459
+ main : '<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div><table class="elfinder-info-tb">{content}</table>',
12460
+ itemTitle : '<strong>{name}</strong><span class="elfinder-info-kind">{kind}</span>',
12461
+ groupTitle : '<strong>{items}: {num}</strong>',
12462
+ row : '<tr><td>{label} : </td><td>{value}</td></tr>',
12463
+ spinner : '<span>{text}</span> <span class="'+spclass+' '+spclass+'-{name}"/>'
12464
+ };
12465
+
12466
+ this.alwaysEnabled = true;
12467
+ this.updateOnSelect = false;
12468
+ this.shortcuts = [{
12469
+ pattern : 'ctrl+i'
12470
+ }];
12471
+
12472
+ this.init = function() {
12473
+ $.each(msg, function(k, v) {
12474
+ msg[k] = fm.i18n(v);
12475
+ });
12476
+ };
12477
+
12478
+ this.getstate = function() {
12479
+ return 0;
12480
+ };
12481
+
12482
+ this.exec = function(hashes) {
12483
+ var files = this.files(hashes);
12484
+ if (! files.length) {
12485
+ files = this.files([ this.fm.cwd().hash ]);
12486
+ }
12487
+ var self = this,
12488
+ fm = this.fm,
12489
+ o = this.options,
12490
+ tpl = this.tpl,
12491
+ row = tpl.row,
12492
+ cnt = files.length,
12493
+ content = [],
12494
+ view = tpl.main,
12495
+ l = '{label}',
12496
+ v = '{value}',
12497
+ opts = {
12498
+ title : this.title,
12499
+ width : 'auto',
12500
+ close : function() { $(this).elfinderdialog('destroy'); }
12501
+ },
12502
+ count = [],
12503
+ replSpinner = function(msg, name) { dialog.find('.'+spclass+'-'+name).parent().html(msg); },
12504
+ id = fm.namespace+'-info-'+$.map(files, function(f) { return f.hash; }).join('-'),
12505
+ dialog = fm.getUI().find('#'+id),
12506
+ customActions = [],
12507
+ size, tmb, file, title, dcnt;
12508
+
12509
+ if (!cnt) {
12510
+ return $.Deferred().reject();
12511
+ }
12512
+
12513
+ if (dialog.length) {
12514
+ dialog.elfinderdialog('toTop');
12515
+ return $.Deferred().resolve();
12516
+ }
12517
+
12518
+
12519
+ if (cnt == 1) {
12520
+ file = files[0];
12521
+
12522
+ view = view.replace('{class}', fm.mime2class(file.mime));
12523
+ title = tpl.itemTitle.replace('{name}', fm.escape(file.i18 || file.name)).replace('{kind}', fm.mime2kind(file));
12524
+
12525
+ if (file.tmb) {
12526
+ tmb = fm.option('tmbUrl')+file.tmb;
12527
+ }
12528
+
12529
+ if (!file.read) {
12530
+ size = msg.unknown;
12531
+ } else if (file.mime != 'directory' || file.alias) {
12532
+ size = fm.formatSize(file.size);
12533
+ } else {
12534
+ size = tpl.spinner.replace('{text}', msg.calc).replace('{name}', 'size');
12535
+ count.push(file.hash);
12536
+ }
12537
+
12538
+ content.push(row.replace(l, msg.size).replace(v, size));
12539
+ file.alias && content.push(row.replace(l, msg.aliasfor).replace(v, file.alias));
12540
+ content.push(row.replace(l, msg.path).replace(v, fm.escape(fm.path(file.hash, true))));
12541
+ if (file.read) {
12542
+ var href,
12543
+ name_esc = fm.escape(file.name);
12544
+ if (file.url == '1') {
12545
+ content.push(row.replace(l, msg.link).replace(v, tpl.spinner.replace('{text}', msg.modify).replace('{name}', 'url')));
12546
+ fm.request({
12547
+ data : {cmd : 'url', target : file.hash},
12548
+ preventDefault : true
12549
+ })
12550
+ .fail(function() {
12551
+ replSpinner(name_esc, 'url');
12552
+ })
12553
+ .done(function(data) {
12554
+ replSpinner('<a href="'+data.url+'" target="_blank">'+name_esc+'</a>' || name_esc, 'url');
12555
+ if (data.url) {
12556
+ var rfile = fm.file(file.hash);
12557
+ rfile.url = data.url;
12558
+ }
12559
+ });
12560
+ } else {
12561
+ if (o.nullUrlDirLinkSelf && file.mime == 'directory' && file.url === null) {
12562
+ var loc = window.location;
12563
+ href = loc.pathname + loc.search + '#elf_' + file.hash;
12564
+ } else {
12565
+ href = fm.url(file.hash);
12566
+ }
12567
+ content.push(row.replace(l, msg.link).replace(v, '<a href="'+href+'" target="_blank">'+name_esc+'</a>'));
12568
+ }
12569
+ }
12570
+
12571
+ if (file.dim) { // old api
12572
+ content.push(row.replace(l, msg.dim).replace(v, file.dim));
12573
+ } else if (file.mime.indexOf('image') !== -1) {
12574
+ if (file.width && file.height) {
12575
+ content.push(row.replace(l, msg.dim).replace(v, file.width+'x'+file.height));
12576
+ } else {
12577
+ content.push(row.replace(l, msg.dim).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{name}', 'dim')));
12578
+ fm.request({
12579
+ data : {cmd : 'dim', target : file.hash},
12580
+ preventDefault : true
12581
+ })
12582
+ .fail(function() {
12583
+ replSpinner(msg.unknown, 'dim');
12584
+ })
12585
+ .done(function(data) {
12586
+ replSpinner(data.dim || msg.unknown, 'dim');
12587
+ if (data.dim) {
12588
+ var dim = data.dim.split('x');
12589
+ var rfile = fm.file(file.hash);
12590
+ rfile.width = dim[0];
12591
+ rfile.height = dim[1];
12592
+ }
12593
+ });
12594
+ }
12595
+ }
12596
+
12597
+
12598
+ content.push(row.replace(l, msg.modify).replace(v, fm.formatDate(file)));
12599
+ content.push(row.replace(l, msg.perms).replace(v, fm.formatPermissions(file)));
12600
+ content.push(row.replace(l, msg.locked).replace(v, file.locked ? msg.yes : msg.no));
12601
+ file.owner && content.push(row.replace(l, msg.owner).replace(v, file.owner));
12602
+ file.group && content.push(row.replace(l, msg.group).replace(v, file.group));
12603
+ file.perm && content.push(row.replace(l, msg.perm).replace(v, fm.formatFileMode(file.perm)));
12604
+
12605
+ // Add custom info fields
12606
+ if (o.custom) {
12607
+ $.each(o.custom, function(name, details) {
12608
+ if (
12609
+ (!details.mimes || $.map(details.mimes, function(m){return (file.mime === m || file.mime.indexOf(m+'/') === 0)? true : null;}).length)
12610
+ &&
12611
+ (!details.hashRegex || file.hash.match(details.hashRegex))
12612
+ ) {
12613
+ // Add to the content
12614
+ content.push(row.replace(l, fm.i18n(details.label)).replace(v , details.tpl.replace('{id}', id)));
12615
+ // Register the action
12616
+ if (details.action && (typeof details.action == 'function')) {
12617
+ customActions.push(details.action);
12618
+ }
12619
+ }
12620
+ });
12621
+ }
12622
+ } else {
12623
+ view = view.replace('{class}', 'elfinder-cwd-icon-group');
12624
+ title = tpl.groupTitle.replace('{items}', msg.items).replace('{num}', cnt);
12625
+ dcnt = $.map(files, function(f) { return f.mime == 'directory' ? 1 : null ; }).length;
12626
+ if (!dcnt) {
12627
+ size = 0;
12628
+ $.each(files, function(h, f) {
12629
+ var s = parseInt(f.size);
12630
+
12631
+ if (s >= 0 && size >= 0) {
12632
+ size += s;
12633
+ } else {
12634
+ size = 'unknown';
12635
+ }
12636
+ });
12637
+ content.push(row.replace(l, msg.kind).replace(v, msg.files));
12638
+ content.push(row.replace(l, msg.size).replace(v, fm.formatSize(size)));
12639
+ } else {
12640
+ content.push(row.replace(l, msg.kind).replace(v, dcnt == cnt ? msg.folders : msg.folders+' '+dcnt+', '+msg.files+' '+(cnt-dcnt)));
12641
+ content.push(row.replace(l, msg.size).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{name}', 'size')));
12642
+ count = $.map(files, function(f) { return f.hash; });
12643
+
12644
+ }
12645
+ }
12646
+
12647
+ view = view.replace('{title}', title).replace('{content}', content.join(''));
12648
+
12649
+ dialog = fm.dialog(view, opts);
12650
+ dialog.attr('id', id);
12651
+
12652
+ // load thumbnail
12653
+ if (tmb) {
12654
+ $('<img/>')
12655
+ .load(function() { dialog.find('.elfinder-cwd-icon').css('background', 'url("'+tmb+'") center center no-repeat'); })
12656
+ .attr('src', tmb);
12657
+ }
12658
+
12659
+ // send request to count total size
12660
+ if (count.length) {
12661
+ fm.request({
12662
+ data : {cmd : 'size', targets : count},
12663
+ preventDefault : true
12664
+ })
12665
+ .fail(function() {
12666
+ replSpinner(msg.unknown, 'size');
12667
+ })
12668
+ .done(function(data) {
12669
+ var size = parseInt(data.size);
12670
+ replSpinner(size >= 0 ? fm.formatSize(size) : msg.unknown, 'size');
12671
+ });
12672
+ }
12673
+
12674
+ // call custom actions
12675
+ if (customActions.length) {
12676
+ $.each(customActions, function(i, action) {
12677
+ try {
12678
+ action(file, fm, dialog);
12679
+ } catch(e) {
12680
+ fm.debug('error', e);
12681
+ }
12682
+ });
12683
+ }
12684
+
12685
+ };
12686
+
12687
+ };
12688
+
12689
+
12690
+ /*
12691
+ * File: /js/commands/mkdir.js
12692
+ */
12693
+
12694
+ /**
12695
+ * @class elFinder command "mkdir"
12696
+ * Create new folder
12697
+ *
12698
+ * @author Dmitry (dio) Levashov
12699
+ **/
12700
+ elFinder.prototype.commands.mkdir = function() {
12701
+ this.disableOnSearch = true;
12702
+ this.updateOnSelect = false;
12703
+ this.mime = 'directory';
12704
+ this.prefix = 'untitled folder';
12705
+ this.exec = $.proxy(this.fm.res('mixin', 'make'), this);
12706
+
12707
+ this.shortcuts = [{
12708
+ pattern : 'ctrl+shift+n'
12709
+ }];
12710
+
12711
+ this.getstate = function() {
12712
+ return !this._disabled && this.fm.cwd().write ? 0 : -1;
12713
+ }
12714
+
12715
+ }
12716
+
12717
+
12718
+ /*
12719
+ * File: /js/commands/mkfile.js
12720
+ */
12721
+
12722
+ /**
12723
+ * @class elFinder command "mkfile"
12724
+ * Create new empty file
12725
+ *
12726
+ * @author Dmitry (dio) Levashov
12727
+ **/
12728
+ elFinder.prototype.commands.mkfile = function() {
12729
+ this.disableOnSearch = true;
12730
+ this.updateOnSelect = false;
12731
+ this.mime = 'text/plain';
12732
+ this.prefix = 'untitled file.txt';
12733
+ this.exec = $.proxy(this.fm.res('mixin', 'make'), this);
12734
+
12735
+ this.getstate = function() {
12736
+ return !this._disabled && this.fm.cwd().write ? 0 : -1;
12737
+ }
12738
+
12739
+ }
12740
+
12741
+
12742
+ /*
12743
+ * File: /js/commands/netmount.js
12744
+ */
12745
+
12746
+ /**
12747
+ * @class elFinder command "netmount"
12748
+ * Mount network volume with user credentials.
12749
+ *
12750
+ * @author Dmitry (dio) Levashov
12751
+ **/
12752
+ elFinder.prototype.commands.netmount = function() {
12753
+ var self = this;
12754
+
12755
+ this.alwaysEnabled = true;
12756
+ this.updateOnSelect = false;
12757
+
12758
+ this.drivers = [];
12759
+
12760
+ this.handlers = {
12761
+ load : function() {
12762
+ this.drivers = this.fm.netDrivers;
12763
+ }
12764
+ }
12765
+
12766
+ this.getstate = function() {
12767
+ return this.drivers.length ? 0 : -1;
12768
+ }
12769
+
12770
+ this.exec = function() {
12771
+ var fm = self.fm,
12772
+ dfrd = $.Deferred(),
12773
+ o = self.options,
12774
+ create = function() {
12775
+ var inputs = {
12776
+ protocol : $('<select/>').change(function(){
12777
+ var protocol = this.value;
12778
+ content.find('.elfinder-netmount-tr').hide();
12779
+ content.find('.elfinder-netmount-tr-'+protocol).show();
12780
+ if (typeof o[protocol].select == 'function') {
12781
+ o[protocol].select(fm);
12782
+ }
12783
+ })
12784
+ },
12785
+ opts = {
12786
+ title : fm.i18n('netMountDialogTitle'),
12787
+ resizable : false,
12788
+ modal : true,
12789
+ destroyOnClose : true,
12790
+ close : function() {
12791
+ delete self.dialog;
12792
+ dfrd.state() == 'pending' && dfrd.reject();
12793
+ },
12794
+ buttons : {}
12795
+ },
12796
+ content = $('<table class="elfinder-info-tb elfinder-netmount-tb"/>'),
12797
+ hidden = $('<div/>'),
12798
+ dialog;
12799
+
12800
+ content.append($('<tr/>').append($('<td>'+fm.i18n('protocol')+'</td>')).append($('<td/>').append(inputs.protocol)));
12801
+
12802
+ $.each(self.drivers, function(i, protocol) {
12803
+ inputs.protocol.append('<option value="'+protocol+'">'+fm.i18n(protocol)+'</option>');
12804
+ $.each(o[protocol].inputs, function(name, input) {
12805
+ input.attr('name', name);
12806
+ if (input.attr('type') != 'hidden') {
12807
+ input.addClass('ui-corner-all elfinder-netmount-inputs-'+protocol);
12808
+ content.append($('<tr/>').addClass('elfinder-netmount-tr elfinder-netmount-tr-'+protocol).append($('<td>'+fm.i18n(name)+'</td>')).append($('<td/>').append(input)));
12809
+ } else {
12810
+ input.addClass('elfinder-netmount-inputs-'+protocol);
12811
+ hidden.append(input);
12812
+ }
12813
+ });
12814
+ });
12815
+
12816
+ content.append(hidden);
12817
+
12818
+ content.find('.elfinder-netmount-tr').hide();
12819
+
12820
+ opts.buttons[fm.i18n('btnMount')] = function() {
12821
+ var protocol = inputs.protocol.val();
12822
+ var data = {cmd : 'netmount', protocol: protocol};
12823
+ $.each(content.find('input.elfinder-netmount-inputs-'+protocol), function(name, input) {
12824
+ var val;
12825
+ if (typeof input.val == 'function') {
12826
+ val = $.trim(input.val());
12827
+ } else {
12828
+ val = $.trim(input.value);
12829
+ }
12830
+ if (val) {
12831
+ data[input.name] = val;
12832
+ }
12833
+ });
12834
+
12835
+ if (!data.host) {
12836
+ return fm.trigger('error', {error : 'errNetMountHostReq'});
12837
+ }
12838
+
12839
+ fm.request({data : data, notify : {type : 'netmount', cnt : 1, hideCnt : true}})
12840
+ .done(function(data) {
12841
+ data.added && data.added.length && fm.exec('open', data.added[0].hash);
12842
+ dfrd.resolve();
12843
+ })
12844
+ .fail(function(error) { dfrd.reject(error); });
12845
+
12846
+ self.dialog.elfinderdialog('close');
12847
+ };
12848
+
12849
+ opts.buttons[fm.i18n('btnCancel')] = function() {
12850
+ self.dialog.elfinderdialog('close');
12851
+ };
12852
+
12853
+ dialog = fm.dialog(content, opts);
12854
+ dialog.ready(function(){
12855
+ inputs.protocol.change();
12856
+ dialog.elfinderdialog('posInit');
12857
+ });
12858
+ return dialog;
12859
+ }
12860
+ ;
12861
+
12862
+ fm.bind('netmount', function(e) {
12863
+ var d = e.data || null;
12864
+ if (d && d.protocol) {
12865
+ if (o[d.protocol] && typeof o[d.protocol].done == 'function') {
12866
+ o[d.protocol].done(fm, d);
12867
+ }
12868
+ }
12869
+ });
12870
+
12871
+ if (!self.dialog) {
12872
+ self.dialog = create();
12873
+ }
12874
+
12875
+ return dfrd.promise();
12876
+ }
12877
+
12878
+ }
12879
+
12880
+ elFinder.prototype.commands.netunmount = function() {
12881
+ var self = this;
12882
+
12883
+ this.alwaysEnabled = true;
12884
+ this.updateOnSelect = false;
12885
+
12886
+ this.drivers = [];
12887
+
12888
+ this.handlers = {
12889
+ load : function() {
12890
+ this.drivers = this.fm.netDrivers;
12891
+ }
12892
+ };
12893
+
12894
+ this.getstate = function(sel) {
12895
+ var fm = this.fm;
12896
+ return !!sel && this.drivers.length && !this._disabled && fm.file(sel[0]).netkey ? 0 : -1;
12897
+ };
12898
+
12899
+ this.exec = function(hashes) {
12900
+ var self = this,
12901
+ fm = this.fm,
12902
+ dfrd = $.Deferred()
12903
+ .fail(function(error) {
12904
+ error && fm.error(error);
12905
+ }),
12906
+ drive = fm.file(hashes[0]);
12907
+
12908
+ if (this._disabled) {
12909
+ return dfrd.reject();
12910
+ }
12911
+
12912
+ if (dfrd.state() == 'pending') {
12913
+ fm.confirm({
12914
+ title : self.title,
12915
+ text : fm.i18n('confirmUnmount', drive.name),
12916
+ accept : {
12917
+ label : 'btnUnmount',
12918
+ callback : function() {
12919
+ fm.request({
12920
+ data : {cmd : 'netmount', protocol : 'netunmount', host: drive.netkey, user : drive.hash, pass : 'dum'},
12921
+ notify : {type : 'netunmount', cnt : 1, hideCnt : true},
12922
+ preventFail : true
12923
+ })
12924
+ .fail(function(error) {
12925
+ dfrd.reject(error);
12926
+ })
12927
+ .done(function(data) {
12928
+ var chDrive = (fm.root() == drive.hash);
12929
+ data.removed = [ drive.hash ];
12930
+ fm.remove(data);
12931
+ if (chDrive) {
12932
+ var files = fm.files();
12933
+ for (var i in files) {
12934
+ if (fm.file(i).mime == 'directory') {
12935
+ fm.exec('open', i);
12936
+ break;
12937
+ }
12938
+ }
12939
+ }
12940
+ dfrd.resolve();
12941
+ });
12942
+ }
12943
+ },
12944
+ cancel : {
12945
+ label : 'btnCancel',
12946
+ callback : function() { dfrd.reject(); }
12947
+ }
12948
+ });
12949
+ }
12950
+
12951
+ return dfrd;
12952
+ };
12953
+
12954
+ };
12955
+
12956
+
12957
+ /*
12958
+ * File: /js/commands/open.js
12959
+ */
12960
+
12961
+ /**
12962
+ * @class elFinder command "open"
12963
+ * Enter folder or open files in new windows
12964
+ *
12965
+ * @author Dmitry (dio) Levashov
12966
+ **/
12967
+ elFinder.prototype.commands.open = function() {
12968
+ this.alwaysEnabled = true;
12969
+
12970
+ this._handlers = {
12971
+ dblclick : function(e) { e.preventDefault(); this.exec() },
12972
+ 'select enable disable reload' : function(e) { this.update(e.type == 'disable' ? -1 : void(0)); }
12973
+ }
12974
+
12975
+ this.shortcuts = [{
12976
+ pattern : 'ctrl+down numpad_enter'+(this.fm.OS != 'mac' && ' enter')
12977
+ }];
12978
+
12979
+ this.getstate = function(sel) {
12980
+ var sel = this.files(sel),
12981
+ cnt = sel.length;
12982
+
12983
+ return cnt == 1
12984
+ ? 0
12985
+ : (cnt && !this.fm.UA.Mobile) ? ($.map(sel, function(file) { return file.mime == 'directory' ? null : file}).length == cnt ? 0 : -1) : -1
12986
+ }
12987
+
12988
+ this.exec = function(hashes, opts) {
12989
+ var fm = this.fm,
12990
+ dfrd = $.Deferred().fail(function(error) { error && fm.error(error); }),
12991
+ files = this.files(hashes),
12992
+ cnt = files.length,
12993
+ thash = (typeof opts == 'object')? opts.thash : false,
12994
+ file, url, s, w, imgW, imgH, winW, winH, reg, link, html5dl, inline;
12995
+
12996
+ if (!cnt && !thash) {
12997
+ {
12998
+ return dfrd.reject();
12999
+ }
13000
+ }
13001
+
13002
+ // open folder
13003
+ if (thash || (cnt == 1 && (file = files[0]) && file.mime == 'directory')) {
13004
+ return !thash && file && !file.read
13005
+ ? dfrd.reject(['errOpen', file.name, 'errPerm'])
13006
+ : fm.request({
13007
+ data : {cmd : 'open', target : thash || file.hash},
13008
+ notify : {type : 'open', cnt : 1, hideCnt : true},
13009
+ syncOnFail : true
13010
+ });
13011
+ }
13012
+
13013
+ files = $.map(files, function(file) { return file.mime != 'directory' ? file : null });
13014
+
13015
+ // nothing to open or files and folders selected - do nothing
13016
+ if (cnt != files.length) {
13017
+ return dfrd.reject();
13018
+ }
13019
+
13020
+
13021
+ try {
13022
+ reg = new RegExp(fm.option('dispInlineRegex'));
13023
+ } catch(e) {
13024
+ reg = false;
13025
+ }
13026
+
13027
+ // open files
13028
+ link = $('<a>').hide().appendTo($('body')),
13029
+ html5dl = (typeof link.get(0).download === 'string');
13030
+ cnt = files.length;
13031
+ while (cnt--) {
13032
+ file = files[cnt];
13033
+
13034
+ if (!file.read) {
13035
+ return dfrd.reject(['errOpen', file.name, 'errPerm']);
13036
+ }
13037
+
13038
+ inline = (reg && file.mime.match(reg));
13039
+ url = fm.openUrl(file.hash, !inline);
13040
+ if (fm.UA.Mobile || !inline) {
13041
+ if (html5dl) {
13042
+ !inline && link.attr('download', file.name);
13043
+ link.attr('href', url)
13044
+ .attr('target', '_blank')
13045
+ .get(0).click();
13046
+ } else {
13047
+ var wnd = window.open(url);
13048
+ if (!wnd) {
13049
+ return dfrd.reject('errPopup');
13050
+ }
13051
+ }
13052
+ } else {
13053
+
13054
+ // set window size for image if set
13055
+ imgW = winW = Math.round(2 * $(window).width() / 3);
13056
+ imgH = winH = Math.round(2 * $(window).height() / 3);
13057
+ if (parseInt(file.width) && parseInt(file.height)) {
13058
+ imgW = parseInt(file.width);
13059
+ imgH = parseInt(file.height);
13060
+ } else if (file.dim) {
13061
+ s = file.dim.split('x');
13062
+ imgW = parseInt(s[0]);
13063
+ imgH = parseInt(s[1]);
13064
+ }
13065
+ if (winW >= imgW && winH >= imgH) {
13066
+ winW = imgW;
13067
+ winH = imgH;
13068
+ } else {
13069
+ if ((imgW - winW) > (imgH - winH)) {
13070
+ winH = Math.round(imgH * (winW / imgW));
13071
+ } else {
13072
+ winW = Math.round(imgW * (winH / imgH));
13073
+ }
13074
+ }
13075
+ w = 'width='+winW+',height='+winH;
13076
+
13077
+ if (url.indexOf(fm.options.url) === 0) {
13078
+ url = '';
13079
+ }
13080
+ var wnd = window.open(url, 'new_window', w + ',top=50,left=50,scrollbars=yes,resizable=yes');
13081
+ if (!wnd) {
13082
+ return dfrd.reject('errPopup');
13083
+ }
13084
+
13085
+ if (url === '') {
13086
+ var form = document.createElement("form");
13087
+ form.action = fm.options.url;
13088
+ form.method = 'POST';
13089
+ form.target = 'new_window';
13090
+ form.style.display = 'none';
13091
+ var params = $.extend({}, fm.options.customData, {
13092
+ cmd: 'file',
13093
+ target: file.hash
13094
+ });
13095
+ $.each(params, function(key, val)
13096
+ {
13097
+ var input = document.createElement("input");
13098
+ input.name = key;
13099
+ input.value = val;
13100
+ form.appendChild(input);
13101
+ });
13102
+
13103
+ document.body.appendChild(form);
13104
+ form.submit();
13105
+ }
13106
+ wnd.focus();
13107
+
13108
+ }
13109
+ }
13110
+ link.remove();
13111
+ return dfrd.resolve(hashes);
13112
+ }
13113
+
13114
+ }
13115
+
13116
+ /*
13117
+ * File: /js/commands/opendir.js
13118
+ */
13119
+
13120
+ /**
13121
+ * @class elFinder command "opendir"
13122
+ * Enter parent folder
13123
+ *
13124
+ * @author Naoki Sawada
13125
+ **/
13126
+ elFinder.prototype.commands.opendir = function() {
13127
+ this.alwaysEnabled = true;
13128
+
13129
+ this.getstate = function() {
13130
+ var sel = this.fm.selected(),
13131
+ cnt = sel.length,
13132
+ cwdWrapper;
13133
+ if (cnt !== 1) {
13134
+ return -1;
13135
+ }
13136
+ cwdWrapper = this.fm.getUI('cwd').parent();
13137
+ return cwdWrapper.hasClass('elfinder-search-result')? 0 : -1;
13138
+ }
13139
+
13140
+ this.exec = function(hashes) {
13141
+ var fm = this.fm,
13142
+ dfrd = $.Deferred(),
13143
+ files = this.files(hashes),
13144
+ cnt = files.length,
13145
+ hash, pcheck = null;
13146
+
13147
+ if (!cnt || !files[0].phash) {
13148
+ return dfrd.reject();
13149
+ }
13150
+
13151
+ hash = files[0].phash;
13152
+ if (!fm.file(hash)) {
13153
+ // parents check
13154
+ pcheck = fm.request({
13155
+ data : {cmd : 'parents', target : hash},
13156
+ syncOnFail : false
13157
+ });
13158
+ }
13159
+ // open folder
13160
+ $.when(pcheck)
13161
+ .done(function(data){
13162
+ fm.trigger('searchend', { noupdate: true });
13163
+ fm.request({
13164
+ data : {cmd : 'open', target : hash},
13165
+ notify : {type : 'open', cnt : 1, hideCnt : true},
13166
+ syncOnFail : false
13167
+ });
13168
+ });
13169
+
13170
+ return dfrd;
13171
+ }
13172
+
13173
+ }
13174
+
13175
+
13176
+ /*
13177
+ * File: /js/commands/paste.js
13178
+ */
13179
+
13180
+ /**
13181
+ * @class elFinder command "paste"
13182
+ * Paste filesfrom clipboard into directory.
13183
+ * If files pasted in its parent directory - files duplicates will created
13184
+ *
13185
+ * @author Dmitry (dio) Levashov
13186
+ **/
13187
+ elFinder.prototype.commands.paste = function() {
13188
+
13189
+ this.updateOnSelect = false;
13190
+
13191
+ this.handlers = {
13192
+ changeclipboard : function() { this.update(); }
13193
+ }
13194
+
13195
+ this.shortcuts = [{
13196
+ pattern : 'ctrl+v shift+insert'
13197
+ }];
13198
+
13199
+ this.getstate = function(dst) {
13200
+ if (this._disabled) {
13201
+ return -1;
13202
+ }
13203
+ if (dst) {
13204
+ if ($.isArray(dst)) {
13205
+ if (dst.length != 1) {
13206
+ return -1;
13207
+ }
13208
+ dst = this.fm.file(dst[0]);
13209
+ }
13210
+ } else {
13211
+ dst = this.fm.cwd();
13212
+ }
13213
+
13214
+ return this.fm.clipboard().length && dst.mime == 'directory' && dst.write ? 0 : -1;
13215
+ }
13216
+
13217
+ this.exec = function(dst) {
13218
+ var self = this,
13219
+ fm = self.fm,
13220
+ dst = dst ? this.files(dst)[0] : fm.cwd(),
13221
+ files = fm.clipboard(),
13222
+ cnt = files.length,
13223
+ cut = cnt ? files[0].cut : false,
13224
+ error = cut ? 'errMove' : 'errCopy',
13225
+ fpaste = [],
13226
+ fcopy = [],
13227
+ dfrd = $.Deferred()
13228
+ .fail(function(error) {
13229
+ error && fm.error(error);
13230
+ })
13231
+ .always(function() {
13232
+ fm.unlockfiles({files : $.map(files, function(f) { return f.hash})});
13233
+ }),
13234
+ copy = function(files) {
13235
+ return files.length && fm._commands.duplicate
13236
+ ? fm.exec('duplicate', files)
13237
+ : $.Deferred().resolve();
13238
+ },
13239
+ paste = function(files) {
13240
+ var dfrd = $.Deferred(),
13241
+ existed = [],
13242
+ intersect = function(files, names) {
13243
+ var ret = [],
13244
+ i = files.length;
13245
+
13246
+ while (i--) {
13247
+ $.inArray(files[i].name, names) !== -1 && ret.unshift(i);
13248
+ }
13249
+ return ret;
13250
+ },
13251
+ confirm = function(ndx) {
13252
+ var i = existed[ndx],
13253
+ file = files[i],
13254
+ last = ndx == existed.length-1;
13255
+
13256
+ if (!file) {
13257
+ return;
13258
+ }
13259
+
13260
+ fm.confirm({
13261
+ title : fm.i18n(cut ? 'moveFiles' : 'copyFiles'),
13262
+ text : ['errExists', file.name, 'confirmRepl'],
13263
+ all : !last,
13264
+ accept : {
13265
+ label : 'btnYes',
13266
+ callback : function(all) {
13267
+ !last && !all
13268
+ ? confirm(++ndx)
13269
+ : paste(files);
13270
+ }
13271
+ },
13272
+ reject : {
13273
+ label : 'btnNo',
13274
+ callback : function(all) {
13275
+ var i;
13276
+
13277
+ if (all) {
13278
+ i = existed.length;
13279
+ while (ndx < i--) {
13280
+ files[existed[i]].remove = true
13281
+ }
13282
+ } else {
13283
+ files[existed[ndx]].remove = true;
13284
+ }
13285
+
13286
+ !last && !all
13287
+ ? confirm(++ndx)
13288
+ : paste(files);
13289
+ }
13290
+ },
13291
+ cancel : {
13292
+ label : 'btnCancel',
13293
+ callback : function() {
13294
+ dfrd.resolve();
13295
+ }
13296
+ },
13297
+ buttons : [
13298
+ {
13299
+ label : 'btnBackup',
13300
+ callback : function(all) {
13301
+ var i;
13302
+ if (all) {
13303
+ i = existed.length;
13304
+ while (ndx < i--) {
13305
+ files[existed[i]].rename = true
13306
+ }
13307
+ } else {
13308
+ files[existed[ndx]].rename = true;
13309
+ }
13310
+ !last && !all
13311
+ ? confirm(++ndx)
13312
+ : paste(files);
13313
+ }
13314
+ }
13315
+ ]
13316
+ })
13317
+ },
13318
+ valid = function(names) {
13319
+ existed = intersect(files, names);
13320
+ existed.length ? confirm(0) : paste(files);
13321
+ },
13322
+ paste = function(files) {
13323
+ var renames = [],
13324
+ files = $.map(files, function(file) {
13325
+ if (file.rename) {
13326
+ renames.push(file.name);
13327
+ }
13328
+ return !file.remove ? file : null;
13329
+ }),
13330
+ cnt = files.length,
13331
+ groups = {},
13332
+ args = [],
13333
+ src;
13334
+
13335
+ if (!cnt) {
13336
+ return dfrd.resolve();
13337
+ }
13338
+
13339
+ src = files[0].phash;
13340
+ files = $.map(files, function(f) { return f.hash});
13341
+
13342
+ fm.request({
13343
+ data : {cmd : 'paste', dst : dst.hash, targets : files, cut : cut ? 1 : 0, src : src, renames : renames, suffix : fm.options.backupSuffix},
13344
+ notify : {type : cut ? 'move' : 'copy', cnt : cnt}
13345
+ })
13346
+ .done(function(data) {
13347
+ dfrd.resolve(data);
13348
+ if (data && data.added && data.added[0]) {
13349
+ var newItem = fm.getUI('cwd').find('#'+fm.cwdHash2Id(data.added[0].hash));
13350
+ if (newItem.length) {
13351
+ newItem.trigger('scrolltoview');
13352
+ }
13353
+ }
13354
+ })
13355
+ .always(function() {
13356
+ fm.unlockfiles({files : files});
13357
+ });
13358
+ }
13359
+ ;
13360
+
13361
+ if (!fm.isCommandEnabled(self.name, dst.hash) || !files.length) {
13362
+ return dfrd.resolve();
13363
+ }
13364
+
13365
+
13366
+ if (fm.oldAPI) {
13367
+ paste(files);
13368
+ } else {
13369
+
13370
+ if (!fm.option('copyOverwrite')) {
13371
+ paste(files);
13372
+ } else {
13373
+
13374
+ dst.hash == fm.cwd().hash
13375
+ ? valid($.map(fm.files(), function(file) { return file.phash == dst.hash ? file.name : null }))
13376
+ : fm.request({
13377
+ data : {cmd : 'ls', target : dst.hash},
13378
+ notify : {type : 'prepare', cnt : 1, hideCnt : true},
13379
+ preventFail : true
13380
+ })
13381
+ .always(function(data) {
13382
+ valid(data.list || [])
13383
+ });
13384
+ }
13385
+ }
13386
+
13387
+ return dfrd;
13388
+ },
13389
+ parents, fparents;
13390
+
13391
+
13392
+ if (!cnt || !dst || dst.mime != 'directory') {
13393
+ return dfrd.reject();
13394
+ }
13395
+
13396
+ if (!dst.write) {
13397
+ return dfrd.reject([error, files[0].name, 'errPerm']);
13398
+ }
13399
+
13400
+ parents = fm.parents(dst.hash);
13401
+
13402
+ $.each(files, function(i, file) {
13403
+ if (!file.read) {
13404
+ return !dfrd.reject([error, files[0].name, 'errPerm']);
13405
+ }
13406
+
13407
+ if (cut && file.locked) {
13408
+ return !dfrd.reject(['errLocked', file.name]);
13409
+ }
13410
+
13411
+ if ($.inArray(file.hash, parents) !== -1) {
13412
+ return !dfrd.reject(['errCopyInItself', file.name]);
13413
+ }
13414
+
13415
+ fparents = fm.parents(file.hash);
13416
+ fparents.pop();
13417
+ if ($.inArray(dst.hash, fparents) !== -1) {
13418
+
13419
+ if ($.map(fparents, function(h) { var d = fm.file(h); return d.phash == dst.hash && d.name == file.name ? d : null }).length) {
13420
+ return !dfrd.reject(['errReplByChild', file.name]);
13421
+ }
13422
+ }
13423
+
13424
+ if (file.phash == dst.hash) {
13425
+ fcopy.push(file.hash);
13426
+ } else {
13427
+ fpaste.push({
13428
+ hash : file.hash,
13429
+ phash : file.phash,
13430
+ name : file.name
13431
+ });
13432
+ }
13433
+ });
13434
+
13435
+ if (dfrd.state() == 'rejected') {
13436
+ return dfrd;
13437
+ }
13438
+
13439
+ return $.when(
13440
+ copy(fcopy),
13441
+ paste(fpaste)
13442
+ ).always(function() {
13443
+ cut && fm.clipboard([]);
13444
+ });
13445
+ }
13446
+
13447
+ }
13448
+
13449
+ /*
13450
+ * File: /js/commands/places.js
13451
+ */
13452
+
13453
+ /**
13454
+ * @class elFinder command "places"
13455
+ * Regist to Places
13456
+ *
13457
+ * @author Naoki Sawada
13458
+ **/
13459
+ elFinder.prototype.commands.places = function() {
13460
+ var self = this,
13461
+ fm = this.fm,
13462
+ filter = function(hashes) {
13463
+ return $.map(self.files(hashes), function(f) { return f.mime == 'directory' ? f : null; });
13464
+ },
13465
+ places = null;
13466
+
13467
+ this.getstate = function(sel) {
13468
+ var sel = this.hashes(sel),
13469
+ cnt = sel.length;
13470
+
13471
+ return places && cnt && cnt == filter(sel).length ? 0 : -1;
13472
+ };
13473
+
13474
+ this.exec = function(hashes) {
13475
+ var files = this.files(hashes);
13476
+ places.trigger('regist', [ files ]);
13477
+ };
13478
+
13479
+ fm.one('load', function(){
13480
+ places = fm.ui.places;
13481
+ });
13482
+
13483
+ };
13484
+
13485
+ /*
13486
+ * File: /js/commands/quicklook.js
13487
+ */
13488
+
13489
+ /**
13490
+ * @class elFinder command "quicklook"
13491
+ * Fast preview for some files types
13492
+ *
13493
+ * @author Dmitry (dio) Levashov
13494
+ **/
13495
+ elFinder.prototype.commands.quicklook = function() {
13496
+ var self = this,
13497
+ fm = self.fm,
13498
+ /**
13499
+ * window closed state
13500
+ *
13501
+ * @type Number
13502
+ **/
13503
+ closed = 0,
13504
+ /**
13505
+ * window animated state
13506
+ *
13507
+ * @type Number
13508
+ **/
13509
+ animated = 1,
13510
+ /**
13511
+ * window opened state
13512
+ *
13513
+ * @type Number
13514
+ **/
13515
+ opened = 2,
13516
+ /**
13517
+ * window state
13518
+ *
13519
+ * @type Number
13520
+ **/
13521
+ state = closed,
13522
+ /**
13523
+ * next/prev event name (requied to cwd catch it)
13524
+ *
13525
+ * @type Number
13526
+ **/
13527
+ // keydown = fm.UA.Firefox || fm.UA.Opera ? 'keypress' : 'keydown',
13528
+ /**
13529
+ * navbar icon class
13530
+ *
13531
+ * @type Number
13532
+ **/
13533
+ navicon = 'elfinder-quicklook-navbar-icon',
13534
+ /**
13535
+ * navbar "fullscreen" icon class
13536
+ *
13537
+ * @type Number
13538
+ **/
13539
+ fullscreen = 'elfinder-quicklook-fullscreen',
13540
+ /**
13541
+ * Triger keydown/keypress event with left/right arrow key code
13542
+ *
13543
+ * @param Number left/right arrow key code
13544
+ * @return void
13545
+ **/
13546
+ navtrigger = function(code) {
13547
+ $(document).trigger($.Event('keydown', { keyCode: code, ctrlKey : false, shiftKey : false, altKey : false, metaKey : false }));
13548
+ },
13549
+ /**
13550
+ * Return css for closed window
13551
+ *
13552
+ * @param jQuery file node in cwd
13553
+ * @return void
13554
+ **/
13555
+ closedCss = function(node) {
13556
+ return {
13557
+ opacity : 0,
13558
+ width : 20,//node.width(),
13559
+ height : fm.view == 'list' ? 1 : 20,
13560
+ top : node.offset().top+'px',
13561
+ left : node.offset().left+'px'
13562
+ }
13563
+ },
13564
+ /**
13565
+ * Return css for opened window
13566
+ *
13567
+ * @return void
13568
+ **/
13569
+ openedCss = function() {
13570
+ var win = $(window);
13571
+ var w = Math.min(width, $(window).width()-10);
13572
+ var h = Math.min(height, $(window).height()-80);
13573
+ return {
13574
+ opacity : 1,
13575
+ width : w,
13576
+ height : h,
13577
+ top : parseInt((win.height() - h - 60)/2 + win.scrollTop()),
13578
+ left : parseInt((win.width() - w)/2 + win.scrollLeft())
13579
+ }
13580
+ },
13581
+
13582
+ support = function(codec) {
13583
+ var media = document.createElement(codec.substr(0, codec.indexOf('/'))),
13584
+ value = false;
13585
+
13586
+ try {
13587
+ value = media.canPlayType && media.canPlayType(codec);
13588
+ } catch (e) {
13589
+
13590
+ }
13591
+
13592
+ return value && value !== '' && value != 'no';
13593
+ },
13594
+
13595
+ /**
13596
+ * Opened window width (from config)
13597
+ *
13598
+ * @type Number
13599
+ **/
13600
+ width,
13601
+ /**
13602
+ * Opened window height (from config)
13603
+ *
13604
+ * @type Number
13605
+ **/
13606
+ height,
13607
+ /**
13608
+ * elFinder node
13609
+ *
13610
+ * @type jQuery
13611
+ **/
13612
+ parent,
13613
+ /**
13614
+ * elFinder current directory node
13615
+ *
13616
+ * @type jQuery
13617
+ **/
13618
+ cwd,
13619
+ title = $('<div class="elfinder-quicklook-title"/>'),
13620
+ icon = $('<div/>'),
13621
+ info = $('<div class="elfinder-quicklook-info"/>'),//.hide(),
13622
+ fsicon = $('<div class="'+navicon+' '+navicon+'-fullscreen"/>')
13623
+ .mousedown(function(e) {
13624
+ var win = self.window,
13625
+ full = win.hasClass(fullscreen),
13626
+ scroll = 'scroll.'+fm.namespace,
13627
+ $window = $(window);
13628
+
13629
+ e.stopPropagation();
13630
+
13631
+ if (full) {
13632
+ win.css(win.data('position')).unbind('mousemove');
13633
+ $window.unbind(scroll).trigger(self.resize).unbind(self.resize);
13634
+ navbar.unbind('mouseenter').unbind('mousemove');
13635
+ } else {
13636
+ win.data('position', {
13637
+ left : win.css('left'),
13638
+ top : win.css('top'),
13639
+ width : win.width(),
13640
+ height : win.height()
13641
+ })
13642
+ .css({
13643
+ width : '100%',
13644
+ height : '100%'
13645
+ });
13646
+
13647
+ $(window).bind(scroll, function() {
13648
+ win.css({
13649
+ left : parseInt($(window).scrollLeft())+'px',
13650
+ top : parseInt($(window).scrollTop()) +'px'
13651
+ })
13652
+ })
13653
+ .bind(self.resize, function(e) {
13654
+ self.preview.trigger('changesize');
13655
+ })
13656
+ .trigger(scroll)
13657
+ .trigger(self.resize);
13658
+
13659
+ win.bind('mousemove', function(e) {
13660
+ navbar.stop(true, true).show().delay(3000).fadeOut('slow');
13661
+ })
13662
+ .mousemove();
13663
+
13664
+ navbar.mouseenter(function() {
13665
+ navbar.stop(true, true).show();
13666
+ })
13667
+ .mousemove(function(e) {
13668
+ e.stopPropagation();
13669
+ });
13670
+ }
13671
+ navbar.attr('style', '').draggable(full ? 'destroy' : {});
13672
+ win.toggleClass(fullscreen);
13673
+ $(this).toggleClass(navicon+'-fullscreen-off');
13674
+ var collection = win;
13675
+ if(parent.is('.ui-resizable')) {
13676
+ collection = collection.add(parent);
13677
+ };
13678
+ $.fn.resizable && !fm.UA.Touch && collection.resizable(full ? 'enable' : 'disable').removeClass('ui-state-disabled');
13679
+ }),
13680
+
13681
+ navbar = $('<div class="elfinder-quicklook-navbar"/>')
13682
+ .append($('<div class="'+navicon+' '+navicon+'-prev"/>').mousedown(function() { navtrigger(37); }))
13683
+ .append(fsicon)
13684
+ .append($('<div class="'+navicon+' '+navicon+'-next"/>').mousedown(function() { navtrigger(39); }))
13685
+ .append('<div class="elfinder-quicklook-navbar-separator"/>')
13686
+ .append($('<div class="'+navicon+' '+navicon+'-close"/>').mousedown(function() { self.window.trigger('close'); }))
13687
+ ;
13688
+
13689
+ this.resize = 'resize.'+fm.namespace;
13690
+ this.info = $('<div class="elfinder-quicklook-info-wrapper"/>')
13691
+ .append(icon)
13692
+ .append(info);
13693
+
13694
+ this.preview = $('<div class="elfinder-quicklook-preview ui-helper-clearfix"/>')
13695
+ // clean info/icon
13696
+ .bind('change', function(e) {
13697
+ self.info.attr('style', '').hide();
13698
+ icon.removeAttr('class').attr('style', '');
13699
+ info.html('');
13700
+
13701
+ })
13702
+ // update info/icon
13703
+ .bind('update', function(e) {
13704
+ var fm = self.fm,
13705
+ preview = self.preview,
13706
+ file = e.file,
13707
+ tpl = '<div class="elfinder-quicklook-info-data">{value}</div>',
13708
+ tmb;
13709
+
13710
+ if (file) {
13711
+ !file.read && e.stopImmediatePropagation();
13712
+ self.window.data('hash', file.hash);
13713
+ self.preview.unbind('changesize').trigger('change').children().remove();
13714
+ title.html(fm.escape(file.name));
13715
+
13716
+ info.html(
13717
+ tpl.replace(/\{value\}/, fm.escape(file.name))
13718
+ + tpl.replace(/\{value\}/, fm.mime2kind(file))
13719
+ + (file.mime == 'directory' ? '' : tpl.replace(/\{value\}/, fm.formatSize(file.size)))
13720
+ + tpl.replace(/\{value\}/, fm.i18n('modify')+': '+ fm.formatDate(file))
13721
+ )
13722
+ icon.addClass('elfinder-cwd-icon ui-corner-all '+fm.mime2class(file.mime));
13723
+
13724
+ if (file.tmb) {
13725
+ $('<img/>')
13726
+ .hide()
13727
+ .appendTo(self.preview)
13728
+ .load(function() {
13729
+ icon.css('background', 'url("'+tmb+'") center center no-repeat');
13730
+ $(this).remove();
13731
+ })
13732
+ .attr('src', (tmb = fm.tmb(file.hash)));
13733
+ }
13734
+ self.info.delay(100).fadeIn(10);
13735
+ } else {
13736
+ e.stopImmediatePropagation();
13737
+ }
13738
+ });
13739
+
13740
+
13741
+
13742
+
13743
+ this.window = $('<div class="ui-helper-reset ui-widget elfinder-quicklook" style="position:absolute"/>')
13744
+ .click(function(e) { e.stopPropagation(); })
13745
+ .append(
13746
+ $('<div class="elfinder-quicklook-titlebar"/>')
13747
+ .append(title)
13748
+ .append($('<span class="ui-icon ui-icon-circle-close"/>').mousedown(function(e) {
13749
+ e.stopPropagation();
13750
+ self.window.trigger('close');
13751
+ }))
13752
+ )
13753
+ .append(this.preview.add(navbar))
13754
+ .append(self.info.hide())
13755
+ .draggable({handle : 'div.elfinder-quicklook-titlebar'})
13756
+ .bind('open', function(e) {
13757
+ var win = self.window,
13758
+ file = self.value,
13759
+ node;
13760
+
13761
+ if (self.closed() && file && (node = cwd.find('#'+fm.cwdHash2Id(file.hash))).length) {
13762
+ navbar.attr('style', '');
13763
+ state = animated;
13764
+ node.trigger('scrolltoview');
13765
+ win.css(closedCss(node))
13766
+ .show()
13767
+ .animate(openedCss(), 550, function() {
13768
+ state = opened;
13769
+ self.update(1, self.value);
13770
+ });
13771
+ }
13772
+ })
13773
+ .bind('close', function(e) {
13774
+ var win = self.window,
13775
+ preview = self.preview.trigger('change'),
13776
+ file = self.value,
13777
+ node = cwd.find('#'+fm.cwdHash2Id(win.data('hash'))),
13778
+ close = function() {
13779
+ state = closed;
13780
+ win.hide();
13781
+ preview.children().remove();
13782
+ self.update(0, self.value);
13783
+
13784
+ };
13785
+
13786
+ if (self.opened()) {
13787
+ state = animated;
13788
+ win.hasClass(fullscreen) && fsicon.mousedown()
13789
+ node.length
13790
+ ? win.animate(closedCss(node), 500, close)
13791
+ : close();
13792
+ }
13793
+ });
13794
+
13795
+ /**
13796
+ * This command cannot be disable by backend
13797
+ *
13798
+ * @type Boolean
13799
+ **/
13800
+ this.alwaysEnabled = true;
13801
+
13802
+ /**
13803
+ * Selected file
13804
+ *
13805
+ * @type Object
13806
+ **/
13807
+ this.value = null;
13808
+
13809
+ this.handlers = {
13810
+ // save selected file
13811
+ select : function() { this.update(void(0), this.fm.selectedFiles()[0]); },
13812
+ error : function() { self.window.is(':visible') && self.window.data('hash', '').trigger('close'); },
13813
+ 'searchshow searchhide' : function() { this.opened() && this.window.trigger('close'); }
13814
+ }
13815
+
13816
+ this.shortcuts = [{
13817
+ pattern : 'space'
13818
+ }];
13819
+
13820
+ this.support = {
13821
+ audio : {
13822
+ ogg : support('audio/ogg; codecs="vorbis"'),
13823
+ mp3 : support('audio/mpeg;'),
13824
+ wav : support('audio/wav; codecs="1"'),
13825
+ m4a : support('audio/x-m4a;') || support('audio/aac;')
13826
+ },
13827
+ video : {
13828
+ ogg : support('video/ogg; codecs="theora"'),
13829
+ webm : support('video/webm; codecs="vp8, vorbis"'),
13830
+ mp4 : support('video/mp4; codecs="avc1.42E01E"') || support('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')
13831
+ }
13832
+ }
13833
+
13834
+
13835
+ /**
13836
+ * Return true if quickLoock window is visible and not animated
13837
+ *
13838
+ * @return Boolean
13839
+ **/
13840
+ this.closed = function() {
13841
+ return state == closed;
13842
+ }
13843
+
13844
+ /**
13845
+ * Return true if quickLoock window is hidden
13846
+ *
13847
+ * @return Boolean
13848
+ **/
13849
+ this.opened = function() {
13850
+ return state == opened;
13851
+ }
13852
+
13853
+ /**
13854
+ * Init command.
13855
+ * Add default plugins and init other plugins
13856
+ *
13857
+ * @return Object
13858
+ **/
13859
+ this.init = function() {
13860
+ var o = this.options,
13861
+ win = this.window,
13862
+ preview = this.preview,
13863
+ i, p;
13864
+
13865
+ width = o.width > 0 ? parseInt(o.width) : 450;
13866
+ height = o.height > 0 ? parseInt(o.height) : 300;
13867
+
13868
+ fm.one('load', function() {
13869
+ parent = fm.getUI();
13870
+ cwd = fm.getUI('cwd');
13871
+
13872
+ win.appendTo('body').zIndex(100 + parent.zIndex());
13873
+
13874
+ // close window on escape
13875
+ $(document).keydown(function(e) {
13876
+ e.keyCode == 27 && self.opened() && win.trigger('close')
13877
+ })
13878
+
13879
+ if ($.fn.resizable && !fm.UA.Touch) {
13880
+ win.resizable({
13881
+ handles : 'se',
13882
+ minWidth : 350,
13883
+ minHeight : 120,
13884
+ resize : function() {
13885
+ // use another event to avoid recursion in fullscreen mode
13886
+ // may be there is clever solution, but i cant find it :(
13887
+ preview.trigger('changesize');
13888
+ }
13889
+ });
13890
+ }
13891
+
13892
+ self.change(function() {
13893
+ if (self.opened()) {
13894
+ self.value ? preview.trigger($.Event('update', {file : self.value})) : win.trigger('close');
13895
+ }
13896
+ });
13897
+
13898
+ $.each(fm.commands.quicklook.plugins || [], function(i, plugin) {
13899
+ if (typeof(plugin) == 'function') {
13900
+ new plugin(self)
13901
+ }
13902
+ });
13903
+
13904
+ preview.bind('update', function() {
13905
+ self.info.show();
13906
+ });
13907
+ });
13908
+
13909
+ }
13910
+
13911
+ this.getstate = function() {
13912
+ return this.fm.selected().length == 1 ? state == opened ? 1 : 0 : -1;
13913
+ }
13914
+
13915
+ this.exec = function() {
13916
+ this.enabled() && this.window.trigger(this.opened() ? 'close' : 'open');
13917
+ }
13918
+
13919
+ this.hideinfo = function() {
13920
+ this.info.stop(true).hide();
13921
+ }
13922
+
13923
+ }
13924
+
13925
+
13926
+
13927
+ /*
13928
+ * File: /js/commands/quicklook.plugins.js
13929
+ */
13930
+
13931
+
13932
+ elFinder.prototype.commands.quicklook.plugins = [
13933
+
13934
+ /**
13935
+ * Images preview plugin
13936
+ *
13937
+ * @param elFinder.commands.quicklook
13938
+ **/
13939
+ function(ql) {
13940
+ var mimes = ['image/jpeg', 'image/png', 'image/gif'],
13941
+ preview = ql.preview;
13942
+
13943
+ // what kind of images we can display
13944
+ $.each(navigator.mimeTypes, function(i, o) {
13945
+ var mime = o.type;
13946
+
13947
+ if (mime.indexOf('image/') === 0 && $.inArray(mime, mimes)) {
13948
+ mimes.push(mime);
13949
+ }
13950
+ });
13951
+
13952
+ preview.bind('update', function(e) {
13953
+ var file = e.file,
13954
+ img;
13955
+
13956
+ if ($.inArray(file.mime, mimes) !== -1) {
13957
+ // this is our file - stop event propagation
13958
+ e.stopImmediatePropagation();
13959
+
13960
+ img = $('<img/>')
13961
+ .hide()
13962
+ .appendTo(preview)
13963
+ .load(function() {
13964
+ // timeout - because of strange safari bug -
13965
+ // sometimes cant get image height 0_o
13966
+ setTimeout(function() {
13967
+ var prop = (img.width()/img.height()).toFixed(2);
13968
+ preview.bind('changesize', function() {
13969
+ var pw = parseInt(preview.width()),
13970
+ ph = parseInt(preview.height()),
13971
+ w, h;
13972
+
13973
+ if (prop < (pw/ph).toFixed(2)) {
13974
+ h = ph;
13975
+ w = Math.floor(h * prop);
13976
+ } else {
13977
+ w = pw;
13978
+ h = Math.floor(w/prop);
13979
+ }
13980
+ img.width(w).height(h).css('margin-top', h < ph ? Math.floor((ph - h)/2) : 0);
13981
+
13982
+ })
13983
+ .trigger('changesize');
13984
+
13985
+ // hide info/icon
13986
+ ql.hideinfo();
13987
+ //show image
13988
+ img.fadeIn(100);
13989
+ }, 1)
13990
+ })
13991
+ .attr('src', ql.fm.openUrl(file.hash));
13992
+ }
13993
+
13994
+ });
13995
+ },
13996
+
13997
+ /**
13998
+ * HTML preview plugin
13999
+ *
14000
+ * @param elFinder.commands.quicklook
14001
+ **/
14002
+ function(ql) {
14003
+ var mimes = ['text/html', 'application/xhtml+xml'],
14004
+ preview = ql.preview,
14005
+ fm = ql.fm;
14006
+
14007
+ preview.bind('update', function(e) {
14008
+ var file = e.file, jqxhr;
14009
+
14010
+ if ($.inArray(file.mime, mimes) !== -1) {
14011
+ e.stopImmediatePropagation();
14012
+
14013
+ // stop loading on change file if not loaded yet
14014
+ preview.one('change', function() {
14015
+ jqxhr.state() == 'pending' && jqxhr.reject();
14016
+ });
14017
+
14018
+ jqxhr = fm.request({
14019
+ data : {cmd : 'get', target : file.hash, current : file.phash, conv : 1},
14020
+ preventDefault : true
14021
+ })
14022
+ .done(function(data) {
14023
+ ql.hideinfo();
14024
+ doc = $('<iframe class="elfinder-quicklook-preview-html"/>').appendTo(preview)[0].contentWindow.document;
14025
+ doc.open();
14026
+ doc.write(data.content);
14027
+ doc.close();
14028
+ });
14029
+ }
14030
+ })
14031
+ },
14032
+
14033
+ /**
14034
+ * Texts preview plugin
14035
+ *
14036
+ * @param elFinder.commands.quicklook
14037
+ **/
14038
+ function(ql) {
14039
+ var fm = ql.fm,
14040
+ mimes = fm.res('mimes', 'text'),
14041
+ preview = ql.preview;
14042
+
14043
+
14044
+ preview.bind('update', function(e) {
14045
+ var file = e.file,
14046
+ mime = file.mime,
14047
+ jqxhr;
14048
+
14049
+ if (mime.indexOf('text/') === 0 || $.inArray(mime, mimes) !== -1) {
14050
+ e.stopImmediatePropagation();
14051
+
14052
+ // stop loading on change file if not loadin yet
14053
+ preview.one('change', function() {
14054
+ jqxhr.state() == 'pending' && jqxhr.reject();
14055
+ });
14056
+
14057
+ jqxhr = fm.request({
14058
+ data : {cmd : 'get', target : file.hash, conv : 1},
14059
+ preventDefault : true
14060
+ })
14061
+ .done(function(data) {
14062
+ ql.hideinfo();
14063
+ $('<div class="elfinder-quicklook-preview-text-wrapper"><pre class="elfinder-quicklook-preview-text">'+fm.escape(data.content)+'</pre></div>').appendTo(preview);
14064
+ });
14065
+ }
14066
+ });
14067
+ },
14068
+
14069
+ /**
14070
+ * PDF preview plugin
14071
+ *
14072
+ * @param elFinder.commands.quicklook
14073
+ **/
14074
+ function(ql) {
14075
+ var fm = ql.fm,
14076
+ mime = 'application/pdf',
14077
+ preview = ql.preview,
14078
+ active = false;
14079
+
14080
+ if ((fm.UA.Safari && fm.OS == 'mac') || fm.UA.IE) {
14081
+ active = true;
14082
+ } else {
14083
+ $.each(navigator.plugins, function(i, plugins) {
14084
+ $.each(plugins, function(i, plugin) {
14085
+ if (plugin.type == mime) {
14086
+ return !(active = true);
14087
+ }
14088
+ });
14089
+ });
14090
+ }
14091
+
14092
+ active && preview.bind('update', function(e) {
14093
+ var file = e.file, node;
14094
+
14095
+ if (file.mime == mime) {
14096
+ e.stopImmediatePropagation();
14097
+ preview.one('change', function() {
14098
+ node.unbind('load').remove();
14099
+ });
14100
+
14101
+ node = $('<iframe class="elfinder-quicklook-preview-pdf"/>')
14102
+ .hide()
14103
+ .appendTo(preview)
14104
+ .load(function() {
14105
+ ql.hideinfo();
14106
+ node.show();
14107
+ })
14108
+ .attr('src', fm.url(file.hash));
14109
+ }
14110
+
14111
+ })
14112
+
14113
+
14114
+ },
14115
+
14116
+ /**
14117
+ * Flash preview plugin
14118
+ *
14119
+ * @param elFinder.commands.quicklook
14120
+ **/
14121
+ function(ql) {
14122
+ var fm = ql.fm,
14123
+ mime = 'application/x-shockwave-flash',
14124
+ preview = ql.preview,
14125
+ active = false;
14126
+
14127
+ $.each(navigator.plugins, function(i, plugins) {
14128
+ $.each(plugins, function(i, plugin) {
14129
+ if (plugin.type == mime) {
14130
+ return !(active = true);
14131
+ }
14132
+ });
14133
+ });
14134
+
14135
+ active && preview.bind('update', function(e) {
14136
+ var file = e.file,
14137
+ node;
14138
+
14139
+ if (file.mime == mime) {
14140
+ e.stopImmediatePropagation();
14141
+ ql.hideinfo();
14142
+ preview.append((node = $('<embed class="elfinder-quicklook-preview-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+fm.url(file.hash)+'" quality="high" type="application/x-shockwave-flash" />')));
14143
+ }
14144
+ });
14145
+ },
14146
+
14147
+ /**
14148
+ * HTML5 audio preview plugin
14149
+ *
14150
+ * @param elFinder.commands.quicklook
14151
+ **/
14152
+ function(ql) {
14153
+ var preview = ql.preview,
14154
+ autoplay = !!ql.options['autoplay'],
14155
+ mimes = {
14156
+ 'audio/mpeg' : 'mp3',
14157
+ 'audio/mpeg3' : 'mp3',
14158
+ 'audio/mp3' : 'mp3',
14159
+ 'audio/x-mpeg3' : 'mp3',
14160
+ 'audio/x-mp3' : 'mp3',
14161
+ 'audio/x-wav' : 'wav',
14162
+ 'audio/wav' : 'wav',
14163
+ 'audio/x-m4a' : 'm4a',
14164
+ 'audio/aac' : 'm4a',
14165
+ 'audio/mp4' : 'm4a',
14166
+ 'audio/x-mp4' : 'm4a',
14167
+ 'audio/ogg' : 'ogg'
14168
+ },
14169
+ node;
14170
+
14171
+ preview.bind('update', function(e) {
14172
+ var file = e.file,
14173
+ type = mimes[file.mime];
14174
+
14175
+ if (ql.support.audio[type]) {
14176
+ e.stopImmediatePropagation();
14177
+
14178
+ node = $('<audio class="elfinder-quicklook-preview-audio" controls preload="auto" autobuffer><source src="'+ql.fm.openUrl(file.hash)+'" /></audio>')
14179
+ .appendTo(preview);
14180
+ autoplay && node[0].play();
14181
+ }
14182
+ }).bind('change', function() {
14183
+ if (node && node.parent().length) {
14184
+ node[0].pause();
14185
+ node.remove();
14186
+ node= null;
14187
+ }
14188
+ });
14189
+ },
14190
+
14191
+ /**
14192
+ * HTML5 video preview plugin
14193
+ *
14194
+ * @param elFinder.commands.quicklook
14195
+ **/
14196
+ function(ql) {
14197
+ var preview = ql.preview,
14198
+ autoplay = !!ql.options['autoplay'],
14199
+ mimes = {
14200
+ 'video/mp4' : 'mp4',
14201
+ 'video/x-m4v' : 'mp4',
14202
+ 'video/ogg' : 'ogg',
14203
+ 'application/ogg' : 'ogg',
14204
+ 'video/webm' : 'webm'
14205
+ },
14206
+ node;
14207
+
14208
+ preview.bind('update', function(e) {
14209
+ var file = e.file,
14210
+ type = mimes[file.mime];
14211
+
14212
+ if (ql.support.video[type]) {
14213
+ e.stopImmediatePropagation();
14214
+
14215
+ ql.hideinfo();
14216
+ node = $('<video class="elfinder-quicklook-preview-video" controls preload="auto" autobuffer><source src="'+ql.fm.openUrl(file.hash)+'" /></video>').appendTo(preview);
14217
+ autoplay && node[0].play();
14218
+
14219
+ }
14220
+ }).bind('change', function() {
14221
+ if (node && node.parent().length) {
14222
+ node[0].pause();
14223
+ node.remove();
14224
+ node= null;
14225
+ }
14226
+ });
14227
+ },
14228
+
14229
+ /**
14230
+ * Audio/video preview plugin using browser plugins
14231
+ *
14232
+ * @param elFinder.commands.quicklook
14233
+ **/
14234
+ function(ql) {
14235
+ var preview = ql.preview,
14236
+ mimes = [],
14237
+ node;
14238
+
14239
+ $.each(navigator.plugins, function(i, plugins) {
14240
+ $.each(plugins, function(i, plugin) {
14241
+ (plugin.type.indexOf('audio/') === 0 || plugin.type.indexOf('video/') === 0) && mimes.push(plugin.type);
14242
+ });
14243
+ });
14244
+
14245
+ preview.bind('update', function(e) {
14246
+ var file = e.file,
14247
+ mime = file.mime,
14248
+ video;
14249
+
14250
+ if ($.inArray(file.mime, mimes) !== -1) {
14251
+ e.stopImmediatePropagation();
14252
+ (video = mime.indexOf('video/') === 0) && ql.hideinfo();
14253
+ node = $('<embed src="'+ql.fm.openUrl(file.hash)+'" type="'+mime+'" class="elfinder-quicklook-preview-'+(video ? 'video' : 'audio')+'"/>')
14254
+ .appendTo(preview);
14255
+ }
14256
+ }).bind('change', function() {
14257
+ if (node && node.parent().length) {
14258
+ node.remove();
14259
+ node= null;
14260
+ }
14261
+ });
14262
+
14263
+ }
14264
+
14265
+ ]
14266
+
14267
+ /*
14268
+ * File: /js/commands/reload.js
14269
+ */
14270
+
14271
+ /**
14272
+ * @class elFinder command "reload"
14273
+ * Sync files and folders
14274
+ *
14275
+ * @author Dmitry (dio) Levashov
14276
+ **/
14277
+ elFinder.prototype.commands.reload = function() {
14278
+ var self = this,
14279
+ search = false;
14280
+
14281
+ this.alwaysEnabled = true;
14282
+ this.updateOnSelect = true;
14283
+
14284
+ this.shortcuts = [{
14285
+ pattern : 'ctrl+shift+r f5'
14286
+ }];
14287
+
14288
+ this.getstate = function() {
14289
+ return 0;
14290
+ };
14291
+
14292
+ this.init = function() {
14293
+ this.fm.bind('search searchend', function(e) {
14294
+ search = e.type == 'search';
14295
+ });
14296
+ };
14297
+
14298
+ this.fm.bind('contextmenu', function(e){
14299
+ var fm = self.fm;
14300
+ if (fm.options.sync >= 1000) {
14301
+ var node;
14302
+ self.extra = {
14303
+ icon: 'accept',
14304
+ node: $('<span/>')
14305
+ .attr({title: fm.i18n('autoSync')})
14306
+ .on('click', function(e){
14307
+ e.stopPropagation();
14308
+ e.preventDefault();
14309
+ node.parent()
14310
+ .toggleClass('ui-state-disabled', fm.options.syncStart)
14311
+ .parent().removeClass('ui-state-hover');
14312
+ fm.options.syncStart = !fm.options.syncStart;
14313
+ fm.autoSync(fm.options.syncStart? null : 'stop');
14314
+ })
14315
+ };
14316
+ node = self.extra.node;
14317
+ node.ready(function(){
14318
+ setTimeout(function(){
14319
+ node.parent().toggleClass('ui-state-disabled', !fm.options.syncStart);
14320
+ }, 10);
14321
+ });
14322
+ }
14323
+ });
14324
+
14325
+ this.exec = function() {
14326
+ var fm = this.fm;
14327
+ if (!search) {
14328
+ var dfrd = fm.sync(),
14329
+ timeout = setTimeout(function() {
14330
+ fm.notify({type : 'reload', cnt : 1, hideCnt : true});
14331
+ dfrd.always(function() { fm.notify({type : 'reload', cnt : -1}); });
14332
+ }, fm.notifyDelay);
14333
+
14334
+ return dfrd.always(function() {
14335
+ clearTimeout(timeout);
14336
+ fm.trigger('reload');
14337
+ });
14338
+ } else {
14339
+ $('div.elfinder-toolbar > div.'+fm.res('class', 'searchbtn') + ' > span.ui-icon-search').click();
14340
+ }
14341
+ };
14342
+
14343
+ };
14344
+
14345
+ /*
14346
+ * File: /js/commands/rename.js
14347
+ */
14348
+
14349
+ /**
14350
+ * @class elFinder command "rename".
14351
+ * Rename selected file.
14352
+ *
14353
+ * @author Dmitry (dio) Levashov, dio@std42.ru
14354
+ **/
14355
+ elFinder.prototype.commands.rename = function() {
14356
+
14357
+ this.shortcuts = [{
14358
+ pattern : 'f2'+(this.fm.OS == 'mac' ? ' enter' : '')
14359
+ }];
14360
+
14361
+ this.getstate = function(sel) {
14362
+ var sel = this.files(sel);
14363
+
14364
+ return !this._disabled && sel.length == 1 && sel[0].phash && !sel[0].locked ? 0 : -1;
14365
+ };
14366
+
14367
+ this.exec = function(hashes) {
14368
+ var fm = this.fm,
14369
+ cwd = fm.getUI('cwd'),
14370
+ sel = hashes || (fm.selected().length? fm.selected() : false) || [fm.cwd().hash],
14371
+ cnt = sel.length,
14372
+ file = fm.file(sel.shift()),
14373
+ filename = '.elfinder-cwd-filename',
14374
+ type = (hashes && hashes._type)? hashes._type : (fm.selected().length? 'files' : 'navbar'),
14375
+ navbar = (type === 'navbar'),
14376
+ incwd = (fm.cwd().hash == file.hash),
14377
+ tarea = (type === 'files' && fm.storage('view') != 'list'),
14378
+ rest = function(){
14379
+ if (tarea) {
14380
+ pnode.zIndex('').css('position', '');
14381
+ node.css('max-height', '');
14382
+ } else if (!navbar) {
14383
+ pnode.css('width', '');
14384
+ pnode.parent('td').css('overflow', '');
14385
+ }
14386
+ }, colwidth,
14387
+ dfrd = $.Deferred()
14388
+ .done(function(data){
14389
+ incwd && fm.exec('open', data.added[0].hash);
14390
+ })
14391
+ .fail(function(error) {
14392
+ var parent = input.parent(),
14393
+ name = fm.escape(file.name);
14394
+
14395
+ if (tarea) {
14396
+ name = name.replace(/([_.])/g, '&#8203;$1');
14397
+ }
14398
+ rest();
14399
+ if (navbar) {
14400
+ input.replaceWith(name);
14401
+ } else {
14402
+ if (parent.length) {
14403
+ input.remove();
14404
+ parent.html(name);
14405
+ } else {
14406
+ cwd.find('#'+fm.cwdHash2Id(file.hash)).find(filename).html(name);
14407
+ setTimeout(function() {
14408
+ cwd.find('#'+fm.cwdHash2Id(file.hash)).click();
14409
+ }, 50);
14410
+ }
14411
+ }
14412
+
14413
+ error && fm.error(error);
14414
+ })
14415
+ .always(function() {
14416
+ fm.enable();
14417
+ }),
14418
+ input = $(tarea? '<textarea/>' : '<input type="text"/>')
14419
+ .on('keyup text', function(){
14420
+ if (tarea) {
14421
+ this.style.height = '1px';
14422
+ this.style.height = this.scrollHeight + 'px';
14423
+ } else if (colwidth) {
14424
+ this.style.width = colwidth + 'px';
14425
+ if (this.scrollWidth > colwidth) {
14426
+ this.style.width = this.scrollWidth + 10 + 'px';
14427
+ }
14428
+ }
14429
+ })
14430
+ .keydown(function(e) {
14431
+ e.stopPropagation();
14432
+ e.stopImmediatePropagation();
14433
+ if (e.keyCode == $.ui.keyCode.ESCAPE) {
14434
+ dfrd.reject();
14435
+ } else if (e.keyCode == $.ui.keyCode.ENTER) {
14436
+ input.blur();
14437
+ }
14438
+ })
14439
+ .mousedown(function(e) {
14440
+ e.stopPropagation();
14441
+ })
14442
+ .click(function(e) { // for touch device
14443
+ e.stopPropagation();
14444
+ })
14445
+ .dblclick(function(e) {
14446
+ e.stopPropagation();
14447
+ e.preventDefault();
14448
+ })
14449
+ .blur(function() {
14450
+ var name = $.trim(input.val()),
14451
+ parent = input.parent(),
14452
+ valid = true;
14453
+
14454
+ if (pnode.length) {
14455
+ if (input[0].setSelectionRange) {
14456
+ input[0].setSelectionRange(0, 0)
14457
+ }
14458
+ if (name == file.name) {
14459
+ return dfrd.reject();
14460
+ }
14461
+ if (fm.options.validName && fm.options.validName.test) {
14462
+ try {
14463
+ valid = fm.options.validName.test(name);
14464
+ } catch(e) {
14465
+ valid = false;
14466
+ }
14467
+ }
14468
+ if (!name || name === '..' || !valid) {
14469
+ fm.error('errInvName');
14470
+ return false;
14471
+ }
14472
+ if (fm.fileByName(name, file.phash)) {
14473
+ fm.error(['errExists', name]);
14474
+ return false;
14475
+ }
14476
+
14477
+ rest();
14478
+ (navbar? pnode : node).html(fm.escape(name));
14479
+ fm.lockfiles({files : [file.hash]});
14480
+ fm.request({
14481
+ data : {cmd : 'rename', target : file.hash, name : name},
14482
+ notify : {type : 'rename', cnt : 1}
14483
+ })
14484
+ .fail(function(error) {
14485
+ dfrd.reject();
14486
+ fm.sync();
14487
+ })
14488
+ .done(function(data) {
14489
+ dfrd.resolve(data);
14490
+ if (!navbar && data && data.added && data.added[0]) {
14491
+ var newItem = cwd.find('#'+fm.cwdHash2Id(data.added[0].hash));
14492
+ if (newItem.length) {
14493
+ newItem.trigger('scrolltoview');
14494
+ }
14495
+ }
14496
+ })
14497
+ .always(function() {
14498
+ fm.unlockfiles({files : [file.hash]})
14499
+ });
14500
+
14501
+ }
14502
+ }),
14503
+ node = navbar? $('#'+fm.navHash2Id(file.hash)).contents().filter(function(){ return this.nodeType==3 && $(this).parent().attr('id') === fm.navHash2Id(file.hash); })
14504
+ : cwd.find('#'+fm.cwdHash2Id(file.hash)).find(filename),
14505
+ name = file.name.replace(/\.((tar\.(gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(gz|bz2)|[a-z0-9]{1,4})$/ig, ''),
14506
+ pnode = node.parent();
14507
+
14508
+ if (navbar) {
14509
+ node.replaceWith(input.val(file.name));
14510
+ } else {
14511
+ if (tarea) {
14512
+ pnode.zIndex((pnode.zIndex()) + 1).css('position', 'relative');
14513
+ node.css('max-height', 'none');
14514
+ } else if (!navbar) {
14515
+ colwidth = pnode.width();
14516
+ pnode.width(colwidth - 15);
14517
+ pnode.parent('td').css('overflow', 'visible');
14518
+ }
14519
+ node.empty().append(input.val(file.name));
14520
+ }
14521
+
14522
+ if (cnt > 1 || this.getstate([file.hash]) < 0) {
14523
+ return dfrd.reject();
14524
+ }
14525
+
14526
+ if (!file || !node.length) {
14527
+ return dfrd.reject('errCmdParams', this.title);
14528
+ }
14529
+
14530
+ if (file.locked) {
14531
+ return dfrd.reject(['errLocked', file.name]);
14532
+ }
14533
+
14534
+ fm.one('select', function() {
14535
+ input.parent().length && file && $.inArray(file.hash, fm.selected()) === -1 && input.blur();
14536
+ })
14537
+
14538
+ input.trigger('keyup');
14539
+
14540
+ input.select().focus();
14541
+
14542
+ input[0].setSelectionRange && input[0].setSelectionRange(0, name.length);
14543
+
14544
+ return dfrd;
14545
+ };
14546
+
14547
+ }
14548
+
14549
+
14550
+ /*
14551
+ * File: /js/commands/resize.js
14552
+ */
14553
+
14554
+ /**
14555
+ * @class elFinder command "resize"
14556
+ * Open dialog to resize image
14557
+ *
14558
+ * @author Dmitry (dio) Levashov
14559
+ * @author Alexey Sukhotin
14560
+ * @author Naoki Sawada
14561
+ * @author Sergio Jovani
14562
+ **/
14563
+ elFinder.prototype.commands.resize = function() {
14564
+
14565
+ this.updateOnSelect = false;
14566
+
14567
+ this.getstate = function() {
14568
+ var sel = this.fm.selectedFiles();
14569
+ return !this._disabled && sel.length == 1 && sel[0].read && sel[0].write && sel[0].mime.indexOf('image/') !== -1 ? 0 : -1;
14570
+ };
14571
+
14572
+ this.exec = function(hashes) {
14573
+ var fm = this.fm,
14574
+ files = this.files(hashes),
14575
+ dfrd = $.Deferred(),
14576
+
14577
+ open = function(file, id) {
14578
+ var isJpeg = (file.mime === 'image/jpeg'),
14579
+ dialog = $('<div class="elfinder-dialog-resize"/>'),
14580
+ input = '<input type="text" size="5"/>',
14581
+ row = '<div class="elfinder-resize-row"/>',
14582
+ label = '<div class="elfinder-resize-label"/>',
14583
+ control = $('<div class="elfinder-resize-control"/>'),
14584
+ preview = $('<div class="elfinder-resize-preview"/>'),
14585
+ spinner = $('<div class="elfinder-resize-spinner">'+fm.i18n('ntfloadimg')+'</div>'),
14586
+ rhandle = $('<div class="elfinder-resize-handle"/>'),
14587
+ rhandlec = $('<div class="elfinder-resize-handle"/>'),
14588
+ uiresize = $('<div class="elfinder-resize-uiresize"/>'),
14589
+ uicrop = $('<div class="elfinder-resize-uicrop"/>'),
14590
+ uibuttonset = '<div class="ui-widget-content ui-corner-all elfinder-buttonset"/>',
14591
+ uibutton = '<div class="ui-state-default elfinder-button"/>',
14592
+ uiseparator = '<span class="ui-widget-content elfinder-toolbar-button-separator"/>',
14593
+ uirotate = $('<div class="elfinder-resize-rotate"/>'),
14594
+ uideg270 = $(uibutton).attr('title',fm.i18n('rotate-cw')).append($('<span class="elfinder-button-icon elfinder-button-icon-rotate-l"/>')
14595
+ .click(function(){
14596
+ rdegree = rdegree - 90;
14597
+ rotate.update(rdegree);
14598
+ })),
14599
+ uideg90 = $(uibutton).attr('title',fm.i18n('rotate-ccw')).append($('<span class="elfinder-button-icon elfinder-button-icon-rotate-r"/>')
14600
+ .click(function(){
14601
+ rdegree = rdegree + 90;
14602
+ rotate.update(rdegree);
14603
+ })),
14604
+ uiprop = $('<span />'),
14605
+ reset = $('<div class="ui-state-default ui-corner-all elfinder-resize-reset"><span class="ui-icon ui-icon-arrowreturnthick-1-w"/></div>'),
14606
+ uitype = $('<div class="elfinder-resize-type"/>')
14607
+ .append('<input type="radio" name="type" id="'+id+'-resize" value="resize" checked="checked" /><label for="'+id+'-resize">'+fm.i18n('resize')+'</label>')
14608
+ .append('<input type="radio" name="type" id="'+id+'-crop" value="crop" /><label for="'+id+'-crop">'+fm.i18n('crop')+'</label>')
14609
+ .append('<input type="radio" name="type" id="'+id+'-rotate" value="rotate" /><label for="'+id+'-rotate">'+fm.i18n('rotate')+'</label>'),
14610
+ type = $('input', uitype).attr('disabled', 'disabled')
14611
+ .change(function() {
14612
+ var val = $('input:checked', uitype).val();
14613
+
14614
+ resetView();
14615
+ resizable(true);
14616
+ croppable(true);
14617
+ rotateable(true);
14618
+
14619
+ if (val == 'resize') {
14620
+ uiresize.show();
14621
+ uirotate.hide();
14622
+ uicrop.hide();
14623
+ resizable();
14624
+ }
14625
+ else if (val == 'crop') {
14626
+ uirotate.hide();
14627
+ uiresize.hide();
14628
+ uicrop.show();
14629
+ croppable();
14630
+ } else if (val == 'rotate') {
14631
+ uiresize.hide();
14632
+ uicrop.hide();
14633
+ uirotate.show();
14634
+ rotateable();
14635
+ }
14636
+ }),
14637
+ constr = $('<input type="checkbox" checked="checked"/>')
14638
+ .change(function() {
14639
+ cratio = !!constr.prop('checked');
14640
+ resize.fixHeight();
14641
+ resizable(true);
14642
+ resizable();
14643
+ }),
14644
+ width = $(input)
14645
+ .change(function() {
14646
+ var w = parseInt(width.val()),
14647
+ h = parseInt(cratio ? Math.round(w/ratio) : height.val());
14648
+
14649
+ if (w > 0 && h > 0) {
14650
+ resize.updateView(w, h);
14651
+ height.val(h);
14652
+ }
14653
+ }),
14654
+ height = $(input)
14655
+ .change(function() {
14656
+ var h = parseInt(height.val()),
14657
+ w = parseInt(cratio ? Math.round(h*ratio) : width.val());
14658
+
14659
+ if (w > 0 && h > 0) {
14660
+ resize.updateView(w, h);
14661
+ width.val(w);
14662
+ }
14663
+ }),
14664
+ pointX = $(input).change(function(){crop.updateView();}),
14665
+ pointY = $(input).change(function(){crop.updateView();}),
14666
+ offsetX = $(input).change(function(){crop.updateView();}),
14667
+ offsetY = $(input).change(function(){crop.updateView();}),
14668
+ quality = isJpeg?
14669
+ $(input).val(fm.option('jpgQuality'))
14670
+ .addClass('quality')
14671
+ .on('blur', function(){
14672
+ var q = Math.min(100, Math.max(1, parseInt(this.value)));
14673
+ dialog.find('input.quality').val(q);
14674
+ })
14675
+ : null,
14676
+ degree = $('<input type="text" size="3" maxlength="3" value="0" />')
14677
+ .change(function() {
14678
+ rotate.update();
14679
+ }),
14680
+ uidegslider = $('<div class="elfinder-resize-rotate-slider"/>')
14681
+ .slider({
14682
+ min: 0,
14683
+ max: 360,
14684
+ value: degree.val(),
14685
+ animate: true,
14686
+ change: function(event, ui) {
14687
+ if (ui.value != uidegslider.slider('value')) {
14688
+ rotate.update(ui.value);
14689
+ }
14690
+ },
14691
+ slide: function(event, ui) {
14692
+ rotate.update(ui.value, false);
14693
+ }
14694
+ }),
14695
+ ratio = 1,
14696
+ prop = 1,
14697
+ owidth = 0,
14698
+ oheight = 0,
14699
+ cratio = true,
14700
+ pwidth = 0,
14701
+ pheight = 0,
14702
+ rwidth = 0,
14703
+ rheight = 0,
14704
+ rdegree = 0,
14705
+ img = $('<img/>')
14706
+ .load(function() {
14707
+ spinner.remove();
14708
+
14709
+ owidth = img.width();
14710
+ oheight = img.height();
14711
+ ratio = owidth/oheight;
14712
+ resize.updateView(owidth, oheight);
14713
+
14714
+ rhandle.append(img.show()).show();
14715
+ width.val(owidth);
14716
+ height.val(oheight);
14717
+
14718
+ var r_scale = Math.min(pwidth, pheight) / Math.sqrt(Math.pow(owidth, 2) + Math.pow(oheight, 2));
14719
+ rwidth = owidth * r_scale;
14720
+ rheight = oheight * r_scale;
14721
+
14722
+ type.button('enable');
14723
+ control.find('input,select').removeAttr('disabled')
14724
+ .filter(':text').keydown(function(e) {
14725
+ var c = e.keyCode, i;
14726
+
14727
+ e.stopPropagation();
14728
+
14729
+ if ((c >= 37 && c <= 40)
14730
+ || c == $.ui.keyCode.BACKSPACE
14731
+ || c == $.ui.keyCode.DELETE
14732
+ || (c == 65 && (e.ctrlKey||e.metaKey))
14733
+ || c == 27) {
14734
+ return;
14735
+ }
14736
+
14737
+ if (c == 9) {
14738
+ i = $(this).parent()[e.shiftKey ? 'prevAll' : 'nextAll']('div.elfinder-resize-row').children(':text');
14739
+
14740
+ if (i.length) {
14741
+ i[0].focus();
14742
+ } else {
14743
+ $(this).parent().parent().find(':text:' + (e.shiftKey ? 'last' : 'first')).focus();
14744
+ }
14745
+ }
14746
+
14747
+ if (c == 13) {
14748
+ fm.confirm({
14749
+ title : $('input:checked', uitype).val(),
14750
+ text : 'confirmReq',
14751
+ accept : {
14752
+ label : 'btnApply',
14753
+ callback : function() {
14754
+ save();
14755
+ }
14756
+ },
14757
+ cancel : {
14758
+ label : 'btnCancel',
14759
+ callback : function(){}
14760
+ }
14761
+ });
14762
+ return;
14763
+ }
14764
+
14765
+ if (!((c >= 48 && c <= 57) || (c >= 96 && c <= 105))) {
14766
+ e.preventDefault();
14767
+ }
14768
+ })
14769
+ .filter(':first').focus();
14770
+
14771
+ resizable();
14772
+
14773
+ reset.hover(function() { reset.toggleClass('ui-state-hover'); }).click(resetView);
14774
+
14775
+ })
14776
+ .error(function() {
14777
+ spinner.text('Unable to load image').css('background', 'transparent');
14778
+ }),
14779
+ basec = $('<div/>'),
14780
+ imgc = $('<img/>'),
14781
+ coverc = $('<div/>'),
14782
+ imgr = $('<img/>'),
14783
+ round = function(v) {
14784
+ return isJpeg? Math.round(v/8)*8 : Math.round(v);
14785
+ },
14786
+ resetView = function() {
14787
+ width.val(owidth);
14788
+ height.val(oheight);
14789
+ resize.updateView(owidth, oheight);
14790
+ },
14791
+ resize = {
14792
+ update : function() {
14793
+ width.val(round(img.width()/prop));
14794
+ height.val(round(img.height()/prop));
14795
+ },
14796
+
14797
+ updateView : function(w, h) {
14798
+ if (w > pwidth || h > pheight) {
14799
+ if (w / pwidth > h / pheight) {
14800
+ prop = pwidth / w;
14801
+ img.width(pwidth).height(Math.ceil(h*prop));
14802
+ } else {
14803
+ prop = pheight / h;
14804
+ img.height(pheight).width(Math.ceil(w*prop));
14805
+ }
14806
+ } else {
14807
+ img.width(w).height(h);
14808
+ }
14809
+
14810
+ prop = img.width()/w;
14811
+ uiprop.text('1 : '+(1/prop).toFixed(2));
14812
+ resize.updateHandle();
14813
+ },
14814
+
14815
+ updateHandle : function() {
14816
+ rhandle.width(img.width()).height(img.height());
14817
+ },
14818
+ fixHeight : function() {
14819
+ var w, h;
14820
+ if (cratio) {
14821
+ w = width.val();
14822
+ h = Math.round(w/ratio);
14823
+ resize.updateView(w, h);
14824
+ height.val(h);
14825
+ }
14826
+ }
14827
+ },
14828
+ crop = {
14829
+ update : function() {
14830
+ offsetX.val(round((rhandlec.data('w')||rhandlec.width())/prop));
14831
+ offsetY.val(round((rhandlec.data('h')||rhandlec.height())/prop));
14832
+ pointX.val(Math.round(((rhandlec.data('x')||rhandlec.offset().left)-imgc.offset().left)/prop));
14833
+ pointY.val(Math.round(((rhandlec.data('y')||rhandlec.offset().top)-imgc.offset().top)/prop));
14834
+ },
14835
+ updateView : function() {
14836
+ var x = parseInt(pointX.val()) * prop + imgc.offset().left;
14837
+ var y = parseInt(pointY.val()) * prop + imgc.offset().top;
14838
+ var w = offsetX.val() * prop;
14839
+ var h = offsetY.val() * prop;
14840
+ rhandlec.data({x: x, y: y, w: w, h: h})
14841
+ .width(Math.round(w))
14842
+ .height(Math.round(h))
14843
+ .offset({left: Math.round(x), top: Math.round(y)});
14844
+ coverc.width(rhandlec.width())
14845
+ .height(rhandlec.height());
14846
+ },
14847
+ resize_update : function() {
14848
+ rhandlec.data({w: null, h: null});
14849
+ crop.update();
14850
+ coverc.width(rhandlec.width())
14851
+ .height(rhandlec.height());
14852
+ },
14853
+ drag_update : function() {
14854
+ rhandlec.data({x: null, y: null});
14855
+ crop.update();
14856
+ }
14857
+ },
14858
+ rotate = {
14859
+ mouseStartAngle : 0,
14860
+ imageStartAngle : 0,
14861
+ imageBeingRotated : false,
14862
+
14863
+ update : function(value, animate) {
14864
+ if (typeof value == 'undefined') {
14865
+ rdegree = value = parseInt(degree.val());
14866
+ }
14867
+ if (typeof animate == 'undefined') {
14868
+ animate = true;
14869
+ }
14870
+ if (! animate || fm.UA.Opera || fm.UA.ltIE8) {
14871
+ imgr.rotate(value);
14872
+ } else {
14873
+ imgr.animate({rotate: value + 'deg'});
14874
+ }
14875
+ value = value % 360;
14876
+ if (value < 0) {
14877
+ value += 360;
14878
+ }
14879
+ degree.val(parseInt(value));
14880
+
14881
+ uidegslider.slider('value', degree.val());
14882
+ },
14883
+
14884
+ execute : function ( e ) {
14885
+
14886
+ if ( !rotate.imageBeingRotated ) return;
14887
+
14888
+ var imageCentre = rotate.getCenter( imgr );
14889
+ var mouseXFromCentre = e.pageX - imageCentre[0];
14890
+ var mouseYFromCentre = e.pageY - imageCentre[1];
14891
+ var mouseAngle = Math.atan2( mouseYFromCentre, mouseXFromCentre );
14892
+
14893
+ var rotateAngle = mouseAngle - rotate.mouseStartAngle + rotate.imageStartAngle;
14894
+ rotateAngle = Math.round(parseFloat(rotateAngle) * 180 / Math.PI);
14895
+
14896
+ if ( e.shiftKey ) {
14897
+ rotateAngle = Math.round((rotateAngle + 6)/15) * 15;
14898
+ }
14899
+
14900
+ imgr.rotate(rotateAngle);
14901
+
14902
+ rotateAngle = rotateAngle % 360;
14903
+ if (rotateAngle < 0) {
14904
+ rotateAngle += 360;
14905
+ }
14906
+ degree.val(rotateAngle);
14907
+
14908
+ uidegslider.slider('value', degree.val());
14909
+
14910
+ return false;
14911
+ },
14912
+
14913
+ start : function ( e ) {
14914
+
14915
+ rotate.imageBeingRotated = true;
14916
+
14917
+ var imageCentre = rotate.getCenter( imgr );
14918
+ var mouseStartXFromCentre = e.pageX - imageCentre[0];
14919
+ var mouseStartYFromCentre = e.pageY - imageCentre[1];
14920
+ rotate.mouseStartAngle = Math.atan2( mouseStartYFromCentre, mouseStartXFromCentre );
14921
+
14922
+ rotate.imageStartAngle = parseFloat(imgr.rotate()) * Math.PI / 180.0;
14923
+
14924
+ $(document).mousemove( rotate.execute );
14925
+
14926
+ return false;
14927
+ },
14928
+
14929
+ stop : function ( e ) {
14930
+
14931
+ if ( !rotate.imageBeingRotated ) return;
14932
+
14933
+ $(document).unbind( 'mousemove' , rotate.execute);
14934
+
14935
+ setTimeout( function() { rotate.imageBeingRotated = false; }, 10 );
14936
+ return false;
14937
+ },
14938
+
14939
+ getCenter : function ( image ) {
14940
+
14941
+ var currentRotation = imgr.rotate();
14942
+ imgr.rotate(0);
14943
+
14944
+ var imageOffset = imgr.offset();
14945
+ var imageCentreX = imageOffset.left + imgr.width() / 2;
14946
+ var imageCentreY = imageOffset.top + imgr.height() / 2;
14947
+
14948
+ imgr.rotate(currentRotation);
14949
+
14950
+ return Array( imageCentreX, imageCentreY );
14951
+ }
14952
+ },
14953
+ resizable = function(destroy) {
14954
+ if ($.fn.resizable) {
14955
+ if (destroy) {
14956
+ rhandle.filter(':ui-resizable').resizable('destroy');
14957
+ rhandle.hide();
14958
+ }
14959
+ else {
14960
+ rhandle.show();
14961
+ rhandle.resizable({
14962
+ alsoResize : img,
14963
+ aspectRatio : cratio,
14964
+ resize : resize.update,
14965
+ stop : resize.fixHeight
14966
+ });
14967
+ }
14968
+ }
14969
+ },
14970
+ croppable = function(destroy) {
14971
+ if ($.fn.draggable && $.fn.resizable) {
14972
+ if (destroy) {
14973
+ rhandlec.filter(':ui-resizable').resizable('destroy')
14974
+ .filter(':ui-draggable').draggable('destroy');
14975
+ basec.hide();
14976
+ }
14977
+ else {
14978
+ basec.show()
14979
+ .width(img.width())
14980
+ .height(img.height());
14981
+
14982
+ imgc
14983
+ .width(img.width())
14984
+ .height(img.height());
14985
+
14986
+ coverc
14987
+ .width(img.width())
14988
+ .height(img.height());
14989
+
14990
+ rhandlec
14991
+ .width(imgc.width())
14992
+ .height(imgc.height())
14993
+ .offset(imgc.offset())
14994
+ .resizable({
14995
+ containment : basec,
14996
+ resize : crop.resize_update,
14997
+ handles : 'all'
14998
+ })
14999
+ .draggable({
15000
+ handle : coverc,
15001
+ containment : imgc,
15002
+ drag : crop.drag_update
15003
+ });
15004
+
15005
+ crop.update();
15006
+ }
15007
+ }
15008
+ },
15009
+ rotateable = function(destroy) {
15010
+ if ($.fn.draggable && $.fn.resizable) {
15011
+ if (destroy) {
15012
+ imgr.hide();
15013
+ }
15014
+ else {
15015
+ imgr.show()
15016
+ .width(rwidth)
15017
+ .height(rheight)
15018
+ .css('margin-top', (pheight-rheight)/2 + 'px')
15019
+ .css('margin-left', (pwidth-rwidth)/2 + 'px');
15020
+
15021
+ }
15022
+ }
15023
+ },
15024
+ save = function() {
15025
+ var w, h, x, y, d, q;
15026
+ var mode = $('input:checked', uitype).val();
15027
+
15028
+ //width.add(height).change(); // may be unnecessary
15029
+
15030
+ if (mode == 'resize') {
15031
+ w = parseInt(width.val()) || 0;
15032
+ h = parseInt(height.val()) || 0;
15033
+ } else if (mode == 'crop') {
15034
+ w = parseInt(offsetX.val()) || 0;
15035
+ h = parseInt(offsetY.val()) || 0;
15036
+ x = parseInt(pointX.val()) || 0;
15037
+ y = parseInt(pointY.val()) || 0;
15038
+ } else if (mode == 'rotate') {
15039
+ w = owidth;
15040
+ h = oheight;
15041
+ d = parseInt(degree.val()) || 0;
15042
+ if (d < 0 || d > 360) {
15043
+ return fm.error('Invalid rotate degree');
15044
+ }
15045
+ if (d == 0 || d == 360) {
15046
+ return fm.error('Image dose not rotated');
15047
+ }
15048
+ }
15049
+ q = quality? parseInt(quality.val()) : 0;
15050
+
15051
+ if (mode != 'rotate') {
15052
+
15053
+ if (w <= 0 || h <= 0) {
15054
+ return fm.error('Invalid image size');
15055
+ }
15056
+
15057
+ if (w == owidth && h == oheight) {
15058
+ return fm.error('Image size not changed');
15059
+ }
15060
+
15061
+ }
15062
+
15063
+ dialog.elfinderdialog('close');
15064
+
15065
+ fm.request({
15066
+ data : {
15067
+ cmd : 'resize',
15068
+ target : file.hash,
15069
+ width : w,
15070
+ height : h,
15071
+ x : x,
15072
+ y : y,
15073
+ degree : d,
15074
+ quality: q,
15075
+ mode : mode
15076
+ },
15077
+ notify : {type : 'resize', cnt : 1}
15078
+ })
15079
+ .fail(function(error) {
15080
+ dfrd.reject(error);
15081
+ })
15082
+ .done(function() {
15083
+ dfrd.resolve();
15084
+ });
15085
+
15086
+ },
15087
+ buttons = {},
15088
+ hline = 'elfinder-resize-handle-hline',
15089
+ vline = 'elfinder-resize-handle-vline',
15090
+ rpoint = 'elfinder-resize-handle-point',
15091
+ src = fm.url(file.hash)
15092
+ ;
15093
+
15094
+ imgr.mousedown( rotate.start );
15095
+ $(document).mouseup( rotate.stop );
15096
+
15097
+ uiresize.append(
15098
+ $(row).append($(label).text(fm.i18n('width')), width, reset),
15099
+ $(row).append($(label).text(fm.i18n('height')), height),
15100
+ $(row).append($('<label/>').text(fm.i18n('aspectRatio')).prepend(constr)),
15101
+ (quality? $(row).append($(label).text(fm.i18n('quality')), quality, $('<span/>').text(' (1-100)')) : $()),
15102
+ $(row).append($(label).text(fm.i18n('scale')), uiprop)
15103
+ );
15104
+
15105
+ uicrop.append(
15106
+ $(row).append($(label).text('X'), pointX),
15107
+ $(row).append($(label).text('Y')).append(pointY),
15108
+ $(row).append($(label).text(fm.i18n('width')), offsetX),
15109
+ $(row).append($(label).text(fm.i18n('height')), offsetY),
15110
+ (quality? $(row).append($(label).text(fm.i18n('quality')), quality.clone(true), $('<span/>').text(' (1-100)')) : $())
15111
+ );
15112
+
15113
+ uirotate.append(
15114
+ $(row).append(
15115
+ $(label).text(fm.i18n('rotate')),
15116
+ degree,
15117
+ $('<span/>').text(fm.i18n('degree')),
15118
+ $(uibuttonset).append(uideg270, $(uiseparator), uideg90)
15119
+ ),
15120
+ $(row).css('height', '20px').append(uidegslider),
15121
+ (quality? $(row).append($(label).text(fm.i18n('quality')), quality.clone(true), $('<span/>').text(' (1-100)')) : $())
15122
+ );
15123
+
15124
+
15125
+ dialog.append(uitype).on('resize', function(e){
15126
+ e.stopPropagation();
15127
+ });
15128
+
15129
+ control.append($(row), uiresize, uicrop.hide(), uirotate.hide())
15130
+ .find('input,select').attr('disabled', 'disabled');
15131
+
15132
+ rhandle.append('<div class="'+hline+' '+hline+'-top"/>',
15133
+ '<div class="'+hline+' '+hline+'-bottom"/>',
15134
+ '<div class="'+vline+' '+vline+'-left"/>',
15135
+ '<div class="'+vline+' '+vline+'-right"/>',
15136
+ '<div class="'+rpoint+' '+rpoint+'-e"/>',
15137
+ '<div class="'+rpoint+' '+rpoint+'-se"/>',
15138
+ '<div class="'+rpoint+' '+rpoint+'-s"/>');
15139
+
15140
+ preview.append(spinner).append(rhandle.hide()).append(img.hide());
15141
+
15142
+ rhandlec.css('position', 'absolute')
15143
+ .append('<div class="'+hline+' '+hline+'-top"/>',
15144
+ '<div class="'+hline+' '+hline+'-bottom"/>',
15145
+ '<div class="'+vline+' '+vline+'-left"/>',
15146
+ '<div class="'+vline+' '+vline+'-right"/>',
15147
+ '<div class="'+rpoint+' '+rpoint+'-n"/>',
15148
+ '<div class="'+rpoint+' '+rpoint+'-e"/>',
15149
+ '<div class="'+rpoint+' '+rpoint+'-s"/>',
15150
+ '<div class="'+rpoint+' '+rpoint+'-w"/>',
15151
+ '<div class="'+rpoint+' '+rpoint+'-ne"/>',
15152
+ '<div class="'+rpoint+' '+rpoint+'-se"/>',
15153
+ '<div class="'+rpoint+' '+rpoint+'-sw"/>',
15154
+ '<div class="'+rpoint+' '+rpoint+'-nw"/>');
15155
+
15156
+ preview.append(basec.css('position', 'absolute').hide().append(imgc, rhandlec.append(coverc)));
15157
+
15158
+ preview.append(imgr.hide());
15159
+
15160
+ preview.css('overflow', 'hidden');
15161
+
15162
+ dialog.append(preview, control);
15163
+
15164
+ buttons[fm.i18n('btnApply')] = save;
15165
+ buttons[fm.i18n('btnCancel')] = function() { dialog.elfinderdialog('close'); };
15166
+
15167
+ fm.dialog(dialog, {
15168
+ title : fm.escape(file.name),
15169
+ width : 650,
15170
+ resizable : false,
15171
+ destroyOnClose : true,
15172
+ buttons : buttons,
15173
+ open : function() {
15174
+ var dw = dialog.width() - 20;
15175
+ (preview.width() > dw) && preview.width(dw);
15176
+ preview.zIndex(1+$(this).parent().zIndex());
15177
+ pwidth = preview.width() - (rhandle.outerWidth() - rhandle.width());
15178
+ pheight = preview.height() - (rhandle.outerHeight() - rhandle.height());
15179
+ img.attr('src', src + (src.indexOf('?') === -1 ? '?' : '&')+'_='+Math.random());
15180
+ imgc.attr('src', img.attr('src'));
15181
+ imgr.attr('src', img.attr('src'));
15182
+ }
15183
+ }).attr('id', id);
15184
+
15185
+ // for IE < 9 dialog mising at open second+ time.
15186
+ if (fm.UA.ltIE8) {
15187
+ $('.elfinder-dialog').css('filter', '');
15188
+ }
15189
+
15190
+ reset.css('left', width.position().left + width.width() + 12);
15191
+
15192
+ coverc.css({ 'opacity': 0.2, 'background-color': '#fff', 'position': 'absolute'}),
15193
+ rhandlec.css('cursor', 'move');
15194
+ rhandlec.find('.elfinder-resize-handle-point').css({
15195
+ 'background-color' : '#fff',
15196
+ 'opacity': 0.5,
15197
+ 'border-color':'#000'
15198
+ });
15199
+
15200
+ imgr.css('cursor', 'pointer');
15201
+
15202
+ uitype.buttonset();
15203
+
15204
+ },
15205
+
15206
+ id, dialog
15207
+ ;
15208
+
15209
+
15210
+ if (!files.length || files[0].mime.indexOf('image/') === -1) {
15211
+ return dfrd.reject();
15212
+ }
15213
+
15214
+ id = 'resize-'+fm.namespace+'-'+files[0].hash;
15215
+ dialog = fm.getUI().find('#'+id);
15216
+
15217
+ if (dialog.length) {
15218
+ dialog.elfinderdialog('toTop');
15219
+ return dfrd.resolve();
15220
+ }
15221
+
15222
+ open(files[0], id);
15223
+
15224
+ return dfrd;
15225
+ };
15226
+
15227
+ };
15228
+
15229
+ (function ($) {
15230
+
15231
+ var findProperty = function (styleObject, styleArgs) {
15232
+ var i = 0 ;
15233
+ for( i in styleArgs) {
15234
+ if (typeof styleObject[styleArgs[i]] != 'undefined')
15235
+ return styleArgs[i];
15236
+ }
15237
+ styleObject[styleArgs[i]] = '';
15238
+ return styleArgs[i];
15239
+ };
15240
+
15241
+ $.cssHooks.rotate = {
15242
+ get: function(elem, computed, extra) {
15243
+ return $(elem).rotate();
15244
+ },
15245
+ set: function(elem, value) {
15246
+ $(elem).rotate(value);
15247
+ return value;
15248
+ }
15249
+ };
15250
+ $.cssHooks.transform = {
15251
+ get: function(elem, computed, extra) {
15252
+ var name = findProperty( elem.style ,
15253
+ ['WebkitTransform', 'MozTransform', 'OTransform' , 'msTransform' , 'transform'] );
15254
+ return elem.style[name];
15255
+ },
15256
+ set: function(elem, value) {
15257
+ var name = findProperty( elem.style ,
15258
+ ['WebkitTransform', 'MozTransform', 'OTransform' , 'msTransform' , 'transform'] );
15259
+ elem.style[name] = value;
15260
+ return value;
15261
+ }
15262
+ };
15263
+
15264
+ $.fn.rotate = function(val) {
15265
+ if (typeof val == 'undefined') {
15266
+ if (!!window.opera) {
15267
+ var r = this.css('transform').match(/rotate\((.*?)\)/);
15268
+ return ( r && r[1])?
15269
+ Math.round(parseFloat(r[1]) * 180 / Math.PI) : 0;
15270
+ } else {
15271
+ var r = this.css('transform').match(/rotate\((.*?)\)/);
15272
+ return ( r && r[1])? parseInt(r[1]) : 0;
15273
+ }
15274
+ }
15275
+ this.css('transform',
15276
+ this.css('transform').replace(/none|rotate\(.*?\)/, '') + 'rotate(' + parseInt(val) + 'deg)');
15277
+ return this;
15278
+ };
15279
+
15280
+ $.fx.step.rotate = function(fx) {
15281
+ if ( fx.state == 0 ) {
15282
+ fx.start = $(fx.elem).rotate();
15283
+ fx.now = fx.start;
15284
+ }
15285
+ $(fx.elem).rotate(fx.now);
15286
+ };
15287
+
15288
+ if (typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined") { // IE & IE<9
15289
+ var GetAbsoluteXY = function(element) {
15290
+ var pnode = element;
15291
+ var x = pnode.offsetLeft;
15292
+ var y = pnode.offsetTop;
15293
+
15294
+ while ( pnode.offsetParent ) {
15295
+ pnode = pnode.offsetParent;
15296
+ if (pnode != document.body && pnode.currentStyle['position'] != 'static') {
15297
+ break;
15298
+ }
15299
+ if (pnode != document.body && pnode != document.documentElement) {
15300
+ x -= pnode.scrollLeft;
15301
+ y -= pnode.scrollTop;
15302
+ }
15303
+ x += pnode.offsetLeft;
15304
+ y += pnode.offsetTop;
15305
+ }
15306
+
15307
+ return { x: x, y: y };
15308
+ };
15309
+
15310
+ var StaticToAbsolute = function (element) {
15311
+ if ( element.currentStyle['position'] != 'static') {
15312
+ return ;
15313
+ }
15314
+
15315
+ var xy = GetAbsoluteXY(element);
15316
+ element.style.position = 'absolute' ;
15317
+ element.style.left = xy.x + 'px';
15318
+ element.style.top = xy.y + 'px';
15319
+ };
15320
+
15321
+ var IETransform = function(element,transform){
15322
+
15323
+ var r;
15324
+ var m11 = 1;
15325
+ var m12 = 1;
15326
+ var m21 = 1;
15327
+ var m22 = 1;
15328
+
15329
+ if (typeof element.style['msTransform'] != 'undefined'){
15330
+ return true;
15331
+ }
15332
+
15333
+ StaticToAbsolute(element);
15334
+
15335
+ r = transform.match(/rotate\((.*?)\)/);
15336
+ var rotate = ( r && r[1]) ? parseInt(r[1]) : 0;
15337
+
15338
+ rotate = rotate % 360;
15339
+ if (rotate < 0) rotate = 360 + rotate;
15340
+
15341
+ var radian= rotate * Math.PI / 180;
15342
+ var cosX =Math.cos(radian);
15343
+ var sinY =Math.sin(radian);
15344
+
15345
+ m11 *= cosX;
15346
+ m12 *= -sinY;
15347
+ m21 *= sinY;
15348
+ m22 *= cosX;
15349
+
15350
+ element.style.filter = (element.style.filter || '').replace(/progid:DXImageTransform\.Microsoft\.Matrix\([^)]*\)/, "" ) +
15351
+ ("progid:DXImageTransform.Microsoft.Matrix(" +
15352
+ "M11=" + m11 +
15353
+ ",M12=" + m12 +
15354
+ ",M21=" + m21 +
15355
+ ",M22=" + m22 +
15356
+ ",FilterType='bilinear',sizingMethod='auto expand')")
15357
+ ;
15358
+
15359
+ var ow = parseInt(element.style.width || element.width || 0 );
15360
+ var oh = parseInt(element.style.height || element.height || 0 );
15361
+
15362
+ var radian = rotate * Math.PI / 180;
15363
+ var absCosX =Math.abs(Math.cos(radian));
15364
+ var absSinY =Math.abs(Math.sin(radian));
15365
+
15366
+ var dx = (ow - (ow * absCosX + oh * absSinY)) / 2;
15367
+ var dy = (oh - (ow * absSinY + oh * absCosX)) / 2;
15368
+
15369
+ element.style.marginLeft = Math.floor(dx) + "px";
15370
+ element.style.marginTop = Math.floor(dy) + "px";
15371
+
15372
+ return(true);
15373
+ };
15374
+
15375
+ var transform_set = $.cssHooks.transform.set;
15376
+ $.cssHooks.transform.set = function(elem, value) {
15377
+ transform_set.apply(this, [elem, value] );
15378
+ IETransform(elem,value);
15379
+ return value;
15380
+ };
15381
+ }
15382
+
15383
+ })(jQuery);
15384
+
15385
+
15386
+ /*
15387
+ * File: /js/commands/rm.js
15388
+ */
15389
+
15390
+ /**
15391
+ * @class elFinder command "rm"
15392
+ * Delete files
15393
+ *
15394
+ * @author Dmitry (dio) Levashov
15395
+ **/
15396
+ elFinder.prototype.commands.rm = function() {
15397
+
15398
+ this.shortcuts = [{
15399
+ pattern : 'delete ctrl+backspace'
15400
+ }];
15401
+
15402
+ this.getstate = function(sel) {
15403
+ var fm = this.fm;
15404
+ sel = sel || fm.selected();
15405
+ return !this._disabled && sel.length && $.map(sel, function(h) { var f = fm.file(h); return f && f.phash && !f.locked ? h : null }).length == sel.length
15406
+ ? 0 : -1;
15407
+ }
15408
+
15409
+ this.exec = function(hashes) {
15410
+ var self = this,
15411
+ fm = this.fm,
15412
+ dfrd = $.Deferred()
15413
+ .fail(function(error) {
15414
+ error && fm.error(error);
15415
+ }),
15416
+ files = this.files(hashes),
15417
+ cnt = files.length,
15418
+ cwd = fm.cwd().hash,
15419
+ tpl = '<div class="ui-helper-clearfix elfinder-rm-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}<div class="elfinder-rm-desc">{desc}</div></div>',
15420
+ targets, text, f, fname, size, tmb, descs, dialog;
15421
+
15422
+ if (!cnt || this._disabled) {
15423
+ return dfrd.reject();
15424
+ }
15425
+
15426
+ $.each(files, function(i, file) {
15427
+ if (!file.phash) {
15428
+ return !dfrd.reject(['errRm', file.name, 'errPerm']);
15429
+ }
15430
+ if (file.locked) {
15431
+ return !dfrd.reject(['errLocked', file.name]);
15432
+ }
15433
+ });
15434
+
15435
+ if (dfrd.state() == 'pending') {
15436
+ targets = this.hashes(hashes);
15437
+ cnt = files.length;
15438
+ descs = [];
15439
+
15440
+ if (cnt > 1) {
15441
+ if (!$.map(files, function(f) { return f.mime == 'directory' ? 1 : null ; }).length) {
15442
+ size = 0;
15443
+ $.each(files, function(h, f) {
15444
+ if (f.size && f.size != 'unknown') {
15445
+ var s = parseInt(f.size);
15446
+ if (s >= 0 && size >= 0) {
15447
+ size += s;
15448
+ }
15449
+ } else {
15450
+ size = 'unknown';
15451
+ return false;
15452
+ }
15453
+ });
15454
+ descs.push(fm.i18n('size')+': '+fm.formatSize(size));
15455
+ }
15456
+ text = [$(tpl.replace('{class}', 'elfinder-cwd-icon-group').replace('{title}', '<strong>' + fm.i18n('items')+ ': ' + cnt + '</strong>').replace('{desc}', descs.join('<br>')))];
15457
+ } else {
15458
+ f = files[0];
15459
+ if (f.tmb) {
15460
+ tmb = fm.option('tmbUrl')+f.tmb;
15461
+ }
15462
+ if (f.size) {
15463
+ descs.push(fm.i18n('size')+': '+fm.formatSize(f.size));
15464
+ }
15465
+ descs.push(fm.i18n('modify')+': '+fm.formatDate(f));
15466
+ fname = fm.escape(f.i18 || f.name).replace(/([_.])/g, '&#8203;$1');
15467
+ text = [$(tpl.replace('{class}', fm.mime2class(f.mime)).replace('{title}', '<strong>' + fname + '</strong>').replace('{desc}', descs.join('<br>')))];
15468
+
15469
+ }
15470
+
15471
+ text.push('confirmRm');
15472
+
15473
+ fm.lockfiles({files : targets});
15474
+ dialog = fm.confirm({
15475
+ title : self.title,
15476
+ text : text,
15477
+ accept : {
15478
+ label : 'btnRm',
15479
+ callback : function() {
15480
+ fm.request({
15481
+ data : {cmd : 'rm', targets : targets},
15482
+ notify : {type : 'rm', cnt : cnt},
15483
+ preventFail : true
15484
+ })
15485
+ .fail(function(error) {
15486
+ dfrd.reject(error);
15487
+ })
15488
+ .done(function(data) {
15489
+ dfrd.done(data);
15490
+ })
15491
+ .always(function() {
15492
+ fm.unlockfiles({files : targets});
15493
+ });
15494
+ }
15495
+ },
15496
+ cancel : {
15497
+ label : 'btnCancel',
15498
+ callback : function() {
15499
+ fm.unlockfiles({files : targets});
15500
+ fm.selectfiles({files : targets});
15501
+ dfrd.reject();
15502
+ }
15503
+ }
15504
+ });
15505
+ // load thumbnail
15506
+ if (tmb) {
15507
+ $('<img/>')
15508
+ .load(function() { dialog.find('.elfinder-cwd-icon').css('background', 'url("'+tmb+'") center center no-repeat'); })
15509
+ .attr('src', tmb);
15510
+ }
15511
+ }
15512
+
15513
+ return dfrd;
15514
+ }
15515
+
15516
+ }
15517
+
15518
+ /*
15519
+ * File: /js/commands/search.js
15520
+ */
15521
+
15522
+ /**
15523
+ * @class elFinder command "search"
15524
+ * Find files
15525
+ *
15526
+ * @author Dmitry (dio) Levashov
15527
+ **/
15528
+ elFinder.prototype.commands.search = function() {
15529
+ this.title = 'Find files';
15530
+ this.options = {ui : 'searchbutton'}
15531
+ this.alwaysEnabled = true;
15532
+ this.updateOnSelect = false;
15533
+
15534
+ /**
15535
+ * Return command status.
15536
+ * Search does not support old api.
15537
+ *
15538
+ * @return Number
15539
+ **/
15540
+ this.getstate = function() {
15541
+ return 0;
15542
+ }
15543
+
15544
+ /**
15545
+ * Send search request to backend.
15546
+ *
15547
+ * @param String search string
15548
+ * @return $.Deferred
15549
+ **/
15550
+ this.exec = function(q, target, mime) {
15551
+ var fm = this.fm;
15552
+
15553
+ if (typeof q == 'string' && q) {
15554
+ if (typeof target == 'object') {
15555
+ mime = target.mime || '';
15556
+ target = target.target || '';
15557
+ }
15558
+ target = target? target : '';
15559
+ mime = mime? $.trim(mime).replace(',', ' ').split(' ') : [];
15560
+ $.each(mime, function(){ return $.trim(this); });
15561
+ fm.trigger('searchstart', {query : q, target : target, mimes : mime});
15562
+
15563
+ return fm.request({
15564
+ data : {cmd : 'search', q : q, target : target, mimes : mime},
15565
+ notify : {type : 'search', cnt : 1, hideCnt : true}
15566
+ });
15567
+ }
15568
+ fm.getUI('toolbar').find('.'+fm.res('class', 'searchbtn')+' :text').focus();
15569
+ return $.Deferred().reject();
15570
+ }
15571
+
15572
+ }
15573
+
15574
+ /*
15575
+ * File: /js/commands/sort.js
15576
+ */
15577
+
15578
+ /**
15579
+ * @class elFinder command "sort"
15580
+ * Change sort files rule
15581
+ *
15582
+ * @author Dmitry (dio) Levashov
15583
+ **/
15584
+ elFinder.prototype.commands.sort = function() {
15585
+ var self = this,
15586
+ fm = self.fm,
15587
+ timer;
15588
+
15589
+ /**
15590
+ * Command options
15591
+ *
15592
+ * @type Object
15593
+ */
15594
+ this.options = {ui : 'sortbutton'};
15595
+
15596
+ fm.bind('open sortchange', function() {
15597
+ self.variants = [];
15598
+ $.each(fm.sortRules, function(name, value) {
15599
+ var sort = {
15600
+ type : name,
15601
+ order : name == fm.sortType ? fm.sortOrder == 'asc' ? 'desc' : 'asc' : fm.sortOrder
15602
+ };
15603
+ var arr = name == fm.sortType ? (sort.order == 'asc'? 'n' : 's') : '';
15604
+ self.variants.push([sort, (arr? '<span class="ui-icon ui-icon-arrowthick-1-'+arr+'"></span>' : '') + '&nbsp;' + fm.i18n('sort'+name)]);
15605
+ });
15606
+ });
15607
+
15608
+ fm.bind('open sortchange viewchange search searchend', function() {
15609
+ timer && clearTimeout(timer);
15610
+ timer = setTimeout(function(){
15611
+ var cols = $(fm.cwd).find('div.elfinder-cwd-wrapper-list table');
15612
+ if (cols.length) {
15613
+ $.each(fm.sortRules, function(name, value) {
15614
+ var td = cols.find('thead tr td.elfinder-cwd-view-th-'+name);
15615
+ if (td.length) {
15616
+ var current = ( name == fm.sortType),
15617
+ sort = {
15618
+ type : name,
15619
+ order : current ? fm.sortOrder == 'asc' ? 'desc' : 'asc' : fm.sortOrder
15620
+ },arr;
15621
+ if (current) {
15622
+ td.addClass('ui-state-active');
15623
+ arr = fm.sortOrder == 'asc' ? 'n' : 's';
15624
+ $('<span class="ui-icon ui-icon-triangle-1-'+arr+'"/>').appendTo(td);
15625
+ }
15626
+ $(td).on('click', function(e){
15627
+ e.stopPropagation();
15628
+ self.exec([], sort);
15629
+ })
15630
+ .hover(function() {
15631
+ $(this).addClass('ui-state-hover');
15632
+ },function() {
15633
+ $(this).removeClass('ui-state-hover');
15634
+ });
15635
+ }
15636
+
15637
+ });
15638
+ }
15639
+ }, 100);
15640
+ });
15641
+
15642
+ this.getstate = function() {
15643
+ return 0;
15644
+ };
15645
+
15646
+ this.exec = function(hashes, sortopt) {
15647
+ var fm = this.fm,
15648
+ sort = $.extend({
15649
+ type : fm.sortType,
15650
+ order : fm.sortOrder,
15651
+ stick : fm.sortStickFolders
15652
+ }, sortopt);
15653
+
15654
+ this.fm.setSort(sort.type, sort.order, sort.stick);
15655
+ return $.Deferred().resolve();
15656
+ };
15657
+
15658
+ };
15659
+
15660
+ /*
15661
+ * File: /js/commands/up.js
15662
+ */
15663
+
15664
+ /**
15665
+ * @class elFinder command "up"
15666
+ * Go into parent directory
15667
+ *
15668
+ * @author Dmitry (dio) Levashov
15669
+ **/
15670
+ elFinder.prototype.commands.up = function() {
15671
+ this.alwaysEnabled = true;
15672
+ this.updateOnSelect = false;
15673
+
15674
+ this.shortcuts = [{
15675
+ pattern : 'ctrl+up'
15676
+ }];
15677
+
15678
+ this.getstate = function() {
15679
+ return this.fm.cwd().phash ? 0 : -1;
15680
+ }
15681
+
15682
+ this.exec = function() {
15683
+ return this.fm.cwd().phash ? this.fm.exec('open', this.fm.cwd().phash) : $.Deferred().reject();
15684
+ }
15685
+
15686
+ }
15687
+
15688
+ /*
15689
+ * File: /js/commands/upload.js
15690
+ */
15691
+
15692
+ /**
15693
+ * @class elFinder command "upload"
15694
+ * Upload files using iframe or XMLHttpRequest & FormData.
15695
+ * Dialog allow to send files using drag and drop
15696
+ *
15697
+ * @type elFinder.command
15698
+ * @author Dmitry (dio) Levashov
15699
+ */
15700
+ elFinder.prototype.commands.upload = function() {
15701
+ var hover = this.fm.res('class', 'hover');
15702
+
15703
+ this.disableOnSearch = true;
15704
+ this.updateOnSelect = false;
15705
+
15706
+ // Shortcut opens dialog
15707
+ this.shortcuts = [{
15708
+ pattern : 'ctrl+u'
15709
+ }];
15710
+
15711
+ /**
15712
+ * Return command state
15713
+ *
15714
+ * @return Number
15715
+ **/
15716
+ this.getstate = function(sel) {
15717
+ var fm = this.fm, f,
15718
+ sel = fm.directUploadTarget? [fm.directUploadTarget] : (sel || [fm.cwd().hash]);
15719
+ if (!this._disabled && sel.length == 1) {
15720
+ f = fm.file(sel[0]);
15721
+ }
15722
+ return (f && f.mime == 'directory' && f.write)? 0 : -1;
15723
+ };
15724
+
15725
+
15726
+ this.exec = function(data) {
15727
+ var fm = this.fm,
15728
+ targets = data && (data instanceof Array)? data : null,
15729
+ check = !targets && data && data.target? [ data.target ] : targets,
15730
+ fmUpload = function(data) {
15731
+ fm.upload(data)
15732
+ .fail(function(error) {
15733
+ dfrd.reject(error);
15734
+ })
15735
+ .done(function(data) {
15736
+ var cwd = fm.getUI('cwd');
15737
+ dfrd.resolve(data);
15738
+ if (data && data.added && data.added[0]) {
15739
+ var newItem = cwd.find('#'+fm.cwdHash2Id(data.added[0].hash));
15740
+ if (newItem.length) {
15741
+ newItem.trigger('scrolltoview');
15742
+ }
15743
+ }
15744
+ });
15745
+ },
15746
+ upload = function(data) {
15747
+ dialog.elfinderdialog('close');
15748
+ if (targets) {
15749
+ data.target = targets[0];
15750
+ }
15751
+ fmUpload(data);
15752
+ },
15753
+ dfrd = $.Deferred(),
15754
+ dialog, input, button, dropbox, pastebox, dropUpload, paste;
15755
+
15756
+ if (this.getstate(check) < 0) {
15757
+ return dfrd.reject();
15758
+ }
15759
+
15760
+ dropUpload = function(e) {
15761
+ e.stopPropagation();
15762
+ e.preventDefault();
15763
+ var file = false,
15764
+ type = '',
15765
+ elfFrom = null,
15766
+ mycwd = '',
15767
+ data = null,
15768
+ target = e._target || null;
15769
+ try { elfFrom = e.dataTransfer.getData('elfinderfrom'); } catch(e) {}
15770
+ if (elfFrom) {
15771
+ mycwd = window.location.href + fm.cwd().hash;
15772
+ if ((!target && elfFrom === mycwd) || target === mycwd) {
15773
+ dfrd.reject();
15774
+ return;
15775
+ }
15776
+ }
15777
+ try{
15778
+ data = e.dataTransfer.getData('text/html');
15779
+ } catch(e) {}
15780
+ if (data) {
15781
+ file = [ data ];
15782
+ type = 'html';
15783
+ } else if (e.dataTransfer && e.dataTransfer.items && e.dataTransfer.items.length) {
15784
+ file = e.dataTransfer;
15785
+ type = 'data';
15786
+ } else if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length) {
15787
+ file = e.dataTransfer.files;
15788
+ type = 'files';
15789
+ } else if (data = e.dataTransfer.getData('text')) {
15790
+ file = [ data ];
15791
+ type = 'text';
15792
+ }
15793
+ if (file) {
15794
+ fmUpload({files : file, type : type, target : target});
15795
+ } else {
15796
+ dfrd.reject();
15797
+ }
15798
+ };
15799
+
15800
+ if (!targets && data) {
15801
+ if (data.input || data.files) {
15802
+ data.type = 'files';
15803
+ fmUpload(data);
15804
+ } else if (data.dropEvt) {
15805
+ dropUpload(data.dropEvt);
15806
+ }
15807
+ return dfrd;
15808
+ }
15809
+
15810
+ paste = function(e) {
15811
+ var e = e.originalEvent || e;
15812
+ var files = [], items = [];
15813
+ var file;
15814
+ if (e.clipboardData) {
15815
+ if (e.clipboardData.items && e.clipboardData.items.length){
15816
+ items = e.clipboardData.items;
15817
+ for (var i=0; i < items.length; i++) {
15818
+ if (e.clipboardData.items[i].kind == 'file') {
15819
+ file = e.clipboardData.items[i].getAsFile();
15820
+ files.push(file);
15821
+ }
15822
+ }
15823
+ } else if (e.clipboardData.files && e.clipboardData.files.length) {
15824
+ files = e.clipboardData.files;
15825
+ }
15826
+ if (files.length) {
15827
+ upload({files : files, type : 'files'});
15828
+ return;
15829
+ }
15830
+ }
15831
+ var my = e.target || e.srcElement;
15832
+ setTimeout(function () {
15833
+ if (my.innerHTML) {
15834
+ $(my).find('img').each(function(i, v){
15835
+ if (v.src.match(/^webkit-fake-url:\/\//)) {
15836
+ // For Safari's bug.
15837
+ // ref. https://bugs.webkit.org/show_bug.cgi?id=49141
15838
+ // https://dev.ckeditor.com/ticket/13029
15839
+ $(v).remove();
15840
+ }
15841
+ });
15842
+ var src = my.innerHTML.replace(/<br[^>]*>/gi, ' ');
15843
+ var type = src.match(/<[^>]+>/)? 'html' : 'text';
15844
+ my.innerHTML = '';
15845
+ upload({files : [ src ], type : type});
15846
+ }
15847
+ }, 1);
15848
+ };
15849
+
15850
+ input = $('<input type="file" multiple="true"/>')
15851
+ .change(function() {
15852
+ upload({input : input[0], type : 'files'});
15853
+ })
15854
+ .on('dragover', function(e) {
15855
+ e.originalEvent.dataTransfer.dropEffect = 'copy';
15856
+ });
15857
+
15858
+ button = $('<div class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text">'+fm.i18n('selectForUpload')+'</span></div>')
15859
+ .append($('<form/>').append(input))
15860
+ .hover(function() {
15861
+ button.toggleClass(hover)
15862
+ });
15863
+
15864
+ dialog = $('<div class="elfinder-upload-dialog-wrapper"/>')
15865
+ .append(button);
15866
+
15867
+ pastebox = $('<div class="ui-corner-all elfinder-upload-dropbox" contenteditable="true">'+fm.i18n('dropFilesBrowser')+'</div>')
15868
+ .on('paste drop', function(e){
15869
+ paste(e);
15870
+ })
15871
+ .on('mousedown click', function(){
15872
+ $(this).focus();
15873
+ })
15874
+ .on('focus', function(){
15875
+ this.innerHTML = '';
15876
+ })
15877
+ .on('dragenter mouseover', function(){
15878
+ pastebox.addClass(hover);
15879
+ })
15880
+ .on('dragleave mouseout', function(){
15881
+ pastebox.removeClass(hover);
15882
+ });
15883
+
15884
+ if (fm.dragUpload) {
15885
+ dropbox = $('<div class="ui-corner-all elfinder-upload-dropbox" contenteditable="true">'+fm.i18n('dropPasteFiles')+'</div>')
15886
+ .on('paste', function(e){
15887
+ paste(e);
15888
+ })
15889
+ .on('mousedown click', function(){
15890
+ $(this).focus();
15891
+ })
15892
+ .on('focus', function(){
15893
+ this.innerHTML = '';
15894
+ })
15895
+ .on('mouseover', function(){
15896
+ $(this).addClass(hover);
15897
+ })
15898
+ .on('mouseout', function(){
15899
+ $(this).removeClass(hover);
15900
+ })
15901
+ .prependTo(dialog)
15902
+ .after('<div class="elfinder-upload-dialog-or">'+fm.i18n('or')+'</div>')[0];
15903
+
15904
+ dropbox.addEventListener('dragenter', function(e) {
15905
+ e.stopPropagation();
15906
+ e.preventDefault();
15907
+ $(dropbox).addClass(hover);
15908
+ }, false);
15909
+
15910
+ dropbox.addEventListener('dragleave', function(e) {
15911
+ e.stopPropagation();
15912
+ e.preventDefault();
15913
+ $(dropbox).removeClass(hover);
15914
+ }, false);
15915
+
15916
+ dropbox.addEventListener('dragover', function(e) {
15917
+ e.stopPropagation();
15918
+ e.preventDefault();
15919
+ e.dataTransfer.dropEffect = 'copy';
15920
+ $(dropbox).addClass(hover);
15921
+ }, false);
15922
+
15923
+ dropbox.addEventListener('drop', function(e) {
15924
+ dialog.elfinderdialog('close');
15925
+ targets && (e._target = targets[0]);
15926
+ dropUpload(e);
15927
+ }, false);
15928
+
15929
+ } else {
15930
+ pastebox
15931
+ .prependTo(dialog)
15932
+ .after('<div class="elfinder-upload-dialog-or">'+fm.i18n('or')+'</div>')[0];
15933
+
15934
+ }
15935
+
15936
+ fm.dialog(dialog, {
15937
+ title : this.title + (targets? ' - ' + fm.escape(fm.file(targets[0]).name) : ''),
15938
+ modal : true,
15939
+ resizable : false,
15940
+ destroyOnClose : true
15941
+ });
15942
+
15943
+ return dfrd;
15944
+ };
15945
+
15946
+ };
15947
+
15948
+ /*
15949
+ * File: /js/commands/view.js
15950
+ */
15951
+
15952
+ /**
15953
+ * @class elFinder command "view"
15954
+ * Change current directory view (icons/list)
15955
+ *
15956
+ * @author Dmitry (dio) Levashov
15957
+ **/
15958
+ elFinder.prototype.commands.view = function() {
15959
+ this.value = this.fm.viewType;
15960
+ this.alwaysEnabled = true;
15961
+ this.updateOnSelect = false;
15962
+
15963
+ this.options = { ui : 'viewbutton'};
15964
+
15965
+ this.getstate = function() {
15966
+ return 0;
15967
+ }
15968
+
15969
+ this.exec = function() {
15970
+ var value = this.fm.storage('view', this.value == 'list' ? 'icons' : 'list');
15971
+ this.fm.viewchange();
15972
+ this.update(void(0), value);
15973
+ }
15974
+
15975
+ }
15976
+ })(jQuery);
elFinder/js/elfinder.min.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * elFinder - file manager for web
3
+ * Version 2.1.6 (2016-01-19)
4
+ * http://elfinder.org
5
+ *
6
+ * Copyright 2009-2016, Studio 42
7
+ * Licensed under a 3 clauses BSD license
8
+ */
9
+ !function(e){window.elFinder=function(t,n){var i,a,r,o=this,t=e(t),s=e("<div/>").append(t.contents()),l=t.attr("style"),d=t.attr("id")||"",c="elfinder-"+(d||Math.random().toString().substr(2,7)),u="mousedown."+c,p="keydown."+c,h="keypress."+c,f=!0,m=!0,g="",v={path:"",url:"",tmbUrl:"",disabled:[],separator:"/",archives:[],extract:[],copyOverwrite:!0,uploadOverwrite:!0,uploadMaxSize:0,jpgQuality:100,tmb:!1},b={},y=[],w={},x={},k=[],C=[],T=[],I=new o.command(o),F="auto",M=400,P="./sounds/",S=e(document.createElement("audio")).hide().appendTo("body")[0],z="",A=function(t){var n,i,a={},r={};o.commandMap=t.options.uiCmdMap&&Object.keys(t.options.uiCmdMap).length?t.options.uiCmdMap:{},z!==JSON.stringify(o.commandMap)&&(z=JSON.stringify(o.commandMap),Object.keys(o.commandMap).length&&(i=o.getUI("contextmenu"),i.data("cmdMaps")||i.data("cmdMaps",{}),n=t.cwd?t.cwd.volumeid:null,n&&!i.data("cmdMaps")[n]&&(i.data("cmdMaps")[n]=o.commandMap))),t.init?b={}:(e.each(Object.keys(b),function(t,n){var i="directory"===b[n].mime,s=b[n].phash;o.res("class","navcollapse"),(!i||a[s]||!r[s]&&e("#"+o.navHash2Id(b[n].hash)).is(":hidden")&&e("#"+o.navHash2Id(s)).next(".elfinder-navbar-subtree").children().length>100)&&(i||s===g)&&-1===e.inArray(n,C)?(i&&!a[s]&&(a[s]=!0),delete b[n]):i&&(r[s]=!0)}),e.each(Object.keys(a),function(t,n){var i="elfinder-subtree-loaded "+o.res("class","navexpand");e("#"+o.navHash2Id(n)).removeClass(i).next(".elfinder-navbar-subtree").empty()})),g=t.cwd.hash,D(t.files),b[g]||D([t.cwd]),o.lastDir(g),o.autoSync()},D=function(e){var t,n,i=e.length;for(n=0;i>n;n++)if(t=e[n],t.name&&t.hash&&t.mime){if(!t.phash){var a="volume_"+t.name,r=o.i18n(a);a!=r&&(t.i18=r),t.volumeid&&(t.disabled&&(o.disabledCmds[t.volumeid]=t.disabled),o.tmbUrls[t.volumeid]=o.option("tmbUrl"))}b[t.hash]=t}},O=function(t){var n=t.keyCode,i=!(!t.ctrlKey&&!t.metaKey);f&&(e.each(x,function(e,a){a.type==t.type&&a.keyCode==n&&a.shiftKey==t.shiftKey&&a.ctrlKey==i&&a.altKey==t.altKey&&(t.preventDefault(),t.stopPropagation(),a.callback(t,o),o.debug("shortcut-exec",e+" : "+a.description))}),9!=n||e(t.target).is(":input")||t.preventDefault(),27==n&&o.clipboard().length&&o.clipboard([]))},U=new Date;return this.api=null,this.newAPI=!1,this.oldAPI=!1,this.netDrivers=[],this.OS=-1!==navigator.userAgent.indexOf("Mac")?"mac":-1!==navigator.userAgent.indexOf("Win")?"win":"other",this.UA=function(){var e=!document.uniqueID&&!window.opera&&!window.sidebar&&window.localStorage&&"undefined"==typeof window.orientation;return{ltIE6:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.documentElement.style.maxHeight,ltIE7:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.querySelectorAll,ltIE8:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.getElementsByClassName,IE:document.uniqueID,Firefox:window.sidebar,Opera:window.opera,Webkit:e,Chrome:e&&window.chrome,Safari:e&&!window.chrome,Mobile:"undefined"!=typeof window.orientation,Touch:"undefined"!=typeof window.ontouchstart}}(),this.options=e.extend(!0,{},this._options,n||{}),n.ui&&(this.options.ui=n.ui),n.commands&&(this.options.commands=n.commands),n.uiOptions&&n.uiOptions.toolbar&&(this.options.uiOptions.toolbar=n.uiOptions.toolbar),n.uiOptions&&n.uiOptions.cwd&&n.uiOptions.cwd.listView&&n.uiOptions.cwd.listView.columns&&(this.options.uiOptions.cwd.listView.columns=n.uiOptions.cwd.listView.columns),n.uiOptions&&n.uiOptions.cwd&&n.uiOptions.cwd.listView&&n.uiOptions.cwd.listView.columnsCustomName&&(this.options.uiOptions.cwd.listView.columnsCustomName=n.uiOptions.cwd.listView.columnsCustomName),function(){var t,i=document.createElement("a");i.href=n.url,n.urlUpload&&n.urlUpload!==n.url&&(t=document.createElement("a"),t.href=n.urlUpload),(window.location.host!==i.host||t&&window.location.host!==t.host)&&(e.isPlainObject(o.options.customHeaders)||(o.options.customHeaders={}),e.isPlainObject(o.options.xhrFields)||(o.options.xhrFields={}),o.options.requestType="post",o.options.customHeaders["X-Requested-With"]="XMLHttpRequest",o.options.xhrFields.withCredentials=!0)}(),e.extend(this.options.contextmenu,n.contextmenu),this.requestType=/^(get|post)$/i.test(this.options.requestType)?this.options.requestType.toLowerCase():"get",this.customData=e.isPlainObject(this.options.customData)?this.options.customData:{},this.customHeaders=e.isPlainObject(this.options.customHeaders)?this.options.customHeaders:{},this.xhrFields=e.isPlainObject(this.options.xhrFields)?this.options.xhrFields:{},this.id=d,this.navPrefix="nav"+(elFinder.prototype.uniqueid?elFinder.prototype.uniqueid:"")+"-",this.cwdPrefix=elFinder.prototype.uniqueid?"cwd"+elFinder.prototype.uniqueid+"-":"",++elFinder.prototype.uniqueid,this.uploadURL=n.urlUpload||n.url,this.namespace=c,this.lang=this.i18[this.options.lang]&&this.i18[this.options.lang].messages?this.options.lang:"en",r="en"==this.lang?this.i18.en:e.extend(!0,{},this.i18.en,this.i18[this.lang]),this.direction=r.direction,this.messages=r.messages,this.dateFormat=this.options.dateFormat||r.dateFormat,this.fancyFormat=this.options.fancyDateFormat||r.fancyDateFormat,this.today=new Date(U.getFullYear(),U.getMonth(),U.getDate()).getTime()/1e3,this.yesterday=this.today-86400,a=this.options.UTCDate?"UTC":"",this.getHours="get"+a+"Hours",this.getMinutes="get"+a+"Minutes",this.getSeconds="get"+a+"Seconds",this.getDate="get"+a+"Date",this.getDay="get"+a+"Day",this.getMonth="get"+a+"Month",this.getFullYear="get"+a+"FullYear",this.cssClass="ui-helper-reset ui-helper-clearfix ui-widget ui-widget-content ui-corner-all elfinder elfinder-"+("rtl"==this.direction?"rtl":"ltr")+" "+this.options.cssClass,this.storage=function(){try{return"localStorage"in window&&null!==window.localStorage?o.localStorage:o.cookie}catch(e){return o.cookie}}(),this.viewType=this.storage("view")||this.options.defaultView||"icons",this.sortType=this.storage("sortType")||this.options.sortType||"name",this.sortOrder=this.storage("sortOrder")||this.options.sortOrder||"asc",this.sortStickFolders=this.storage("sortStickFolders"),this.sortStickFolders=null===this.sortStickFolders?!!this.options.sortStickFolders:!!this.sortStickFolders,this.sortRules=e.extend(!0,{},this._sortRules,this.options.sortsRules),e.each(this.sortRules,function(e,t){"function"!=typeof t&&delete o.sortRules[e]}),this.compare=e.proxy(this.compare,this),this.notifyDelay=this.options.notifyDelay>0?parseInt(this.options.notifyDelay):500,this.draggingUiHelper=null,this.draggable={appendTo:"body",addClasses:!0,delay:30,distance:8,revert:!0,refreshPositions:!1,cursor:"crosshair",cursorAt:{left:50,top:47},start:function(t,n){var i,a,r=e.map(n.helper.data("files")||[],function(e){return e||null}),s=!1;for(o.draggingUiHelper=n.helper,i=r.length;i--;)if(a=r[i],b[a].locked){s=!0,n.helper.data("locked",!0);break}!s&&o.trigger("lockfiles",{files:r})},drag:function(t,n){var i=n.helper;i.data("refreshPositions")&&e(this).draggable("instance")&&(i.data("refreshPositions")>0?(e(this).draggable("option",{refreshPositions:!0}),i.data("refreshPositions",-1)):(e(this).draggable("option",{refreshPositions:!1}),i.data("refreshPositions",null)))},stop:function(t,n){var i;e(this).draggable("instance")&&e(this).draggable("option",{refreshPositions:!1}),o.draggingUiHelper=null,o.trigger("focus").trigger("dragstop"),n.helper.data("droped")||(i=e.map(n.helper.data("files")||[],function(e){return e||null}),o.trigger("unlockfiles",{files:i}),o.trigger("selectfiles",{files:i}))},helper:function(t){var n,i,a,r=this.id?e(this):e(this).parents("[id]:first"),s=e('<div class="elfinder-drag-helper"><span class="elfinder-drag-helper-icon-status"/></div>'),l=function(t){var n,i=t.mime;return n='<div class="elfinder-cwd-icon '+o.mime2class(i)+' ui-corner-all"/>',t.tmb&&1!==t.tmb&&(n=e(n).css("background","url('"+o.option("tmbUrl")+t.tmb+"') center center no-repeat").get(0).outerHTML),n};return o.draggingUiHelper&&o.draggingUiHelper.stop(!0,!0),o.trigger("dragstart",{target:r[0],originalEvent:t}),n=r.hasClass(o.res("class","cwdfile"))?o.selected():[o.navId2Hash(r.attr("id"))],s.append(l(b[n[0]])).data("files",n).data("locked",!1).data("droped",!1).data("namespace",o.namespace).data("dropover",0),(i=n.length)>1&&s.append(l(b[n[i-1]])+'<span class="elfinder-drag-num">'+i+"</span>"),e(document).on(p+" keyup."+c,function(e){var t=e.shiftKey||e.ctrlKey||e.metaKey;a!==t&&(a=t,s.is(":visible")&&s.data("dropover")&&!s.data("droped")&&(s.toggleClass("elfinder-drag-helper-plus",s.data("locked")?!0:a),o.trigger(a?"unlockfiles":"lockfiles",{files:n,helper:s})))}),s}},this.droppable={greedy:!0,tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file,.elfinder-cwd-filename",hoverClass:this.res("class","adroppable"),autoDisable:!0,drop:function(t,n){var i,a,r,s=e(this),l=e.map(n.helper.data("files")||[],function(e){return e||null}),d=[],c=[],u=[],p=n.helper.hasClass("elfinder-drag-helper-plus"),h="class";if(n.helper.data("namespace")!==o.namespace)return!1;for(a=s.hasClass(o.res(h,"cwdfile"))?o.cwdId2Hash(s.attr("id")):s.hasClass(o.res(h,"navdir"))?o.navId2Hash(s.attr("id")):g,i=l.length;i--;)r=l[i],r!=a&&b[r].phash!=a?d.push(r):(p&&r!==a&&b[a].write?c:u).push(r);return u.length?!1:(n.helper.data("droped",!0),c.length&&(n.helper.hide(),o.exec("duplicate",c)),d.length&&(n.helper.hide(),o.clipboard(d,!p),o.exec("paste",a,void 0,a).always(function(){o.trigger("unlockfiles",{files:l})}),o.trigger("drop",{files:l})),void 0)}},this.enabled=function(){return t.is(":visible")&&f},this.visible=function(){return t.is(":visible")},this.root=function(e){for(var t,n=b[e||g];n&&n.phash;)n=b[n.phash];if(n)return n.hash;for(;t in b&&b.hasOwnProperty(t);)if(n=b[t],!n.phash&&"directory"==!n.mime&&n.read)return n.hash;return""},this.cwd=function(){return b[g]||{}},this.option=function(e){return v[e]||""},this.file=function(e){return b[e]},this.files=function(){return e.extend(!0,{},b)},this.parents=function(e){for(var t,n=[];t=this.file(e);)n.unshift(t.hash),e=t.phash;return n},this.path2array=function(e,t){for(var n,i=[];e&&(n=b[e])&&n.hash;)i.unshift(t&&n.i18?n.i18:n.name),e=n.phash;return i},this.path=function(e,t){return b[e]&&b[e].path?b[e].path:this.path2array(e,t).join(v.separator)},this.url=function(t){var n=b[t];if(!n||!n.read)return"";if("1"==n.url&&this.request({data:{cmd:"url",target:t},preventFail:!0,options:{async:!1}}).done(function(e){n.url=e.url||""}).fail(function(){n.url=""}),n.url)return n.url;if(v.url)return v.url+e.map(this.path2array(t),function(e){return encodeURIComponent(e)}).slice(1).join("/");var i=e.extend({},this.customData,{cmd:"file",target:n.hash});return this.oldAPI&&(i.cmd="open",i.current=n.phash),this.options.url+(-1===this.options.url.indexOf("?")?"?":"&")+e.param(i,!0)},this.convAbsUrl=function(e){if(e.match(/^http/i))return e;var t,n=window.location.protocol+"//"+window.location.host,i=/[^\/]+\/\.\.\//;for(t="/"===e.substr(0,1)?n+e:n+window.location.pathname+e,t=t.replace("/./","/");i.test(t);)t=t.replace(i,"");return t},this.openUrl=function(t,n){var i=b[t],a="";if(!i||!i.read)return"";if(!n)if(i.url){if(1!=i.url)return i.url}else if(v.url)return v.url+e.map(this.path2array(t),function(e){return encodeURIComponent(e)}).slice(1).join("/");return a=this.options.url,a=a+(-1===a.indexOf("?")?"?":"&")+(this.oldAPI?"cmd=open&current="+i.phash:"cmd=file")+"&target="+i.hash,n&&(a+="&download=1"),e.each(this.options.customData,function(e,t){a+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)}),a},this.tmb=function(t){var n=b[t],i=function(t){var n=v.tmbUrl;return e.each(o.tmbUrls,function(e){return 0===t.indexOf(e)?(n=o.tmbUrls[e],!1):void 0}),n},a=o.tmbUrls._search&&0!==t.indexOf(o.cwd().volumeid)?i(t):v.tmbUrl,r=n&&n.tmb&&1!=n.tmb?a+n.tmb:"";return r},this.selected=function(){return y.slice(0)},this.selectedFiles=function(){return e.map(y,function(t){return b[t]?e.extend({},b[t]):null})},this.fileByName=function(e,t){var n;for(n in b)if(b.hasOwnProperty(n)&&b[n].phash==t&&b[n].name==e)return b[n]},this.validResponse=function(e,t){return t.error||this.rules[this.rules[e]?e:"defaults"](t)},this.returnBytes=function(e){var t;return isNaN(e)?(e=e.replace(/b$/i,""),t=e.charAt(e.length-1).toLowerCase(),e=e.replace(/[tgmk]$/i,""),"t"==t?e=1024*1024*1024*1024*e:"g"==t?e=1024*1024*1024*e:"m"==t?e=1024*1024*e:"k"==t&&(e=1024*e),e=isNaN(e)?0:parseInt(e)):(e=parseInt(e),1>e&&(e=0)),e},this.request=function(t){var n,i,a,r=this,o=this.options,s=e.Deferred(),l=e.extend({},o.customData,{mimes:o.onlyMimes},t.data||t),d=l.cmd,c=!(t.preventDefault||t.preventFail),u=!(t.preventDefault||t.preventDone),p=e.extend({},t.notify),h=!!t.raw,f=t.syncOnFail,t=e.extend({url:o.url,async:!0,type:this.requestType,dataType:"json",cache:!1,data:l,headers:this.customHeaders,xhrFields:this.xhrFields},t.options||{}),m=function(t){t.warning&&r.error(t.warning),"open"==d&&A(e.extend(!0,{},t)),t.removed&&t.removed.length&&r.remove(t),t.added&&t.added.length&&r.add(t),t.changed&&t.changed.length&&r.change(t),r.trigger(d,t),t.sync&&r.sync()},g=function(e,t){var n;switch(t){case"abort":n=e.quiet?"":["errConnect","errAbort"];break;case"timeout":n=["errConnect","errTimeout"];break;case"parsererror":n=["errResponse","errDataNotJSON"];break;default:n=403==e.status?["errConnect","errAccess"]:404==e.status?["errConnect","errNotFound"]:"errConnect"}s.reject(n,e,t)},b=function(t){return r.currentReqCmd=d,h?s.resolve(t):t?e.isPlainObject(t)?t.error?s.reject(t.error,i):r.validResponse(d,t)?(t=r.normalize(t),r.api||(r.api=t.api||1,r.newAPI=r.api>=2,r.oldAPI=!r.newAPI),t.options&&(v=e.extend({},v,t.options)),t.netDrivers&&(r.netDrivers=t.netDrivers),"open"==d&&l.init&&(r.uplMaxSize=r.returnBytes(t.uplMaxSize),r.uplMaxFile=t.uplMaxFile?parseInt(t.uplMaxFile):20),s.resolve(t),t.debug&&r.debug("backend-debug",t.debug),void 0):s.reject("errResponse",i):s.reject(["errResponse","errDataNotJSON"],i):s.reject(["errResponse","errDataEmpty"],i)},y=function(e){if("autosync"==e.type){if("stop"!=e.data.action)return}else if(!e.data.added||!e.data.added.length)return;"pending"==i.state()&&(i.quiet=!0,i.abort(),"unload"!=e.type&&"destroy"!=e.type&&r.autoSync())};if(u&&s.done(m),s.fail(function(e){e&&(c?r.error(e):r.debug("error",r.i18n(e)))}),!d)return s.reject("errCmdReq");if(f&&s.fail(function(e){e&&r.sync()}),p.type&&p.cnt&&(n=setTimeout(function(){r.notify(p),s.always(function(){p.cnt=-(parseInt(p.cnt)||0),r.notify(p)})},r.notifyDelay),s.always(function(){clearTimeout(n)})),"open"==d)for(;a=T.pop();)"pending"==a.state()&&(a.quiet=!0,a.abort());return delete t.preventFail,i=this.transport.send(t).fail(g).done(b),("open"==d||"info"==d&&l.compare)&&(T.unshift(i),r.bind(r.cmdsToAdd+" autosync",y),s.always(function(){var t=e.inArray(i,T);r.unbind(r.cmdsToAdd+" autosync",y),-1!==t&&T.splice(t,1)})),r.bind("unload destroy",y),s.always(function(){r.unbind("unload destroy",y)}),s},this.diff=function(t,n){var i={},a=[],r=[],o=[],s=function(e){for(var t=o.length;t--;)if(o[t].hash==e)return!0};return e.each(t,function(e,t){i[t.hash]=t}),e.each(b,function(e,t){n&&t.phash!==n||!i[e]&&r.push(e)}),e.each(i,function(t,n){var i=b[t];i?e.each(n,function(e){return n[e]!=i[e]?(o.push(n),!1):void 0}):a.push(n)}),e.each(r,function(t,n){var a=b[n],l=a.phash;l&&"directory"==a.mime&&-1===e.inArray(l,r)&&i[l]&&!s(l)&&o.push(i[l])}),{added:a,removed:r,changed:o}},this.sync=function(t,n){this.autoSync("stop");var i=this,a=function(){var i="",a=0,r=0;return t&&n&&e.each(b,function(e,n){n.phash&&n.phash===t&&(++a,r=Math.max(r,n.ts)),i=a+":"+r}),i},r=a(),o=e.Deferred().done(function(){i.trigger("sync")}),s={data:{cmd:"open",reload:1,target:g,tree:!t&&this.ui.tree?1:0,compare:r},preventDefault:!0},l={data:{cmd:"parents",target:g},preventDefault:!0};return e.when(this.request(s),t?null:this.request(l)).fail(function(e){o.reject(e),e&&i.request({data:{cmd:"open",target:i.lastDir("")||i.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}})}).done(function(e,n){if(e.cwd.compare&&r===e.cwd.compare)return o.reject();var a=i.diff(e.files.concat(n&&n.tree?n.tree:[]),t);return a.added.push(e.cwd),a.removed.length&&i.remove(a),a.added.length&&i.add(a),a.changed.length&&i.change(a),o.resolve(a)}).always(function(){i.autoSync()}),o},this.upload=function(e){return this.transport.upload(e,this)},this.bind=function(e,t){var n;if("function"==typeof t)for(e=(""+e).toLowerCase().split(/\s+/),n=0;n<e.length;n++)void 0===w[e[n]]&&(w[e[n]]=[]),w[e[n]].push(t);return this},this.unbind=function(e,t){var n=w[(""+e).toLowerCase()]||[],i=n.indexOf(t);return i>-1&&n.splice(i,1),t=null,this},this.trigger=function(t,n){var i,a,r,t=t.toLowerCase(),o="open"===t,s=w[t]||[];if(this.debug("event-"+t,n),o&&(r=JSON.stringify(n)),s.length)for(t=e.Event(t),a=s.length,i=0;a>i;i++){s[i].length&&(t.data=o?JSON.parse(r):e.extend(!0,{},n));try{if(s[i](t,this)===!1||t.isDefaultPrevented()){this.debug("event-stoped",t.type);break}}catch(l){window.console&&window.console.log&&window.console.log(l)}}return this},this.shortcut=function(t){var n,i,a,r,o;if(this.options.allowShortcuts&&t.pattern&&e.isFunction(t.callback))for(n=t.pattern.toUpperCase().split(/\s+/),r=0;r<n.length;r++)i=n[r],o=i.split("+"),a=1==(a=o.pop()).length?a>0?a:a.charCodeAt(0):e.ui.keyCode[a],a&&!x[i]&&(x[i]={keyCode:a,altKey:-1!=e.inArray("ALT",o),ctrlKey:-1!=e.inArray("CTRL",o),shiftKey:-1!=e.inArray("SHIFT",o),type:t.type||"keydown",callback:t.callback,description:t.description,pattern:i});return this},this.shortcuts=function(){var t=[];return e.each(x,function(e,n){t.push([n.pattern,o.i18n(n.description)])}),t},this.clipboard=function(t,n){var i=function(){return e.map(k,function(e){return e.hash})};return void 0!==t&&(k.length&&this.trigger("unlockfiles",{files:i()}),C=[],k=e.map(t||[],function(e){var t=b[e];return t?(C.push(e),{hash:e,phash:t.phash,name:t.name,mime:t.mime,read:t.read,locked:t.locked,cut:!!n}):null}),this.trigger("changeclipboard",{clipboard:k.slice(0,k.length)}),n&&this.trigger("lockfiles",{files:i()})),k.slice(0,k.length)},this.isCommandEnabled=function(t,n){var i;return n&&o.root(n)!==g&&e.each(o.disabledCmds,function(e,t){return 0==n.indexOf(e,0)?(i=t,!1):void 0}),i||(i=v.disabled),this._commands[t]?-1===e.inArray(t,i):!1},this.exec=function(t,n,i,a){return"open"===t&&this.autoSync("stop"),this._commands[t]&&this.isCommandEnabled(t,a)?this._commands[t].exec(n,i):e.Deferred().reject("No such command")},this.dialog=function(n,i){var a=e("<div/>").append(n).appendTo(t).elfinderdialog(i);return this.bind("resize",function(){a.elfinderdialog("posInit")}),a},this.getUI=function(e){return this.ui[e]||t},this.command=function(e){return void 0===e?this._commands:this._commands[e]},this.resize=function(e,n){t.css("width",e).height(n).trigger("resize"),this.trigger("resize",{width:t.width(),height:t.height()})},this.restoreSize=function(){this.resize(F,M)},this.show=function(){t.show(),this.enable().trigger("show")},this.hide=function(){this.disable().trigger("hide"),t.hide()},this.destroy=function(){t&&t[0].elfinder&&(this.autoSync("stop"),this.trigger("destroy").disable(),w={},x={},e(document).add(t).off("."+this.namespace),o.trigger=function(){},t.children().remove(),t.append(s.contents()).removeClass(this.cssClass).attr("style",l),t[0].elfinder=null)},this.autoSync=function(e){var t;if(o.options.sync>=1e3){if(i&&(clearTimeout(i),i=null,o.trigger("autosync",{action:"stop"})),e||!o.options.syncStart)return;t=function(e){var n;v.syncMinMs&&(e||i)&&(e&&o.trigger("autosync",{action:"start"}),n=Math.max(o.options.sync,v.syncMinMs),i&&clearTimeout(i),i=setTimeout(function(){var e=!0,a=g;v.syncChkAsTs?o.request({data:{cmd:"info",targets:[a],compare:b[a].ts,reload:1},preventDefault:!0}).done(function(n){var i;e=!0,n.compare&&(i=n.compare,b[a]&&i==b[a].ts&&(e=!1)),e?o.sync(a).always(function(){i&&(b[a].ts=i),t()}):t()}).fail(function(e){e&&"errConnect"!=e?o.error(e):i=setTimeout(function(){t()},n)}):o.sync(g,!0).always(function(){t()})},n))},t(!0)}},e.fn.selectable&&e.fn.draggable&&e.fn.droppable?t.length?this.options.url?(e.extend(e.ui.keyCode,{F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120}),this.dragUpload=!1,this.xhrUpload=("undefined"!=typeof XMLHttpRequestUpload||"undefined"!=typeof XMLHttpRequestEventTarget)&&"undefined"!=typeof File&&"undefined"!=typeof FormData,this.transport={},"object"==typeof this.options.transport&&(this.transport=this.options.transport,"function"==typeof this.transport.init&&this.transport.init(this)),"function"!=typeof this.transport.send&&(this.transport.send=function(t){return e.ajax(t)}),"iframe"==this.transport.upload?this.transport.upload=e.proxy(this.uploads.iframe,this):"function"==typeof this.transport.upload?this.dragUpload=!!this.options.dragUploadAllow:this.xhrUpload&&this.options.dragUploadAllow?(this.transport.upload=e.proxy(this.uploads.xhr,this),this.dragUpload=!0):this.transport.upload=e.proxy(this.uploads.iframe,this),this.error=function(){var e=arguments[0];return 1==arguments.length&&"function"==typeof e?o.bind("error",e):o.trigger("error",{error:e})},e.each(["enable","disable","load","open","reload","select","add","remove","change","dblclick","getfile","lockfiles","unlockfiles","selectfiles","unselectfiles","dragstart","dragstop","search","searchend","viewchange"],function(t,n){o[n]=function(){var t=arguments[0];return 1==arguments.length&&"function"==typeof t?o.bind(n,t):o.trigger(n,e.isPlainObject(t)?t:{})}}),this.enable(function(){!f&&o.visible()&&o.ui.overlay.is(":hidden")&&(f=!0,document.activeElement&&document.activeElement.blur(),t.removeClass("elfinder-disabled"))}).disable(function(){m=f,f=!1,t.addClass("elfinder-disabled")}).open(function(){y=[]}).select(function(t){y=e.map(t.data.selected||t.data.value||[],function(e){return b[e]?e:null})}).error(function(t){var n={cssClass:"elfinder-dialog-error",title:o.i18n(o.i18n("error")),resizable:!1,destroyOnClose:!0,buttons:{}};n.buttons[o.i18n(o.i18n("btnClose"))]=function(){e(this).elfinderdialog("close")},o.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-error"/>'+o.i18n(t.data.error),n)}).bind("tree parents",function(e){D(e.data.tree||[])}).bind("tmb",function(t){e.each(t.data.images||[],function(e,t){b[e]&&(b[e].tmb=t)})}).add(function(e){D(e.data.added||[])}).change(function(t){e.each(t.data.changed||[],function(t,n){var i=n.hash;b[i]&&e.each(["locked","hidden","width","height"],function(e,t){b[i][t]&&!n[t]&&delete b[i][t]}),b[i]=b[i]?e.extend(b[i],n):n})}).remove(function(t){for(var n=t.data.removed||[],i=n.length,a=function(t){var n=b[t];n&&("directory"==n.mime&&n.dirs&&e.each(b,function(e,n){n.phash==t&&a(e)}),delete b[t])};i--;)a(n[i])}).bind("search",function(e){D(e.data.files),o.tmbUrls._search=!0}).bind("searchend",function(){o.tmbUrls._search=!1}).bind("rm",function(){var t=S.canPlayType&&S.canPlayType('audio/wav; codecs="1"');t&&""!=t&&"no"!=t&&e(S).html('<source src="'+P+'rm.wav" type="audio/wav">')[0].play()}),e.each(this.options.handlers,function(e,t){o.bind(e,t)}),this.history=new this.history(this),"function"==typeof this.options.getFileCallback&&this.commands.getfile&&(this.bind("dblclick",function(e){e.preventDefault(),o.exec("getfile").fail(function(){o.exec("open")})}),this.shortcut({pattern:"enter",description:this.i18n("cmdgetfile"),callback:function(){o.exec("getfile").fail(function(){o.exec("mac"==o.OS?"rename":"open")})}}).shortcut({pattern:"ctrl+enter",description:this.i18n("mac"==this.OS?"cmdrename":"cmdopen"),callback:function(){o.exec("mac"==o.OS?"rename":"open")}})),this._commands={},e.isArray(this.options.commands)||(this.options.commands=[]),e.each(["open","reload","back","forward","up","home","info","quicklook","getfile","help"],function(t,n){-1===e.inArray(n,o.options.commands)&&o.options.commands.push(n)}),e.each(this.options.commands,function(t,n){var i=o.commands[n];e.isFunction(i)&&!o._commands[n]&&(i.prototype=I,o._commands[n]=new i,o._commands[n].setup(n,o.options.commandsOptions[n]||{}))}),this.commandMap={},this.disabledCmds={},this.tmbUrls={},t.addClass(this.cssClass).on(u,function(){!f&&o.enable()}),this.ui={workzone:e("<div/>").appendTo(t).elfinderworkzone(this),navbar:e("<div/>").appendTo(t).elfindernavbar(this,this.options.uiOptions.navbar||{}),contextmenu:e("<div/>").appendTo(t).elfindercontextmenu(this),overlay:e("<div/>").appendTo(t).elfinderoverlay({show:function(){o.disable()},hide:function(){m&&o.enable()}}),cwd:e("<div/>").appendTo(t).elfindercwd(this,this.options.uiOptions.cwd||{}),notify:this.dialog("",{cssClass:"elfinder-dialog-notify",position:this.options.notifyDialog.position,resizable:!1,autoOpen:!1,title:"&nbsp;",width:parseInt(this.options.notifyDialog.width)}),statusbar:e('<div class="ui-widget-header ui-helper-clearfix ui-corner-bottom elfinder-statusbar"/>').hide().appendTo(t)},e.each(this.options.ui||[],function(n,i){var a="elfinder"+i,r=o.options.uiOptions[i]||{};!o.ui[i]&&e.fn[a]&&(o.ui[i]=e("<"+(r.tag||"div")+"/>").appendTo(t)[a](o,r))}),t[0].elfinder=this,this.options.resizable&&!this.UA.Touch&&e.fn.resizable&&t.resizable({handles:"se",minWidth:300,minHeight:200}),this.options.width&&(F=this.options.width),this.options.height&&(M=parseInt(this.options.height)),this.options.soundPath&&(P=this.options.soundPath.replace(/\/+$/,"")+"/"),o.resize(F,M),e(document).on("click."+this.namespace,function(n){f&&!e(n.target).closest(t).length&&o.disable()}).on(p+" "+h,O),o.options.useBrowserHistory&&e(window).on("popstate",function(t){var n=t.originalEvent.state&&t.originalEvent.state.thash;n&&!e.isEmptyObject(o.files())&&o.request({data:{cmd:"open",target:n,onhistory:1},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0})}),this.trigger("init").request({data:{cmd:"open",target:o.startDir(),init:1,tree:this.ui.tree?1:0},preventDone:!0,notify:{type:"open",cnt:1,hideCnt:!0},freeze:!0}).fail(function(){o.trigger("fail").disable().lastDir(""),w={},x={},e(document).add(t).off("."+this.namespace),o.trigger=function(){}}).done(function(t){o.load().debug("api",o.api),t=e.extend(!0,{},t),A(t),o.trigger("open",t)}),this.one("load",function(){t.trigger("resize")}),function(){var n;e(window).on("resize",function(){n&&clearTimeout(n),n=setTimeout(function(){o.trigger("resize",{width:t.width(),height:t.height()})},200)}).on("beforeunload",function(){return o.ui.notify.children().length?o.i18n("ntfsmth"):(o.trigger("unload"),void 0)})}(),e(window).on("message",function(e){var t,n,i=e.originalEvent||null;if(i&&0===o.uploadURL.indexOf(i.origin))try{t=JSON.parse(i.data),n=t.data||null,n&&(n.error?o.error(n.error):(n.warning&&o.error(n.warning),n.removed&&n.removed.length&&o.remove(n),n.added&&n.added.length&&o.add(n),n.changed&&n.changed.length&&o.change(n),t.bind&&o.trigger(t.bind,n),n.sync&&o.sync()))}catch(e){o.sync()}}),o.dragUpload&&(t[0].addEventListener("dragenter",function(e){"TEXTAREA"!==e.target.nodeName&&"INPUT"!==e.target.nodeName&&(e.preventDefault(),e.stopPropagation())},!1),t[0].addEventListener("dragleave",function(e){"TEXTAREA"!==e.target.nodeName&&"INPUT"!==e.target.nodeName&&(e.preventDefault(),e.stopPropagation())},!1),t[0].addEventListener("dragover",function(e){"TEXTAREA"!==e.target.nodeName&&"INPUT"!==e.target.nodeName&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="none")},!1),t[0].addEventListener("drop",function(e){"TEXTAREA"!==e.target.nodeName&&"INPUT"!==e.target.nodeName&&(e.stopPropagation(),e.preventDefault())},!1),function(){var n="native-drag-enter",i="native-drag-disable",a="class",r=o.res(a,"navdir"),s=(o.res(a,"droppable"),o.res(a,"navcollapse")),l=o.res(a,"navexpand"),c=o.res(a,"adroppable"),u=o.res(a,"navarrow"),p=o.res(a,"adroppable");t.on("dragenter",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var a,d=e(t.currentTarget),h=t.currentTarget.id||null,f=null;if(h)!d.data(n)&&d.hasClass(r)&&d.is("."+s+":not(."+l+")")&&setTimeout(function(){d.is("."+s+"."+c)&&d.children("."+u).click()},500);else{f=o.cwd(),d.data(i,!1);try{e.each(t.originalEvent.dataTransfer.types,function(e,t){"elfinderfrom:"===t.substr(0,13)&&(a=t.substr(13).toLowerCase())})}catch(t){}}f&&(!f.write||a&&a===(window.location.href+f.hash).toLowerCase())?d.data(i,!0):(t.preventDefault(),t.stopPropagation(),d.data(n,!0),d.addClass(p))}}).on("dragleave",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var i=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),i.data(n)?i.data(n,!1):i.removeClass(p)}}).on("dragover",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var a=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),t.originalEvent.dataTransfer.dropEffect=a.data(i)?"none":"copy",a.data(n,!1)}}).on("drop",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var n=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),n.removeClass(p),d=t.currentTarget.id?n.hasClass(r)?o.navId2Hash(t.currentTarget.id):o.cwdId2Hash(t.currentTarget.id):o.cwd().hash,t.originalEvent._target=d,o.directUploadTarget=d,o.exec("upload",{dropEvt:t.originalEvent,target:d}),o.directUploadTarget=null}})}()),void 0):alert(this.i18n("errURL")):alert(this.i18n("errNode")):alert(this.i18n("errJqui"))},elFinder.prototype={uniqueid:0,res:function(e,t){return this.resources[e]&&this.resources[e][t]},currentReqCmd:"",i18:{en:{translator:"",language:"English",direction:"ltr",dateFormat:"d.m.Y H:i",fancyDateFormat:"$1 H:i",messages:{}},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["msJan","msFeb","msMar","msApr","msMay","msJun","msJul","msAug","msSep","msOct","msNov","msDec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},kinds:{unknown:"Unknown",directory:"Folder",symlink:"Alias","symlink-broken":"AliasBroken","application/x-empty":"TextPlain","application/postscript":"Postscript","application/vnd.ms-office":"MsOffice","application/msword":"MsWord","application/vnd.ms-word":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"MsWord","application/vnd.ms-word.document.macroEnabled.12":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"MsWord","application/vnd.ms-word.template.macroEnabled.12":"MsWord","application/vnd.ms-excel":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"MsExcel","application/vnd.ms-excel.sheet.macroEnabled.12":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"MsExcel","application/vnd.ms-excel.template.macroEnabled.12":"MsExcel","application/vnd.ms-excel.sheet.binary.macroEnabled.12":"MsExcel","application/vnd.ms-excel.addin.macroEnabled.12":"MsExcel","application/vnd.ms-powerpoint":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.presentation":"MsPP","application/vnd.ms-powerpoint.presentation.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"MsPP","application/vnd.ms-powerpoint.slideshow.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.template":"MsPP","application/vnd.ms-powerpoint.template.macroEnabled.12":"MsPP","application/vnd.ms-powerpoint.addin.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slide":"MsPP","application/vnd.ms-powerpoint.slide.macroEnabled.12":"MsPP","application/pdf":"PDF","application/xml":"XML","application/vnd.oasis.opendocument.text":"OO","application/vnd.oasis.opendocument.text-template":"OO","application/vnd.oasis.opendocument.text-web":"OO","application/vnd.oasis.opendocument.text-master":"OO","application/vnd.oasis.opendocument.graphics":"OO","application/vnd.oasis.opendocument.graphics-template":"OO","application/vnd.oasis.opendocument.presentation":"OO","application/vnd.oasis.opendocument.presentation-template":"OO","application/vnd.oasis.opendocument.spreadsheet":"OO","application/vnd.oasis.opendocument.spreadsheet-template":"OO","application/vnd.oasis.opendocument.chart":"OO","application/vnd.oasis.opendocument.formula":"OO","application/vnd.oasis.opendocument.database":"OO","application/vnd.oasis.opendocument.image":"OO","application/vnd.openofficeorg.extension":"OO","application/x-shockwave-flash":"AppFlash","application/flash-video":"Flash video","application/x-bittorrent":"Torrent","application/javascript":"JS","application/rtf":"RTF","application/rtfd":"RTF","application/x-font-ttf":"TTF","application/x-font-otf":"OTF","application/x-rpm":"RPM","application/x-web-config":"TextPlain","application/xhtml+xml":"HTML","application/docbook+xml":"DOCBOOK","application/x-awk":"AWK","application/x-gzip":"GZIP","application/x-bzip2":"BZIP","application/x-xz":"XZ","application/zip":"ZIP","application/x-zip":"ZIP","application/x-rar":"RAR","application/x-tar":"TAR","application/x-7z-compressed":"7z","application/x-jar":"JAR","text/plain":"TextPlain","text/x-php":"PHP","text/html":"HTML","text/javascript":"JS","text/css":"CSS","text/rtf":"RTF","text/rtfd":"RTF","text/x-c":"C","text/x-csrc":"C","text/x-chdr":"CHeader","text/x-c++":"CPP","text/x-c++src":"CPP","text/x-c++hdr":"CPPHeader","text/x-shellscript":"Shell","application/x-csh":"Shell","text/x-python":"Python","text/x-java":"Java","text/x-java-source":"Java","text/x-ruby":"Ruby","text/x-perl":"Perl","text/x-sql":"SQL","text/xml":"XML","text/x-comma-separated-values":"CSV","text/x-markdown":"Markdown","image/x-ms-bmp":"BMP","image/jpeg":"JPEG","image/gif":"GIF","image/png":"PNG","image/tiff":"TIFF","image/x-targa":"TGA","image/vnd.adobe.photoshop":"PSD","image/xbm":"XBITMAP","image/pxm":"PXM","audio/mpeg":"AudioMPEG","audio/midi":"AudioMIDI","audio/ogg":"AudioOGG","audio/mp4":"AudioMPEG4","audio/x-m4a":"AudioMPEG4","audio/wav":"AudioWAV","audio/x-mp3-playlist":"AudioPlaylist","video/x-dv":"VideoDV","video/mp4":"VideoMPEG4","video/mpeg":"VideoMPEG","video/x-msvideo":"VideoAVI","video/quicktime":"VideoMOV","video/x-ms-wmv":"VideoWM","video/x-flv":"VideoFlash","video/x-matroska":"VideoMKV","video/ogg":"VideoOGG"},rules:{defaults:function(t){return!t||t.added&&!e.isArray(t.added)||t.removed&&!e.isArray(t.removed)||t.changed&&!e.isArray(t.changed)?!1:!0
10
+ },open:function(t){return t&&t.cwd&&t.files&&e.isPlainObject(t.cwd)&&e.isArray(t.files)},tree:function(t){return t&&t.tree&&e.isArray(t.tree)},parents:function(t){return t&&t.tree&&e.isArray(t.tree)},tmb:function(t){return t&&t.images&&(e.isPlainObject(t.images)||e.isArray(t.images))},upload:function(t){return t&&(e.isPlainObject(t.added)||e.isArray(t.added))},search:function(t){return t&&t.files&&e.isArray(t.files)}},commands:{},cmdsToAdd:"archive duplicate extract mkdir mkfile paste rm upload",parseUploadData:function(t){var n;if(!e.trim(t))return{error:["errResponse","errDataEmpty"]};try{n=e.parseJSON(t)}catch(i){return{error:["errResponse","errDataNotJSON"]}}return this.validResponse("upload",n)?(n=this.normalize(n),n.removed=e.merge(n.removed||[],e.map(n.added||[],function(e){return e.hash})),n):{error:["errResponse"]}},iframeCnt:0,uploads:{xhrUploading:!1,checkExists:function(t,n,i){var a,r,o=e.Deferred(),s=function(){for(var e=t.length;--e>-1;)t[e]._remove=!0},l=function(){var l=[],d=[],c=[],u=function(e){var n=e==c.length-1,a={title:i.i18n("cmdupload"),text:["errExists",c[e].name,"confirmRepl"],all:!n,accept:{label:"btnYes",callback:function(t){n||t?o.resolve(l):u(++e)}},reject:{label:"btnNo",callback:function(i){var a;if(i)for(a=c.length;e<a--;)t[c[a].i]._remove=!0;else t[c[e].i]._remove=!0;n||i?o.resolve(l):u(++e)}},cancel:{label:"btnCancel",callback:function(){s(),o.resolve(l)}},buttons:[{label:"btnBackup",callback:function(t){var i;if(t)for(i=c.length;e<i--;)l.push(c[i].name);else l.push(c[e].name);n||t?o.resolve(l):u(++e)}}]};i.iframeCnt>0&&delete a.reject,i.confirm(a)};a=e.map(t,function(e,t){return e.name?{i:t,name:e.name}:null}),r=e.map(a,function(e){return e.name}),i.request({data:{cmd:"upload",target:n,name:r,FILES:""},notify:{type:"preupload",cnt:1,hideCnt:!0},preventFail:!0}).done(function(t){t&&(t.error?s():(t.name&&(d=t.name||[],c=e.map(a,function(t){return-1!==e.inArray(t.name,d)?t:null})),t.list&&n==i.cwd().hash&&t.list.length!=e.map(i.files(),function(e){return e.phash==n?e.name:null}).length&&i.sync())),c.length>0?u(0):o.resolve([])}).fail(function(e){s(),o.resolve([]),e&&i.error(e)})};return i.option("uploadOverwrite")&&"object"==typeof t[0]?(l(),o):o.resolve([])},checkFile:function(t,n,i){if(t.checked||"files"==t.type)return t.files;if("data"==t.type){var a,r=e.Deferred(),o=[],s=[],l=[],d=[],c=0,u=function(t){var i=function(e){return Array.prototype.slice.call(e||[])},a=function(t){var n=e.Deferred();return"undefined"==typeof t?n.reject("empty"):t.isFile?t.file(function(e){n.resolve(e)},function(){n.reject()}):n.reject("dirctory"),n.promise()};t.readEntries(function(e){if(e.length)d=d.concat(i(e)),u(t);else{var r=d.length-1,p=function(e){a(d[e]).done(function(t){"win"==n.OS&&t.name.match(/^(?:desktop\.ini|thumbs\.db)$/i)||"mac"==n.OS&&t.name.match(/^\.ds_store$/i)||(s.push(d[e].fullPath),o.push(t))}).fail(function(t){"dirctory"==t&&l.push(d[e])}).always(function(){c--,r>e&&(c++,p(++e))})};c++,p(0),c--}})},p=function(e,t){var n,i;d=[];for(var a=e.length,r=0;a>r;r++)i=t?e[r]:e[r].getAsEntry?e[r].getAsEntry():e[r].webkitGetAsEntry(),i&&(i.isFile?(c++,i.file(function(e){s.push(""),o.push(e),c--})):i.isDirectory&&(c>0?l.push(i):(c=0,n=i.createReader(),c++,u(n))))};return a=e.map(t.files.items,function(e){return e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry()}),a.length>0?(n.uploads.checkExists(a,i,n).done(function(t){var d,u=[];n.option("uploadOverwrite")&&(a=e.map(a,function(a){var r,o,s,l;return a.isDirectory&&(r=e.inArray(a.name,t),-1!==r&&(t.splice(r,1),o=n.uniqueName(a.name+n.options.backupSuffix,null,""),s=n.fileByName(a.name,i),n.lockfiles({files:[s.hash]}),l=n.request({data:{cmd:"rename",target:s.hash,name:o},notify:{type:"rename",cnt:1}}).fail(function(){a._remove=!0,n.sync()}).always(function(){n.unlockfiles({files:[s.hash]})}),u.push(l))),a._remove?null:a})),e.when.apply(e,u).done(function(){a.length>0?(d=setTimeout(function(){n.notify({type:"readdir",cnt:1,hideCnt:!0})},n.options.notifyDelay),p(a,!0),setTimeout(function e(){c>0?setTimeout(e,10):l.length>0?(p([l.shift()],!0),setTimeout(e,10)):(d&&clearTimeout(d),n.notify({type:"readdir",cnt:-1}),r.resolve([o,s,t]))},10)):r.reject()})}),r.promise()):r.reject()}var h=[],f=[],m=t.files[0];if("html"==t.type){var g,v=e("<html/>").append(e.parseHTML(m));e("img[src]",v).each(function(){var t,n,i=e(this),a=i.closest("a");a&&a.attr("href")&&a.attr("href").match(/\.(?:jpe?g|gif|bmp|png)/i)&&(n=a.attr("href")),t=i.attr("src"),t&&(n?(-1==e.inArray(n,h)&&h.push(n),-1==e.inArray(t,f)&&f.push(t)):-1==e.inArray(t,h)&&h.push(t))}),g=e("a[href]",v),g.each(function(){var t,n=function(e){var t=document.createElement("a");return t.href=e,t};e(this).text()&&(t=n(e(this).attr("href")),!t.href||1!==g.length&&t.pathname.match(/(?:\.html?|\/[^\/.]*)$/i)||-1==e.inArray(t.href,h)&&-1==e.inArray(t.href,f)&&h.push(t.href))})}else{var b,y,w;for(b=/(http[^<>"{}|\\^\[\]`\s]+)/gi;y=b.exec(m);)w=y[1].replace(/&amp;/g,"&"),-1==e.inArray(w,h)&&h.push(w)}return h},xhr:function(t,n){var i,a=n?n:this,r=new XMLHttpRequest,o=null,s=null,l=t.checked,d=t.isDataType||"data"==t.type,c=0,u="div.elfinder-notify-upload div.elfinder-notify-cancel button",p=e.Deferred().fail(function(e){var t=m.length?d?m[0][0]:m[0]:{};t._cid&&(h=new FormData,m=[{_chunkfail:!0}],h.append("chunk",t._chunk),h.append("cid",t._cid),d=!1,F(m)),m=null,e&&a.error(e)}).done(function(e){r=null,m=null,e&&(e.warning&&a.error(e.warning),e.removed&&a.remove(e),e.added&&a.add(e),e.changed&&a.change(e),a.trigger("upload",e),e.sync&&a.sync())}).always(function(){o&&clearTimeout(o),s&&clearTimeout(s),l&&!t.multiupload&&x()&&a.notify({type:"upload",cnt:-g,progress:0,size:0}),I&&a.ui.notify.children(".elfinder-notify-chunkmerge").length&&a.notify({type:"chunkmerge",cnt:-1}),a.ui.notify.off("click",u,C),e(document).off("keydown",C)}),h=new FormData,f=t.target||a.cwd().hash,m=t.input?t.input.files:a.uploads.checkFile(t,a,f),g=t.checked?d?m[0].length:m.length:m.length,v=0,b=0,y=!1,w=!1,x=function(){return y=y||a.ui.notify.children(".elfinder-notify-upload").length},k=function(e){return e||(e=b),setTimeout(function(){y=!0,a.notify({type:"upload",cnt:g,progress:v-i,size:e,cancel:!0}),i=v},a.options.notifyDelay)},C=function(t){("keydown"!=t.type||t.keyCode==e.ui.keyCode.ESCAPE)&&(t.preventDefault(),t.stopPropagation(),w=!0,r.abort(),p.reject(),a.sync())},T=t.renames||null,I=!1;if(a.ui.notify.one("click",u,C),e(document).on("keydown",C),e(window).on("unload",function(){"pending"==p.state()&&p.reject()}),!I&&(i=v),!d&&!g)return p.reject(["errUploadNoFiles"]);r.addEventListener("error",function(){p.reject("errConnect")},!1),r.addEventListener("abort",function(){p.reject(["errConnect","errAbort"])},!1),r.addEventListener("load",function(){var e,n=r.status,l=0,u="";if(n>=400?u=n>500?"errResponse":"errConnect":(4!=r.readyState&&(u=["errConnect","errTimeout"]),r.responseText||(u=["errResponse","errDataEmpty"])),u){if(I||c++>3){var f=d?m[0][0]:m[0];return f._cid?(h=new FormData,m=[{_chunkfail:!0}],h.append("chunk",f._chunk),h.append("cid",f._cid),h.append("range",f._range),d=!1,F(m),void 0):p.reject(u)}return b=0,r.open("POST",a.uploadURL,!0),r.send(h),void 0}if(v=b,x()&&(l=v-i)&&a.notify({type:"upload",cnt:0,progress:l,size:0}),e=a.parseUploadData(r.responseText),e._chunkmerged){h=new FormData;var y=[{_chunkmerged:e._chunkmerged,_name:e._name}];return I=!0,s=setTimeout(function(){a.notify({type:"chunkmerge",cnt:1})},a.options.notifyDelay),d?F(y,m[1]):F(y),void 0}e._multiupload=t.multiupload?!0:!1,e.error?e._chunkfailure?(w=!0,a.uploads.xhrUploading=!1,o&&clearTimeout(o),a.ui.notify.children(".elfinder-notify-upload").length?(a.notify({type:"upload",cnt:-g,progress:0,size:0}),p.reject(e.error)):p.reject()):p.reject(e.error):p.resolve(e)},!1),r.upload.addEventListener("loadstart",function(e){!I&&e.lengthComputable&&(v=e.loaded,c&&(v=0),b=e.total,v||(v=parseInt(.05*b)),x()&&(a.notify({type:"upload",cnt:0,progress:v-i,size:t.multiupload?0:b}),i=v))},!1),r.upload.addEventListener("progress",function(e){var n;e.lengthComputable&&!I&&(v=e.loaded,!t.checked&&v>0&&!o&&(o=k(r._totalSize-v)),b||(c&&(v=0),b=e.total,v||(v=parseInt(.05*b))),n=v-i,x()&&n/e.total>=.05&&(a.notify({type:"upload",cnt:0,progress:n,size:0}),i=v))},!1);var F=function(i,s){var c,u,m,v,b,y,C,I,F,M,P,S,z=0,A=1,D=[],O=0,U=g,E=0,j=[],H=+new Date,R=Math.min((n.uplMaxSize?n.uplMaxSize:2097152)-8190,n.options.uploadMaxChunkSize),_=!1,N=function(i,r){var s,l=[];if(!w)for(;i.length&&l.length<r;)l.push(i.shift());if(l.length)for(var c=0;c<l.length&&!w;c++)s=d?l[c][0][0]._cid||null:l[c][0]._cid||null,S[s]?P--:n.exec("upload",{type:t.type,isDataType:d,files:l[c],checked:!0,target:f,renames:T,multiupload:!0}).fail(function(){s&&(S[s]=!0)}).always(function(t){t&&t.added&&(F=e.merge(F,t.added)),P<=++M&&(n.trigger("multiupload",{added:F}),o&&clearTimeout(o),x()&&a.notify({type:"upload",cnt:-g,progress:0,size:0})),N(i,1)});else a.uploads.xhrUploading=!1,w&&(o&&clearTimeout(o),x()&&a.notify({type:"upload",cnt:-g,progress:0,size:0}),s&&(S[s]=!0)),p.resolve()},q=function(){a.uploads.xhrUploading?setTimeout(function(){q()},100):(a.uploads.xhrUploading=!0,N(D,3))};if(!l&&(d||"files"==t.type)){for(c=n.option("uploadMaxSize")?n.option("uploadMaxSize"):0,m=0;m<i.length;m++)if(C=i[m],u=C.size,_===!1&&(_="slice"in C?"slice":"mozSlice"in C?"mozSlice":"webkitSlice"in C?"webkitSlice":""),c&&u>c||!_&&n.uplMaxSize&&u>n.uplMaxSize)a.error(a.i18n("errUploadFile",C.name)+" "+a.i18n("errUploadFileSize")),g--,U--;else if(_&&u>R){for(v=0,b=R,y=-1,U=Math.floor(u/R),E+=u,j[H]=0;u>=v;)I=C[_](v,b),I._chunk=C.name+"."+ ++y+"_"+U+".part",I._cid=H,I._range=v+","+I.size+","+u,j[H]++,z&&O++,"undefined"==typeof D[O]&&(D[O]=[],d&&(D[O][0]=[],D[O][1]=[])),z=R,A=1,d?(D[O][0].push(I),D[O][1].push(s[m])):D[O].push(I),v=b,b=v+R;null==I?(a.error(a.i18n("errUploadFile",C.name)+" "+a.i18n("errUploadFileSize")),g--,U--):U+=y}else(n.uplMaxSize&&z+u>=n.uplMaxSize||A>n.uplMaxFile)&&(z=0,A=1,O++),"undefined"==typeof D[O]&&(D[O]=[],d&&(D[O][0]=[],D[O][1]=[])),d?(D[O][0].push(C),D[O][1].push(s[m])):D[O].push(C),z+=u,E+=u,A++;if(0==D.length)return t.checked=!0,!1;if(D.length>1)return o=k(E),F=[],M=0,P=D.length,S=[],q(),!0;d?(i=D[0][0],s=D[0][1]):i=D[0]}return l||(n.UA.Safari&&t.files?r._totalSize=E:o=k(E)),l=!0,i.length||p.reject(["errUploadNoFiles"]),r.open("POST",a.uploadURL,!0),n.customHeaders&&e.each(n.customHeaders,function(e){r.setRequestHeader(e,this)}),n.xhrFields&&e.each(n.xhrFields,function(e){e in r&&(r[e]=this)}),h.append("cmd","upload"),h.append(a.newAPI?"target":"current",f),T&&(e.each(T,function(e,t){h.append("renames[]",t)}),h.append("suffix",n.options.backupSuffix)),e.each(a.options.customData,function(e,t){h.append(e,t)}),e.each(a.options.onlyMimes,function(e,t){h.append("mimes["+e+"]",t)}),e.each(i,function(e,t){t._chunkmerged?(h.append("chunk",t._chunkmerged),h.append("upload[]",t._name)):(t._chunkfail?(h.append("upload[]","chunkfail"),h.append("mimes","chunkfail")):h.append("upload[]",t),t._chunk&&(h.append("chunk",t._chunk),h.append("cid",t._cid),h.append("range",t._range)))}),d&&e.each(s,function(e,t){h.append("upload_path[]",t)}),r.onreadystatechange=function(){if(4==r.readyState&&0==r.status)if(w)p.reject();else{var n=["errAbort"];!d&&t.files&&e.map(t.files,function(e){return 0===e.size?e:null}).length&&n.push("errFolderUpload"),p.reject(n)}},r.send(h),!0};return d?l?F(m[0],m[1]):m.done(function(e){T=[],g=e[0].length,g?(T=e[2],F(e[0],e[1])):p.reject(["errUploadNoFiles"])}).fail(function(){p.reject()}):m.length>0?null==T?(T=[],a.uploads.checkExists(m,f,n).done(function(t){n.option("uploadOverwrite")&&(T=t,m=e.map(m,function(e){return e._remove?null:e})),g=m.length,g>0?F(m)||p.reject():p.reject()})):F(m)||p.reject():p.reject(),p},iframe:function(t,n){var i,a,r,o,s=n?n:this,l=t.input?t.input:!1,d=l?!1:s.uploads.checkFile(t,s),c=e.Deferred().fail(function(e){e&&s.error(e)}).done(function(e){e.warning&&s.error(e.warning),e.removed&&s.remove(e),e.added&&s.add(e),e.changed&&s.change(e),s.trigger("upload",e),e.sync&&s.sync()}),u="iframe-"+s.namespace+ ++s.iframeCnt,p=e('<form action="'+s.uploadURL+'" method="post" enctype="multipart/form-data" encoding="multipart/form-data" target="'+u+'" style="display:none"><input type="hidden" name="cmd" value="upload" /></form>'),h=this.UA.IE,f=function(){o&&clearTimeout(o),r&&clearTimeout(r),a&&s.notify({type:"upload",cnt:-i}),setTimeout(function(){h&&e('<iframe src="javascript:false;"/>').appendTo(p),p.remove(),m.remove()},100)},m=e('<iframe src="'+(h?"javascript:false;":"about:blank")+'" name="'+u+'" style="position:absolute;left:-1000px;top:-1000px" />').on("load",function(){m.off("load").on("load",function(){f(),c.reject()}),r=setTimeout(function(){a=!0,s.notify({type:"upload",cnt:i})},s.options.notifyDelay),s.options.iframeTimeout>0&&(o=setTimeout(function(){f(),c.reject([errors.connect,errors.timeout])},s.options.iframeTimeout)),p.submit()}),g=t.target||s.cwd().hash,v=[],b=[],y=[];if(d&&d.length)e.each(d,function(e,t){p.append('<input type="hidden" name="upload[]" value="'+t+'"/>')}),i=1;else{if(!(l&&e(l).is(":file")&&e(l).val()))return c.reject();n.option("uploadOverwrite")&&(v=l.files?l.files:[{name:e(l).val().replace(/^(?:.+[\\\/])?([^\\\/]+)$/,"$1")}],b.push(s.uploads.checkExists(v,g,s).done(function(t){y=t,i=e.map(v,function(e){return e._remove?null:e}).length,i!=v.length&&(i=0)}))),i=l.files?l.files.length:1,p.append(l)}return e.when.apply(e,b).done(function(){return 1>i?c.reject():(p.append('<input type="hidden" name="'+(s.newAPI?"target":"current")+'" value="'+g+'"/>').append('<input type="hidden" name="html" value="1"/>').append('<input type="hidden" name="node" value="'+s.id+'"/>').append(e(l).attr("name","upload[]")),y.length>0&&(e.each(y,function(e,t){p.append('<input type="hidden" name="renames[]" value="'+t+'"/>')}),p.append('<input type="hidden" name="suffix" value="'+n.options.backupSuffix+'"/>')),e.each(s.options.onlyMimes||[],function(e,t){p.append('<input type="hidden" name="mimes[]" value="'+t+'"/>')}),e.each(s.options.customData,function(e,t){p.append('<input type="hidden" name="'+e+'" value="'+t+'"/>')}),p.appendTo("body"),m.appendTo("body"),void 0)}),c}},one:function(t,n){var i=this,a=e.proxy(n,function(e){return setTimeout(function(){i.unbind(e.type,a)},3),n.apply(this,arguments)});return this.bind(t,a)},localStorage:function(e,t){var n,i,a=window.localStorage,r="elfinder-"+e+this.id;if(e=window.location.pathname+"-elfinder-"+e+this.id,null===t)return a.removeItem(e);if(void 0===t&&!(n=a.getItem(e))&&(i=a.getItem(r))&&(t=i,a.removeItem(r)),void 0!==t){try{a.setItem(e,t)}catch(o){a.clear(),a.setItem(e,t)}n=a.getItem(e)}return n},cookie:function(t,n){var i,a,r,o;if(t="elfinder-"+t+this.id,void 0===n){if(document.cookie&&""!=document.cookie)for(r=document.cookie.split(";"),t+="=",o=0;o<r.length;o++)if(r[o]=e.trim(r[o]),r[o].substring(0,t.length)==t)return decodeURIComponent(r[o].substring(t.length));return""}return a=e.extend({},this.options.cookie),null===n&&(n="",a.expires=-1),"number"==typeof a.expires&&(i=new Date,i.setTime(i.getTime()+864e5*a.expires),a.expires=i),document.cookie=t+"="+encodeURIComponent(n)+"; expires="+a.expires.toUTCString()+(a.path?"; path="+a.path:"")+(a.domain?"; domain="+a.domain:"")+(a.secure?"; secure":""),n},startDir:function(){var e=window.location.hash;return e&&e.match(/^#elf_/)?e.replace(/^#elf_/,""):this.options.startPathHash?this.options.startPathHash:this.lastDir()},lastDir:function(e){return this.options.rememberLastDir?this.storage("lastdir",e):""},_node:e("<span/>"),escape:function(e){return this._node.text(e).html().replace(/"/g,"&quot;").replace(/'/g,"&#039;")},normalize:function(t){var n=function(e){return e&&e.hash&&e.name&&e.mime?("application/x-empty"==e.mime&&(e.mime="text/plain"),e):null};return t.files&&(t.files=e.map(t.files,n)),t.tree&&(t.tree=e.map(t.tree,n)),t.added&&(t.added=e.map(t.added,n)),t.changed&&(t.changed=e.map(t.changed,n)),t.api&&(t.init=!0),t},setSort:function(e,t,n){this.storage("sortType",this.sortType=this.sortRules[e]?e:"name"),this.storage("sortOrder",this.sortOrder=/asc|desc/.test(t)?t:"asc"),this.storage("sortStickFolders",(this.sortStickFolders=!!n)?1:""),this.trigger("sortchange")},_sortRules:{name:function(e,t){var n,i,a=e.name.toLowerCase(),r=t.name.toLowerCase(),o="",s="",l=elFinder.prototype.naturalCompare;return(n=a.match(/^(.+)(\.[0-9a-z.]+)$/))&&(a=n[1],o=n[2]),(n=r.match(/^(.+)(\.[0-9a-z.]+)$/))&&(r=n[1],s=n[2]),i=l(a,r),0==i&&(o||s)&&o!=s&&(i=l(o,s)),i},size:function(e,t){var n=parseInt(e.size)||0,i=parseInt(t.size)||0;return n==i?0:n>i?1:-1},kind:function(e,t){return elFinder.prototype.naturalCompare(e.mime,t.mime)},date:function(e,t){var n=e.ts||e.date,i=t.ts||t.date;return n==i?0:n>i?1:-1}},naturalCompare:function(e,t){var n=elFinder.prototype.naturalCompare;return"undefined"==typeof n.loc&&(n.loc=navigator.userLanguage||navigator.browserLanguage||navigator.language||"en-US"),"undefined"==typeof n.sort&&("11".localeCompare("2",n.loc,{numeric:!0})>0?n.sort=window.Intl&&window.Intl.Collator?new Intl.Collator(n.loc,{numeric:!0}).compare:function(e,t){return e.localeCompare(t,n.loc,{numeric:!0})}:(n.sort=function(e,t){var i,a,r=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,o=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,d=/^0/,c=/^[\x01\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/,u=function(e){return n.sort.insensitive&&(""+e).toLowerCase()||""+e},p=u(e).replace(o,"").replace(/^_/,"")||"",h=u(t).replace(o,"").replace(/^_/,"")||"",f=p.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=h.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),g=parseInt(p.match(l))||1!=f.length&&p.match(s)&&Date.parse(p),v=parseInt(h.match(l))||g&&h.match(s)&&Date.parse(h)||null,b=0;if(v){if(v>g)return-1;if(g>v)return 1}for(var y=0,w=Math.max(f.length,m.length);w>y;y++){if(i=!(f[y]||"").match(d)&&parseFloat(f[y])||f[y]||0,a=!(m[y]||"").match(d)&&parseFloat(m[y])||m[y]||0,isNaN(i)!==isNaN(a)){if(isNaN(i)&&("string"!=typeof i||!i.match(c)))return 1;if("string"!=typeof a||!a.match(c))return-1}if(0===parseInt(i,10)&&(i=0),0===parseInt(a,10)&&(a=0),typeof i!=typeof a&&(i+="",a+=""),n.sort.insensitive&&"string"==typeof i&&"string"==typeof a&&(b=i.localeCompare(a,n.loc),0!==b))return b;if(a>i)return-1;if(i>a)return 1}return 0},n.sort.insensitive=!0)),n.sort(e,t)},compare:function(e,t){var n,i=this,a=i.sortType,r="asc"==i.sortOrder,o=i.sortStickFolders,s=i.sortRules,l=s[a],d="directory"==e.mime,c="directory"==t.mime;if(o){if(d&&!c)return-1;if(!d&&c)return 1}return n=r?l(e,t):l(t,e),"name"!=a&&0==n?n=r?s.name(e,t):s.name(t,e):n},sortFiles:function(e){return e.sort(this.compare)},notify:function(t){var n,i,a,r,o=t.type,s=this.messages["ntf"+o]?this.i18n("ntf"+o):this.i18n("ntfsmth"),l=this.ui.notify,d=l.children(".elfinder-notify-"+o),c='<div class="elfinder-notify elfinder-notify-{type}"><span class="elfinder-dialog-icon elfinder-dialog-icon-{type}"/><span class="elfinder-notify-msg">{msg}</span> <span class="elfinder-notify-cnt"/><div class="elfinder-notify-progressbar"><div class="elfinder-notify-progress"/></div><div class="elfinder-notify-cancel"/></div></div>',u=t.cnt,p="undefined"!=typeof t.size?parseInt(t.size):null,h="undefined"!=typeof t.progress&&t.progress>=0?t.progress:null,f=t.cancel,m="ui-state-hover";return o?(d.length||(d=e(c.replace(/\{type\}/g,o).replace(/\{msg\}/g,s)).appendTo(l).data("cnt",0),null!=h&&d.data({progress:0,total:0}),f&&(r=e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text">'+this.i18n("btnCancel")+"</span></button>").hover(function(t){e(this).toggleClass(m,"mouseenter"==t.type)}),d.children("div.elfinder-notify-cancel").append(r))),n=u+parseInt(d.data("cnt")),n>0?(!t.hideCnt&&d.children(".elfinder-notify-cnt").text("("+n+")"),l.is(":hidden")&&l.elfinderdialog("open"),d.data("cnt",n),null!=h&&(i=d.data("total"))>=0&&(a=d.data("progress"))>=0&&(i+=null!=p?p:u,a+=h,null==p&&0>u&&(a+=100*u),d.data({progress:a,total:i}),null!=p&&(a*=100,i=Math.max(1,i)),h=parseInt(a/i),d.find(".elfinder-notify-progress").animate({width:(100>h?h:100)+"%"},20))):(d.remove(),!l.children().length&&l.elfinderdialog("close")),this):this},confirm:function(t){var n,i=this,a=!1,r={cssClass:"elfinder-dialog-confirm",modal:!0,resizable:!1,title:this.i18n(t.title||"confirmReq"),buttons:{},close:function(){!a&&t.cancel.callback(),e(this).elfinderdialog("destroy")}},o=this.i18n("apllyAll");return r.buttons[this.i18n(t.accept.label)]=function(){t.accept.callback(!(!n||!n.prop("checked"))),a=!0,e(this).elfinderdialog("close")},t.reject&&(r.buttons[this.i18n(t.reject.label)]=function(){t.reject.callback(!(!n||!n.prop("checked"))),a=!0,e(this).elfinderdialog("close")}),t.buttons&&t.buttons.length>0&&e.each(t.buttons,function(t,o){r.buttons[i.i18n(o.label)]=function(){o.callback(!(!n||!n.prop("checked"))),a=!0,e(this).elfinderdialog("close")}}),r.buttons[this.i18n(t.cancel.label)]=function(){e(this).elfinderdialog("close")},t.all&&(t.reject&&(r.width=370),r.create=function(){n=e('<input type="checkbox" />'),e(this).next().children().before(e("<label>"+o+"</label>").prepend(n))},r.open=function(){var t=e(this).next(),n=parseInt(t.children(":first").outerWidth()+t.children(":last").outerWidth());n>parseInt(t.width())&&e(this).closest(".elfinder-dialog").width(n+30)}),this.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-confirm"/>'+this.i18n(t.text),r)},uniqueName:function(e,t,n){var i,a,r=0,o="";if(e=this.i18n(e),t=t||this.cwd().hash,n="undefined"==typeof n?" ":n,(i=e.match(/^(.+)(\.[^.]+)$/))&&(o=i[2],e=i[1]),a=e+o,!this.fileByName(a,t))return a;for(;1e4>r;)if(a=e+n+ ++r+o,!this.fileByName(a,t))return a;return e+Math.random()+o},i18n:function(){var t,n,i,a=this,r=this.messages,o=[],s=[],l=function(e){var t;return 0===e.indexOf("#")&&(t=a.file(e.substr(1)))?t.name:e};for(t=0;t<arguments.length;t++)if(i=arguments[t],"string"==typeof i)o.push(l(i));else if(e.isArray(i))for(n=0;n<i.length;n++)"string"==typeof i[n]?o.push(l(i[n])):i[n]instanceof jQuery&&o.push(i[n]);else i instanceof jQuery&&o.push(i[n]);for(t=0;t<o.length;t++)-1===e.inArray(t,s)&&(i=o[t],"string"==typeof i?(i=r[i]||a.escape(i),i=i.replace(/\$(\d+)/g,function(e,n){return n=t+parseInt(n),n>0&&o[n]&&s.push(n),a.escape(o[n])||""})):i=i.get(0).outerHTML,o[t]=i);return e.map(o,function(t,n){return-1===e.inArray(n,s)?t:null}).join("<br>")},mime2class:function(e){var t="elfinder-cwd-icon-";return e=e.split("/"),t+e[0]+("image"!=e[0]&&e[1]?" "+t+e[1].replace(/(\.|\+)/g,"-"):"")},mime2kind:function(e){var t,n="object"==typeof e?e.mime:e;return t=e.alias&&"symlink-broken"!=e.mime?"Alias":this.kinds[n]?this.kinds[n]:0===n.indexOf("text")?"Text":0===n.indexOf("image")?"Image":0===n.indexOf("audio")?"Audio":0===n.indexOf("video")?"Video":0===n.indexOf("application")?"App":n,this.messages["kind"+t]?this.i18n("kind"+t):n},formatDate:function(e,t){var n,i,a,r,o,s,l,d,c,u,p,h=this,t=t||e.ts,f=h.i18;return h.options.clientFormatDate&&t>0?(n=new Date(1e3*t),d=n[h.getHours](),c=d>12?d-12:d,u=n[h.getMinutes](),p=n[h.getSeconds](),r=n[h.getDate](),o=n[h.getDay](),s=n[h.getMonth]()+1,l=n[h.getFullYear](),i=t>=this.yesterday?this.fancyFormat:this.dateFormat,a=i.replace(/[a-z]/gi,function(e){switch(e){case"d":return r>9?r:"0"+r;case"j":return r;case"D":return h.i18n(f.daysShort[o]);case"l":return h.i18n(f.days[o]);case"m":return s>9?s:"0"+s;case"n":return s;case"M":return h.i18n(f.monthsShort[s-1]);case"F":return h.i18n(f.months[s-1]);case"Y":return l;case"y":return(""+l).substr(2);case"H":return d>9?d:"0"+d;case"G":return d;case"g":return c;case"h":return c>9?c:"0"+c;case"a":return d>12?"pm":"am";case"A":return d>12?"PM":"AM";case"i":return u>9?u:"0"+u;case"s":return p>9?p:"0"+p}return e}),t>=this.yesterday?a.replace("$1",this.i18n(t>=this.today?"Today":"Yesterday")):a):e.date?e.date.replace(/([a-z]+)\s/i,function(e,t){return h.i18n(t)+" "}):h.i18n("dateUnknown")},perms2class:function(e){var t="";return e.read||e.write?e.read?e.write||(t="elfinder-ro"):t="elfinder-wo":t="elfinder-na",t},formatPermissions:function(e){var t=[];return e.read&&t.push(this.i18n("read")),e.write&&t.push(this.i18n("write")),t.length?t.join(" "+this.i18n("and")+" "):this.i18n("noaccess")},formatSize:function(e){var t=1,n="b";return"unknown"==e?this.i18n("unknown"):(e>1073741824?(t=1073741824,n="GB"):e>1048576?(t=1048576,n="MB"):e>1024&&(t=1024,n="KB"),e/=t,(e>0?t>=1048576?e.toFixed(2):Math.round(e):0)+" "+n)},formatFileMode:function(t,n){var i,a,r,o,s,l,d,c,u;if(n||(n=this.options.fileModeStyle.toLowerCase()),t=e.trim(t),t.match(/[rwxs-]{9}$/i)){if(c=t=t.substr(-9),"string"==n)return c;for(u="",r=0,i=0;7>i;i+=3)a=t.substr(i,3),o=0,a.match(/[r]/i)&&(o+=4),a.match(/[w]/i)&&(o+=2),a.match(/[xs]/i)&&(a.match(/[xs]/)&&(o+=1),a.match(/[s]/i)&&(0==i?r+=4:3==i&&(r+=2))),u+=o.toString(8);r&&(u=r.toString(8)+u)}else{if(t=parseInt(t,8),u=t?t.toString(8):"",!t||"octal"==n)return u;for(a=t.toString(8),r=0,a.length>3&&(a=a.substr(-4),r=parseInt(a.substr(0,1),8),a=a.substr(1)),s=1==(1&r),d=2==(2&r),l=4==(4&r),c="",i=0;3>i;i++)c+=4==(4&parseInt(a.substr(i,1),8))?"r":"-",c+=2==(2&parseInt(a.substr(i,1),8))?"w":"-",c+=1==(1&parseInt(a.substr(i,1),8))?0==i&&l||1==i&&d?"s":"x":"-"}return"both"==n?c+" ("+u+")":"string"==n?c:u},navHash2Id:function(e){return this.navPrefix+e},navId2Hash:function(e){return"string"==typeof e?e.substr(this.navPrefix.length):!1},cwdHash2Id:function(e){return this.cwdPrefix+e},cwdId2Hash:function(e){return"string"==typeof e?e.substr(this.cwdPrefix.length):!1},log:function(e){return window.console&&window.console.log&&window.console.log(e),this},debug:function(t,n){var i=this.options.debug;return("all"==i||i===!0||e.isArray(i)&&-1!=e.inArray(t,i))&&window.console&&window.console.log&&window.console.log("elfinder debug: ["+t+"] ["+this.id+"]",n),this},time:function(e){window.console&&window.console.time&&window.console.time(e)},timeEnd:function(e){window.console&&window.console.timeEnd&&window.console.timeEnd(e)}},Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=n.length;return function(a){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError("Object.keys called on non-object");var r=[];for(var o in a)e.call(a,o)&&r.push(o);if(t)for(var s=0;i>s;s++)e.call(a,n[s])&&r.push(n[s]);return r}}()),elFinder.prototype.version="2.1.6",function(){if(e.ui&&e.ui.ddmanager){var t=e.ui.ddmanager.prepareOffsets;e.ui.ddmanager.prepareOffsets=function(n,i){var a=function(e){if(e.is(":hidden"))return!0;var t=e[0].getBoundingClientRect();return document.elementFromPoint(t.left,t.top)?!1:!0};if("mousedown"===i.type){var r,o,s=e.ui.ddmanager.droppables[n.options.scope]||[],l=s.length;for(r=0;l>r;r++)o=s[r],o.options.autoDisable&&(!o.options.disabled||o.options.autoDisable>1)&&(o.options.disabled=a(o.element),o.options.autoDisable=o.options.disabled?2:1)}return t(n,i)}}}(),e.fn.elfinder=function(e){return"instance"==e?this.getElFinder():this.each(function(){var t="string"==typeof e?e:"";switch(this.elfinder||new elFinder(this,"object"==typeof e?e:{}),t){case"close":case"hide":this.elfinder.hide();break;case"open":case"show":this.elfinder.show();break;case"destroy":this.elfinder.destroy()}})},e.fn.getElFinder=function(){var e;return this.each(function(){return this.elfinder?(e=this.elfinder,!1):void 0}),e},elFinder.prototype._options={url:"",requestType:"get",transport:{},urlUpload:"",dragUploadAllow:"auto",uploadMaxChunkSize:10485760,iframeTimeout:0,customData:{},handlers:{},customHeaders:{},xhrFields:{},lang:"en",cssClass:"",commands:["open","opendir","reload","home","up","back","forward","getfile","quicklook","download","rm","duplicate","rename","mkdir","mkfile","upload","copy","cut","paste","edit","extract","archive","search","info","view","help","resize","sort","netmount","netunmount","places","chmod"],commandsOptions:{getfile:{onlyURL:!1,multiple:!1,folders:!1,oncomplete:""},upload:{ui:"uploadbutton"},quicklook:{autoplay:!0,jplayer:"extensions/jplayer"},edit:{mimes:[],editors:[]},info:{nullUrlDirLinkSelf:!0,custom:{}},netmount:{ftp:{inputs:{host:e('<input type="text"/>'),port:e('<input type="text" placeholder="21"/>'),path:e('<input type="text" value="/"/>'),user:e('<input type="text"/>'),pass:e('<input type="password"/>'),encoding:e('<input type="text" placeholder="Optional"/>'),locale:e('<input type="text" placeholder="Optional"/>')}},dropbox:{inputs:{host:e('<span><span class="elfinder-info-spinner"/></span></span><input type="hidden"/>'),path:e('<input type="text" value="/"/>'),user:e('<input type="hidden"/>'),pass:e('<input type="hidden"/>')},select:function(e){var t=this;t.inputs.host.find("span").length&&e.request({data:{cmd:"netmount",protocol:"dropbox",host:"dropbox.com",user:"init",pass:"init",options:{url:e.uploadURL,id:e.id}},preventDefault:!0}).done(function(n){t.inputs.host.find("span").removeClass("elfinder-info-spinner"),t.inputs.host.find("span").html(n.body.replace(/\{msg:([^}]+)\}/g,function(t,n){return e.i18n(n,"Dropbox.com")}))}).fail(function(){})},done:function(t,n){var i=this;"makebtn"==n.mode?(i.inputs.host.find("span").removeClass("elfinder-info-spinner"),i.inputs.host.find("input").hover(function(){e(this).toggleClass("ui-state-hover")}),i.inputs.host[1].value=""):(i.inputs.host.find("span").removeClass("elfinder-info-spinner"),i.inputs.host.find("span").html("Dropbox.com"),i.inputs.host[1].value="dropbox",i.inputs.user.val("done"),i.inputs.pass.val("done"))}}},help:{view:["about","shortcuts","help"]}},getFileCallback:null,defaultView:"icons",startPathHash:"",ui:["toolbar","tree","path","stat"],uiOptions:{toolbar:[["back","forward"],["netmount"],["mkdir","mkfile","upload"],["open","download","getfile"],["info","chmod"],["quicklook"],["copy","cut","paste"],["rm"],["duplicate","rename","edit","resize"],["extract","archive"],["search"],["view","sort"],["help"]],tree:{openRootOnLoad:!0,openCwdOnOpen:!0,syncTree:!0},navbar:{minWidth:150,maxWidth:500},cwd:{oldSchool:!1,listView:{columns:["perm","date","size","kind"],columnsCustomName:{}}}},onlyMimes:[],sortRules:{},sortType:"name",sortOrder:"asc",sortStickFolders:!0,clientFormatDate:!0,UTCDate:!1,dateFormat:"",fancyDateFormat:"",fileModeStyle:"both",width:"auto",height:400,resizable:!0,notifyDelay:500,notifyDialog:{position:{top:"12px",right:"12px"},width:280},allowShortcuts:!0,rememberLastDir:!0,reloadClearHistory:!1,useBrowserHistory:!0,showFiles:30,showThreshold:50,validName:!1,backupSuffix:"~",sync:0,syncStart:!0,loadTmbs:5,cookie:{expires:30,domain:"",path:"/",secure:!1},contextmenu:{navbar:["open","|","upload","|","copy","cut","paste","duplicate","|","rm","|","rename","|","places","info","chmod","netunmount"],cwd:["reload","back","|","upload","mkdir","mkfile","paste","|","sort","|","info"],files:["getfile","|","open","opendir","quicklook","|","download","upload","|","copy","cut","paste","duplicate","|","rm","|","edit","rename","resize","|","archive","extract","|","places","info","chmod"]},debug:["error","warning","event-destroy"]},elFinder.prototype.history=function(t){var n,i=this,a=!0,r=[],o=function(){r=[t.cwd().hash],n=0,a=!0},s=t.options.useBrowserHistory&&window.history&&window.history.pushState?window.history:null,l=function(s){return s&&i.canForward()||!s&&i.canBack()?(a=!1,t.exec("open",r[s?++n:--n]).fail(o)):e.Deferred().reject()};this.canBack=function(){return n>0},this.canForward=function(){return n<r.length-1},this.back=l,this.forward=function(){return l(!0)},t.open(function(){var e=r.length,i=t.cwd().hash;a&&(n>=0&&e>n+1&&r.splice(n+1),r[r.length-1]!=i&&r.push(i),n=r.length-1),a=!0,s&&(s.state?s.state.thash!=i&&s.pushState({thash:i},null,location.pathname+location.search+"#elf_"+i):s.replaceState({thash:i},null,location.pathname+location.search+"#elf_"+i))
11
+ }).reload(t.options.reloadClearHistory&&o)},elFinder.prototype.command=function(t){this.fm=t,this.name="",this.title="",this.state=-1,this.alwaysEnabled=!1,this._disabled=!1,this.disableOnSearch=!1,this.updateOnSelect=!0,this._handlers={enable:function(){this.update(void 0,this.value)},disable:function(){this.update(-1,this.value)},"open reload load":function(){this._disabled=!(this.alwaysEnabled||this.fm.isCommandEnabled(this.name)),this.update(void 0,this.value),this.change()}},this.handlers={},this.shortcuts=[],this.options={ui:"button"},this.setup=function(t,n){var i,a,r,o=this,s=this.fm;for(this.name=t,this.title=s.messages["cmd"+t]?s.i18n("cmd"+t):t,this.options=e.extend({},this.options,n),this.listeners=[],n.shortcuts&&("function"==typeof n.shortcuts?r=n.shortcuts(this.fm,this.shortcuts):e.isArray(n.shortcuts)&&(r=n.shortcuts),this.shortcuts=r||[]),this.updateOnSelect&&(this._handlers.select=function(){this.update(void 0,this.value)}),e.each(e.extend({},o._handlers,o.handlers),function(t,n){s.bind(t,e.proxy(n,o))}),i=0;i<this.shortcuts.length;i++)a=this.shortcuts[i],a.callback=e.proxy(a.callback||function(){this.exec()},this),!a.description&&(a.description=this.title),s.shortcut(a);this.disableOnSearch&&s.bind("search searchend",function(e){o._disabled="search"==e.type,o.update(void 0,o.value)}),this.init()},this.init=function(){},this.exec=function(){return e.Deferred().reject()},this.disabled=function(){return this.state<0},this.enabled=function(){return this.state>-1},this.active=function(){return this.state>0},this.getstate=function(){return-1},this.update=function(e,t){var n=this.state,i=this.value;this.state=this._disabled?-1:void 0!==e?e:this.getstate(),this.value=t,(n!=this.state||i!=this.value)&&this.change()},this.change=function(e){var t,n;if("function"==typeof e)this.listeners.push(e);else for(n=0;n<this.listeners.length;n++){t=this.listeners[n];try{t(this.state,this.value)}catch(i){this.fm.debug("error",i)}}return this},this.hashes=function(n){return n?e.map(e.isArray(n)?n:[n],function(e){return t.file(e)?e:null}):t.selected()},this.files=function(t){var n=this.fm;return t?e.map(e.isArray(t)?t:[t],function(e){return n.file(e)||null}):n.selectedFiles()}},elFinder.prototype.resources={"class":{hover:"ui-state-hover",active:"ui-state-active",disabled:"ui-state-disabled",draggable:"ui-draggable",droppable:"ui-droppable",adroppable:"elfinder-droppable-active",cwdfile:"elfinder-cwd-file",cwd:"elfinder-cwd",tree:"elfinder-tree",treeroot:"elfinder-navbar-root",navdir:"elfinder-navbar-dir",navdirwrap:"elfinder-navbar-dir-wrapper",navarrow:"elfinder-navbar-arrow",navsubtree:"elfinder-navbar-subtree",navcollapse:"elfinder-navbar-collapsed",navexpand:"elfinder-navbar-expanded",treedir:"elfinder-tree-dir",placedir:"elfinder-place-dir",searchbtn:"elfinder-button-search"},tpl:{perms:'<span class="elfinder-perms"/>',lock:'<span class="elfinder-lock"/>',symlink:'<span class="elfinder-symlink"/>',navicon:'<span class="elfinder-nav-icon"/>',navspinner:'<span class="elfinder-navbar-spinner"/>',navdir:'<div class="elfinder-navbar-wrapper"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}"><span class="elfinder-navbar-arrow"/><span class="elfinder-navbar-icon" {style}/>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree"/></div>',placedir:'<div class="elfinder-navbar-wrapper"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}" title="{title}"><span class="elfinder-navbar-arrow"/><span class="elfinder-navbar-icon" {style}/>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree"/></div>'},mimes:{text:["application/x-empty","application/javascript","application/xhtml+xml","audio/x-mp3-playlist","application/x-web-config","application/docbook+xml","application/x-php","application/x-perl","application/x-awk","application/x-config","application/x-csh","application/xml"]},mixin:{make:function(){var t,n,i,a=this.fm,r=this.name,o=a.getUI("cwd"),s="list"!=a.storage("view"),l=function(){s?(m.zIndex("").css("position",""),n.css("max-height","")):(i.css("width",""),i.parent("td").css("overflow",""))},d=e.Deferred().fail(function(e){l(),o.trigger("unselectall"),e&&a.error(e)}).always(function(){g.remove(),m.remove(),a.enable()}),c="tmp_"+parseInt(1e5*Math.random()),u=a.cwd().hash,p=new Date,h={hash:c,name:a.uniqueName(this.prefix),mime:this.mime,read:!0,write:!0,date:"Today "+p.getHours()+":"+p.getMinutes()},f=this.data||{},m=o.trigger("create."+a.namespace,h).find("#"+a.cwdHash2Id(c)),g=e(s?"<textarea/>":'<input type="text"/>').on("keyup text",function(){s?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):t&&(this.style.width=t+"px",this.scrollWidth>t&&(this.style.width=this.scrollWidth+10+"px"))}).keydown(function(t){t.stopImmediatePropagation(),t.keyCode==e.ui.keyCode.ESCAPE?d.reject():t.keyCode==e.ui.keyCode.ENTER&&g.blur()}).mousedown(function(e){e.stopPropagation()}).blur(function(){var t=e.trim(g.val()),n=g.parent(),i=!0;if(n.length){if(a.options.validName&&a.options.validName.test)try{i=a.options.validName.test(t)}catch(s){i=!1}if(!t||".."===t||!i)return a.error("errInvName"),!1;if(a.fileByName(t,u))return a.error(["errExists",t]),!1;l(),n.html(a.escape(t)),a.lockfiles({files:[c]}),a.request({data:e.extend({cmd:r,name:t,target:u},f||{}),notify:{type:r,cnt:1},preventFail:!0,syncOnFail:!0}).fail(function(e){d.reject(e)}).done(function(e){if(d.resolve(e),e.added&&e.added[0]){var t=o.find("#"+a.cwdHash2Id(e.added[0].hash));t.length&&t.trigger("scrolltoview")}})}});return this.disabled()||!m.length?d.reject():(a.disable(),n=m.find(".elfinder-cwd-filename"),i=n.parent(),s?(m.zIndex(m.parent().zIndex()+1).css("position","relative"),n.css("max-height","none")):(t=i.width(),i.width(t-15),i.parent("td").css("overflow","visible")),n.empty("").append(g.val(h.name)),g.trigger("keyup"),g.select().focus(),g[0].setSelectionRange&&g[0].setSelectionRange(0,h.name.replace(/\..+$/,"").length),d)}}},e.fn.dialogelfinder=function(t){var n="elfinderPosition",i="elfinderDestroyOnClose";if(this.not(".elfinder").each(function(){var a=(e(document),e('<div class="ui-widget-header dialogelfinder-drag ui-corner-top">'+(t.title||"Files")+"</div>")),r=(e('<a href="#" class="dialogelfinder-drag-close ui-corner-all"><span class="ui-icon ui-icon-closethick"/></a>').appendTo(a).click(function(e){e.preventDefault(),r.dialogelfinder("close")}),e(this).addClass("dialogelfinder").css("position","absolute").hide().appendTo("body").draggable({handle:".dialogelfinder-drag",containment:"window"}).elfinder(t).prepend(a));r.elfinder("instance"),r.width(parseInt(r.width())||840).data(i,!!t.destroyOnClose).find(".elfinder-toolbar").removeClass("ui-corner-top"),t.position&&r.data(n,t.position),t.autoOpen!==!1&&e(this).dialogelfinder("open")}),"open"==t){var a=e(this),r=a.data(n)||{top:parseInt(e(document).scrollTop()+(e(window).height()<a.height()?2:(e(window).height()-a.height())/2)),left:parseInt(e(document).scrollLeft()+(e(window).width()<a.width()?2:(e(window).width()-a.width())/2))},o=100;a.is(":hidden")&&(e("body").find(":visible").each(function(){var t,n=e(this);this!==a[0]&&"absolute"==n.css("position")&&(t=parseInt(n.zIndex()))>o&&(o=t+1)}),a.zIndex(o).css(r).show().trigger("resize"),setTimeout(function(){a.trigger("resize").mousedown()},200))}else if("close"==t){var a=e(this);a.is(":visible")&&(a.data(i)?a.elfinder("destroy").remove():a.elfinder("close"))}else if("instance"==t)return e(this).getElFinder();return this},elFinder&&elFinder.prototype&&"object"==typeof elFinder.prototype.i18&&(elFinder.prototype.i18.en={translator:"Troex Nevelin &lt;troex@fury.scancode.ru&gt;",language:"English",direction:"ltr",dateFormat:"M d, Y h:i A",fancyDateFormat:"$1 h:i A",messages:{error:"Error",errUnknown:"Unknown error.",errUnknownCmd:"Unknown command.",errJqui:"Invalid jQuery UI configuration. Selectable, draggable and droppable components must be included.",errNode:"elFinder requires DOM Element to be created.",errURL:"Invalid elFinder configuration! URL option is not set.",errAccess:"Access denied.",errConnect:"Unable to connect to backend.",errAbort:"Connection aborted.",errTimeout:"Connection timeout.",errNotFound:"Backend not found.",errResponse:"Invalid backend response.",errConf:"Invalid backend configuration.",errJSON:"PHP JSON module not installed.",errNoVolumes:"Readable volumes not available.",errCmdParams:'Invalid parameters for command "$1".',errDataNotJSON:"Data is not JSON.",errDataEmpty:"Data is empty.",errCmdReq:"Backend request requires command name.",errOpen:'Unable to open "$1".',errNotFolder:"Object is not a folder.",errNotFile:"Object is not a file.",errRead:'Unable to read "$1".',errWrite:'Unable to write into "$1".',errPerm:"Permission denied.",errLocked:'"$1" is locked and can not be renamed, moved or removed.',errExists:'File named "$1" already exists.',errInvName:"Invalid file name.",errFolderNotFound:"Folder not found.",errFileNotFound:"File not found.",errTrgFolderNotFound:'Target folder "$1" not found.',errPopup:"Browser prevented opening popup window. To open file enable it in browser options.",errMkdir:'Unable to create folder "$1".',errMkfile:'Unable to create file "$1".',errRename:'Unable to rename "$1".',errCopyFrom:'Copying files from volume "$1" not allowed.',errCopyTo:'Copying files to volume "$1" not allowed.',errMkOutLink:"Unable to create a link to outside the volume root.",errUpload:"Upload error.",errUploadFile:'Unable to upload "$1".',errUploadNoFiles:"No files found for upload.",errUploadTotalSize:"Data exceeds the maximum allowed size.",errUploadFileSize:"File exceeds maximum allowed size.",errUploadMime:"File type not allowed.",errUploadTransfer:'"$1" transfer error.',errUploadTemp:"Unable to make temporary file for upload.",errNotReplace:'Object "$1" already exists at this location and can not be replaced by object with another type.',errReplace:'Unable to replace "$1".',errSave:'Unable to save "$1".',errCopy:'Unable to copy "$1".',errMove:'Unable to move "$1".',errCopyInItself:'Unable to copy "$1" into itself.',errRm:'Unable to remove "$1".',errRmSrc:"Unable remove source file(s).",errExtract:'Unable to extract files from "$1".',errArchive:"Unable to create archive.",errArcType:"Unsupported archive type.",errNoArchive:"File is not archive or has unsupported archive type.",errCmdNoSupport:"Backend does not support this command.",errReplByChild:'The folder "$1" can\'t be replaced by an item it contains.',errArcSymlinks:"For security reason denied to unpack archives contains symlinks or files with not allowed names.",errArcMaxSize:"Archive files exceeds maximum allowed size.",errResize:'Unable to resize "$1".',errResizeDegree:"Invalid rotate degree.",errResizeRotate:"Unable to rotate image.",errResizeSize:"Invalid image size.",errResizeNoChange:"Image size not changed.",errUsupportType:"Unsupported file type.",errNotUTF8Content:'File "$1" is not in UTF-8 and cannot be edited.',errNetMount:'Unable to mount "$1".',errNetMountNoDriver:"Unsupported protocol.",errNetMountFailed:"Mount failed.",errNetMountHostReq:"Host required.",errSessionExpires:"Your session has expired due to inactivity.",errCreatingTempDir:'Unable to create temporary directory: "$1"',errFtpDownloadFile:'Unable to download file from FTP: "$1"',errFtpUploadFile:'Unable to upload file to FTP: "$1"',errFtpMkdir:'Unable to create remote directory on FTP: "$1"',errArchiveExec:'Error while archiving files: "$1"',errExtractExec:'Error while extracting files: "$1"',errNetUnMount:"Unable to unmount",errConvUTF8:"Not convertible to UTF-8",errFolderUpload:"Try Google Chrome, If you'd like to upload the folder.",errSearchTimeout:'Timed out while searching "$1". Search result is partial.',cmdarchive:"Create archive",cmdback:"Back",cmdcopy:"Copy",cmdcut:"Cut",cmddownload:"Download",cmdduplicate:"Duplicate",cmdedit:"Edit file",cmdextract:"Extract files from archive",cmdforward:"Forward",cmdgetfile:"Select files",cmdhelp:"About this software",cmdhome:"Home",cmdinfo:"Get info",cmdmkdir:"New folder",cmdmkfile:"New text file",cmdopen:"Open",cmdpaste:"Paste",cmdquicklook:"Preview",cmdreload:"Reload",cmdrename:"Rename",cmdrm:"Delete",cmdsearch:"Find files",cmdup:"Go to parent directory",cmdupload:"Upload files",cmdview:"View",cmdresize:"Resize & Rotate",cmdsort:"Sort",cmdnetmount:"Mount network volume",cmdnetunmount:"Unmount",cmdplaces:"To Places",cmdchmod:"Change mode",cmdopendir:"Open a folder",btnClose:"Close",btnSave:"Save",btnRm:"Remove",btnApply:"Apply",btnCancel:"Cancel",btnNo:"No",btnYes:"Yes",btnMount:"Mount",btnApprove:"Goto $1 & approve",btnUnmount:"Unmount",btnConv:"Convert",btnCwd:"Here",btnVolume:"Volume",btnAll:"All",btnMime:"MIME Type",btnFileName:"Filename",btnSaveClose:"Save & Close",btnBackup:"Backup",ntfopen:"Open folder",ntffile:"Open file",ntfreload:"Reload folder content",ntfmkdir:"Creating directory",ntfmkfile:"Creating files",ntfrm:"Delete files",ntfcopy:"Copy files",ntfmove:"Move files",ntfprepare:"Prepare to copy files",ntfrename:"Rename files",ntfupload:"Uploading files",ntfdownload:"Downloading files",ntfsave:"Save files",ntfarchive:"Creating archive",ntfextract:"Extracting files from archive",ntfsearch:"Searching files",ntfresize:"Resizing images",ntfsmth:"Doing something",ntfloadimg:"Loading image",ntfnetmount:"Mounting network volume",ntfnetunmount:"Unmounting network volume",ntfdim:"Acquiring image dimension",ntfreaddir:"Reading folder infomation",ntfurl:"Getting URL of link",ntfchmod:"Changing file mode",ntfpreupload:"Verifying upload file name",dateUnknown:"unknown",Today:"Today",Yesterday:"Yesterday",msJan:"Jan",msFeb:"Feb",msMar:"Mar",msApr:"Apr",msMay:"May",msJun:"Jun",msJul:"Jul",msAug:"Aug",msSep:"Sep",msOct:"Oct",msNov:"Nov",msDec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",Sun:"Sun",Mon:"Mon",Tue:"Tue",Wed:"Wed",Thu:"Thu",Fri:"Fri",Sat:"Sat",sortname:"by name",sortkind:"by kind",sortsize:"by size",sortdate:"by date",sortFoldersFirst:"Folders first","untitled file.txt":"NewFile.txt","untitled folder":"NewFolder",Archive:"NewArchive",confirmReq:"Confirmation required",confirmRm:"Are you sure you want to remove files?<br/>This cannot be undone!",confirmRepl:"Replace old file with new one?",confirmConvUTF8:"Not in UTF-8<br/>Convert to UTF-8?<br/>Contents become UTF-8 by saving after conversion.",confirmNotSave:"It has been modified.<br/>Losing work if you do not save changes.",apllyAll:"Apply to all",name:"Name",size:"Size",perms:"Permissions",modify:"Modified",kind:"Kind",read:"read",write:"write",noaccess:"no access",and:"and",unknown:"unknown",selectall:"Select all files",selectfiles:"Select file(s)",selectffile:"Select first file",selectlfile:"Select last file",viewlist:"List view",viewicons:"Icons view",places:"Places",calc:"Calculate",path:"Path",aliasfor:"Alias for",locked:"Locked",dim:"Dimensions",files:"Files",folders:"Folders",items:"Items",yes:"yes",no:"no",link:"Link",searcresult:"Search results",selected:"selected items",about:"About",shortcuts:"Shortcuts",help:"Help",webfm:"Web file manager",ver:"Version",protocolver:"protocol version",homepage:"Project home",docs:"Documentation",github:"Fork us on Github",twitter:"Follow us on twitter",facebook:"Join us on facebook",team:"Team",chiefdev:"chief developer",developer:"developer",contributor:"contributor",maintainer:"maintainer",translator:"translator",icons:"Icons",dontforget:"and don't forget to take your towel",shortcutsof:"Shortcuts disabled",dropFiles:"Drop files here",or:"or",selectForUpload:"Select files to upload",moveFiles:"Move files",copyFiles:"Copy files",rmFromPlaces:"Remove from places",aspectRatio:"Aspect ratio",scale:"Scale",width:"Width",height:"Height",resize:"Resize",crop:"Crop",rotate:"Rotate","rotate-cw":"Rotate 90 degrees CW","rotate-ccw":"Rotate 90 degrees CCW",degree:"°",netMountDialogTitle:"Mount network volume",protocol:"Protocol",host:"Host",port:"Port",user:"User",pass:"Password",confirmUnmount:"Are you unmount $1?",dropFilesBrowser:"Drop or Paste files from browser",dropPasteFiles:"Drop or Paste files here",encoding:"Encoding",locale:"Locale",searchTarget:"Target: $1",searchMime:"Search by input MIME Type",owner:"Owner",group:"Group",other:"Other",execute:"Execute",perm:"Permission",mode:"Mode",emptyFolder:"Folder is empty",emptyFolderDrop:"Folder is empty\\A Drop to add items",emptyFolderLTap:"Folder is empty\\A Long tap to add items",quality:"Quality",autoSync:"Auto sync",moveUp:"Move up",kindUnknown:"Unknown",kindFolder:"Folder",kindAlias:"Alias",kindAliasBroken:"Broken alias",kindApp:"Application",kindPostscript:"Postscript document",kindMsOffice:"Microsoft Office document",kindMsWord:"Microsoft Word document",kindMsExcel:"Microsoft Excel document",kindMsPP:"Microsoft Powerpoint presentation",kindOO:"Open Office document",kindAppFlash:"Flash application",kindPDF:"Portable Document Format (PDF)",kindTorrent:"Bittorrent file",kind7z:"7z archive",kindTAR:"TAR archive",kindGZIP:"GZIP archive",kindBZIP:"BZIP archive",kindXZ:"XZ archive",kindZIP:"ZIP archive",kindRAR:"RAR archive",kindJAR:"Java JAR file",kindTTF:"True Type font",kindOTF:"Open Type font",kindRPM:"RPM package",kindText:"Text document",kindTextPlain:"Plain text",kindPHP:"PHP source",kindCSS:"Cascading style sheet",kindHTML:"HTML document",kindJS:"Javascript source",kindRTF:"Rich Text Format",kindC:"C source",kindCHeader:"C header source",kindCPP:"C++ source",kindCPPHeader:"C++ header source",kindShell:"Unix shell script",kindPython:"Python source",kindJava:"Java source",kindRuby:"Ruby source",kindPerl:"Perl script",kindSQL:"SQL source",kindXML:"XML document",kindAWK:"AWK source",kindCSV:"Comma separated values",kindDOCBOOK:"Docbook XML document",kindMarkdown:"Markdown text",kindImage:"Image",kindBMP:"BMP image",kindJPEG:"JPEG image",kindGIF:"GIF Image",kindPNG:"PNG Image",kindTIFF:"TIFF image",kindTGA:"TGA image",kindPSD:"Adobe Photoshop image",kindXBITMAP:"X bitmap image",kindPXM:"Pixelmator image",kindAudio:"Audio media",kindAudioMPEG:"MPEG audio",kindAudioMPEG4:"MPEG-4 audio",kindAudioMIDI:"MIDI audio",kindAudioOGG:"Ogg Vorbis audio",kindAudioWAV:"WAV audio",AudioPlaylist:"MP3 playlist",kindVideo:"Video media",kindVideoDV:"DV movie",kindVideoMPEG:"MPEG movie",kindVideoMPEG4:"MPEG-4 movie",kindVideoAVI:"AVI movie",kindVideoMOV:"Quick Time movie",kindVideoWM:"Windows Media movie",kindVideoFlash:"Flash movie",kindVideoMKV:"Matroska movie",kindVideoOGG:"Ogg movie"}}),e.fn.elfinderbutton=function(t){return this.each(function(){var n,i="class",a=t.fm,r=a.res(i,"disabled"),o=a.res(i,"active"),s=a.res(i,"hover"),l="elfinder-button-menu-item",d="elfinder-button-menu-item-selected",c=e(this).addClass("ui-state-default elfinder-button").attr("title",t.title).append('<span class="elfinder-button-icon elfinder-button-icon-'+t.name+'"/>').hover(function(e){!c.hasClass(r)&&c["mouseleave"==e.type?"removeClass":"addClass"](s)}).click(function(e){c.hasClass(r)||(n&&t.variants.length>1?(n.is(":hidden")&&t.fm.getUI().click(),e.stopPropagation(),n.slideToggle(100)):t.exec())}),u=function(){n.hide()};e.isArray(t.variants)&&(c.addClass("elfinder-menubutton"),n=e('<div class="ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>').hide().appendTo(c).zIndex(12+c.zIndex()).on("mouseenter mouseleave","."+l,function(){e(this).toggleClass(s)}).on("click","."+l,function(i){i.preventDefault(),i.stopPropagation(),c.removeClass(s),n.hide(),t.exec(t.fm.selected(),e(this).data("value"))}),t.fm.bind("disable select",u).getUI().click(u),t.change(function(){n.html(""),e.each(t.variants,function(i,a){n.append(e('<div class="'+l+'">'+a[1]+"</div>").data("value",a[0]).addClass(a[0]==t.value?d:""))})})),t.change(function(){t.disabled()?c.removeClass(o+" "+s).addClass(r):(c.removeClass(r),c[t.active()?"addClass":"removeClass"](o))}).change()})},e.fn.elfindercontextmenu=function(t){return this.each(function(){var n=e(this),i="elfinder-contextmenu-item",a="elfinder-contextsubmenu-item",r="elfinder-contextmenu-extra-icon",o=n.addClass("ui-helper-reset ui-widget ui-state-default ui-corner-all elfinder-contextmenu elfinder-contextmenu-"+t.direction).hide().appendTo("body").on("mouseenter mouseleave","."+i,function(t){e(this).toggleClass("ui-state-hover","mouseenter"===t.type)}).on("mouseenter mouseleave","."+r,function(t){e(this).parent().toggleClass("ui-state-hover","mouseleave"===t.type)}).on("contextmenu",function(){return!1}),s="ltr"==t.direction?"left":"right",l=e.extend({},t.options.contextmenu),d=i+(t.UA.Touch?" elfinder-touch":""),c='<div class="'+d+'"><span class="elfinder-button-icon {icon} elfinder-contextmenu-icon"/><span>{label}</span></div>',u=function(t,n,i){return e(c.replace("{icon}",n?"elfinder-button-icon-"+n:"").replace("{label}",t)).click(function(e){e.stopPropagation(),e.preventDefault(),i()})},p=function(n,i){var a=e(window),r=o.outerWidth(),l=o.outerHeight(),d=a.width(),c=a.height(),u=a.scrollTop(),p=a.scrollLeft(),h=t.UA.Touch?10:0,f={top:c>i-u+h+l?i+h:i-h-l>0?i-h-l:i+h,left:d>n-p+h+r?n+h:n-h-r,"z-index":100+t.getUI("workzone").zIndex()};o.css(f).show(),f={"z-index":f["z-index"]+10},f[s]=parseInt(o.width()),o.find(".elfinder-contextmenu-sub").css(f)},h=function(){o.hide().empty(),t.trigger("closecontextmenu")},f=function(i,r){var s=!1,c={},p=[],f=0===r[0].indexOf(t.cwd().volumeid,0);n.data("cmdMaps")&&e.each(n.data("cmdMaps"),function(e,t){return 0==r[0].indexOf(e,0)?(c=t,!1):void 0}),f||t.disabledCmds&&e.each(t.disabledCmds,function(e,t){return 0==r[0].indexOf(e,0)?(p=t,!1):void 0}),e.each(l[i]||[],function(n,l){var m,g,v,b,y;if("|"==l&&s)return o.append('<div class="elfinder-contextmenu-separator"/>'),s=!1,void 0;if(c[l]&&(l=c[l]),m=t.command(l),m&&!f&&(y=m._disabled,m._disabled=!(m.alwaysEnabled||(t._commands[l]?-1===e.inArray(l,p):!1))),m&&-1!=m.getstate(r)){if(r._type=i,m.variants){if(!m.variants.length)return;g=u(m.title,m.name,function(){}).on("touchend",function(){g.data("touching",!0),setTimeout(function(){g.data("touching",!1)},50)}).on("click touchend","."+a,function(t){t.stopPropagation(),g.data("touching")?(g.data("touching",!1),e(this).removeClass("ui-state-hover"),t.preventDefault()):"click"==t.type&&(o.hide(),m.exec(r,e(this).data("exec")))}),v=e('<div class="ui-corner-all elfinder-contextmenu-sub"/>').appendTo(g.append('<span class="elfinder-contextmenu-arrow"/>')),b=function(){var t,n,i,a=e(window),r=e(g).offset().left,o=e(g).offset().top,s=e(g).outerWidth(),l=v.outerWidth(),d=v.outerHeight(),c=a.scrollLeft()+a.width(),u=a.scrollTop()+a.height(),p=5;i=r+s+l+p-c,t=i>0?s-i:s,i=o+5+d+p-u,n=i>0?5-i:5;var h={left:t,top:n};v.css(h).toggle()},g.addClass("elfinder-contextmenu-group").hover(function(){b()}),e.each(m.variants,function(t,n){v.append(e('<div class="'+d+" "+a+'"><span>'+n[1]+"</span></div>").data("exec",n[0]))})}else g=u(m.title,m.name,function(){h(),m.exec(r)}),m.extra&&m.extra.node?g.append(e('<span class="elfinder-button-icon elfinder-button-icon-'+(m.extra.icon||"")+' elfinder-contextmenu-extra-icon"/>').append(m.extra.node)):g.remove(".elfinder-contextmenu-extra-icon");o.append(g),s=!0}m&&!f&&(m._disabled=y)})},m=function(t){e.each(t,function(e,t){var n;"|"===t?o.append('<div class="elfinder-contextmenu-separator"/>'):t.label&&"function"==typeof t.callback&&(n=u(t.label,t.icon,function(){!t.remain&&h(),t.callback()}),o.append(n))})};t.one("load",function(){t.bind("contextmenu",function(e){var t=e.data;h(),t.type&&t.targets?f(t.type,t.targets):t.raw&&m(t.raw),o.children().length&&p(t.x,t.y)}).one("destroy",function(){o.remove()}).bind("disable select",function(){!n.data("mouseEvInternal")&&h(),n.data("mouseEvInternal",!1)}).getUI().click(h)})})},e.fn.elfindercwd=function(t,n){return this.not(".elfinder-cwd").each(function(){var i=t.UA.Mobile,a="list"==t.viewType,r="select."+t.namespace,o="unselect."+t.namespace,s="disable."+t.namespace,l="enable."+t.namespace,d="class",c=t.res(d,"cwdfile"),u="."+c,p="ui-selected",h=t.res(d,"disabled"),f=t.res(d,"draggable"),m=t.res(d,"droppable"),g=t.res(d,"hover"),v=t.res(d,"adroppable"),b=c+"-tmp",y=t.options.loadTmbs>0?t.options.loadTmbs:5,w="",x=[],k=[],C=function(){for(var e="",n=t.options.uiOptions.cwd.listView.columns,i=0;i<n.length;i++)e+="<td>{"+n[i]+"}</td>";return e},T={icon:'<div id="{id}" class="'+c+(t.UA.Touch?" elfinder-touch":"")+' {permsclass} {dirclass} ui-corner-all" title="{tooltip}"><div class="elfinder-cwd-file-wrapper ui-corner-all"><div class="elfinder-cwd-icon {mime} ui-corner-all" unselectable="on" {style}/>{marker}</div><div class="elfinder-cwd-filename" title="{nametitle}">{name}</div></div>',row:'<tr id="{id}" class="'+c+(t.UA.Touch?" elfinder-touch":"")+' {permsclass} {dirclass}" title="{tooltip}"><td><div class="elfinder-cwd-file-wrapper"><span class="elfinder-cwd-icon {mime}"/>{marker}<span class="elfinder-cwd-filename">{name}</span></div></td>'+C()+"</tr>"},I=t.res("tpl","perms"),F=t.res("tpl","lock"),M=t.res("tpl","symlink"),P={id:function(e){return t.cwdHash2Id(e.hash)},name:function(e){return name=t.escape(e.name),!a&&(name=name.replace(/([_.])/g,"&#8203;$1")),name},nametitle:function(e){return t.escape(e.name)},permsclass:function(e){return t.perms2class(e)},perm:function(e){return t.formatPermissions(e)},dirclass:function(e){return"directory"==e.mime?"directory":""},mime:function(e){return t.mime2class(e.mime)},size:function(e){return t.formatSize(e.size)},date:function(e){return t.formatDate(e)},kind:function(e){return t.mime2kind(e)},mode:function(e){return e.perm?t.formatFileMode(e.perm):""},modestr:function(e){return e.perm?t.formatFileMode(e.perm,"string"):""},modeoct:function(e){return e.perm?t.formatFileMode(e.perm,"octal"):""},modeboth:function(e){return e.perm?t.formatFileMode(e.perm,"both"):""},marker:function(e){return(e.alias||"symlink-broken"==e.mime?M:"")+(e.read&&e.write?"":I)+(e.locked?F:"")},tooltip:function(e){var n=t.formatDate(e)+(e.size>0?" ("+t.formatSize(e.size)+")":""),i="";return i=w&&e.path?t.escape(e.path.replace(/\/[^\/]*$/,"")):e.tooltip?t.escape(e.tooltip).replace(/\r/g,"&#13;"):"",i?i+"&#13;"+n:n}},S=function(e){return T[a?"row":"icon"].replace(/\{([a-z]+)\}/g,function(t,n){return P[n]?P[n](e):e[n]?e[n]:""})},z=!1,A=function(t,n){function i(e,t){return e[t+"All"]("[id]:not(."+h+"):not(.elfinder-cwd-parent):first")}var s,l,d,c,u,f=e.ui.keyCode,m=t==f.LEFT||t==f.UP,g=Z.find("[id]."+p);if(g.length)if(s=g.filter(m?":first":":last"),d=i(s,m?"prev":"next"),d.length)if(a||t==f.LEFT||t==f.RIGHT)l=d;else if(c=s.position().top,u=s.position().left,l=s,m){do l=l.prev("[id]");while(l.length&&!(l.position().top<c&&l.position().left<=u));l.hasClass(h)&&(l=i(l,"next"))}else{do l=l.next("[id]");while(l.length&&!(l.position().top>c&&l.position().left>=u));l.hasClass(h)&&(l=i(l,"prev")),l.length||(d=Z.find("[id]:not(."+h+"):last"),d.position().top>c&&(l=d))}else l=s;else l=Z.find("[id]:not(."+h+"):not(.elfinder-cwd-parent):"+(m?"last":"first"));l&&l.length&&!l.hasClass("elfinder-cwd-parent")&&(n?l=s.add(s[m?"prevUntil":"nextUntil"]("#"+l.attr("id"))).add(l):g.trigger(o),l.trigger(r),H(l.filter(m?":first":":last")),j())},D=[],O=function(n){e("#"+t.cwdHash2Id(n)).trigger(r)},U=function(){var n=t.cwd().hash;Z.find("[id]:not(."+p+"):not(.elfinder-cwd-parent)").trigger(r),D=e.map(t.files(),function(e){return e.phash==n?e.hash:null}),j()},E=function(){z=!1,D=[],Z.find("[id]."+p).trigger(o),j()},j=function(){t.trigger("select",{selected:D})},H=function(e){var t=e.position().top,n=e.outerHeight(!0),i=et.scrollTop(),a=et.innerHeight();t+n>i+a?et.scrollTop(parseInt(t+n-a)):i>t&&et.scrollTop(t)},R=[],_=function(e){for(var t=R.length;t--;)if(R[t].hash==e)return t;return-1},N="scroll."+t.namespace,q={filter:u,stop:j,delay:250,selected:function(t,n){e(n.selected).trigger(r)},unselected:function(t,n){e(n.unselected).trigger(o)}},L=function(){var n=function(){var o,s,l=[],d=!1,c=[],u={},h=R._last||Z.find("[id]:last"),f=!h.length,m=R._place||(a?Z.children("table").children("tbody"):Z);if(f&&(et._top=0),et._mousedown&&et._top!=et.scrollTop())return et._top=et.scrollTop(),setTimeout(function(){n()},50),void 0;if(delete R._timer,!R.length)return tt.hide(),et.off(N);for(;(!h.length||(o=h.position().top-(et.height()+et.scrollTop()+t.options.showThreshold))<=0)&&(s=R.splice(0,t.options.showFiles-(o||0)/(R._hpi||1))).length&&(l=e.map(s,function(e){return e.hash&&e.name?("directory"==e.mime&&(d=!0),e.tmb&&(1===e.tmb?c.push(e.hash):u[e.hash]=e.tmb),S(e)):null}),(f||!R.length)&&tt.hide(),m.append(l.join("")),h=Z.find("[id]:last"),f&&et.scrollTop(0),(f||!R._hpi)&&Y(m,s.length),!f););R._last=h,W(u),c.length&&B(c),d&&!i&&V(),D.length&&m.find("[id]:not(."+p+"):not(.elfinder-cwd-parent)").each(function(){var n=t.cwdId2Hash(this.id);-1!==e.inArray(n,D)&&e(this).trigger(r)})};R._timer&&clearTimeout(R._timer),!R._timer&&n(),R._timer=setTimeout(function(){n()},100)},$=e.extend({},t.droppable,{over:function(n,i){var a,r,o,s=e(this),l=i.helper,c=n.shiftKey||n.ctrlKey||n.metaKey;return n.stopPropagation(),l.data("dropover",l.data("dropover")+1),s.data("dropover",!0),l.data("namespace")!==t.namespace?(s.removeClass(v),!1):(s.hasClass(t.res(d,"cwdfile"))?(a=t.cwdId2Hash(s.attr("id")),s.data("dropover",a)):(a=t.cwd().hash,t.cwd().write&&s.data("dropover",a)),o=t.file(l.data("files")[0]).phash===a,s.data("dropover")===a?e.each(l.data("files"),function(e,t){return t===a||o&&!c&&!l.hasClass("elfinder-drag-helper-plus")?(s.removeClass(v),!1):void 0}):s.removeClass(v),l.data("locked")||o?r="elfinder-drag-helper-plus":(r="elfinder-drag-helper-move",c&&(r+=" elfinder-drag-helper-plus")),s.hasClass(v)&&l.addClass(r),setTimeout(function(){s.hasClass(v)&&l.addClass(r)},20),void 0)},out:function(t,n){var i=n.helper;t.stopPropagation(),i.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(i.data("dropover")-1,0)),e(this).removeData("dropover").removeClass(v)},deactivate:function(){e(this).removeData("dropover").removeClass(v)}}),V=function(){var e=Z.find(".directory:not(."+m+",.elfinder-na,.elfinder-ro)");t.isCommandEnabled("paste")&&e.droppable($),t.isCommandEnabled("upload")&&e.addClass("native-droppable")},W=function(n){var i,a=t.option("tmbUrl"),r=!0;return e.each(n,function(n,o){var s=e("#"+t.cwdHash2Id(n));s.length?function(t,n){e("<img/>").load(function(){t.find(".elfinder-cwd-icon").css("background","url('"+n+"') center center no-repeat")}).attr("src",n)}(s,t.tmbUrls._search?t.tmb(n):a+o):(r=!1,-1!=(i=_(n))&&(R[i].tmb=o))}),r},B=function(e){var n=[];return t.oldAPI?(t.request({data:{cmd:"tmb",current:t.cwd().hash},preventFail:!0}).done(function(e){W(e.images||[])&&e.tmb&&B()}),void 0):(n=n=e.splice(0,y),n.length&&t.request({data:{cmd:"tmb",targets:n},preventFail:!0}).done(function(t){W(t.images||[])&&B(e)}),void 0)},K=function(n){var r,o,s,l,d=a?Z.find("tbody"):Z,c=n.length,u=[],p={},h=!1,f=function(e){for(var n,i=Z.find("[id]:first");i.length;){if(n=t.file(t.cwdId2Hash(i.attr("id"))),!i.hasClass("elfinder-cwd-parent")&&n&&t.compare(e,n)<0)return i;i=i.next("[id]")}},m=function(e){var n,i=R.length;for(n=0;i>n;n++)if(t.compare(e,R[n])<0)return n;return i||-1};for(c&&et.removeClass("elfinder-cwd-wrapper-empty");c--;)r=n[c],o=r.hash,e("#"+t.cwdHash2Id(o)).length||((s=f(r))&&s.length?s.before(S(r)):(l=m(r))>=0?R.splice(l,0,r):d.append(S(r)),e("#"+t.cwdHash2Id(o)).length&&("directory"==r.mime?h=!0:r.tmb&&(1===r.tmb?u.push(o):p[o]=r.tmb)));Y(d),W(p),u.length&&B(u),h&&!i&&V()},J=function(n){var i,a,r,o=n.length;if(!t.cwd().hash&&"open"!==t.currentReqCmd)return e.each(k.reverse(),function(e,n){return t.files()[n]?(t.one(t.currentReqCmd,function(){t.exec("open",n)}),!1):void 0}),void 0;for(;o--;)if(i=n[o],(a=e("#"+t.cwdHash2Id(i))).length)try{a.remove()}catch(s){t.debug("error",s)}else-1!=(r=_(i))&&R.splice(r,1);
12
+ Z.children().length<1&&(et.addClass("elfinder-cwd-wrapper-empty"),Z.hide(),setTimeout(function(){Z.show()},0))},G={name:t.i18n("name"),perm:t.i18n("perms"),date:t.i18n("modify"),size:t.i18n("size"),kind:t.i18n("kind"),modestr:t.i18n("mode"),modeoct:t.i18n("mode"),modeboth:t.i18n("mode")},X=function(){for(var n="",i="",a=t.options.uiOptions.cwd.listView.columns,r=e.extend({},G,t.options.uiOptions.cwd.listView.columnsCustomName),o=0;o<a.length;o++)n="undefined"!=typeof r[a[o]]?r[a[o]]:t.i18n(a[o]),i+='<td class="elfinder-cwd-view-th-'+a[o]+'">'+n+"</td>";return i},Y=function(e,t){var n;e=e||(a?Z.find("tbody"):Z),R.length>0&&(e.css({height:"auto"}),n=e.height(),t&&(R._hpi=n/t),tt.css({top:R._hpi*R.length+n+"px"}).show())},Q=function(i,r){var o=t.cwd().hash;k=t.parents(o),E();try{Z.empty()}catch(s){Z.html("")}if(Z.removeClass("elfinder-cwd-view-icons elfinder-cwd-view-list").addClass("elfinder-cwd-view-"+(a?"list":"icons")),Z.css("height","auto"),tt.hide(),et[a?"addClass":"removeClass"]("elfinder-cwd-wrapper-list"),et._padding=parseInt(et.css("padding-top"))+parseInt(et.css("padding-bottom")),a&&Z.html('<table><thead><tr class="ui-state-default'+(t.UA.Touch?" elfinder-touch":"")+'"><td class="elfinder-cwd-view-th-name">'+G.name+"</td>"+X()+"</tr></thead><tbody/></table>"),R=e.map(i,function(e){return r||e.phash==o?e:null}),R=t.sortFiles(R),et[!r&&R.length<1?"addClass":"removeClass"]("elfinder-cwd-wrapper-empty").on(N,L).trigger(N),o=t.cwd().phash,n.oldSchool&&o&&!w){var l=e.extend(!0,{},t.file(o),{name:"..",mime:"directory"});l=e(S(l)).addClass("elfinder-cwd-parent").bind("mousedown click mouseup touchstart touchmove touchend dblclick mouseenter",function(e){e.preventDefault(),e.stopPropagation()}).dblclick(function(){t.exec("open",t.cwdId2Hash(this.id))}),(a?Z.find("tbody"):Z).prepend(l)}r||!t.cwd().write?et.removeClass("native-droppable").droppable("disable"):(et[t.isCommandEnabled("upload")?"addClass":"removeClass"]("native-droppable"),et.droppable("enable"))},Z=e(this).addClass("ui-helper-clearfix elfinder-cwd").attr("unselectable","on").on("click."+t.namespace,u,function(n){var i,a=this.id?e(this):e(this).parents("[id]:first"),s=a.prevAll("."+p+":first"),l=a.nextAll("."+p+":first"),d=s.length,c=l.length;if(Z.data("longtap"))return n.stopPropagation(),void 0;if(n.stopImmediatePropagation(),n.shiftKey&&(d||c))i=d?a.prevUntil("#"+s.attr("id")):a.nextUntil("#"+l.attr("id")),i.add(a).trigger(r);else if(n.ctrlKey||n.metaKey)a.trigger(a.hasClass(p)?o:r);else{if(a.data("touching")&&a.hasClass(p))return a.data("touching",null),t.dblclick({file:t.cwdId2Hash(this.id)}),E(),void 0;E(),a.trigger(r)}j()}).on("dblclick."+t.namespace,u,function(){t.dblclick({file:t.cwdId2Hash(this.id)})}).on("touchstart."+t.namespace,u,function(n){if(n.stopPropagation(),"INPUT"!=n.target.nodeName&&"TEXTAREA"!=n.target.nodeName){var i=this.id?e(this):e(this).parents("[id]:first"),a=i.prevAll("."+p+":first").length+i.nextAll("."+p+":first").length;Z.data("longtap",null),i.addClass(g).data("touching",!0).data("tmlongtap",setTimeout(function(){Z.data("longtap",!0),i.hasClass(p)&&a>0?(i.trigger(o),j()):("TD"!=n.target.nodeName||t.selected().length>0)&&(i.trigger(r),j(),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY}))},500))}}).on("touchmove."+t.namespace+" touchend."+t.namespace,u,function(t){if(t.stopPropagation(),"INPUT"!=t.target.nodeName&&"TEXTAREA"!=t.target.nodeName){var n=this.id?e(this):e(this).parents("[id]:first");clearTimeout(n.data("tmlongtap")),"touchmove"==t.type&&n.removeClass(g)}}).on("mouseenter."+t.namespace,u,function(){var n=e(this),o=null,s=a?n:n.children("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");i||n.hasClass(b)||s.hasClass(f+" "+h)||s.on("mousedown",function(n){n.shiftKey&&!t.UA.IE&&Z.data("selectable")&&(Z.selectable("destroy").data("selectable",!1),setTimeout(function(){Z.selectable(q).data("selectable",!0)},10)),s.draggable("option","disabled",n.shiftKey),n.shiftKey?s.attr("draggable","true"):s.attr("draggable","false").draggable("option","cursorAt",{left:50-parseInt(e(n.currentTarget).css("margin-left")),top:47})}).on("dragstart",function(n){var i=n.dataTransfer||n.originalEvent.dataTransfer||null;if(o=null,i&&!t.UA.IE){var a,s=this.id?e(this):e(this).parents("[id]:first"),l=e("<span>"),d="",c=null,u=null,p=[],h=function(n){var i,a=n.mime;return i='<div class="elfinder-cwd-icon '+t.mime2class(a)+' ui-corner-all"/>',n.tmb&&1!==n.tmb&&(i=e(i).css("background","url('"+t.option("tmbUrl")+n.tmb+"') center center no-repeat").get(0).outerHTML),i},f=[];if(s.trigger(r),j(),e.each(D,function(n,i){var a=t.file(i),r=a.url;if(a&&"directory"!==a.mime){if(r){if("1"==r)return f.push(i),!0}else r=t.url(a.hash);r&&(r=t.convAbsUrl(r),p.push(i),e("<a>").attr("href",r).text(r).appendTo(l),d+=r+"\n",c||(c=a.mime+":"+a.name+":"+r),u||(u=r+"\n"+a.name))}}),f.length)return e.each(f,function(e,n){var i=t.file(n);i.url="",t.request({data:{cmd:"url",target:n},notify:{type:"url",cnt:1},preventDefault:!0}).always(function(e){i.url=e.url?e.url:"1"})}),!1;if(!d)return!1;i.setDragImage&&(o=e('<div class="elfinder-drag-helper html5-native"></div>').append(h(t.file(p[0]))).appendTo(e(document.body)),(a=p.length)>1&&o.append(h(t.file(p[a-1]))+'<span class="elfinder-drag-num">'+a+"</span>"),i.setDragImage(o.get(0),50,47)),i.effectAllowed="copyLink",i.setData("DownloadURL",c),i.setData("text/x-moz-url",u),i.setData("text/uri-list",d),i.setData("text/plain",d),i.setData("text/html",l.html()),i.setData("elfinderfrom",window.location.href+t.cwd().hash),i.setData("elfinderfrom:"+i.getData("elfinderfrom"),"")}}).on("dragend",function(){E(),o&&o.remove()}).draggable(t.draggable)}).on(r,u,function(){var n=e(this),i=t.cwdId2Hash(n.attr("id"));z||n.hasClass(h)||(n.addClass(p).children().addClass(g),-1===e.inArray(i,D)&&D.push(i))}).on(o,u,function(){var n,i=e(this),a=t.cwdId2Hash(i.attr("id"));z||(e(this).removeClass(p).children().removeClass(g),n=e.inArray(a,D),-1!==n&&D.splice(n,1))}).on(s,u,function(){var t=e(this).removeClass(g+" "+p).addClass(h),n=t.children(),i=a?t:n;n.removeClass(g+" "+p),t.hasClass(m)&&t.droppable("disable"),i.hasClass(f)&&i.draggable("disable")}).on(l,u,function(){var t=e(this).removeClass(h),n=a?t:t.children();t.hasClass(m)&&t.droppable("enable"),n.hasClass(f)&&n.draggable("enable")}).on("scrolltoview",u,function(){H(e(this))}).on("mouseenter."+t.namespace+" mouseleave."+t.namespace,u,function(n){t.trigger("hover",{hash:t.cwdId2Hash(e(this).attr("id")),type:n.type}),e(this).toggleClass(g,"mouseenter"==n.type)}).on("contextmenu."+t.namespace,function(n){var i=e(n.target).closest("."+c);i.length&&("TD"!=n.target.nodeName||e.inArray(t.cwdId2Hash(i.get(0).id),t.selected())>-1)&&(n.stopPropagation(),n.preventDefault(),i.hasClass(h)||i.data("touching")||(i.hasClass(p)||(E(),i.trigger(r),j()),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.pageX,y:n.pageY})))}).on("click."+t.namespace,function(e){return Z.data("longtap")?(e.stopPropagation(),void 0):(!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&E(),void 0)}).selectable(q).data("selectable",!0).on("create."+t.namespace,function(t,n){var i=a?Z.find("tbody"):Z,r=i.find(".elfinder-cwd-parent"),n=e(S(n)).addClass(b);E(),r.length?r.after(n):i.prepend(n),Z.parent().scrollTop(0)}).on("unselectall",E).on("selectfile",function(n,i){e("#"+t.cwdHash2Id(i)).trigger(r),j()}),et=e('<div class="elfinder-cwd-wrapper"/>').droppable(e.extend({},$,{autoDisable:!1})).on("contextmenu",function(e){e.preventDefault(),t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:e.pageX,y:e.pageY})}).on("touchstart."+t.namespace,function(n){var i=e(this);Z.data("longtap",null),i.data("touching",!0),i.data("tmlongtap",setTimeout(function(){Z.data("longtap",!0),t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY})},500))}).on("touchmove."+t.namespace+" touchend."+t.namespace,function(){clearTimeout(e(this).data("tmlongtap"))}).on("mousedown",function(){et._mousedown=!0}).on("mouseup",function(){et._mousedown=!1}),tt=e("<div>&nbsp;</div>").css({position:"absolute",width:"1px",height:"1px"}).hide(),nt=null,it=function(t){var n=function(){var t=0;et.siblings("div.elfinder-panel:visible").each(function(){t+=e(this).outerHeight(!0)}),et.height(rt.height()-t-et._padding)};t&&n(),nt&&clearTimeout(nt),nt=setTimeout(function(){!t&&n();var e,i;Z.css("height","auto"),e=et[0].clientHeight-parseInt(et.css("padding-top"))-parseInt(et.css("padding-bottom")),i=Z.outerHeight(!0),e>i&&Z.height(e)},20)},at=e(this).parent().resize(it),rt=at.children(".elfinder-workzone").append(et.append(this).append(tt));e("body").on("touchstart touchmove touchend",function(){}),t.one("init",function(){var e,n=document.createElement("style");document.head.appendChild(n),e=n.sheet,e.insertRule('.elfinder-cwd-wrapper-empty .elfinder-cwd:after{ content:"'+t.i18n("emptyFolder")+'" }',0),e.insertRule('.ui-droppable.elfinder-cwd-wrapper-empty .elfinder-cwd:after{ content:"'+t.i18n("emptyFolder"+(i?"LTap":"Drop"))+'" }',1),e.insertRule('.ui-droppable.elfinder-cwd-wrapper-empty.ui-droppable-disabled .elfinder-cwd:after{ content:"'+t.i18n("emptyFolder")+'" }',2)}).bind("open",function(e){Q(e.data.files),it()}).bind("search",function(e){x=e.data.files,Q(x,!0),et.addClass("elfinder-search-result"),t.autoSync("stop"),it()}).bind("searchend",function(e){x=[],w&&(w="",e.data&&e.data.noupdate||Q(t.files())),et.removeClass("elfinder-search-result"),t.autoSync(),it()}).bind("searchstart",function(e){w=e.data.query}).bind("sortchange",function(){Q(w?x:t.files(),!!w)}).bind("viewchange",function(){var n=t.selected(),i="list"==t.storage("view");i!=a&&(a=i,Q(w?x:t.files(),!!w),e.each(n,function(e,t){O(t)}),j()),it()}).bind("resize",function(){var e=a?Z.find("tbody"):Z;it(!0),Y(e,e.find("[id]").length)}).bind("add",function(){it()}).add(function(n){var i=t.cwd().hash,a=w?e.map(n.data.added||[],function(e){return-1===e.name.indexOf(w)?null:e}):e.map(n.data.added||[],function(e){return e.phash==i?e:null});K(a)}).change(function(n){var i=t.cwd().hash,a=t.selected();w?e.each(n.data.changed||[],function(t,n){J([n.hash]),-1!==n.name.indexOf(w)&&(K([n]),-1!==e.inArray(n.hash,a)&&O(n.hash))}):e.each(e.map(n.data.changed||[],function(e){return e.phash==i?e:null}),function(t,n){J([n.hash]),K([n]),-1!==e.inArray(n.hash,a)&&O(n.hash)}),j()}).remove(function(e){J(e.data.removed||[]),j()}).dragstart(function(t){var n=e(t.data.target),i=t.data.originalEvent;n.hasClass(u.substr(1))&&(n.hasClass(p)||(!(i.ctrlKey||i.metaKey||i.shiftKey)&&E(),n.trigger(r),j())),Z.selectable("disable").removeClass(h),z=!0}).dragstop(function(){Z.selectable("enable"),z=!1}).bind("lockfiles unlockfiles selectfiles unselectfiles",function(n){var i,a,d={lockfiles:s,unlockfiles:l,selectfiles:r,unselectfiles:o},c=d[n.type],u=n.data.files||[],p=u.length,h=n.data.helper||e();if(p>0&&(i=t.parents(u[0])),!h.data("locked")){for(;p--;)e("#"+t.cwdHash2Id(u[p])).trigger(c);j()}et.data("dropover")&&-1!==i.indexOf(et.data("dropover"))&&(a="lockfiles"!==n.type,h.toggleClass("elfinder-drag-helper-plus",a),et.toggleClass(v,a))}).bind("mkdir mkfile duplicate upload rename archive extract paste multiupload",function(n){if("upload"!=n.type||!n.data._multiupload){var i=t.cwd().hash;E(),e.each(n.data.added||[],function(e,t){t&&t.phash==i&&O(t.hash)}),j()}}).shortcut({pattern:"ctrl+a",description:"selectall",callback:U}).shortcut({pattern:"left right up down shift+left shift+right shift+up shift+down",description:"selectfiles",type:"keydown",callback:function(e){A(e.keyCode,e.shiftKey)}}).shortcut({pattern:"home",description:"selectffile",callback:function(){E(),H(Z.find("[id]:first").trigger(r)),j()}}).shortcut({pattern:"end",description:"selectlfile",callback:function(){E(),H(Z.find("[id]:last").trigger(r)),j()}})}),this},e.fn.elfinderdialog=function(t){var n;return"string"==typeof t&&(n=this.closest(".ui-dialog")).length&&("open"==t?"none"==n.css("display")&&n.fadeIn(120,function(){n.trigger("open")}):"close"==t?"none"!=n.css("display")&&n.hide().trigger("close"):"destroy"==t?n.hide().remove():"toTop"==t?n.trigger("totop"):"posInit"==t&&n.trigger("posinit")),t=e.extend({},e.fn.elfinderdialog.defaults,t),this.filter(":not(.ui-dialog-content)").each(function(){var n=e(this).addClass("ui-dialog-content ui-widget-content"),i=n.parent(),a="elfinder-dialog-active",r="elfinder-dialog",o="elfinder-dialog-notify",s="ui-state-hover",l=parseInt(1e6*Math.random()),d=i.children(".elfinder-overlay"),c=e('<div class="ui-dialog-buttonset"/>'),u=e('<div class=" ui-helper-clearfix ui-dialog-buttonpane ui-widget-content"/>').append(c),p=-1!=window.navigator.platform.indexOf("Win"),h=e('<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable std42-dialog '+r+" "+t.cssClass+'"/>').hide().append(n).appendTo(i).draggable({handle:".ui-dialog-titlebar",containment:"document",stop:function(){h.css({height:t.height})}}).css({width:t.width,height:t.height}).mousedown(function(t){t.stopPropagation(),e(document).mousedown(),h.hasClass(a)||(i.find("."+r+":visible").removeClass(a),h.addClass(a).zIndex(f()+1))}).on("open",function(){var a=e(this),s=a.outerWidth()>i.width()-10?i.width()-10:null;s&&a.css({width:s,left:"5px"}),h.trigger("totop"),"function"==typeof t.open&&e.proxy(t.open,n[0])(),h.hasClass(o)||i.find("."+r+":visible").not("."+o).each(function(){var t=e(this),n=parseInt(t.css("top")),i=parseInt(t.css("left")),a=parseInt(h.css("top")),r=parseInt(h.css("left"));t[0]==h[0]||n!=a&&i!=r||h.css({top:n+(s?15:10)+"px",left:(s?5:i+10)+"px"})})}).on("close",function(){var a=i.find(".elfinder-dialog:visible"),r=f();e(this).data("modal")&&d.elfinderoverlay("hide"),a.length?a.each(function(){var t=e(this);return t.zIndex()>=r?(t.trigger("totop"),!1):void 0}):setTimeout(function(){i.mousedown().click()},10),"function"==typeof t.close?e.proxy(t.close,n[0])():t.destroyOnClose&&h.hide().remove()}).on("totop",function(){e(this).mousedown().find(".ui-button:"+(p?"first":"last")).focus().end().find(":text:first").focus(),e(this).data("modal")&&d.is(":hidden")&&d.elfinderoverlay("show"),d.zIndex(e(this).zIndex())}).on("posinit",function(){var e=t.position;e||(e={top:Math.max(0,parseInt((i.height()-h.outerHeight())/2-42))+"px",left:Math.max(0,parseInt((i.width()-h.outerWidth())/2))+"px"}),h.css(e)}).data({modal:t.modal}),f=function(){var t=i.zIndex()+10;return i.find("."+r+":visible").each(function(){var n;this!=h[0]&&(n=e(this).zIndex(),n>t&&(t=n))}),t};h.trigger("posinit"),t.closeOnEscape&&e(document).on("keyup."+l,function(t){t.keyCode==e.ui.keyCode.ESCAPE&&h.hasClass(a)&&(n.elfinderdialog("close"),e(document).off("keyup."+l))}),h.prepend(e('<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">'+t.title+"</div>").prepend(e('<a href="#" class="ui-dialog-titlebar-close ui-corner-all"><span class="ui-icon ui-icon-closethick"/></a>').mousedown(function(e){e.preventDefault(),n.elfinderdialog("close")}))),e.each(t.buttons,function(i,a){var r=e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text">'+i+"</span></button>").click(e.proxy(a,n[0])).hover(function(n){t.btnHoverFocus?e(this)["mouseenter"==n.type?"focus":"blur"]():e(this).toggleClass(s,"mouseenter"==n.type)}).focus(function(){e(this).addClass(s)}).blur(function(){e(this).removeClass(s)}).keydown(function(t){var n;t.keyCode==e.ui.keyCode.ENTER?e(this).click():t.keyCode==e.ui.keyCode.TAB||t.keyCode==e.ui.keyCode.RIGHT?(t.preventDefault(),n=e(this).next(".ui-button"),n.length?n.focus():e(this).parent().children(".ui-button:first").focus()):t.keyCode==e.ui.keyCode.LEFT&&(t.preventDefault(),n=e(this).prev(".ui-button"),n.length?n.focus():e(this).parent().children(".ui-button:last").focus())});p?c.append(r):c.prepend(r)}),c.children().length&&h.append(u),t.resizable&&e.fn.resizable&&h.resizable({minWidth:t.minWidth,minHeight:t.minHeight,alsoResize:this}),"function"==typeof t.create&&e.proxy(t.create,this)(),t.autoOpen&&n.elfinderdialog("open")}),this},e.fn.elfinderdialog.defaults={cssClass:"",title:"",modal:!1,resizable:!0,autoOpen:!0,closeOnEscape:!0,destroyOnClose:!1,buttons:{},btnHoverFocus:!0,position:null,width:320,height:"auto",minWidth:200,minHeight:110},e.fn.elfindernavbar=function(t,n){return this.not(".elfinder-navbar").each(function(){var i,a=e(this).addClass("ui-state-default elfinder-navbar"),r=a.parent().resize(function(){a.height(o.height()-s)}),o=r.children(".elfinder-workzone").append(a),s=a.outerHeight()-a.height(),l="ltr"==t.direction;if(e.fn.resizable){if(i=a.resizable({handles:l?"e":"w",minWidth:n.minWidth||150,maxWidth:n.maxWidth||500}).on("resize scroll",function(){var e=t.UA.Opera&&a.scrollLeft()?20:2;i.css({top:parseInt(a.scrollTop())+"px",left:l?"auto":parseInt(a.scrollLeft()+e),right:l?-1*parseInt(a.scrollLeft()-e):"auto"})}).find(".ui-resizable-handle").zIndex(a.zIndex()+10),t.UA.Touch){var d=function(){i.data("closed")?(i.data("closed",!1).css({backgroundColor:"transparent"}),a.css({width:i.data("width")}).trigger("resize")):(i.data("closed",!0).css({backgroundColor:"inherit"}),a.css({width:8})),i.data({startX:null,endX:null})};i.data({closed:!1,width:a.width()}).on("touchstart",function(e){i.data("startX",e.originalEvent.touches[0].pageX)}).on("touchmove",function(e){var t=e.originalEvent.touches[0].pageX,n=i.data("startX"),a=l?n&&t>n:n>t,r=l?n>t:n&&t>n;(a||r)&&d()}).on("touchend",function(){i.data("startX")&&d()}),t.UA.Mobile&&(i.data("defWidth",a.width()),e(window).on("resize",function(){var e=a.parent().width()/2;i.data("defWidth")>e?a.width(e):a.width(i.data("defWidth")),i.data("width",a.width())}))}t.one("open",function(){setTimeout(function(){a.trigger("resize")},150)})}}),this},e.fn.elfinderoverlay=function(t){if(this.filter(":not(.elfinder-overlay)").each(function(){t=e.extend({},t),e(this).addClass("ui-widget-overlay elfinder-overlay").hide().mousedown(function(e){e.preventDefault(),e.stopPropagation()}).data({cnt:0,show:"function"==typeof t.show?t.show:function(){},hide:"function"==typeof t.hide?t.hide:function(){}})}),"show"==t){var n=this.eq(0),i=n.data("cnt")+1,a=n.data("show");n.data("cnt",i),n.is(":hidden")&&(n.zIndex(n.parent().zIndex()+1),n.show(),a())}if("hide"==t){var n=this.eq(0),i=n.data("cnt")-1,r=n.data("hide");n.data("cnt",i),0==i&&n.is(":visible")&&(n.hide(),r())}return this},e.fn.elfinderpanel=function(t){return this.each(function(){var n=e(this).addClass("elfinder-panel ui-state-default ui-corner-all"),i="margin-"+("ltr"==t.direction?"left":"right");t.one("load",function(){var e=t.getUI("navbar");n.css(i,parseInt(e.outerWidth(!0))),e.on("resize",function(){n.is(":visible")&&n.css(i,parseInt(e.outerWidth(!0)))})})})},e.fn.elfinderpath=function(t){return this.each(function(){var n="",i="",a=[],r=e(this).addClass("elfinder-path").html("&nbsp;").on("click","a",function(i){var r=e(this).attr("href").substr(5);i.preventDefault(),r!=t.cwd().hash&&(n?t.exec("search",n,{target:r,mime:a.join(" ")}):t.exec("open",r))}).prependTo(t.getUI("statusbar").show());t.bind("open searchend parents",function(){var o=[];n="",i="",a=[],e.each(t.parents(t.cwd().hash),function(e,n){o.push('<a href="#elf_'+n+'">'+t.escape(t.file(n).name)+"</a>")}),r.html(o.join(t.option("separator")))}).bind("searchstart",function(e){e.data&&(n=e.data.query||"",i=e.data.target||"",a=e.data.mimes||[])}).bind("search",function(){var n=[],a="";i?(e.each(t.parents(i),function(e,i){n.push('<a href="#elf_'+i+'">'+t.escape(t.file(i).name)+"</a>")}),a=n.join(t.option("separator"))):a=t.i18n("btnAll"),r.html(t.i18n("searcresult")+": "+a)})})},e.fn.elfinderplaces=function(t,n){return this.each(function(){var i={},a="class",r=t.res(a,"navdir"),o=t.res(a,"navcollapse"),s=t.res(a,"navexpand"),l=t.res(a,"hover"),d=t.res(a,"treeroot"),c=t.res(a,"adroppable"),u=t.res("tpl","placedir"),p=t.res("tpl","perms"),h=e(t.res("tpl","navspinner")),f="places"+(n.suffix?n.suffix:""),m=null,g=function(e){return e.substr(6)},v=function(e){return"place-"+e},b=function(){var n=[],a=[];n=e.map(M.children().find("[id]"),function(e){return g(e.id)}),e.each(n.reverse(),function(e,t){a.push(t+"#"+i[t].name)}),t.storage(f,a.join(","))},y=function(n,i){return e(u.replace(/\{id\}/,v(n?n.hash:i)).replace(/\{name\}/,t.escape(n?n.name:i)).replace(/\{cssclass\}/,n?(t.UA.Touch?"elfinder-touch ":"")+t.perms2class(n):"").replace(/\{permissions\}/,!n||n.read&&n.write?"":p).replace(/\{title\}/,n&&n.path?t.escape(n.path):"").replace(/\{symlink\}/,"").replace(/\{style\}/,""))},w=function(e){var n,a;return"directory"!==e.mime?!1:(a=e.hash,t.files().hasOwnProperty(a)||t.trigger("tree",{tree:[e]}),n=y(e,a),e.notfound&&n.addClass("ui-state-disabled"),i[a]=e,M.prepend(n),F.addClass(o),!0)},x=function(t){var n,a=null;return i[t]&&(delete i[t],n=e("#"+v(t)),n.length&&(a=n.text(),n.parent().remove(),M.children().length||(F.removeClass(o),P.removeClass(s),M.slideToggle(!1)))),a},k=function(n){var i=e("#"+v(n)),a=i.parent(),r=a.prev("div"),o="ui-state-hover",s=t.getUI("contextmenu");m&&clearTimeout(m),r.length&&(s.find(":first").data("placesHash",n),i.addClass(o),a.insertBefore(r),r=a.prev("div"),m=setTimeout(function(){i.removeClass(o),s.find(":first").data("placesHash")===n&&s.hide().empty()},1500)),r.length||(i.removeClass(o),s.hide().empty())},C=function(t,n){var a=t.hash,r=e("#"+v(n||a)),o=y(t,a);return r.length>0?(t.notfound&&o.addClass("ui-state-disabled"),r.parent().replaceWith(o),i[a]=t,!0):!1},T=function(){e.each(i,function(n,i){var a=t.file(n)||i,o=y(a,n),s=null;return a||o.hide(),M.children().length&&(e.each(M.children(),function(){var t=e(this);return a.name.localeCompare(t.children("."+r).text())<0?s=!o.insertBefore(t):void 0}),null!==s)?!0:(!e("#"+v(n)).length&&M.append(o),void 0)}),b()},I=y({hash:"root-"+t.namespace,name:t.i18n(n.name,"places"),read:!0,write:!0}),F=I.children("."+r).addClass(d).click(function(e){e.stopPropagation(),F.hasClass(o)&&(P.toggleClass(s),M.slideToggle(),t.storage("placesState",P.hasClass(s)?1:0))}).append(e('<span class="elfinder-button-icon elfinder-button-icon-sort elfinder-places-root-icon" title="'+t.i18n("cmdsort")+'"/>').on("click",function(e){e.stopPropagation(),M.empty(),T()})),M=I.children("."+t.res(a,"navsubtree")).sortable({appendTo:"body",revert:!1,helper:function(n){var i=e(n.target).parent();return i.children().removeClass("ui-state-hover"),e('<div class="ui-widget elfinder-place-drag elfinder-'+t.direction+'"/>').append(e('<div class="elfinder-navbar"/>').show().append(i.clone()))},stop:function(t,n){var i=e(n.item[0]),a=P.offset().top,r=P.offset().left,o=P.width(),s=P.height(),l=t.pageX,d=t.pageY;l>r&&r+o>l&&d>a&&d+s>d||(x(g(i.children(":first").attr("id"))),b())},update:function(){b()}}),P=e(this).addClass(t.res(a,"tree")+" elfinder-places ui-corner-all").hide().append(I).appendTo(t.getUI("navbar")).on("mouseenter mouseleave","."+r,function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)}).on("click","."+r,function(n){var i=e(this);return i.data("longtap")?(n.stopPropagation(),void 0):(t.exec("open",i.attr("id").substr(6)),void 0)}).on("contextmenu","."+r+":not(."+d+")",function(n){var i=e(this),a=i.attr("id").substr(6);n.preventDefault(),t.trigger("contextmenu",{raw:[{label:t.i18n("moveUp"),icon:"up",remain:!0,callback:function(){k(a),b()}},"|",{label:t.i18n("rmFromPlaces"),icon:"rm",callback:function(){x(a),b()}}],x:n.pageX,y:n.pageY}),i.addClass("ui-state-hover"),t.getUI("contextmenu").children().on("mouseenter",function(){i.addClass("ui-state-hover")}),t.bind("closecontextmenu",function(){i.removeClass("ui-state-hover")})}).droppable({tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-tree-dir,.elfinder-cwd-file",hoverClass:t.res("class","adroppable"),over:function(n,a){var r=a.helper,o=e.map(r.data("files"),function(e){return"directory"!==t.file(e).mime||i[e]?null:e});n.stopPropagation(),r.data("dropover",r.data("dropover")+1),o.length>0?r.addClass("elfinder-drag-helper-plus"):e(this).removeClass(c),t.trigger("unlockfiles",{files:r.data("files"),helper:r})},out:function(n,i){var a=i.helper;n.stopPropagation(),a.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(a.data("dropover")-1,0)),e(this).removeData("dropover").removeClass(c),t.trigger("unlockfiles",{files:a.data("files"),helper:a})},drop:function(n,a){var r=a.helper,o=!0;e.each(r.data("files"),function(e,n){var a=t.file(n);a&&"directory"==a.mime&&!i[a.hash]?w(a):o=!1}),b(),o&&r.hide()}}).on("touchstart","."+r+":not(."+d+")",function(n){var i=e(this).attr("id").substr(6),a=e(this).addClass(l).data("longtap",null).data("tmlongtap",setTimeout(function(){a.data("longtap",!0),t.trigger("contextmenu",{raw:[{label:t.i18n("rmFromPlaces"),icon:"rm",callback:function(){x(i),b()}}],x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY})},500))}).on("touchmove touchend","."+r+":not(."+d+")",function(t){clearTimeout(e(this).data("tmlongtap")),"touchmove"==t.type&&e(this).removeClass(l)});e(this).on("regist",function(t,n){var a=!1;e.each(n,function(e,t){t&&"directory"==t.mime&&!i[t.hash]&&w(t)&&(a=!0)}),a&&b()}),t.one("load",function(){var n,a;t.oldAPI||(P.show().parent().show(),i={},n=e.map((t.storage(f)||"").split(","),function(e){return e||null}),e.each(n,function(e,t){var n=t.split("#");i[n[0]]=n[1]?n[1]:{hash:n[0],name:n[0]}}),a=Object.keys(i),a.length&&(F.prepend(h),t.request({data:{cmd:"info",targets:a},preventDefault:!0}).done(function(n){var a={};e.each(n.files,function(e,t){var n=t.hash;a[n]=t}),e.each(i,function(e,t){w(a[e]||{hash:e,name:t,mime:"directory",notfound:!0})}),t.storage("placesState")>0&&F.click()}).always(function(){h.remove()})),t.change(function(t){var n=!1;e.each(t.data.changed,function(e,t){i[t.hash]&&("directory"!==t.mime?x(t.hash)&&(n=!0):C(t)&&(n=!0))}),n&&b()}).bind("rename",function(t){var n=!1;t.data.removed&&e.each(t.data.removed,function(e,i){t.data.added[e]&&C(t.data.added[e],i)&&(n=!0)}),n&&b()}).bind("rm paste",function(t){var n=[],i=!1;t.data.removed&&e.each(t.data.removed,function(e,t){var i=x(t);i&&n.push(i)}),n.length&&(i=!0),t.data.added&&n.length&&e.each(t.data.added,function(t,i){1!==e.inArray(i.name,n)&&"directory"==i.mime&&w(i)}),i&&b()}).bind("sync",function(){var n=Object.keys(i);n.length&&(F.prepend(h),t.request({data:{cmd:"info",targets:n},preventDefault:!0}).done(function(n){var a={},r=!1,o=t.cwd().hash;e.each(n.files||[],function(e,n){var i=n.hash;a[i]=n,t.files().hasOwnProperty(n.hash)||t.trigger("tree",{tree:[n]})}),e.each(i,function(e,t){!t.notfound!=!!a[e]&&(t.phash===o||a[e]&&"directory"!==a[e].mime?x(e)&&(r=!0):C(a[e]||{hash:e,name:t.name,mime:"directory",notfound:!0})&&(r=!0))}),r&&b()}).always(function(){h.remove()}))}))})})},e.fn.elfindersearchbutton=function(t){return this.each(function(){var n=!1,i=t.fm,a=function(e){return i.namespace+e},r=i.getUI("toolbar"),o=i.res("class","searchbtn"),s=e(this).hide().addClass("ui-widget-content elfinder-button "+o),l=function(){u.slideUp();var r=e.trim(c.val()),o=!e("#"+a("SearchFromAll")).prop("checked"),s=e("#"+a("SearchMime")).prop("checked");o&&(o=e("#"+a("SearchFromVol")).prop("checked")?i.root(i.cwd().hash):i.cwd().hash),s&&(s=r,r="."),r?t.exec(r,o,s).done(function(){n=!0,c.focus()}):i.trigger("searchend")},d=function(){u.slideUp(),c.val(""),n&&(n=!1,i.trigger("searchend"))},c=e('<input type="text" size="42"/>').focus(function(){u.slideDown()}).blur(function(){u.data("infocus")?u.data("infocus",!1):u.slideUp()}).appendTo(s).keypress(function(e){e.stopPropagation()}).keydown(function(e){e.stopPropagation(),13==e.keyCode&&l(),27==e.keyCode&&(e.preventDefault(),d())}),u=e('<div class="ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>').append(e('<div class="buttonset"/>').append(e('<input id="'+a("SearchFromCwd")+'" name="serchfrom" type="radio" checked="checked"/><label for="'+a("SearchFromCwd")+'">'+i.i18n("btnCwd")+"</label>")).append(e('<input id="'+a("SearchFromVol")+'" name="serchfrom" type="radio"/><label for="'+a("SearchFromVol")+'">'+i.i18n("btnVolume")+"</label>")).append(e('<input id="'+a("SearchFromAll")+'" name="serchfrom" type="radio"/><label for="'+a("SearchFromAll")+'">'+i.i18n("btnAll")+"</label>"))).append(e('<div class="buttonset"/>').append(e('<input id="'+a("SearchName")+'" name="serchcol" type="radio" checked="checked"/><label for="'+a("SearchName")+'">'+i.i18n("btnFileName")+"</label>")).append(e('<input id="'+a("SearchMime")+'" name="serchcol" type="radio"/><label for="'+a("SearchMime")+'">'+i.i18n("btnMime")+"</label>"))).hide().zIndex(12+s.zIndex()).css("overflow","hidden").appendTo(s);e('<span class="ui-icon ui-icon-search" title="'+t.title+'"/>').appendTo(s).click(l),e('<span class="ui-icon ui-icon-close"/>').appendTo(s).click(d),e(function(){u.find("div.buttonset").buttonset(),e("#"+a("SearchFromAll")).next("label").attr("title",i.i18n("searchTarget",i.i18n("btnAll"))),e("#"+a("SearchMime")).next("label").attr("title",i.i18n("searchMime")),u.find("input").on("mousedown",function(){u.data("infocus",!0)}).on("click",function(){e.trim(c.val())&&l()})}),r.on("load",function(){var e=s.parent();if(e.length){if(r.children("."+o).remove(),r.prepend(s.show()),e.remove(),i.UA.ltIE7){var t=s.children("ltr"==i.direction?".ui-icon-close":".ui-icon-search");t.css({right:"",left:parseInt(s.width())-t.outerWidth(!0)})}i.resize()}}),i.select(function(){c.blur()}).bind("searchend",function(){c.val("")}).bind("open parents",function(){var t=[],n=i.file(i.root(i.cwd().hash));n&&(e.each(i.parents(i.cwd().hash),function(e,n){t.push(i.file(n).name)}),e("#"+a("SearchFromCwd")).next("label").attr("title",i.i18n("searchTarget",t.join(i.option("separator")))),e("#"+a("SearchFromVol")).next("label").attr("title",i.i18n("searchTarget",n.name)))}).shortcut({pattern:"ctrl+f f3",description:t.title,callback:function(){c.select().focus()}})})},e.fn.elfindersortbutton=function(t){return this.each(function(){var n=t.fm,i=t.name,a="class",r=n.res(a,"disabled"),o=n.res(a,"hover"),s="elfinder-button-menu-item",l=s+"-selected",d=l+"-asc",c=l+"-desc",u=e(this).addClass("ui-state-default elfinder-button elfinder-menubutton elfiner-button-"+i).attr("title",t.title).append('<span class="elfinder-button-icon elfinder-button-icon-'+i+'"/>').hover(function(){!u.hasClass(r)&&u.toggleClass(o)}).click(function(e){u.hasClass(r)||(e.stopPropagation(),p.is(":hidden")&&t.fm.getUI().click(),p.slideToggle(100))}),p=e('<div class="ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>').hide().appendTo(u).zIndex(12+u.zIndex()).on("mouseenter mouseleave","."+s,function(){e(this).toggleClass(o)}).on("click","."+s,function(e){e.preventDefault(),e.stopPropagation(),f()}),h=function(){p.children(":not(:last)").removeClass(l+" "+d+" "+c).filter('[rel="'+n.sortType+'"]').addClass(l+" "+("asc"==n.sortOrder?d:c)),p.children(":last").toggleClass(l,n.sortStickFolders)},f=function(){p.hide()};e.each(n.sortRules,function(t){p.append(e('<div class="'+s+'" rel="'+t+'"><span class="ui-icon ui-icon-arrowthick-1-n"/><span class="ui-icon ui-icon-arrowthick-1-s"/>'+n.i18n("sort"+t)+"</div>").data("type",t))}),p.children().click(function(){var i=e(this).attr("rel");t.exec([],{type:i,order:i==n.sortType?"asc"==n.sortOrder?"desc":"asc":n.sortOrder,stick:n.sortStickFolders})}),e('<div class="'+s+" "+s+'-separated"><span class="ui-icon ui-icon-check"/>'+n.i18n("sortFoldersFirst")+"</div>").appendTo(p).click(function(){t.exec([],{type:n.sortType,order:n.sortOrder,stick:!n.sortStickFolders})}),n.bind("disable select",f).getUI().click(f),n.bind("sortchange",h),p.children().length>1?t.change(function(){u.toggleClass(r,t.disabled()),h()}).change():u.addClass(r)})},e.fn.elfinderstat=function(t){return this.each(function(){var n=e(this).addClass("elfinder-stat-size"),i=e('<div class="elfinder-stat-selected"/>').on("click","a",function(n){var i=e(this).data("hash");n.preventDefault(),t.exec("opendir",[i])
13
+ }),a=t.i18n("size").toLowerCase(),r=t.i18n("items").toLowerCase(),o=t.i18n("selected"),s=function(i,o){var s=0,l=0;e.each(i,function(e,t){o&&t.phash!=o||(s++,l+=parseInt(t.size)||0)}),n.html(r+": "+s+", "+a+": "+t.formatSize(l))},l=!1;t.getUI("statusbar").prepend(n).append(i).show(),t.bind("open reload add remove change searchend",function(){s(t.files(),t.cwd().hash)}).bind("searchend",function(){l=!1}).search(function(e){l=!0,s(e.data.files)}).select(function(){var n,r=0,s=0,d=t.selectedFiles(),c=[];return 1==d.length?(n=d[0],r=n.size,l&&c.push('<a href="#elf_'+n.phash+'" data-hash="'+n.hash+'">'+(n.path?n.path.replace(/\/[^\/]*$/,""):"..")+"</a>"),c.push(t.escape(n.name)),i.html(c.join("/")+(r>0?", "+t.formatSize(r):"")),void 0):(e.each(d,function(e,t){s++,r+=parseInt(t.size)||0}),i.html(s?o+": "+s+", "+a+": "+t.formatSize(r):"&nbsp;"),void 0)})})},e.fn.elfindertoolbar=function(t,n){return this.not(".elfinder-toolbar").each(function(){var i,a,r,o,s,l=t._commands,d=e(this).addClass("ui-helper-clearfix ui-widget-header ui-corner-top elfinder-toolbar"),c=n||[],u=null,p="";d.prev().length&&d.parent().prepend(this);var h=function(t){var n;for(d.empty(),i=c.length;i--;)if(c[i]){for(o=e('<div class="ui-widget-content ui-corner-all elfinder-buttonset"/>'),a=c[i].length;a--;)n=c[i][a],t&&-1!==e.inArray(n,t)||!(r=l[n])||(s="elfinder"+r.options.ui,e.fn[s]&&o.prepend(e("<div/>")[s](r)));o.children().length&&d.prepend(o),o.children(":gt(0)").before('<span class="ui-widget-content elfinder-toolbar-button-separator"/>')}d.children().length?d.show():d.hide(),d.trigger("load")};h(),t.bind("open sync",function(){var n=[],i=t.option("disabled");u&&u.toString()===i.sort().toString()||h(i&&i.length?i:null),u=i.concat().sort(),p!==JSON.stringify(t.commandMap)&&(p=JSON.stringify(t.commandMap),Object.keys(t.commandMap).length&&e.each(t.commandMap,function(i,a){var r=t._commands[a],o=r?"elfinder"+r.options.ui:null;if(o&&e.fn[o]){n.push(i);var s=e("div.elfinder-buttonset div.elfinder-button").has("span.elfinder-button-icon-"+i);s.length&&!s.next().has("span.elfinder-button-icon-"+a).length&&(s.after(e("<div/>")[o](t._commands[a]).data("origin",i)),s.hide())}}),e.each(e("div.elfinder-button"),function(){var t=e(this).data("origin");t&&-1==e.inArray(t,n)&&(e("span.elfinder-button-icon-"+e(this).data("origin")).parent().show(),e(this).remove())}))})}),this},e.fn.elfindertree=function(t,n){var i=t.res("class","tree");return this.not("."+i).each(function(){var a="class",r=t.UA.Mobile,o=t.res(a,"treeroot"),s=n.openRootOnLoad,l=n.openCwdOnOpen,d=t.res(a,"navsubtree"),c=t.res(a,"treedir"),u="span."+c,p=t.res(a,"navcollapse"),h=t.res(a,"navexpand"),f="elfinder-subtree-loaded",m=t.res(a,"navarrow"),g=t.res(a,"active"),v=t.res(a,"adroppable"),b=t.res(a,"hover"),y=t.res(a,"disabled"),w=t.res(a,"draggable"),x=t.res(a,"droppable"),k="elfinder-navbar-wrapper-pastable",C="elfinder-navbar-wrapper-uploadable",T=function(e){var t=$.offset().left;return e>=t&&e<=t+$.width()},I=t.droppable.drop,F=e.extend(!0,{},t.droppable,{over:function(n,i){var a,r,o=e(this),s=i.helper,l=b+" "+v;return n.stopPropagation(),s.data("dropover",s.data("dropover")+1),o.data("dropover",!0),i.helper.data("namespace")!==t.namespace?(o.removeClass(l),!1):(o.addClass(b),o.is("."+p+":not(."+h+")")&&o.data("expandTimer",setTimeout(function(){o.children("."+m).click()},500)),a=t.navId2Hash(o.attr("id")),o.data("dropover",a),e.each(i.helper.data("files"),function(e,n){return n===a||t.file(n).phash===a&&!i.helper.hasClass("elfinder-drag-helper-plus")?(o.removeClass(l),!1):void 0}),s.data("locked")?r="elfinder-drag-helper-plus":(r="elfinder-drag-helper-move",(n.shiftKey||n.ctrlKey||n.metaKey)&&(r+=" elfinder-drag-helper-plus")),o.hasClass(v)&&s.addClass(r),setTimeout(function(){o.hasClass(v)&&s.addClass(r)},20),void 0)},out:function(t,n){var i=e(this),a=n.helper;t.stopPropagation(),a.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(a.data("dropover")-1,0)),i.data("expandTimer")&&clearTimeout(i.data("expandTimer")),i.removeData("dropover").removeClass(b+" "+v)},deactivate:function(){e(this).removeData("dropover").removeClass(b+" "+v)},drop:function(e,t){T(e.clientX)&&I.call(this,e,t)}}),M=e(t.res("tpl","navspinner")),P=t.res("tpl","navdir"),S=t.res("tpl","perms"),z=(t.res("tpl","lock"),t.res("tpl","symlink")),A={id:function(e){return t.navHash2Id(e.hash)},cssclass:function(e){var i=(t.UA.Touch?"elfinder-touch ":"")+(e.phash?"":o)+" "+c+" "+t.perms2class(e);return e.dirs&&!e.link&&(i+=" "+p),n.getClass&&(i+=" "+n.getClass(e)),e.csscls&&(i+=" "+t.escape(e.csscls)),i},permissions:function(e){return e.read&&e.write?"":S},symlink:function(e){return e.alias?z:""},style:function(e){return e.icon?"style=\"background-image:url('"+t.escape(e.icon)+"')\"":""}},D=function(e){return e.name=t.escape(e.i18||e.name),P.replace(/(?:\{([a-z]+)\})/gi,function(t,n){return e[n]||(A[n]?A[n](e):"")})},O=function(t){return e.map(t||[],function(e){return"directory"==e.mime?e:null})},U=function(n){return n?e("#"+t.navHash2Id(n)).next("."+d):L},E=function(n,i){var a,r,o=n.children(":first");for(r=t.naturalCompare;o.length;){if(a=t.file(t.navId2Hash(o.children("[id]").attr("id"))),(a=t.file(t.navId2Hash(o.children("[id]").attr("id"))))&&r(i.name,a.name)<0)return o;o=o.next()}return e("")},j=function(n){for(var i,a,o,s,l,d=n.length,c=[],u=n.length,p={},h=!0;u--;)i=n[u],e("#"+t.navHash2Id(i.hash)).length||((a=U(i.phash)).length?i.phash&&((s=!a.children().length)||(o=E(a,i)).length)?s?(p[i.phash]||(p[i.phash]=[]),p[i.phash].push(i)):o.before(D(i)):(a[h||i.phash?"append":"prepend"](D(i)),h=!1,i.phash||(l=e("#"+t.navHash2Id(i.hash)).parent(),!i.disabled||i.disabled.length<1?l.addClass(k+" "+C):(-1===e.inArray("paste",i.disabled)&&l.addClass(k),-1===e.inArray("upload",i.disabled)&&l.addClass(C)))):c.push(i));return Object.keys(p).length&&e.each(p,function(t,n){var i=U(t),a=[];n.sort(H),e.each(n,function(e,t){a.push(D(t))}),i.append(a.join(""))}),c.length&&c.length<d?j(c):(d&&!r&&N(),void 0)},H=function(e,n){return t.naturalCompare(e.name,n.name)},R=function(){var n=e("#"+t.navHash2Id(t.cwd().hash));if(n.length){var i=L.parent().stop(!1,!0),a=i.offset().top,r=i.height(),o=a+r-n.outerHeight(),s=n.offset().top;(a>s||s>o)&&i.animate({scrollTop:i.scrollTop()+s-a-r/3},{duration:"fast"})}},_=function(i,a){var r,c,v,b,y,w,x=t.cwd(),k=x.hash,C=e("#"+t.navHash2Id(k)),i=i||!1,a=a||[];if(s&&(r=e("#"+t.navHash2Id(t.root())),r.hasClass(f)&&r.addClass(h).next("."+d).show(),s=!1),C.hasClass(g)||(L.find(u+"."+g).removeClass(g),C.addClass(g)),n.syncTree||!C.length){if(C.length)return i||(C.addClass(f),l&&C.hasClass(p)&&C.addClass(h).next("."+d).slideDown()),b=C.parentsUntil("."+o).filter("."+d),y=b.length,w=1,b.show().prev(u).addClass(h,function(){!i&&y==w++&&R()}),!y&&!i&&R(),void 0;if(t.newAPI){if(c=t.file(k),c&&c.phash&&(v=e("#"+t.navHash2Id(c.phash)),v.length&&v.hasClass(f)))return j([c]),_(i),void 0;v=x.root?e("#"+t.navHash2Id(x.root)):null,v&&(M.insertBefore(v.children("."+m)),v.removeClass(p)),t.request({data:{cmd:"parents",target:k},preventFail:!0}).done(function(n){a=e.merge(a,O(n.tree)),j(a),q(a,f),k==t.cwd().hash&&_(i)}).always(function(){v&&(M.remove(),v.addClass(p+" "+f))})}}},N=function(e){var t,n=100;e||(L.find("div."+C).find(u+":not(.elfinder-ro,.elfinder-na)").addClass("native-droppable"),e=L.find("div."+k).find(u+":not(."+x+",.elfinder-ro,.elfinder-na)")),e.length>n&&(t=e.slice(n),e=e.slice(0,n)),e.droppable(F),t&&setTimeout(function(){N(t)},20)},q=function(n,i){var a=i==f?"."+p+":not(."+f+")":":not(."+p+")";e.each(n,function(n,r){e("#"+t.navHash2Id(r.phash)+a).filter(function(){return e(this).next("."+d).children().length>0}).addClass(i)})},L=e(this).addClass(i).on("mouseenter mouseleave",u,function(n){var i=e(this),a="mouseenter"==n.type;i.hasClass(v+" "+y)||(!r&&a&&!i.hasClass(o+" "+w+" elfinder-na elfinder-wo")&&i.draggable(t.draggable),i.toggleClass(b,a))}).on("dropover dropout drop",u,function(t){e(this)["dropover"==t.type?"addClass":"removeClass"](v+" "+b)}).on("click",u,function(n){var i=e(this),a=t.navId2Hash(i.attr("id"));return t.file(a),i.data("longtap")?(n.stopPropagation(),void 0):(t.trigger("searchend",{noupdate:!0}),a==t.cwd().hash||i.hasClass(y)?i.hasClass(p)&&i.children("."+m).click():t.exec("open",a),void 0)}).on("touchstart",u,function(n){n.stopPropagation();var i=n.originalEvent,a=e(this).addClass(b).data("longtap",null).data("tmlongtap",setTimeout(function(){a.data("longtap",!0),t.trigger("contextmenu",{type:"navbar",targets:[t.navId2Hash(a.attr("id"))],x:i.touches[0].pageX,y:i.touches[0].pageY})},500))}).on("touchmove touchend",u,function(t){t.stopPropagation(),clearTimeout(e(this).data("tmlongtap")),"touchmove"==t.type&&e(this).removeClass(b)}).on("click",u+"."+p+" ."+m,function(n){var i,a=e(this),r=a.parent(u),o=r.next("."+d),s=30;n.stopPropagation(),r.hasClass(f)?(r.toggleClass(h),i=r.hasClass(h)?o.children().length+o.find("div.elfinder-navbar-subtree[style*=block]").children().length:o.find("div:visible").length,i>s?(o.toggle(),t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1)):o.stop(!0,!0).slideToggle("normal",function(){t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1)})):(M.insertBefore(a),r.removeClass(p),t.request({cmd:"tree",target:t.navId2Hash(r.attr("id"))}).done(function(e){j(O(e.tree)),o.children().length&&(r.addClass(p+" "+h),o.children().length>s?(o.show(),t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1)):o.stop(!0,!0).slideDown("normal",function(){t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1)})),_(!0)}).always(function(){M.remove(),r.addClass(f)}))}).on("contextmenu",u,function(n){var i=e(this);n.preventDefault(),t.trigger("contextmenu",{type:"navbar",targets:[t.navId2Hash(e(this).attr("id"))],x:n.pageX,y:n.pageY}),i.addClass("ui-state-hover"),t.getUI("contextmenu").children().on("mouseenter",function(){i.addClass("ui-state-hover")}),t.bind("closecontextmenu",function(){i.removeClass("ui-state-hover")})}),$=t.getUI("navbar").append(L).show();t.open(function(n){var i=n.data,a=O(i.files),r=t.getUI("contextmenu");i.init&&L.empty(),a.length&&(r.data("cmdMaps")||r.data("cmdMaps",{}),j(a),q(a,f),e.each(a,function(e,t){t.volumeid&&t.uiCmdMap&&Object.keys(t.uiCmdMap).length&&!r.data("cmdMaps")[t.volumeid]&&(r.data("cmdMaps")[t.volumeid]=t.uiCmdMap)})),_(!1,a)}).add(function(e){var t=O(e.data.added);t.length&&(j(t),q(t,p))}).change(function(n){for(var i,a,o,s,l,c,p,m,g,v=O(n.data.changed),b=v.length,y=b;y--;)if(i=v[y],(a=e("#"+t.navHash2Id(i.hash))).length){if(i.phash){if(s=a.closest("."+d),l=U(i.phash),c=a.parent().next(),p=E(l,i),!l.length)continue;(l[0]!==s[0]||c.get(0)!==p.get(0))&&(p.length?p.before(a):l.append(a))}m=a.hasClass(h),g=a.hasClass(f),o=e(D(i)),a.replaceWith(o.children(u)),i.dirs&&(m||g)&&(a=e("#"+t.navHash2Id(i.hash)))&&a.next("."+d).children().length&&(m&&a.addClass(h),g&&a.addClass(f))}_(),b&&!r&&N()}).remove(function(n){for(var i,a,r=n.data.removed,o=r.length;o--;)(i=e("#"+t.navHash2Id(r[o]))).length&&(a=i.closest("."+d),i.parent().detach(),a.children().length||a.hide().prev(u).removeClass(p+" "+h+" "+f))}).bind("lockfiles unlockfiles",function(n){var i="lockfiles"==n.type,a=n.data.helper?n.data.helper.data("locked"):!1,r=i&&!a?"disable":"enable",o=e.map(n.data.files||[],function(e){var n=t.file(e);return n&&"directory"==n.mime?e:null});e.each(o,function(n,o){var s=e("#"+t.navHash2Id(o));s.length&&!a&&(s.hasClass(w)&&s.draggable(r),s.hasClass(x)&&s.droppable(r),s[i?"addClass":"removeClass"](y))})})}),this},e.fn.elfinderuploadbutton=function(t){return this.each(function(){var n=e(this).elfinderbutton(t).off("click"),i=e("<form/>").appendTo(n),a=e('<input type="file" multiple="true" title="'+t.fm.i18n("selectForUpload")+'"/>').change(function(){var n=e(this);n.val()&&(t.exec({input:n.remove()[0]}),a.clone(!0).appendTo(i))}).on("dragover",function(e){e.originalEvent.dataTransfer.dropEffect="copy"});i.append(a.clone(!0)),t.change(function(){i[t.disabled()?"hide":"show"]()}).change()})},e.fn.elfinderviewbutton=function(t){return this.each(function(){var n=e(this).elfinderbutton(t),i=n.children(".elfinder-button-icon");t.change(function(){var e="icons"==t.value;i.toggleClass("elfinder-button-icon-view-list",e),n.attr("title",t.fm.i18n(e?"viewlist":"viewicons"))})})},e.fn.elfinderworkzone=function(){var t="elfinder-workzone";return this.not("."+t).each(function(){var n=e(this).addClass(t),i=n.outerHeight(!0)-n.height(),a=n.parent();a.add(window).on("resize",function(){var r=a.height();a.children(":visible:not(."+t+")").each(function(){var t=e(this);"absolute"!=t.css("position")&&"fixed"!=t.css("position")&&(r-=t.outerHeight(!0))}),n.height(r-i)})}),this},elFinder.prototype.commands.archive=function(){var t,n=this,i=n.fm,a=[];this.variants=[],this.disableOnSearch=!0,i.bind("open reload",function(){n.variants=[],e.each(a=i.option("archivers").create||[],function(e,t){n.variants.push([t,i.mime2kind(t)])}),n.change()}),this.getstate=function(){return!this._disabled&&a.length&&(i.selected().length||t&&"pending"==t.state())&&i.cwd().write?0:-1},this.exec=function(r,o){var s,l,d=this.files(r),c=d.length,u=o||a[0],p=i.cwd(),h=["errArchive","errPerm","errCreatingTempDir","errFtpDownloadFile","errFtpUploadFile","errFtpMkdir","errArchiveExec","errExtractExec","errRm"];if(t=e.Deferred().fail(function(e){e&&i.error(e)}),!(this.enabled()&&c&&a.length&&-1!==e.inArray(u,a)))return t.reject();if(!p.write)return t.reject(h);for(s=0;c>s;s++)if(!d[s].read)return t.reject(h);return n.mime=u,n.prefix=(c>1?"Archive":d[0].name)+"."+i.option("archivers").createext[u],n.data={targets:n.hashes(r),type:u},l=e.proxy(i.res("mixin","make"),n)(),t.reject(),l}},elFinder.prototype.commands.back=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+left backspace"}],this.getstate=function(){return this.fm.history.canBack()?0:-1},this.exec=function(){return this.fm.history.back()}},elFinder.prototype.commands.chmod=function(){this.updateOnSelect=!1;var t=this,n=this.fm,i={0:"owner",1:"group",2:"other"},a={read:n.i18n("read"),write:n.i18n("write"),execute:n.i18n("execute"),perm:n.i18n("perm"),kind:n.i18n("kind"),files:n.i18n("files")},r=function(e){return!isNaN(parseInt(e,8)&&parseInt(e,8)<=511)||e.match(/^([r-][w-][x-]){3}$/i)};this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div>{dataTable}',itemTitle:'<strong>{name}</strong><span id="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",dataTable:'<table id="{id}-table-perm"><tr><td>{0}</td><td>{1}</td><td>{2}</td></tr></table><div class="">'+a.perm+': <input id="{id}-perm" type="text" size="4" maxlength="3" value="{value}"></div>',fieldset:'<fieldset id="{id}-fieldset-{level}"><legend>{f_title}{name}</legend><input type="checkbox" value="4" id="{id}-read-{level}-perm"{checked-r}> <label for="{id}-read-{level}-perm">'+a.read+"</label><br>"+'<input type="checkbox" value="6" id="{id}-write-{level}-perm"{checked-w}> <label for="{id}-write-{level}-perm">'+a.write+"</label><br>"+'<input type="checkbox" value="5" id="{id}-execute-{level}-perm"{checked-x}> <label for="{id}-execute-{level}-perm">'+a.execute+"</label><br>"},this.shortcuts=[{}],this.getstate=function(e){var n=this.fm;return e=e||n.selected(),0==e.length&&(e=[n.cwd().hash]),!this._disabled&&t.checkstate(this.files(e))?0:-1},this.checkstate=function(t){var n=t.length;if(!n)return!1;var i=e.map(t,function(e){return e.isowner&&e.perm&&r(e.perm)&&(1==n||"directory"!=e.mime)?e:null}).length;return n==i?!0:!1},this.exec=function(t){var n=this.files(t);n.length||(t=[this.fm.cwd().hash],n=this.files(t));var o,s,l=this.fm,d=e.Deferred().always(function(){l.enable()}),c=this.tpl,t=this.hashes(t),u=n.length,p=n[0],h=l.namespace+"-perm-"+p.hash,f=c.main,m=' checked="checked"',g=function(){var e={};return e[l.i18n("btnApply")]=v,e[l.i18n("btnCancel")]=function(){I.elfinderdialog("close")},e},v=function(){var n=e.trim(e("#"+h+"-perm").val());return r(n)?(I.elfinderdialog("close"),l.request({data:{cmd:"chmod",targets:t,mode:n},notify:{type:"chmod",cnt:u}}).fail(function(e){d.reject(e)}).done(function(e){d.resolve(e)}),void 0):!1},b=function(){for(var t,n="",a=0;3>a;a++)t=0,e("#"+h+"-read-"+i[a]+"-perm").is(":checked")&&(t=4|t),e("#"+h+"-write-"+i[a]+"-perm").is(":checked")&&(t=2|t),e("#"+h+"-execute-"+i[a]+"-perm").is(":checked")&&(t=1|t),n+=t.toString(8);e("#"+h+"-perm").val(n)},y=function(t){for(var n,a=0;3>a;a++)n=parseInt(t.slice(a,a+1),8),e("#"+h+"-read-"+i[a]+"-perm").prop("checked",!1),e("#"+h+"-write-"+i[a]+"-perm").prop("checked",!1),e("#"+h+"-execute-"+i[a]+"-perm").prop("checked",!1),4==(4&n)&&e("#"+h+"-read-"+i[a]+"-perm").prop("checked",!0),2==(2&n)&&e("#"+h+"-write-"+i[a]+"-perm").prop("checked",!0),1==(1&n)&&e("#"+h+"-execute-"+i[a]+"-perm").prop("checked",!0);b()},w=function(e){for(var t,n,i,a="777",r="",o=e.length,s=0;o>s;s++){t=C(e[s].perm),r="";for(var l=0;3>l;l++)n=parseInt(t.slice(l,l+1),8),i=parseInt(a.slice(l,l+1),8),4!=(4&n)&&4==(4&i)&&(i-=4),2!=(2&n)&&2==(2&i)&&(i-=2),1!=(1&n)&&1==(1&i)&&(i-=1),r+=i.toString(8);a=r}return a},x=function(e){return e?":"+e:""},k=function(e,t){for(var n,r,o="",s=c.dataTable,d=0;3>d;d++)n=parseInt(e.slice(d,d+1),8),o+=n.toString(8),r=c.fieldset.replace("{f_title}",l.i18n(i[d])).replace("{name}",x(t[i[d]])).replace(/\{level\}/g,i[d]),s=s.replace("{"+d+"}",r).replace("{checked-r}",4==(4&n)?m:"").replace("{checked-w}",2==(2&n)?m:"").replace("{checked-x}",1==(1&n)?m:"");return s=s.replace("{value}",o).replace("{valueCaption}",a.perm)},C=function(e){if(isNaN(parseInt(e,8))){for(var t=e.split(""),n=[],i=0,a=t.length;a>i;i++)0===i||3===i||6===i?t[i].match(/[r]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):1===i||4===i||7===i?t[i].match(/[w]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):t[i].match(/[x]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0);n.splice(3,0,","),n.splice(7,0,",");for(var r=n.join(""),o=r.split(","),s=[],l=0,d=o.length;d>l;l++){var c=parseInt(o[l],2).toString(8);s.push(c)}e=s.join("")}else e=parseInt(e,8).toString(8);return e},T={title:this.title,width:"auto",buttons:g(),close:function(){e(this).elfinderdialog("destroy")}},I=l.getUI().find("#"+h),F="";return I.length?(I.elfinderdialog("toTop"),e.Deferred().resolve()):(f=f.replace("{class}",u>1?"elfinder-cwd-icon-group":l.mime2class(p.mime)),u>1?o=c.groupTitle.replace("{items}",l.i18n("items")).replace("{num}",u):(o=c.itemTitle.replace("{name}",p.name).replace("{kind}",l.mime2kind(p)),p.tmb&&(F=l.option("tmbUrl")+p.tmb)),s=k(w(n),1==n.length?n[0]:{}),f=f.replace("{title}",o).replace("{dataTable}",s).replace(/{id}/g,h),I=l.dialog(f,T),I.attr("id",h),F&&e("<img/>").on("load",function(){I.find(".elfinder-cwd-icon").css("background",'url("'+F+'") center center no-repeat')}).attr("src",F),e("#"+h+"-table-perm :checkbox").on("click",function(){b("perm")}),e("#"+h+"-perm").on("keydown",function(e){var t=e.keyCode;return e.stopPropagation(),13==t?(v(),void 0):void 0}).on("focus",function(){e(this).select()}).on("keyup",function(){3==e(this).val().length&&(e(this).select(),y(e(this).val()))}),d)}},elFinder.prototype.commands.copy=function(){this.shortcuts=[{pattern:"ctrl+c ctrl+insert"}],this.getstate=function(t){var t=this.files(t),n=t.length;return!this._disabled&&n&&e.map(t,function(e){return e.phash&&e.read?e:null}).length==n?0:-1},this.exec=function(t){var n=this.fm,i=e.Deferred().fail(function(e){n.error(e)});return e.each(this.files(t),function(e,t){return t.read&&t.phash?void 0:!i.reject(["errCopy",t.name,"errPerm"])}),"rejected"==i.state()?i:i.resolve(n.clipboard(this.hashes(t)))}},elFinder.prototype.commands.cut=function(){this.shortcuts=[{pattern:"ctrl+x shift+insert"}],this.getstate=function(t){var t=this.files(t),n=t.length;return!this._disabled&&n&&e.map(t,function(e){return e.phash&&e.read&&!e.locked?e:null}).length==n?0:-1},this.exec=function(t){var n=this.fm,i=e.Deferred().fail(function(e){n.error(e)});return e.each(this.files(t),function(e,t){return t.read&&t.phash?t.locked?!i.reject(["errLocked",t.name]):void 0:!i.reject(["errCopy",t.name,"errPerm"])}),"rejected"==i.state()?i:i.resolve(n.clipboard(this.hashes(t),!0))}},elFinder.prototype.commands.download=function(){var t=this,n=this.fm,i=function(n){return e.map(t.files(n),function(e){return"directory"==e.mime?null:e})};this.shortcuts=[{pattern:"shift+enter"}],this.getstate=function(){var e=this.fm.selected(),t=e.length;return this._disabled||!t||(n.UA.IE||n.UA.Mobile)&&1!=t||t!=i(e).length?-1:0},this.fm.bind("contextmenu",function(n){var i,a,r=t.fm,o=null,s=function(t){var n=t.url||r.url(t.hash);return{icon:"link",node:e("<a/>").attr({href:n,target:"_blank",title:r.i18n("link")}).text(t.name).on("mousedown click touchstart touchmove touchend contextmenu",function(e){var t=r.getUI("contextmenu");e.stopPropagation(),t.data("mouseEvInternal",!0),setTimeout(function(){t.data("mouseEvInternal",!1)},500)}).on("dragstart",function(n){var i=n.dataTransfer||n.originalEvent.dataTransfer||null;if(o=null,i){var a=function(t){var n,i=t.mime;return n='<div class="elfinder-cwd-icon '+r.mime2class(i)+' ui-corner-all"/>',t.tmb&&1!==t.tmb&&(n=e(n).css("background","url('"+r.option("tmbUrl")+t.tmb+"') center center no-repeat").get(0).outerHTML),n};i.effectAllowed="copyLink",i.setDragImage&&(o=e('<div class="elfinder-drag-helper html5-native">').append(a(t)).appendTo(e(document.body)),i.setDragImage(o.get(0),50,47)),r.UA.IE||(i.setData("elfinderfrom",window.location.href+t.phash),i.setData("elfinderfrom:"+i.getData("elfinderfrom"),""))}}).on("dragend",function(){o&&o.remove()})}};if(t.extra=null,n.data&&(i=n.data.targets||[],1===i.length&&(a=r.file(i[0]))&&"directory"!==a.mime))if("1"!=a.url)t.extra=s(a);else{var l;t.extra={icon:"link",node:e("<a/>").attr({href:"#",title:r.i18n("link"),draggable:"false"}).text(a.name).on("click",function(e){var t=l.parent();e.stopPropagation(),e.preventDefault(),t.removeClass("ui-state-disabled").addClass("elfinder-button-icon-spinner"),r.request({data:{cmd:"url",target:a.hash},preventDefault:!0}).always(function(e){if(e.url){var n=r.file(a.hash);n.url=e.url,t.removeClass("elfinder-button-icon-spinner"),l.replaceWith(s(a).node)}else t.addClass("ui-state-disabled")})})},l=t.extra.node,l.ready(function(){setTimeout(function(){l.parent().addClass("ui-state-disabled")},10)})}}),this.exec=function(t){var n,a,r=this.fm,o=(r.options.url,i(t)),s=e.Deferred(),l="";if(this.disabled())return s.reject();var a,d=e("<a>").hide().appendTo(e("body")),c="string"==typeof d.get(0).download;for(n=0;n<o.length;n++)a=r.openUrl(o[n].hash,!0),c?d.attr("href",a).attr("download",o[n].name).attr("target","_blank").get(0).click():r.UA.Mobile?setTimeout(function(){window.open(a)||r.error("errPopup")},100):l+='<iframe class="downloader" id="downloader-'+o[n].hash+'" style="display:none" src="'+a+'"/>';return d.remove(),e(l).appendTo("body").ready(function(){setTimeout(function(){e(l).each(function(){e("#"+e(this).attr("id")).remove()})},r.UA.Firefox?2e4+1e4*n:1e3)}),r.trigger("download",{files:o}),s.resolve(t)}},elFinder.prototype.commands.duplicate=function(){var t=this.fm;this.getstate=function(n){var n=this.files(n),i=n.length;return!this._disabled&&i&&t.cwd().write&&e.map(n,function(e){return e.phash&&e.read?e:null}).length==i?0:-1},this.exec=function(t){var n=this.fm,i=this.files(t),a=i.length,r=e.Deferred().fail(function(e){e&&n.error(e)});return!a||this._disabled?r.reject():(e.each(i,function(e,t){return t.read&&n.file(t.phash).write?void 0:!r.reject(["errCopy",t.name,"errPerm"])}),"rejected"==r.state()?r:n.request({data:{cmd:"duplicate",targets:this.hashes(t)},notify:{type:"copy",cnt:a}}))}},elFinder.prototype.commands.edit=function(){var t=this,n=this.fm,i=n.res("mimes","text")||[],a=function(e){return e.replace(/\s+$/,"")},r=function(n){return e.map(n,function(n){return 0!==n.mime.indexOf("text/")&&-1===e.inArray(n.mime,i)||!n.mime.indexOf("text/rtf")||t.onlyMimes.length&&-1===e.inArray(n.mime,t.onlyMimes)||!n.read||!n.write?null:n})},o=function(r,o,s){var l=e.Deferred(),d=e('<textarea class="elfinder-file-edit" rows="20" id="'+r+'-ta">'+n.escape(s)+"</textarea>"),c=d.val(),u=function(){d.editor&&d.editor.save(d[0],d.editor.instance),c=d.val(),l.notifyWith(d)},p=function(){var e=function(){l.reject(),d.elfinderdialog("close")};d.editor&&d.editor.save(d[0],d.editor.instance),a(c)!==a(d.val())?(c=d.val(),n.confirm({title:t.title,text:"confirmNotSave",accept:{label:"btnSaveClose",callback:function(){u(),e()}},cancel:{label:"btnClose",callback:e}})):e()},h=function(){u(),p()},f={title:n.escape(o.name),width:t.options.dialogWidth||450,buttons:{},btnHoverFocus:!1,closeOnEscape:!1,close:function(){var i=e(this),r=function(){d.editor&&d.editor.close(d[0],d.editor.instance),i.elfinderdialog("destroy")};d.editor&&d.editor.save(d[0],d.editor.instance),a(c)!==a(d.val())?n.confirm({title:t.title,text:"confirmNotSave",accept:{label:"btnSaveClose",callback:function(){u(),r()}},cancel:{label:"btnClose",callback:r}}):r()},open:function(){n.disable(),d.focus(),d[0].setSelectionRange&&d[0].setSelectionRange(0,0),d.editor&&(d.editor.instance=d.editor.load(d[0])||null,d.editor.focus(d[0],d.editor.instance))}},m=function(t,n){if(n=n||i.concat("text/"),-1!==e.inArray(t,n))return!0;var a,r;for(r=n.length,a=0;r>a;a++)if(0===t.indexOf(n[a]))return!0;return!1},g=function(e,t){if(!t||!t.length)return!0;var n,i,a=e.replace(/^.+\.([^.]+)|(.+)$/,"$1$2").toLowerCase();for(i=t.length,n=0;i>n;n++)if(a===t[n].toLowerCase())return!0;return!1};return d.getContent=function(){return d.val()},e.each(t.options.editors||[],function(e,t){return m(o.mime,t.mimes||null)&&g(o.name,t.exts||null)&&"function"==typeof t.load&&"function"==typeof t.save?(d.editor={load:t.load,save:t.save,close:"function"==typeof t.close?t.close:function(){},focus:"function"==typeof t.focus?t.focus:function(){},instance:null,doSave:u,doCancel:p,doClose:h,file:o},!1):void 0}),d.editor||d.keydown(function(e){var t,n,i=e.keyCode;e.stopPropagation(),9==i&&(e.preventDefault(),this.setSelectionRange&&(t=this.value,n=this.selectionStart,this.value=t.substr(0,n)+" "+t.substr(this.selectionEnd),n+=1,this.setSelectionRange(n,n))),(e.ctrlKey||e.metaKey)&&((81==i||87==i)&&(e.preventDefault(),p()),83==i&&(e.preventDefault(),u()))}).on("mouseenter",function(){this.focus()}),f.buttons[n.i18n("btnSave")]=u,f.buttons[n.i18n("btnSaveClose")]=h,f.buttons[n.i18n("btnCancel")]=p,n.dialog(d,f).attr("id",r),l.promise()},s=function(i,a){var r,l=i.hash,d=(n.options,e.Deferred()),c="edit-"+n.namespace+"-"+i.hash,u=n.getUI().find("#"+c),p=a?1:0;return u.length?(u.elfinderdialog("toTop"),d.resolve()):i.read&&i.write?(n.request({data:{cmd:"get",target:l,conv:p},notify:{type:"file",cnt:1},syncOnFail:!0}).done(function(e){e.doconv?n.confirm({title:t.title,text:"confirmConvUTF8",accept:{label:"btnConv",callback:function(){d=s(i,1)}},cancel:{label:"btnCancel",callback:function(){d.reject()}}}):o(c,i,e.content).progress(function(){var e=this;n.request({options:{type:"post"},data:{cmd:"put",target:l,content:e.getContent()},notify:{type:"save",cnt:1},syncOnFail:!0}).fail(function(e){d.reject(e)}).done(function(t){t.changed&&t.changed.length&&n.change(t),d.resolve(t),setTimeout(function(){e.focus(),e.editor&&e.editor.focus(e[0],e.editor.instance)},50)})})}).fail(function(e){d.reject(e)}),d.promise()):(r=["errOpen",i.name,"errPerm"],n.error(r),d.reject(r))};this.shortcuts=[{pattern:"ctrl+e"}],this.init=function(){this.onlyMimes=this.options.mimes||[]},this.getstate=function(e){var e=this.files(e),t=e.length;return!this._disabled&&t&&r(e).length==t?0:-1},this.exec=function(t){var n,i=r(this.files(t)),a=[];if(this.disabled())return e.Deferred().reject();for(;n=i.shift();)a.push(s(n));return a.length?e.when.apply(null,a):e.Deferred().reject()}},elFinder.prototype.commands.extract=function(){var t=this,n=t.fm,i=[],a=function(t){return e.map(t,function(t){return t.read&&-1!==e.inArray(t.mime,i)?t:null})};this.variants=[],this.disableOnSearch=!0,n.bind("open reload",function(){i=n.option("archivers").extract||[],t.variants=[["makedir",n.i18n("cmdmkdir")],["intohere",n.i18n("btnCwd")]],t.change()}),this.getstate=function(e){var e=this.files(e),t=e.length;return!this._disabled&&t&&this.fm.cwd().write&&a(e).length==t?0:-1},this.exec=function(t,a){var r,o,s,l=this.files(t),d=e.Deferred(),c=l.length,u="makedir"==a?1:0,p=!1,h=!1,f=0,m=e.map(n.files(t),function(e){return e.name}),g={};e.map(n.files(t),function(e){g[e.name]=e});var v=function(e){switch(e){case"overwrite_all":p=!0;break;case"omit_all":h=!0}},b=function(t){t.read&&n.file(t.phash).write?-1===e.inArray(t.mime,i)?(o=["errExtract",t.name,"errNoArchive"],n.error(o),d.reject(o)):n.request({data:{cmd:"extract",target:t.hash,makedir:u},notify:{type:"extract",cnt:1},syncOnFail:!0}).fail(function(e){"rejected"!=d.state()&&d.reject(e)}).done(function(){}):(o=["errExtract",t.name,"errPerm"],n.error(o),d.reject(o))},y=function(t,i){var a=t[i],o=a.name.replace(/\.((tar\.(gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(gz|bz2)|[a-z0-9]{1,4})$/gi,""),l=e.inArray(o,m)>=0,w=function(){c>i+1?y(t,i+1):d.resolve()};!u&&l&&"directory"!=g[o].mime?n.confirm({title:n.i18n("ntfextract"),text:["errExists",o,"confirmRepl"],accept:{label:"btnYes",callback:function(e){if(s=e?"overwrite_all":"overwrite",v(s),p||h){if(p){for(r=i;c>r;r++)b(t[r]);d.resolve()}}else"overwrite"==s&&b(a),c>i+1?y(t,i+1):d.resolve()}},reject:{label:"btnNo",callback:function(e){s=e?"omit_all":"omit",v(s),!p&&!h&&c>i+1?y(t,i+1):h&&d.resolve()}},cancel:{label:"btnCancel",callback:function(){d.resolve()}},all:c>i+1}):u?(b(a),w()):0==f?n.confirm({title:n.i18n("cmdextract"),text:[n.i18n("cmdextract")+' "'+a.name+'"',"confirmRepl"],accept:{label:"btnYes",callback:function(e){e&&(f=1),b(a),w()}},reject:{label:"btnNo",callback:function(e){e&&(f=-1),w()}},cancel:{label:"btnCancel",callback:function(){d.resolve()}},all:c>i+1}):(f>0&&b(a),w())};return this.enabled()&&c&&i.length?(c>0&&y(l,0),d):d.reject()}},elFinder.prototype.commands.forward=function(){this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+right"}],this.getstate=function(){return this.fm.history.canForward()?0:-1},this.exec=function(){return this.fm.history.forward()}},elFinder.prototype.commands.getfile=function(){var t=this,n=this.fm,i=function(n){var i=t.options;return n=e.map(n,function(e){return"directory"!=e.mime||i.folders?e:null}),i.multiple||1==n.length?n:[]};this.alwaysEnabled=!0,this.callback=n.options.getFileCallback,this._disabled="function"==typeof this.callback,this.getstate=function(e){var e=this.files(e),t=e.length;return this.callback&&t&&i(e).length==t?0:-1},this.exec=function(n){var i,a,r,o=this.fm,s=this.options,l=this.files(n),d=l.length,c=o.option("url"),u=o.option("tmbUrl"),p=e.Deferred().done(function(e){o.trigger("getfile",{files:e}),t.callback(e,o),"close"==s.oncomplete?o.hide():"destroy"==s.oncomplete&&o.destroy()}),h=function(){return s.onlyURL?s.multiple?e.map(l,function(e){return e.url}):l[0].url:s.multiple?l:l[0]},f=[];if(-1==this.getstate(n))return p.reject();for(i=0;d>i;i++){if(a=l[i],"directory"==a.mime&&!s.folders)return p.reject();a.baseUrl=c,"1"==a.url?f.push(o.request({data:{cmd:"url",target:a.hash},notify:{type:"url",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){if(e.url){var t=o.file(this.hash);t.url=this.url=e.url}}.bind(a))):a.url=o.url(a.hash),a.path=o.path(a.hash),a.tmb&&1!=a.tmb&&(a.tmb=u+a.tmb),a.width||a.height||(a.dim?(r=a.dim.split("x"),a.width=r[0],a.height=r[1]):-1!==a.mime.indexOf("image")&&f.push(o.request({data:{cmd:"dim",target:a.hash},notify:{type:"dim",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){if(e.dim){var t=e.dim.split("x"),n=o.file(this.hash);n.width=this.width=t[0],n.height=this.height=t[1]}}.bind(a))))}return f.length?(e.when.apply(null,f).always(function(){p.resolve(h(l))}),p):p.resolve(h(l))}},elFinder.prototype.commands.help=function(){var t=this.fm,n=this,i='<div class="elfinder-help-link"> <a href="{url}" target="_blank">{link}</a></div>',a='<div class="elfinder-help-team"><div>{author}</div>{work}</div>',r=/\{url\}/,o=/\{link\}/,s=/\{author\}/,l=/\{work\}/,d="replace",c="ui-priority-primary",u="ui-priority-secondary",p="elfinder-help-license",h='<li class="ui-state-default ui-corner-top"><a href="#{id}">{title}</a></li>',f=['<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-help">','<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">'],m='<div class="elfinder-help-shortcut"><div class="elfinder-help-shortcut-pattern">{pattern}</div> {descrip}</div>',g='<div class="elfinder-help-separator"/>',v=function(){f.push('<div id="about" class="ui-tabs-panel ui-widget-content ui-corner-bottom"><div class="elfinder-help-logo"/>'),f.push("<h3>elFinder</h3>"),f.push('<div class="'+c+'">'+t.i18n("webfm")+"</div>"),f.push('<div class="'+u+'">'+t.i18n("ver")+": "+t.version+", "+t.i18n("protocolver")+': <span id="apiver"></span></div>'),f.push('<div class="'+u+'">jQuery/jQuery UI: '+e().jquery+"/"+e.ui.version+"</div>"),f.push(g),f.push(i[d](r,"http://elfinder.org/")[d](o,t.i18n("homepage"))),f.push(i[d](r,"https://github.com/Studio-42/elFinder/wiki")[d](o,t.i18n("docs"))),f.push(i[d](r,"https://github.com/Studio-42/elFinder")[d](o,t.i18n("github"))),f.push(i[d](r,"http://twitter.com/elrte_elfinder")[d](o,t.i18n("twitter"))),f.push(g),f.push('<div class="'+c+'">'+t.i18n("team")+"</div>"),f.push(a[d](s,'Dmitry "dio" Levashov &lt;dio@std42.ru&gt;')[d](l,t.i18n("chiefdev"))),f.push(a[d](s,"Troex Nevelin &lt;troex@fury.scancode.ru&gt;")[d](l,t.i18n("maintainer"))),f.push(a[d](s,"Alexey Sukhotin &lt;strogg@yandex.ru&gt;")[d](l,t.i18n("contributor"))),f.push(a[d](s,"Naoki Sawada &lt;hypweb@gmail.com&gt;")[d](l,t.i18n("contributor"))),t.i18[t.lang].translator&&f.push(a[d](s,t.i18[t.lang].translator)[d](l,t.i18n("translator")+" ("+t.i18[t.lang].language+")")),f.push(g),f.push('<div class="'+p+'">'+t.i18n("icons")+': Pixelmixer, <a href="http://p.yusukekamiyamane.com" target="_blank">Fugue</a></div>'),f.push(g),f.push('<div class="'+p+'">Licence: BSD Licence</div>'),f.push('<div class="'+p+'">Copyright © 2009-2015, Studio 42</div>'),f.push('<div class="'+p+'">„ …'+t.i18n("dontforget")+" ”</div>"),f.push("</div>")
14
+ },b=function(){var n=t.shortcuts();f.push('<div id="shortcuts" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),n.length?(f.push('<div class="ui-widget-content elfinder-help-shortcuts">'),e.each(n,function(e,t){f.push(m.replace(/\{pattern\}/,t[0]).replace(/\{descrip\}/,t[1]))}),f.push("</div>")):f.push('<div class="elfinder-help-disabled">'+t.i18n("shortcutsof")+"</div>"),f.push("</div>")},y=function(){f.push('<div id="help" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),f.push('<a href="http://elfinder.org/forum/" target="_blank" class="elfinder-dont-panic"><span>DON\'T PANIC</span></a>'),f.push("</div>")},w="";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.state=0,this.shortcuts=[{pattern:"f1",description:this.title}],setTimeout(function(){var i=n.options.view||["about","shortcuts","help"];e.each(i,function(e,n){f.push(h[d](/\{id\}/,n)[d](/\{title\}/,t.i18n(n)))}),f.push("</ul>"),-1!==e.inArray("about",i)&&v(),-1!==e.inArray("shortcuts",i)&&b(),-1!==e.inArray("help",i)&&y(),f.push("</div>"),w=e(f.join("")),w.find(".ui-tabs-nav li").hover(function(){e(this).toggleClass("ui-state-hover")}).children().click(function(t){var n=e(this);t.preventDefault(),t.stopPropagation(),n.hasClass("ui-tabs-selected")||(n.parent().addClass("ui-tabs-selected ui-state-active").siblings().removeClass("ui-tabs-selected").removeClass("ui-state-active"),w.find(".ui-tabs-panel").hide().filter(n.attr("href")).show())}).filter(":first").click()},200),this.getstate=function(){return 0},this.exec=function(){this.dialog||(w.find("#apiver").text(this.fm.api),this.dialog=this.fm.dialog(w,{title:this.title,width:530,autoOpen:!1,destroyOnClose:!1})),this.dialog.elfinderdialog("open").find(".ui-tabs-nav li a:first").click()}},elFinder.prototype.commands.home=function(){this.title="Home",this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+home ctrl+shift+up",description:"Home"}],this.getstate=function(){var e=this.fm.root(),t=this.fm.cwd().hash;return e&&t&&e!=t?0:-1},this.exec=function(){return this.fm.exec("open",this.fm.root())}},elFinder.prototype.commands.info=function(){var t=this.fm,n="elfinder-info-spinner",i={calc:t.i18n("calc"),size:t.i18n("size"),unknown:t.i18n("unknown"),path:t.i18n("path"),aliasfor:t.i18n("aliasfor"),modify:t.i18n("modify"),perms:t.i18n("perms"),locked:t.i18n("locked"),dim:t.i18n("dim"),kind:t.i18n("kind"),files:t.i18n("files"),folders:t.i18n("folders"),items:t.i18n("items"),yes:t.i18n("yes"),no:t.i18n("no"),link:t.i18n("link"),owner:t.i18n("owner"),group:t.i18n("group"),perm:t.i18n("perm")};this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div><table class="elfinder-info-tb">{content}</table>',itemTitle:'<strong>{name}</strong><span class="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",row:"<tr><td>{label} : </td><td>{value}</td></tr>",spinner:'<span>{text}</span> <span class="'+n+" "+n+'-{name}"/>'},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+i"}],this.init=function(){e.each(i,function(e,n){i[e]=t.i18n(n)})},this.getstate=function(){return 0},this.exec=function(t){var a=this.files(t);a.length||(a=this.files([this.fm.cwd().hash]));var r,o,s,l,d,c=this.fm,u=this.options,p=this.tpl,h=p.row,f=a.length,m=[],g=p.main,v="{label}",b="{value}",y={title:this.title,width:"auto",close:function(){e(this).elfinderdialog("destroy")}},w=[],x=function(e,t){C.find("."+n+"-"+t).parent().html(e)},k=c.namespace+"-info-"+e.map(a,function(e){return e.hash}).join("-"),C=c.getUI().find("#"+k),T=[];if(!f)return e.Deferred().reject();if(C.length)return C.elfinderdialog("toTop"),e.Deferred().resolve();if(1==f){if(s=a[0],g=g.replace("{class}",c.mime2class(s.mime)),l=p.itemTitle.replace("{name}",c.escape(s.i18||s.name)).replace("{kind}",c.mime2kind(s)),s.tmb&&(o=c.option("tmbUrl")+s.tmb),s.read?"directory"!=s.mime||s.alias?r=c.formatSize(s.size):(r=p.spinner.replace("{text}",i.calc).replace("{name}","size"),w.push(s.hash)):r=i.unknown,m.push(h.replace(v,i.size).replace(b,r)),s.alias&&m.push(h.replace(v,i.aliasfor).replace(b,s.alias)),m.push(h.replace(v,i.path).replace(b,c.escape(c.path(s.hash,!0)))),s.read){var I,F=c.escape(s.name);if("1"==s.url)m.push(h.replace(v,i.link).replace(b,p.spinner.replace("{text}",i.modify).replace("{name}","url"))),c.request({data:{cmd:"url",target:s.hash},preventDefault:!0}).fail(function(){x(F,"url")}).done(function(e){if(x('<a href="'+e.url+'" target="_blank">'+F+"</a>"||F,"url"),e.url){var t=c.file(s.hash);t.url=e.url}});else{if(u.nullUrlDirLinkSelf&&"directory"==s.mime&&null===s.url){var M=window.location;I=M.pathname+M.search+"#elf_"+s.hash}else I=c.url(s.hash);m.push(h.replace(v,i.link).replace(b,'<a href="'+I+'" target="_blank">'+F+"</a>"))}}s.dim?m.push(h.replace(v,i.dim).replace(b,s.dim)):-1!==s.mime.indexOf("image")&&(s.width&&s.height?m.push(h.replace(v,i.dim).replace(b,s.width+"x"+s.height)):(m.push(h.replace(v,i.dim).replace(b,p.spinner.replace("{text}",i.calc).replace("{name}","dim"))),c.request({data:{cmd:"dim",target:s.hash},preventDefault:!0}).fail(function(){x(i.unknown,"dim")}).done(function(e){if(x(e.dim||i.unknown,"dim"),e.dim){var t=e.dim.split("x"),n=c.file(s.hash);n.width=t[0],n.height=t[1]}}))),m.push(h.replace(v,i.modify).replace(b,c.formatDate(s))),m.push(h.replace(v,i.perms).replace(b,c.formatPermissions(s))),m.push(h.replace(v,i.locked).replace(b,s.locked?i.yes:i.no)),s.owner&&m.push(h.replace(v,i.owner).replace(b,s.owner)),s.group&&m.push(h.replace(v,i.group).replace(b,s.group)),s.perm&&m.push(h.replace(v,i.perm).replace(b,c.formatFileMode(s.perm))),u.custom&&e.each(u.custom,function(t,n){n.mimes&&!e.map(n.mimes,function(e){return s.mime===e||0===s.mime.indexOf(e+"/")?!0:null}).length||n.hashRegex&&!s.hash.match(n.hashRegex)||(m.push(h.replace(v,c.i18n(n.label)).replace(b,n.tpl.replace("{id}",k))),n.action&&"function"==typeof n.action&&T.push(n.action))})}else g=g.replace("{class}","elfinder-cwd-icon-group"),l=p.groupTitle.replace("{items}",i.items).replace("{num}",f),d=e.map(a,function(e){return"directory"==e.mime?1:null}).length,d?(m.push(h.replace(v,i.kind).replace(b,d==f?i.folders:i.folders+" "+d+", "+i.files+" "+(f-d))),m.push(h.replace(v,i.size).replace(b,p.spinner.replace("{text}",i.calc).replace("{name}","size"))),w=e.map(a,function(e){return e.hash})):(r=0,e.each(a,function(e,t){var n=parseInt(t.size);n>=0&&r>=0?r+=n:r="unknown"}),m.push(h.replace(v,i.kind).replace(b,i.files)),m.push(h.replace(v,i.size).replace(b,c.formatSize(r))));g=g.replace("{title}",l).replace("{content}",m.join("")),C=c.dialog(g,y),C.attr("id",k),o&&e("<img/>").load(function(){C.find(".elfinder-cwd-icon").css("background",'url("'+o+'") center center no-repeat')}).attr("src",o),w.length&&c.request({data:{cmd:"size",targets:w},preventDefault:!0}).fail(function(){x(i.unknown,"size")}).done(function(e){var t=parseInt(e.size);x(t>=0?c.formatSize(t):i.unknown,"size")}),T.length&&e.each(T,function(e,t){try{t(s,c,C)}catch(n){c.debug("error",n)}})}},elFinder.prototype.commands.mkdir=function(){this.disableOnSearch=!0,this.updateOnSelect=!1,this.mime="directory",this.prefix="untitled folder",this.exec=e.proxy(this.fm.res("mixin","make"),this),this.shortcuts=[{pattern:"ctrl+shift+n"}],this.getstate=function(){return!this._disabled&&this.fm.cwd().write?0:-1}},elFinder.prototype.commands.mkfile=function(){this.disableOnSearch=!0,this.updateOnSelect=!1,this.mime="text/plain",this.prefix="untitled file.txt",this.exec=e.proxy(this.fm.res("mixin","make"),this),this.getstate=function(){return!this._disabled&&this.fm.cwd().write?0:-1}},elFinder.prototype.commands.netmount=function(){var t=this;this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){this.drivers=this.fm.netDrivers}},this.getstate=function(){return this.drivers.length?0:-1},this.exec=function(){var n=t.fm,i=e.Deferred(),a=t.options,r=function(){var r,o={protocol:e("<select/>").change(function(){var e=this.value;l.find(".elfinder-netmount-tr").hide(),l.find(".elfinder-netmount-tr-"+e).show(),"function"==typeof a[e].select&&a[e].select(n)})},s={title:n.i18n("netMountDialogTitle"),resizable:!1,modal:!0,destroyOnClose:!0,close:function(){delete t.dialog,"pending"==i.state()&&i.reject()},buttons:{}},l=e('<table class="elfinder-info-tb elfinder-netmount-tb"/>'),d=e("<div/>");return l.append(e("<tr/>").append(e("<td>"+n.i18n("protocol")+"</td>")).append(e("<td/>").append(o.protocol))),e.each(t.drivers,function(t,i){o.protocol.append('<option value="'+i+'">'+n.i18n(i)+"</option>"),e.each(a[i].inputs,function(t,a){a.attr("name",t),"hidden"!=a.attr("type")?(a.addClass("ui-corner-all elfinder-netmount-inputs-"+i),l.append(e("<tr/>").addClass("elfinder-netmount-tr elfinder-netmount-tr-"+i).append(e("<td>"+n.i18n(t)+"</td>")).append(e("<td/>").append(a)))):(a.addClass("elfinder-netmount-inputs-"+i),d.append(a))})}),l.append(d),l.find(".elfinder-netmount-tr").hide(),s.buttons[n.i18n("btnMount")]=function(){var a=o.protocol.val(),r={cmd:"netmount",protocol:a};return e.each(l.find("input.elfinder-netmount-inputs-"+a),function(t,n){var i;i="function"==typeof n.val?e.trim(n.val()):e.trim(n.value),i&&(r[n.name]=i)}),r.host?(n.request({data:r,notify:{type:"netmount",cnt:1,hideCnt:!0}}).done(function(e){e.added&&e.added.length&&n.exec("open",e.added[0].hash),i.resolve()}).fail(function(e){i.reject(e)}),t.dialog.elfinderdialog("close"),void 0):n.trigger("error",{error:"errNetMountHostReq"})},s.buttons[n.i18n("btnCancel")]=function(){t.dialog.elfinderdialog("close")},r=n.dialog(l,s),r.ready(function(){o.protocol.change(),r.elfinderdialog("posInit")}),r};return n.bind("netmount",function(e){var t=e.data||null;t&&t.protocol&&a[t.protocol]&&"function"==typeof a[t.protocol].done&&a[t.protocol].done(n,t)}),t.dialog||(t.dialog=r()),i.promise()}},elFinder.prototype.commands.netunmount=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){this.drivers=this.fm.netDrivers}},this.getstate=function(e){var t=this.fm;return e&&this.drivers.length&&!this._disabled&&t.file(e[0]).netkey?0:-1},this.exec=function(t){var n=this,i=this.fm,a=e.Deferred().fail(function(e){e&&i.error(e)}),r=i.file(t[0]);return this._disabled?a.reject():("pending"==a.state()&&i.confirm({title:n.title,text:i.i18n("confirmUnmount",r.name),accept:{label:"btnUnmount",callback:function(){i.request({data:{cmd:"netmount",protocol:"netunmount",host:r.netkey,user:r.hash,pass:"dum"},notify:{type:"netunmount",cnt:1,hideCnt:!0},preventFail:!0}).fail(function(e){a.reject(e)}).done(function(e){var t=i.root()==r.hash;if(e.removed=[r.hash],i.remove(e),t){var n=i.files();for(var o in n)if("directory"==i.file(o).mime){i.exec("open",o);break}}a.resolve()})}},cancel:{label:"btnCancel",callback:function(){a.reject()}}}),a)}},elFinder.prototype.commands.open=function(){this.alwaysEnabled=!0,this._handlers={dblclick:function(e){e.preventDefault(),this.exec()},"select enable disable reload":function(e){this.update("disable"==e.type?-1:void 0)}},this.shortcuts=[{pattern:"ctrl+down numpad_enter"+("mac"!=this.fm.OS&&" enter")}],this.getstate=function(t){var t=this.files(t),n=t.length;return 1==n?0:n&&!this.fm.UA.Mobile?e.map(t,function(e){return"directory"==e.mime?null:e}).length==n?0:-1:-1},this.exec=function(t,n){var i,a,r,o,s,l,d,c,u,p,h,f,m=this.fm,g=e.Deferred().fail(function(e){e&&m.error(e)}),v=this.files(t),b=v.length,y="object"==typeof n?n.thash:!1;if(!b&&!y)return g.reject();if(y||1==b&&(i=v[0])&&"directory"==i.mime)return y||!i||i.read?m.request({data:{cmd:"open",target:y||i.hash},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0}):g.reject(["errOpen",i.name,"errPerm"]);if(v=e.map(v,function(e){return"directory"!=e.mime?e:null}),b!=v.length)return g.reject();try{u=new RegExp(m.option("dispInlineRegex"))}catch(w){u=!1}for(p=e("<a>").hide().appendTo(e("body")),h="string"==typeof p.get(0).download,b=v.length;b--;){if(i=v[b],!i.read)return g.reject(["errOpen",i.name,"errPerm"]);if(f=u&&i.mime.match(u),a=m.openUrl(i.hash,!f),m.UA.Mobile||!f)if(h)!f&&p.attr("download",i.name),p.attr("href",a).attr("target","_blank").get(0).click();else{var x=window.open(a);if(!x)return g.reject("errPopup")}else{s=d=Math.round(2*e(window).width()/3),l=c=Math.round(2*e(window).height()/3),parseInt(i.width)&&parseInt(i.height)?(s=parseInt(i.width),l=parseInt(i.height)):i.dim&&(r=i.dim.split("x"),s=parseInt(r[0]),l=parseInt(r[1])),d>=s&&c>=l?(d=s,c=l):s-d>l-c?c=Math.round(l*(d/s)):d=Math.round(s*(c/l)),o="width="+d+",height="+c,0===a.indexOf(m.options.url)&&(a="");var x=window.open(a,"new_window",o+",top=50,left=50,scrollbars=yes,resizable=yes");if(!x)return g.reject("errPopup");if(""===a){var k=document.createElement("form");k.action=m.options.url,k.method="POST",k.target="new_window",k.style.display="none";var C=e.extend({},m.options.customData,{cmd:"file",target:i.hash});e.each(C,function(e,t){var n=document.createElement("input");n.name=e,n.value=t,k.appendChild(n)}),document.body.appendChild(k),k.submit()}x.focus()}}return p.remove(),g.resolve(t)}},elFinder.prototype.commands.opendir=function(){this.alwaysEnabled=!0,this.getstate=function(){var e,t=this.fm.selected(),n=t.length;return 1!==n?-1:(e=this.fm.getUI("cwd").parent(),e.hasClass("elfinder-search-result")?0:-1)},this.exec=function(t){var n,i=this.fm,a=e.Deferred(),r=this.files(t),o=r.length,s=null;return o&&r[0].phash?(n=r[0].phash,i.file(n)||(s=i.request({data:{cmd:"parents",target:n},syncOnFail:!1})),e.when(s).done(function(){i.trigger("searchend",{noupdate:!0}),i.request({data:{cmd:"open",target:n},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!1})}),a):a.reject()}},elFinder.prototype.commands.paste=function(){this.updateOnSelect=!1,this.handlers={changeclipboard:function(){this.update()}},this.shortcuts=[{pattern:"ctrl+v shift+insert"}],this.getstate=function(t){if(this._disabled)return-1;if(t){if(e.isArray(t)){if(1!=t.length)return-1;t=this.fm.file(t[0])}}else t=this.fm.cwd();return this.fm.clipboard().length&&"directory"==t.mime&&t.write?0:-1},this.exec=function(t){var n,i,a=this,r=a.fm,t=t?this.files(t)[0]:r.cwd(),o=r.clipboard(),s=o.length,l=s?o[0].cut:!1,d=l?"errMove":"errCopy",c=[],u=[],p=e.Deferred().fail(function(e){e&&r.error(e)}).always(function(){r.unlockfiles({files:e.map(o,function(e){return e.hash})})}),h=function(t){return t.length&&r._commands.duplicate?r.exec("duplicate",t):e.Deferred().resolve()},f=function(n){var i=e.Deferred(),o=[],s=function(t,n){for(var i=[],a=t.length;a--;)-1!==e.inArray(t[a].name,n)&&i.unshift(a);return i},d=function(e){var t=o[e],a=n[t],s=e==o.length-1;a&&r.confirm({title:r.i18n(l?"moveFiles":"copyFiles"),text:["errExists",a.name,"confirmRepl"],all:!s,accept:{label:"btnYes",callback:function(t){s||t?u(n):d(++e)}},reject:{label:"btnNo",callback:function(t){var i;if(t)for(i=o.length;e<i--;)n[o[i]].remove=!0;else n[o[e]].remove=!0;s||t?u(n):d(++e)}},cancel:{label:"btnCancel",callback:function(){i.resolve()}},buttons:[{label:"btnBackup",callback:function(t){var i;if(t)for(i=o.length;e<i--;)n[o[i]].rename=!0;else n[o[e]].rename=!0;s||t?u(n):d(++e)}}]})},c=function(e){o=s(n,e),o.length?d(0):u(n)},u=function(n){var a,o=[],n=e.map(n,function(e){return e.rename&&o.push(e.name),e.remove?null:e}),s=n.length;return s?(a=n[0].phash,n=e.map(n,function(e){return e.hash}),r.request({data:{cmd:"paste",dst:t.hash,targets:n,cut:l?1:0,src:a,renames:o,suffix:r.options.backupSuffix},notify:{type:l?"move":"copy",cnt:s}}).done(function(e){if(i.resolve(e),e&&e.added&&e.added[0]){var t=r.getUI("cwd").find("#"+r.cwdHash2Id(e.added[0].hash));t.length&&t.trigger("scrolltoview")}}).always(function(){r.unlockfiles({files:n})}),void 0):i.resolve()};return r.isCommandEnabled(a.name,t.hash)&&n.length?(r.oldAPI?u(n):r.option("copyOverwrite")?t.hash==r.cwd().hash?c(e.map(r.files(),function(e){return e.phash==t.hash?e.name:null})):r.request({data:{cmd:"ls",target:t.hash},notify:{type:"prepare",cnt:1,hideCnt:!0},preventFail:!0}).always(function(e){c(e.list||[])}):u(n),i):i.resolve()};return s&&t&&"directory"==t.mime?t.write?(n=r.parents(t.hash),e.each(o,function(a,s){return s.read?l&&s.locked?!p.reject(["errLocked",s.name]):-1!==e.inArray(s.hash,n)?!p.reject(["errCopyInItself",s.name]):(i=r.parents(s.hash),i.pop(),-1!==e.inArray(t.hash,i)&&e.map(i,function(e){var n=r.file(e);return n.phash==t.hash&&n.name==s.name?n:null}).length?!p.reject(["errReplByChild",s.name]):(s.phash==t.hash?u.push(s.hash):c.push({hash:s.hash,phash:s.phash,name:s.name}),void 0)):!p.reject([d,o[0].name,"errPerm"])}),"rejected"==p.state()?p:e.when(h(u),f(c)).always(function(){l&&r.clipboard([])})):p.reject([d,o[0].name,"errPerm"]):p.reject()}},elFinder.prototype.commands.places=function(){var t=this,n=this.fm,i=function(n){return e.map(t.files(n),function(e){return"directory"==e.mime?e:null})},a=null;this.getstate=function(e){var e=this.hashes(e),t=e.length;return a&&t&&t==i(e).length?0:-1},this.exec=function(e){var t=this.files(e);a.trigger("regist",[t])},n.one("load",function(){a=n.ui.places})},elFinder.prototype.commands.quicklook=function(){var t,n,i,a,r=this,o=r.fm,s=0,l=1,d=2,c=s,u="elfinder-quicklook-navbar-icon",p="elfinder-quicklook-fullscreen",h=function(t){e(document).trigger(e.Event("keydown",{keyCode:t,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))},f=function(e){return{opacity:0,width:20,height:"list"==o.view?1:20,top:e.offset().top+"px",left:e.offset().left+"px"}},m=function(){var i=e(window),a=Math.min(t,e(window).width()-10),r=Math.min(n,e(window).height()-80);return{opacity:1,width:a,height:r,top:parseInt((i.height()-r-60)/2+i.scrollTop()),left:parseInt((i.width()-a)/2+i.scrollLeft())}},g=function(e){var t=document.createElement(e.substr(0,e.indexOf("/"))),n=!1;try{n=t.canPlayType&&t.canPlayType(e)}catch(i){}return n&&""!==n&&"no"!=n},v=e('<div class="elfinder-quicklook-title"/>'),b=e("<div/>"),y=e('<div class="elfinder-quicklook-info"/>'),w=e('<div class="'+u+" "+u+'-fullscreen"/>').mousedown(function(t){var n=r.window,a=n.hasClass(p),s="scroll."+o.namespace,l=e(window);t.stopPropagation(),a?(n.css(n.data("position")).unbind("mousemove"),l.unbind(s).trigger(r.resize).unbind(r.resize),x.unbind("mouseenter").unbind("mousemove")):(n.data("position",{left:n.css("left"),top:n.css("top"),width:n.width(),height:n.height()}).css({width:"100%",height:"100%"}),e(window).bind(s,function(){n.css({left:parseInt(e(window).scrollLeft())+"px",top:parseInt(e(window).scrollTop())+"px"})}).bind(r.resize,function(){r.preview.trigger("changesize")}).trigger(s).trigger(r.resize),n.bind("mousemove",function(){x.stop(!0,!0).show().delay(3e3).fadeOut("slow")}).mousemove(),x.mouseenter(function(){x.stop(!0,!0).show()}).mousemove(function(e){e.stopPropagation()})),x.attr("style","").draggable(a?"destroy":{}),n.toggleClass(p),e(this).toggleClass(u+"-fullscreen-off");var d=n;i.is(".ui-resizable")&&(d=d.add(i)),e.fn.resizable&&!o.UA.Touch&&d.resizable(a?"enable":"disable").removeClass("ui-state-disabled")}),x=e('<div class="elfinder-quicklook-navbar"/>').append(e('<div class="'+u+" "+u+'-prev"/>').mousedown(function(){h(37)})).append(w).append(e('<div class="'+u+" "+u+'-next"/>').mousedown(function(){h(39)})).append('<div class="elfinder-quicklook-navbar-separator"/>').append(e('<div class="'+u+" "+u+'-close"/>').mousedown(function(){r.window.trigger("close")}));this.resize="resize."+o.namespace,this.info=e('<div class="elfinder-quicklook-info-wrapper"/>').append(b).append(y),this.preview=e('<div class="elfinder-quicklook-preview ui-helper-clearfix"/>').bind("change",function(){r.info.attr("style","").hide(),b.removeAttr("class").attr("style",""),y.html("")}).bind("update",function(t){var n,i=r.fm,a=(r.preview,t.file),o='<div class="elfinder-quicklook-info-data">{value}</div>';a?(!a.read&&t.stopImmediatePropagation(),r.window.data("hash",a.hash),r.preview.unbind("changesize").trigger("change").children().remove(),v.html(i.escape(a.name)),y.html(o.replace(/\{value\}/,i.escape(a.name))+o.replace(/\{value\}/,i.mime2kind(a))+("directory"==a.mime?"":o.replace(/\{value\}/,i.formatSize(a.size)))+o.replace(/\{value\}/,i.i18n("modify")+": "+i.formatDate(a))),b.addClass("elfinder-cwd-icon ui-corner-all "+i.mime2class(a.mime)),a.tmb&&e("<img/>").hide().appendTo(r.preview).load(function(){b.css("background",'url("'+n+'") center center no-repeat'),e(this).remove()}).attr("src",n=i.tmb(a.hash)),r.info.delay(100).fadeIn(10)):t.stopImmediatePropagation()}),this.window=e('<div class="ui-helper-reset ui-widget elfinder-quicklook" style="position:absolute"/>').click(function(e){e.stopPropagation()}).append(e('<div class="elfinder-quicklook-titlebar"/>').append(v).append(e('<span class="ui-icon ui-icon-circle-close"/>').mousedown(function(e){e.stopPropagation(),r.window.trigger("close")}))).append(this.preview.add(x)).append(r.info.hide()).draggable({handle:"div.elfinder-quicklook-titlebar"}).bind("open",function(){var e,t=r.window,n=r.value;r.closed()&&n&&(e=a.find("#"+o.cwdHash2Id(n.hash))).length&&(x.attr("style",""),c=l,e.trigger("scrolltoview"),t.css(f(e)).show().animate(m(),550,function(){c=d,r.update(1,r.value)}))}).bind("close",function(){var e=r.window,t=r.preview.trigger("change"),n=(r.value,a.find("#"+o.cwdHash2Id(e.data("hash")))),i=function(){c=s,e.hide(),t.children().remove(),r.update(0,r.value)};r.opened()&&(c=l,e.hasClass(p)&&w.mousedown(),n.length?e.animate(f(n),500,i):i())}),this.alwaysEnabled=!0,this.value=null,this.handlers={select:function(){this.update(void 0,this.fm.selectedFiles()[0])},error:function(){r.window.is(":visible")&&r.window.data("hash","").trigger("close")},"searchshow searchhide":function(){this.opened()&&this.window.trigger("close")}},this.shortcuts=[{pattern:"space"}],this.support={audio:{ogg:g('audio/ogg; codecs="vorbis"'),mp3:g("audio/mpeg;"),wav:g('audio/wav; codecs="1"'),m4a:g("audio/x-m4a;")||g("audio/aac;")},video:{ogg:g('video/ogg; codecs="theora"'),webm:g('video/webm; codecs="vp8, vorbis"'),mp4:g('video/mp4; codecs="avc1.42E01E"')||g('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')}},this.closed=function(){return c==s},this.opened=function(){return c==d},this.init=function(){var s=this.options,l=this.window,d=this.preview;t=s.width>0?parseInt(s.width):450,n=s.height>0?parseInt(s.height):300,o.one("load",function(){i=o.getUI(),a=o.getUI("cwd"),l.appendTo("body").zIndex(100+i.zIndex()),e(document).keydown(function(e){27==e.keyCode&&r.opened()&&l.trigger("close")}),e.fn.resizable&&!o.UA.Touch&&l.resizable({handles:"se",minWidth:350,minHeight:120,resize:function(){d.trigger("changesize")}}),r.change(function(){r.opened()&&(r.value?d.trigger(e.Event("update",{file:r.value})):l.trigger("close"))}),e.each(o.commands.quicklook.plugins||[],function(e,t){"function"==typeof t&&new t(r)}),d.bind("update",function(){r.info.show()})})},this.getstate=function(){return 1==this.fm.selected().length?c==d?1:0:-1},this.exec=function(){this.enabled()&&this.window.trigger(this.opened()?"close":"open")},this.hideinfo=function(){this.info.stop(!0).hide()}},elFinder.prototype.commands.quicklook.plugins=[function(t){var n=["image/jpeg","image/png","image/gif"],i=t.preview;e.each(navigator.mimeTypes,function(t,i){var a=i.type;0===a.indexOf("image/")&&e.inArray(a,n)&&n.push(a)}),i.bind("update",function(a){var r,o=a.file;-1!==e.inArray(o.mime,n)&&(a.stopImmediatePropagation(),r=e("<img/>").hide().appendTo(i).load(function(){setTimeout(function(){var e=(r.width()/r.height()).toFixed(2);i.bind("changesize",function(){var t,n,a=parseInt(i.width()),o=parseInt(i.height());e<(a/o).toFixed(2)?(n=o,t=Math.floor(n*e)):(t=a,n=Math.floor(t/e)),r.width(t).height(n).css("margin-top",o>n?Math.floor((o-n)/2):0)}).trigger("changesize"),t.hideinfo(),r.fadeIn(100)},1)}).attr("src",t.fm.openUrl(o.hash)))})},function(t){var n=["text/html","application/xhtml+xml"],i=t.preview,a=t.fm;i.bind("update",function(r){var o,s=r.file;-1!==e.inArray(s.mime,n)&&(r.stopImmediatePropagation(),i.one("change",function(){"pending"==o.state()&&o.reject()}),o=a.request({data:{cmd:"get",target:s.hash,current:s.phash,conv:1},preventDefault:!0}).done(function(n){t.hideinfo(),doc=e('<iframe class="elfinder-quicklook-preview-html"/>').appendTo(i)[0].contentWindow.document,doc.open(),doc.write(n.content),doc.close()}))})},function(t){var n=t.fm,i=n.res("mimes","text"),a=t.preview;a.bind("update",function(r){var o,s=r.file,l=s.mime;(0===l.indexOf("text/")||-1!==e.inArray(l,i))&&(r.stopImmediatePropagation(),a.one("change",function(){"pending"==o.state()&&o.reject()}),o=n.request({data:{cmd:"get",target:s.hash,conv:1},preventDefault:!0}).done(function(i){t.hideinfo(),e('<div class="elfinder-quicklook-preview-text-wrapper"><pre class="elfinder-quicklook-preview-text">'+n.escape(i.content)+"</pre></div>").appendTo(a)}))})},function(t){var n=t.fm,i="application/pdf",a=t.preview,r=!1;n.UA.Safari&&"mac"==n.OS||n.UA.IE?r=!0:e.each(navigator.plugins,function(t,n){e.each(n,function(e,t){return t.type==i?!(r=!0):void 0})}),r&&a.bind("update",function(r){var o,s=r.file;s.mime==i&&(r.stopImmediatePropagation(),a.one("change",function(){o.unbind("load").remove()}),o=e('<iframe class="elfinder-quicklook-preview-pdf"/>').hide().appendTo(a).load(function(){t.hideinfo(),o.show()}).attr("src",n.url(s.hash)))})},function(t){var n=t.fm,i="application/x-shockwave-flash",a=t.preview,r=!1;e.each(navigator.plugins,function(t,n){e.each(n,function(e,t){return t.type==i?!(r=!0):void 0})}),r&&a.bind("update",function(r){var o,s=r.file;s.mime==i&&(r.stopImmediatePropagation(),t.hideinfo(),a.append(o=e('<embed class="elfinder-quicklook-preview-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+n.url(s.hash)+'" quality="high" type="application/x-shockwave-flash" />')))})},function(t){var n,i=t.preview,a=!!t.options.autoplay,r={"audio/mpeg":"mp3","audio/mpeg3":"mp3","audio/mp3":"mp3","audio/x-mpeg3":"mp3","audio/x-mp3":"mp3","audio/x-wav":"wav","audio/wav":"wav","audio/x-m4a":"m4a","audio/aac":"m4a","audio/mp4":"m4a","audio/x-mp4":"m4a","audio/ogg":"ogg"};i.bind("update",function(o){var s=o.file,l=r[s.mime];t.support.audio[l]&&(o.stopImmediatePropagation(),n=e('<audio class="elfinder-quicklook-preview-audio" controls preload="auto" autobuffer><source src="'+t.fm.openUrl(s.hash)+'" /></audio>').appendTo(i),a&&n[0].play())}).bind("change",function(){n&&n.parent().length&&(n[0].pause(),n.remove(),n=null)})},function(t){var n,i=t.preview,a=!!t.options.autoplay,r={"video/mp4":"mp4","video/x-m4v":"mp4","video/ogg":"ogg","application/ogg":"ogg","video/webm":"webm"};i.bind("update",function(o){var s=o.file,l=r[s.mime];t.support.video[l]&&(o.stopImmediatePropagation(),t.hideinfo(),n=e('<video class="elfinder-quicklook-preview-video" controls preload="auto" autobuffer><source src="'+t.fm.openUrl(s.hash)+'" /></video>').appendTo(i),a&&n[0].play())}).bind("change",function(){n&&n.parent().length&&(n[0].pause(),n.remove(),n=null)})},function(t){var n,i=t.preview,a=[];e.each(navigator.plugins,function(t,n){e.each(n,function(e,t){(0===t.type.indexOf("audio/")||0===t.type.indexOf("video/"))&&a.push(t.type)})}),i.bind("update",function(r){var o,s=r.file,l=s.mime;-1!==e.inArray(s.mime,a)&&(r.stopImmediatePropagation(),(o=0===l.indexOf("video/"))&&t.hideinfo(),n=e('<embed src="'+t.fm.openUrl(s.hash)+'" type="'+l+'" class="elfinder-quicklook-preview-'+(o?"video":"audio")+'"/>').appendTo(i))}).bind("change",function(){n&&n.parent().length&&(n.remove(),n=null)})}],elFinder.prototype.commands.reload=function(){var t=this,n=!1;this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+shift+r f5"}],this.getstate=function(){return 0},this.init=function(){this.fm.bind("search searchend",function(e){n="search"==e.type})},this.fm.bind("contextmenu",function(){var n=t.fm;if(n.options.sync>=1e3){var i;t.extra={icon:"accept",node:e("<span/>").attr({title:n.i18n("autoSync")}).on("click",function(e){e.stopPropagation(),e.preventDefault(),i.parent().toggleClass("ui-state-disabled",n.options.syncStart).parent().removeClass("ui-state-hover"),n.options.syncStart=!n.options.syncStart,n.autoSync(n.options.syncStart?null:"stop")})},i=t.extra.node,i.ready(function(){setTimeout(function(){i.parent().toggleClass("ui-state-disabled",!n.options.syncStart)},10)})}}),this.exec=function(){var t=this.fm;if(!n){var i=t.sync(),a=setTimeout(function(){t.notify({type:"reload",cnt:1,hideCnt:!0}),i.always(function(){t.notify({type:"reload",cnt:-1})})},t.notifyDelay);return i.always(function(){clearTimeout(a),t.trigger("reload")})}e("div.elfinder-toolbar > div."+t.res("class","searchbtn")+" > span.ui-icon-search").click()}},elFinder.prototype.commands.rename=function(){this.shortcuts=[{pattern:"f2"+("mac"==this.fm.OS?" enter":"")}],this.getstate=function(e){var e=this.files(e);return this._disabled||1!=e.length||!e[0].phash||e[0].locked?-1:0},this.exec=function(t){var n,i=this.fm,a=i.getUI("cwd"),r=t||(i.selected().length?i.selected():!1)||[i.cwd().hash],o=r.length,s=i.file(r.shift()),l=".elfinder-cwd-filename",d=t&&t._type?t._type:i.selected().length?"files":"navbar",c="navbar"===d,u=i.cwd().hash==s.hash,p="files"===d&&"list"!=i.storage("view"),h=function(){p?(b.zIndex("").css("position",""),g.css("max-height","")):c||(b.css("width",""),b.parent("td").css("overflow",""))},f=e.Deferred().done(function(e){u&&i.exec("open",e.added[0].hash)}).fail(function(e){var t=m.parent(),n=i.escape(s.name);p&&(n=n.replace(/([_.])/g,"&#8203;$1")),h(),c?m.replaceWith(n):t.length?(m.remove(),t.html(n)):(a.find("#"+i.cwdHash2Id(s.hash)).find(l).html(n),setTimeout(function(){a.find("#"+i.cwdHash2Id(s.hash)).click()},50)),e&&i.error(e)}).always(function(){i.enable()}),m=e(p?"<textarea/>":'<input type="text"/>').on("keyup text",function(){p?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):n&&(this.style.width=n+"px",this.scrollWidth>n&&(this.style.width=this.scrollWidth+10+"px"))}).keydown(function(t){t.stopPropagation(),t.stopImmediatePropagation(),t.keyCode==e.ui.keyCode.ESCAPE?f.reject():t.keyCode==e.ui.keyCode.ENTER&&m.blur()}).mousedown(function(e){e.stopPropagation()}).click(function(e){e.stopPropagation()}).dblclick(function(e){e.stopPropagation(),e.preventDefault()}).blur(function(){var t=e.trim(m.val()),n=(m.parent(),!0);if(b.length){if(m[0].setSelectionRange&&m[0].setSelectionRange(0,0),t==s.name)return f.reject();if(i.options.validName&&i.options.validName.test)try{n=i.options.validName.test(t)}catch(r){n=!1}if(!t||".."===t||!n)return i.error("errInvName"),!1;if(i.fileByName(t,s.phash))return i.error(["errExists",t]),!1;h(),(c?b:g).html(i.escape(t)),i.lockfiles({files:[s.hash]}),i.request({data:{cmd:"rename",target:s.hash,name:t},notify:{type:"rename",cnt:1}}).fail(function(){f.reject(),i.sync()}).done(function(e){if(f.resolve(e),!c&&e&&e.added&&e.added[0]){var t=a.find("#"+i.cwdHash2Id(e.added[0].hash));t.length&&t.trigger("scrolltoview")}}).always(function(){i.unlockfiles({files:[s.hash]})})}}),g=c?e("#"+i.navHash2Id(s.hash)).contents().filter(function(){return 3==this.nodeType&&e(this).parent().attr("id")===i.navHash2Id(s.hash)}):a.find("#"+i.cwdHash2Id(s.hash)).find(l),v=s.name.replace(/\.((tar\.(gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(gz|bz2)|[a-z0-9]{1,4})$/gi,""),b=g.parent();return c?g.replaceWith(m.val(s.name)):(p?(b.zIndex(b.zIndex()+1).css("position","relative"),g.css("max-height","none")):c||(n=b.width(),b.width(n-15),b.parent("td").css("overflow","visible")),g.empty().append(m.val(s.name))),o>1||this.getstate([s.hash])<0?f.reject():s&&g.length?s.locked?f.reject(["errLocked",s.name]):(i.one("select",function(){m.parent().length&&s&&-1===e.inArray(s.hash,i.selected())&&m.blur()}),m.trigger("keyup"),m.select().focus(),m[0].setSelectionRange&&m[0].setSelectionRange(0,v.length),f):f.reject("errCmdParams",this.title)}},elFinder.prototype.commands.resize=function(){this.updateOnSelect=!1,this.getstate=function(){var e=this.fm.selectedFiles();return!this._disabled&&1==e.length&&e[0].read&&e[0].write&&-1!==e[0].mime.indexOf("image/")?0:-1
15
+ },this.exec=function(t){var n,i,a=this.fm,r=this.files(t),o=e.Deferred(),s=function(t,n){var i="image/jpeg"===t.mime,r=e('<div class="elfinder-dialog-resize"/>'),s='<input type="text" size="5"/>',l='<div class="elfinder-resize-row"/>',d='<div class="elfinder-resize-label"/>',c=e('<div class="elfinder-resize-control"/>'),u=e('<div class="elfinder-resize-preview"/>'),p=e('<div class="elfinder-resize-spinner">'+a.i18n("ntfloadimg")+"</div>"),h=e('<div class="elfinder-resize-handle"/>'),f=e('<div class="elfinder-resize-handle"/>'),m=e('<div class="elfinder-resize-uiresize"/>'),g=e('<div class="elfinder-resize-uicrop"/>'),v='<div class="ui-widget-content ui-corner-all elfinder-buttonset"/>',b='<div class="ui-state-default elfinder-button"/>',y='<span class="ui-widget-content elfinder-toolbar-button-separator"/>',w=e('<div class="elfinder-resize-rotate"/>'),x=e(b).attr("title",a.i18n("rotate-cw")).append(e('<span class="elfinder-button-icon elfinder-button-icon-rotate-l"/>').click(function(){B-=90,nt.update(B)})),k=e(b).attr("title",a.i18n("rotate-ccw")).append(e('<span class="elfinder-button-icon elfinder-button-icon-rotate-r"/>').click(function(){B+=90,nt.update(B)})),C=e("<span />"),T=e('<div class="ui-state-default ui-corner-all elfinder-resize-reset"><span class="ui-icon ui-icon-arrowreturnthick-1-w"/></div>'),I=e('<div class="elfinder-resize-type"/>').append('<input type="radio" name="type" id="'+n+'-resize" value="resize" checked="checked" /><label for="'+n+'-resize">'+a.i18n("resize")+"</label>").append('<input type="radio" name="type" id="'+n+'-crop" value="crop" /><label for="'+n+'-crop">'+a.i18n("crop")+"</label>").append('<input type="radio" name="type" id="'+n+'-rotate" value="rotate" /><label for="'+n+'-rotate">'+a.i18n("rotate")+"</label>"),F=e("input",I).attr("disabled","disabled").change(function(){var t=e("input:checked",I).val();Z(),it(!0),at(!0),rt(!0),"resize"==t?(m.show(),w.hide(),g.hide(),it()):"crop"==t?(w.hide(),m.hide(),g.show(),at()):"rotate"==t&&(m.hide(),g.hide(),w.show(),rt())}),M=e('<input type="checkbox" checked="checked"/>').change(function(){q=!!M.prop("checked"),et.fixHeight(),it(!0),it()}),P=e(s).change(function(){var e=parseInt(P.val()),t=parseInt(q?Math.round(e/H):S.val());e>0&&t>0&&(et.updateView(e,t),S.val(t))}),S=e(s).change(function(){var e=parseInt(S.val()),t=parseInt(q?Math.round(e*H):P.val());t>0&&e>0&&(et.updateView(t,e),P.val(t))}),z=e(s).change(function(){tt.updateView()}),A=e(s).change(function(){tt.updateView()}),D=e(s).change(function(){tt.updateView()}),O=e(s).change(function(){tt.updateView()}),U=i?e(s).val(a.option("jpgQuality")).addClass("quality").on("blur",function(){var e=Math.min(100,Math.max(1,parseInt(this.value)));r.find("input.quality").val(e)}):null,E=e('<input type="text" size="3" maxlength="3" value="0" />').change(function(){nt.update()}),j=e('<div class="elfinder-resize-rotate-slider"/>').slider({min:0,max:360,value:E.val(),animate:!0,change:function(e,t){t.value!=j.slider("value")&&nt.update(t.value)},slide:function(e,t){nt.update(t.value,!1)}}),H=1,R=1,_=0,N=0,q=!0,L=0,$=0,V=0,W=0,B=0,K=e("<img/>").load(function(){p.remove(),_=K.width(),N=K.height(),H=_/N,et.updateView(_,N),h.append(K.show()).show(),P.val(_),S.val(N);var t=Math.min(L,$)/Math.sqrt(Math.pow(_,2)+Math.pow(N,2));V=_*t,W=N*t,F.button("enable"),c.find("input,select").removeAttr("disabled").filter(":text").keydown(function(t){var n,i=t.keyCode;return t.stopPropagation(),i>=37&&40>=i||i==e.ui.keyCode.BACKSPACE||i==e.ui.keyCode.DELETE||65==i&&(t.ctrlKey||t.metaKey)||27==i?void 0:(9==i&&(n=e(this).parent()[t.shiftKey?"prevAll":"nextAll"]("div.elfinder-resize-row").children(":text"),n.length?n[0].focus():e(this).parent().parent().find(":text:"+(t.shiftKey?"last":"first")).focus()),13==i?(a.confirm({title:e("input:checked",I).val(),text:"confirmReq",accept:{label:"btnApply",callback:function(){ot()}},cancel:{label:"btnCancel",callback:function(){}}}),void 0):(i>=48&&57>=i||i>=96&&105>=i||t.preventDefault(),void 0))}).filter(":first").focus(),it(),T.hover(function(){T.toggleClass("ui-state-hover")}).click(Z)}).error(function(){p.text("Unable to load image").css("background","transparent")}),J=e("<div/>"),G=e("<img/>"),X=e("<div/>"),Y=e("<img/>"),Q=function(e){return i?8*Math.round(e/8):Math.round(e)},Z=function(){P.val(_),S.val(N),et.updateView(_,N)},et={update:function(){P.val(Q(K.width()/R)),S.val(Q(K.height()/R))},updateView:function(e,t){e>L||t>$?e/L>t/$?(R=L/e,K.width(L).height(Math.ceil(t*R))):(R=$/t,K.height($).width(Math.ceil(e*R))):K.width(e).height(t),R=K.width()/e,C.text("1 : "+(1/R).toFixed(2)),et.updateHandle()},updateHandle:function(){h.width(K.width()).height(K.height())},fixHeight:function(){var e,t;q&&(e=P.val(),t=Math.round(e/H),et.updateView(e,t),S.val(t))}},tt={update:function(){D.val(Q((f.data("w")||f.width())/R)),O.val(Q((f.data("h")||f.height())/R)),z.val(Math.round(((f.data("x")||f.offset().left)-G.offset().left)/R)),A.val(Math.round(((f.data("y")||f.offset().top)-G.offset().top)/R))},updateView:function(){var e=parseInt(z.val())*R+G.offset().left,t=parseInt(A.val())*R+G.offset().top,n=D.val()*R,i=O.val()*R;f.data({x:e,y:t,w:n,h:i}).width(Math.round(n)).height(Math.round(i)).offset({left:Math.round(e),top:Math.round(t)}),X.width(f.width()).height(f.height())},resize_update:function(){f.data({w:null,h:null}),tt.update(),X.width(f.width()).height(f.height())},drag_update:function(){f.data({x:null,y:null}),tt.update()}},nt={mouseStartAngle:0,imageStartAngle:0,imageBeingRotated:!1,update:function(e,t){"undefined"==typeof e&&(B=e=parseInt(E.val())),"undefined"==typeof t&&(t=!0),!t||a.UA.Opera||a.UA.ltIE8?Y.rotate(e):Y.animate({rotate:e+"deg"}),e%=360,0>e&&(e+=360),E.val(parseInt(e)),j.slider("value",E.val())},execute:function(e){if(nt.imageBeingRotated){var t=nt.getCenter(Y),n=e.pageX-t[0],i=e.pageY-t[1],a=Math.atan2(i,n),r=a-nt.mouseStartAngle+nt.imageStartAngle;return r=Math.round(180*parseFloat(r)/Math.PI),e.shiftKey&&(r=15*Math.round((r+6)/15)),Y.rotate(r),r%=360,0>r&&(r+=360),E.val(r),j.slider("value",E.val()),!1}},start:function(t){nt.imageBeingRotated=!0;var n=nt.getCenter(Y),i=t.pageX-n[0],a=t.pageY-n[1];return nt.mouseStartAngle=Math.atan2(a,i),nt.imageStartAngle=parseFloat(Y.rotate())*Math.PI/180,e(document).mousemove(nt.execute),!1},stop:function(){return nt.imageBeingRotated?(e(document).unbind("mousemove",nt.execute),setTimeout(function(){nt.imageBeingRotated=!1},10),!1):void 0},getCenter:function(){var e=Y.rotate();Y.rotate(0);var t=Y.offset(),n=t.left+Y.width()/2,i=t.top+Y.height()/2;return Y.rotate(e),Array(n,i)}},it=function(t){e.fn.resizable&&(t?(h.filter(":ui-resizable").resizable("destroy"),h.hide()):(h.show(),h.resizable({alsoResize:K,aspectRatio:q,resize:et.update,stop:et.fixHeight})))},at=function(t){e.fn.draggable&&e.fn.resizable&&(t?(f.filter(":ui-resizable").resizable("destroy").filter(":ui-draggable").draggable("destroy"),J.hide()):(J.show().width(K.width()).height(K.height()),G.width(K.width()).height(K.height()),X.width(K.width()).height(K.height()),f.width(G.width()).height(G.height()).offset(G.offset()).resizable({containment:J,resize:tt.resize_update,handles:"all"}).draggable({handle:X,containment:G,drag:tt.drag_update}),tt.update()))},rt=function(t){e.fn.draggable&&e.fn.resizable&&(t?Y.hide():Y.show().width(V).height(W).css("margin-top",($-W)/2+"px").css("margin-left",(L-V)/2+"px"))},ot=function(){var n,i,s,l,d,c,u=e("input:checked",I).val();if("resize"==u)n=parseInt(P.val())||0,i=parseInt(S.val())||0;else if("crop"==u)n=parseInt(D.val())||0,i=parseInt(O.val())||0,s=parseInt(z.val())||0,l=parseInt(A.val())||0;else if("rotate"==u){if(n=_,i=N,d=parseInt(E.val())||0,0>d||d>360)return a.error("Invalid rotate degree");if(0==d||360==d)return a.error("Image dose not rotated")}if(c=U?parseInt(U.val()):0,"rotate"!=u){if(0>=n||0>=i)return a.error("Invalid image size");if(n==_&&i==N)return a.error("Image size not changed")}r.elfinderdialog("close"),a.request({data:{cmd:"resize",target:t.hash,width:n,height:i,x:s,y:l,degree:d,quality:c,mode:u},notify:{type:"resize",cnt:1}}).fail(function(e){o.reject(e)}).done(function(){o.resolve()})},st={},lt="elfinder-resize-handle-hline",dt="elfinder-resize-handle-vline",ct="elfinder-resize-handle-point",ut=a.url(t.hash);Y.mousedown(nt.start),e(document).mouseup(nt.stop),m.append(e(l).append(e(d).text(a.i18n("width")),P,T),e(l).append(e(d).text(a.i18n("height")),S),e(l).append(e("<label/>").text(a.i18n("aspectRatio")).prepend(M)),U?e(l).append(e(d).text(a.i18n("quality")),U,e("<span/>").text(" (1-100)")):e(),e(l).append(e(d).text(a.i18n("scale")),C)),g.append(e(l).append(e(d).text("X"),z),e(l).append(e(d).text("Y")).append(A),e(l).append(e(d).text(a.i18n("width")),D),e(l).append(e(d).text(a.i18n("height")),O),U?e(l).append(e(d).text(a.i18n("quality")),U.clone(!0),e("<span/>").text(" (1-100)")):e()),w.append(e(l).append(e(d).text(a.i18n("rotate")),E,e("<span/>").text(a.i18n("degree")),e(v).append(x,e(y),k)),e(l).css("height","20px").append(j),U?e(l).append(e(d).text(a.i18n("quality")),U.clone(!0),e("<span/>").text(" (1-100)")):e()),r.append(I).on("resize",function(e){e.stopPropagation()}),c.append(e(l),m,g.hide(),w.hide()).find("input,select").attr("disabled","disabled"),h.append('<div class="'+lt+" "+lt+'-top"/>','<div class="'+lt+" "+lt+'-bottom"/>','<div class="'+dt+" "+dt+'-left"/>','<div class="'+dt+" "+dt+'-right"/>','<div class="'+ct+" "+ct+'-e"/>','<div class="'+ct+" "+ct+'-se"/>','<div class="'+ct+" "+ct+'-s"/>'),u.append(p).append(h.hide()).append(K.hide()),f.css("position","absolute").append('<div class="'+lt+" "+lt+'-top"/>','<div class="'+lt+" "+lt+'-bottom"/>','<div class="'+dt+" "+dt+'-left"/>','<div class="'+dt+" "+dt+'-right"/>','<div class="'+ct+" "+ct+'-n"/>','<div class="'+ct+" "+ct+'-e"/>','<div class="'+ct+" "+ct+'-s"/>','<div class="'+ct+" "+ct+'-w"/>','<div class="'+ct+" "+ct+'-ne"/>','<div class="'+ct+" "+ct+'-se"/>','<div class="'+ct+" "+ct+'-sw"/>','<div class="'+ct+" "+ct+'-nw"/>'),u.append(J.css("position","absolute").hide().append(G,f.append(X))),u.append(Y.hide()),u.css("overflow","hidden"),r.append(u,c),st[a.i18n("btnApply")]=ot,st[a.i18n("btnCancel")]=function(){r.elfinderdialog("close")},a.dialog(r,{title:a.escape(t.name),width:650,resizable:!1,destroyOnClose:!0,buttons:st,open:function(){var t=r.width()-20;u.width()>t&&u.width(t),u.zIndex(1+e(this).parent().zIndex()),L=u.width()-(h.outerWidth()-h.width()),$=u.height()-(h.outerHeight()-h.height()),K.attr("src",ut+(-1===ut.indexOf("?")?"?":"&")+"_="+Math.random()),G.attr("src",K.attr("src")),Y.attr("src",K.attr("src"))}}).attr("id",n),a.UA.ltIE8&&e(".elfinder-dialog").css("filter",""),T.css("left",P.position().left+P.width()+12),X.css({opacity:.2,"background-color":"#fff",position:"absolute"}),f.css("cursor","move"),f.find(".elfinder-resize-handle-point").css({"background-color":"#fff",opacity:.5,"border-color":"#000"}),Y.css("cursor","pointer"),I.buttonset()};return r.length&&-1!==r[0].mime.indexOf("image/")?(n="resize-"+a.namespace+"-"+r[0].hash,i=a.getUI().find("#"+n),i.length?(i.elfinderdialog("toTop"),o.resolve()):(s(r[0],n),o)):o.reject()}},function(e){var t=function(e,t){var n=0;for(n in t)if("undefined"!=typeof e[t[n]])return t[n];return e[t[n]]="",t[n]};if(e.cssHooks.rotate={get:function(t){return e(t).rotate()},set:function(t,n){return e(t).rotate(n),n}},e.cssHooks.transform={get:function(e){var n=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[n]},set:function(e,n){var i=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[i]=n,n}},e.fn.rotate=function(e){if("undefined"==typeof e){if(window.opera){var t=this.css("transform").match(/rotate\((.*?)\)/);return t&&t[1]?Math.round(180*parseFloat(t[1])/Math.PI):0}var t=this.css("transform").match(/rotate\((.*?)\)/);return t&&t[1]?parseInt(t[1]):0}return this.css("transform",this.css("transform").replace(/none|rotate\(.*?\)/,"")+"rotate("+parseInt(e)+"deg)"),this},e.fx.step.rotate=function(t){0==t.state&&(t.start=e(t.elem).rotate(),t.now=t.start),e(t.elem).rotate(t.now)},"undefined"==typeof window.addEventListener&&"undefined"==typeof document.getElementsByClassName){var n=function(e){for(var t=e,n=t.offsetLeft,i=t.offsetTop;t.offsetParent&&(t=t.offsetParent,t==document.body||"static"==t.currentStyle.position);)t!=document.body&&t!=document.documentElement&&(n-=t.scrollLeft,i-=t.scrollTop),n+=t.offsetLeft,i+=t.offsetTop;return{x:n,y:i}},i=function(e){if("static"==e.currentStyle.position){var t=n(e);e.style.position="absolute",e.style.left=t.x+"px",e.style.top=t.y+"px"}},a=function(e,t){var n,a=1,r=1,o=1,s=1;if("undefined"!=typeof e.style.msTransform)return!0;i(e),n=t.match(/rotate\((.*?)\)/);var l=n&&n[1]?parseInt(n[1]):0;l%=360,0>l&&(l=360+l);var d=l*Math.PI/180,c=Math.cos(d),u=Math.sin(d);a*=c,r*=-u,o*=u,s*=c,e.style.filter=(e.style.filter||"").replace(/progid:DXImageTransform\.Microsoft\.Matrix\([^)]*\)/,"")+("progid:DXImageTransform.Microsoft.Matrix(M11="+a+",M12="+r+",M21="+o+",M22="+s+",FilterType='bilinear',sizingMethod='auto expand')");var p=parseInt(e.style.width||e.width||0),h=parseInt(e.style.height||e.height||0),d=l*Math.PI/180,f=Math.abs(Math.cos(d)),m=Math.abs(Math.sin(d)),g=(p-(p*f+h*m))/2,v=(h-(p*m+h*f))/2;return e.style.marginLeft=Math.floor(g)+"px",e.style.marginTop=Math.floor(v)+"px",!0},r=e.cssHooks.transform.set;e.cssHooks.transform.set=function(e,t){return r.apply(this,[e,t]),a(e,t),t}}}(jQuery),elFinder.prototype.commands.rm=function(){this.shortcuts=[{pattern:"delete ctrl+backspace"}],this.getstate=function(t){var n=this.fm;return t=t||n.selected(),!this._disabled&&t.length&&e.map(t,function(e){var t=n.file(e);return t&&t.phash&&!t.locked?e:null}).length==t.length?0:-1},this.exec=function(t){var n,i,a,r,o,s,l,d,c=this,u=this.fm,p=e.Deferred().fail(function(e){e&&u.error(e)}),h=this.files(t),f=h.length,m=(u.cwd().hash,'<div class="ui-helper-clearfix elfinder-rm-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}<div class="elfinder-rm-desc">{desc}</div></div>');return!f||this._disabled?p.reject():(e.each(h,function(e,t){return t.phash?t.locked?!p.reject(["errLocked",t.name]):void 0:!p.reject(["errRm",t.name,"errPerm"])}),"pending"==p.state()&&(n=this.hashes(t),f=h.length,l=[],f>1?(e.map(h,function(e){return"directory"==e.mime?1:null}).length||(o=0,e.each(h,function(e,t){if(!t.size||"unknown"==t.size)return o="unknown",!1;var n=parseInt(t.size);n>=0&&o>=0&&(o+=n)}),l.push(u.i18n("size")+": "+u.formatSize(o))),i=[e(m.replace("{class}","elfinder-cwd-icon-group").replace("{title}","<strong>"+u.i18n("items")+": "+f+"</strong>").replace("{desc}",l.join("<br>")))]):(a=h[0],a.tmb&&(s=u.option("tmbUrl")+a.tmb),a.size&&l.push(u.i18n("size")+": "+u.formatSize(a.size)),l.push(u.i18n("modify")+": "+u.formatDate(a)),r=u.escape(a.i18||a.name).replace(/([_.])/g,"&#8203;$1"),i=[e(m.replace("{class}",u.mime2class(a.mime)).replace("{title}","<strong>"+r+"</strong>").replace("{desc}",l.join("<br>")))]),i.push("confirmRm"),u.lockfiles({files:n}),d=u.confirm({title:c.title,text:i,accept:{label:"btnRm",callback:function(){u.request({data:{cmd:"rm",targets:n},notify:{type:"rm",cnt:f},preventFail:!0}).fail(function(e){p.reject(e)}).done(function(e){p.done(e)}).always(function(){u.unlockfiles({files:n})})}},cancel:{label:"btnCancel",callback:function(){u.unlockfiles({files:n}),u.selectfiles({files:n}),p.reject()}}}),s&&e("<img/>").load(function(){d.find(".elfinder-cwd-icon").css("background",'url("'+s+'") center center no-repeat')}).attr("src",s)),p)}},elFinder.prototype.commands.search=function(){this.title="Find files",this.options={ui:"searchbutton"},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.getstate=function(){return 0},this.exec=function(t,n,i){var a=this.fm;return"string"==typeof t&&t?("object"==typeof n&&(i=n.mime||"",n=n.target||""),n=n?n:"",i=i?e.trim(i).replace(","," ").split(" "):[],e.each(i,function(){return e.trim(this)}),a.trigger("searchstart",{query:t,target:n,mimes:i}),a.request({data:{cmd:"search",q:t,target:n,mimes:i},notify:{type:"search",cnt:1,hideCnt:!0}})):(a.getUI("toolbar").find("."+a.res("class","searchbtn")+" :text").focus(),e.Deferred().reject())}},elFinder.prototype.commands.sort=function(){var t,n=this,i=n.fm;this.options={ui:"sortbutton"},i.bind("open sortchange",function(){n.variants=[],e.each(i.sortRules,function(e){var t={type:e,order:e==i.sortType?"asc"==i.sortOrder?"desc":"asc":i.sortOrder},a=e==i.sortType?"asc"==t.order?"n":"s":"";n.variants.push([t,(a?'<span class="ui-icon ui-icon-arrowthick-1-'+a+'"></span>':"")+"&nbsp;"+i.i18n("sort"+e)])})}),i.bind("open sortchange viewchange search searchend",function(){t&&clearTimeout(t),t=setTimeout(function(){var t=e(i.cwd).find("div.elfinder-cwd-wrapper-list table");t.length&&e.each(i.sortRules,function(a){var r=t.find("thead tr td.elfinder-cwd-view-th-"+a);if(r.length){var o,s=a==i.sortType,l={type:a,order:s?"asc"==i.sortOrder?"desc":"asc":i.sortOrder};s&&(r.addClass("ui-state-active"),o="asc"==i.sortOrder?"n":"s",e('<span class="ui-icon ui-icon-triangle-1-'+o+'"/>').appendTo(r)),e(r).on("click",function(e){e.stopPropagation(),n.exec([],l)}).hover(function(){e(this).addClass("ui-state-hover")},function(){e(this).removeClass("ui-state-hover")})}})},100)}),this.getstate=function(){return 0},this.exec=function(t,n){var i=this.fm,a=e.extend({type:i.sortType,order:i.sortOrder,stick:i.sortStickFolders},n);return this.fm.setSort(a.type,a.order,a.stick),e.Deferred().resolve()}},elFinder.prototype.commands.up=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+up"}],this.getstate=function(){return this.fm.cwd().phash?0:-1},this.exec=function(){return this.fm.cwd().phash?this.fm.exec("open",this.fm.cwd().phash):e.Deferred().reject()}},elFinder.prototype.commands.upload=function(){var t=this.fm.res("class","hover");this.disableOnSearch=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+u"}],this.getstate=function(e){var t,n=this.fm,e=n.directUploadTarget?[n.directUploadTarget]:e||[n.cwd().hash];return this._disabled||1!=e.length||(t=n.file(e[0])),t&&"directory"==t.mime&&t.write?0:-1},this.exec=function(n){var i,a,r,o,s,l,d,c=this.fm,u=n&&n instanceof Array?n:null,p=!u&&n&&n.target?[n.target]:u,h=function(e){c.upload(e).fail(function(e){m.reject(e)}).done(function(e){var t=c.getUI("cwd");if(m.resolve(e),e&&e.added&&e.added[0]){var n=t.find("#"+c.cwdHash2Id(e.added[0].hash));n.length&&n.trigger("scrolltoview")}})},f=function(e){i.elfinderdialog("close"),u&&(e.target=u[0]),h(e)},m=e.Deferred();return this.getstate(p)<0?m.reject():(l=function(e){e.stopPropagation(),e.preventDefault();var t=!1,n="",i=null,a="",r=null,o=e._target||null;try{i=e.dataTransfer.getData("elfinderfrom")}catch(e){}if(i&&(a=window.location.href+c.cwd().hash,!o&&i===a||o===a))return m.reject(),void 0;try{r=e.dataTransfer.getData("text/html")}catch(e){}r?(t=[r],n="html"):e.dataTransfer&&e.dataTransfer.items&&e.dataTransfer.items.length?(t=e.dataTransfer,n="data"):e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length?(t=e.dataTransfer.files,n="files"):(r=e.dataTransfer.getData("text"))&&(t=[r],n="text"),t?h({files:t,type:n,target:o}):m.reject()},!u&&n?(n.input||n.files?(n.type="files",h(n)):n.dropEvt&&l(n.dropEvt),m):(d=function(t){var n,t=t.originalEvent||t,i=[],a=[];if(t.clipboardData){if(t.clipboardData.items&&t.clipboardData.items.length){a=t.clipboardData.items;for(var r=0;r<a.length;r++)"file"==t.clipboardData.items[r].kind&&(n=t.clipboardData.items[r].getAsFile(),i.push(n))}else t.clipboardData.files&&t.clipboardData.files.length&&(i=t.clipboardData.files);if(i.length)return f({files:i,type:"files"}),void 0}var o=t.target||t.srcElement;setTimeout(function(){if(o.innerHTML){e(o).find("img").each(function(t,n){n.src.match(/^webkit-fake-url:\/\//)&&e(n).remove()});var t=o.innerHTML.replace(/<br[^>]*>/gi," "),n=t.match(/<[^>]+>/)?"html":"text";o.innerHTML="",f({files:[t],type:n})}},1)},a=e('<input type="file" multiple="true"/>').change(function(){f({input:a[0],type:"files"})}).on("dragover",function(e){e.originalEvent.dataTransfer.dropEffect="copy"}),r=e('<div class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text">'+c.i18n("selectForUpload")+"</span></div>").append(e("<form/>").append(a)).hover(function(){r.toggleClass(t)}),i=e('<div class="elfinder-upload-dialog-wrapper"/>').append(r),s=e('<div class="ui-corner-all elfinder-upload-dropbox" contenteditable="true">'+c.i18n("dropFilesBrowser")+"</div>").on("paste drop",function(e){d(e)}).on("mousedown click",function(){e(this).focus()}).on("focus",function(){this.innerHTML=""}).on("dragenter mouseover",function(){s.addClass(t)}).on("dragleave mouseout",function(){s.removeClass(t)}),c.dragUpload?(o=e('<div class="ui-corner-all elfinder-upload-dropbox" contenteditable="true">'+c.i18n("dropPasteFiles")+"</div>").on("paste",function(e){d(e)}).on("mousedown click",function(){e(this).focus()}).on("focus",function(){this.innerHTML=""}).on("mouseover",function(){e(this).addClass(t)}).on("mouseout",function(){e(this).removeClass(t)}).prependTo(i).after('<div class="elfinder-upload-dialog-or">'+c.i18n("or")+"</div>")[0],o.addEventListener("dragenter",function(n){n.stopPropagation(),n.preventDefault(),e(o).addClass(t)},!1),o.addEventListener("dragleave",function(n){n.stopPropagation(),n.preventDefault(),e(o).removeClass(t)},!1),o.addEventListener("dragover",function(n){n.stopPropagation(),n.preventDefault(),n.dataTransfer.dropEffect="copy",e(o).addClass(t)},!1),o.addEventListener("drop",function(e){i.elfinderdialog("close"),u&&(e._target=u[0]),l(e)},!1)):s.prependTo(i).after('<div class="elfinder-upload-dialog-or">'+c.i18n("or")+"</div>")[0],c.dialog(i,{title:this.title+(u?" - "+c.escape(c.file(u[0]).name):""),modal:!0,resizable:!1,destroyOnClose:!0}),m))}},elFinder.prototype.commands.view=function(){this.value=this.fm.viewType,this.alwaysEnabled=!0,this.updateOnSelect=!1,this.options={ui:"viewbutton"},this.getstate=function(){return 0},this.exec=function(){var e=this.fm.storage("view","list"==this.value?"icons":"list");this.fm.viewchange(),this.update(void 0,e)}}}(jQuery);
elFinder/js/i18n/elfinder.LANG.js ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * elFinder translation template
3
+ * use this file to create new translation
4
+ * submit new translation via https://github.com/Studio-42/elFinder/issues
5
+ * or make a pull request
6
+ */
7
+
8
+ /**
9
+ * XXXXX translation
10
+ * @author Translator Name <translator@email.tld>
11
+ * @version 201x-xx-xx
12
+ */
13
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
14
+ elFinder.prototype.i18.REPLACE_WITH_xx_OR_xx_YY_LANG_CODE = {
15
+ translator : 'Translator name &lt;translator@email.tld&gt;',
16
+ language : 'Language of translation in your language',
17
+ direction : 'ltr',
18
+ dateFormat : 'd.m.Y H:i', // Mar 13, 2012 05:27 PM
19
+ fancyDateFormat : '$1 H:i', // will produce smth like: Today 12:25 PM
20
+ messages : {
21
+
22
+ /********************************** errors **********************************/
23
+ 'error' : 'Error',
24
+ 'errUnknown' : 'Unknown error.',
25
+ 'errUnknownCmd' : 'Unknown command.',
26
+ 'errJqui' : 'Invalid jQuery UI configuration. Selectable, draggable and droppable components must be included.',
27
+ 'errNode' : 'elFinder requires DOM Element to be created.',
28
+ 'errURL' : 'Invalid elFinder configuration! URL option is not set.',
29
+ 'errAccess' : 'Access denied.',
30
+ 'errConnect' : 'Unable to connect to backend.',
31
+ 'errAbort' : 'Connection aborted.',
32
+ 'errTimeout' : 'Connection timeout.',
33
+ 'errNotFound' : 'Backend not found.',
34
+ 'errResponse' : 'Invalid backend response.',
35
+ 'errConf' : 'Invalid backend configuration.',
36
+ 'errJSON' : 'PHP JSON module not installed.',
37
+ 'errNoVolumes' : 'Readable volumes not available.',
38
+ 'errCmdParams' : 'Invalid parameters for command "$1".',
39
+ 'errDataNotJSON' : 'Data is not JSON.',
40
+ 'errDataEmpty' : 'Data is empty.',
41
+ 'errCmdReq' : 'Backend request requires command name.',
42
+ 'errOpen' : 'Unable to open "$1".',
43
+ 'errNotFolder' : 'Object is not a folder.',
44
+ 'errNotFile' : 'Object is not a file.',
45
+ 'errRead' : 'Unable to read "$1".',
46
+ 'errWrite' : 'Unable to write into "$1".',
47
+ 'errPerm' : 'Permission denied.',
48
+ 'errLocked' : '"$1" is locked and can not be renamed, moved or removed.',
49
+ 'errExists' : 'File named "$1" already exists.',
50
+ 'errInvName' : 'Invalid file name.',
51
+ 'errFolderNotFound' : 'Folder not found.',
52
+ 'errFileNotFound' : 'File not found.',
53
+ 'errTrgFolderNotFound' : 'Target folder "$1" not found.',
54
+ 'errPopup' : 'Browser prevented opening popup window. To open file enable it in browser options.',
55
+ 'errMkdir' : 'Unable to create folder "$1".',
56
+ 'errMkfile' : 'Unable to create file "$1".',
57
+ 'errRename' : 'Unable to rename "$1".',
58
+ 'errCopyFrom' : 'Copying files from volume "$1" not allowed.',
59
+ 'errCopyTo' : 'Copying files to volume "$1" not allowed.',
60
+ 'errMkOutLink' : 'Unable to create a link to outside the volume root.', // from v2.1 added 03.10.2015
61
+ 'errUpload' : 'Upload error.', // old name - errUploadCommon
62
+ 'errUploadFile' : 'Unable to upload "$1".', // old name - errUpload
63
+ 'errUploadNoFiles' : 'No files found for upload.',
64
+ 'errUploadTotalSize' : 'Data exceeds the maximum allowed size.', // old name - errMaxSize
65
+ 'errUploadFileSize' : 'File exceeds maximum allowed size.', // old name - errFileMaxSize
66
+ 'errUploadMime' : 'File type not allowed.',
67
+ 'errUploadTransfer' : '"$1" transfer error.',
68
+ 'errUploadTemp' : 'Unable to make temporary file for upload.', // from v2.1 added 26.09.2015
69
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.', // new
70
+ 'errReplace' : 'Unable to replace "$1".',
71
+ 'errSave' : 'Unable to save "$1".',
72
+ 'errCopy' : 'Unable to copy "$1".',
73
+ 'errMove' : 'Unable to move "$1".',
74
+ 'errCopyInItself' : 'Unable to copy "$1" into itself.',
75
+ 'errRm' : 'Unable to remove "$1".',
76
+ 'errRmSrc' : 'Unable remove source file(s).',
77
+ 'errExtract' : 'Unable to extract files from "$1".',
78
+ 'errArchive' : 'Unable to create archive.',
79
+ 'errArcType' : 'Unsupported archive type.',
80
+ 'errNoArchive' : 'File is not archive or has unsupported archive type.',
81
+ 'errCmdNoSupport' : 'Backend does not support this command.',
82
+ 'errReplByChild' : 'The folder "$1" can\'t be replaced by an item it contains.',
83
+ 'errArcSymlinks' : 'For security reason denied to unpack archives contains symlinks or files with not allowed names.', // edited 24.06.2012
84
+ 'errArcMaxSize' : 'Archive files exceeds maximum allowed size.',
85
+ 'errResize' : 'Unable to resize "$1".',
86
+ 'errResizeDegree' : 'Invalid rotate degree.', // added 7.3.2013
87
+ 'errResizeRotate' : 'Unable to rotate image.', // added 7.3.2013
88
+ 'errResizeSize' : 'Invalid image size.', // added 7.3.2013
89
+ 'errResizeNoChange' : 'Image size not changed.', // added 7.3.2013
90
+ 'errUsupportType' : 'Unsupported file type.',
91
+ 'errNotUTF8Content' : 'File "$1" is not in UTF-8 and cannot be edited.', // added 9.11.2011
92
+ 'errNetMount' : 'Unable to mount "$1".', // added 17.04.2012
93
+ 'errNetMountNoDriver' : 'Unsupported protocol.', // added 17.04.2012
94
+ 'errNetMountFailed' : 'Mount failed.', // added 17.04.2012
95
+ 'errNetMountHostReq' : 'Host required.', // added 18.04.2012
96
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
97
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
98
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
99
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
100
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
101
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
102
+ 'errExtractExec' : 'Error while extracting files: "$1"',
103
+ 'errNetUnMount' : 'Unable to unmount', // from v2.1 added 30.04.2012
104
+ 'errConvUTF8' : 'Not convertible to UTF-8', // from v2.1 added 08.04.2014
105
+ 'errFolderUpload' : 'Try Google Chrome, If you\'d like to upload the folder.', // from v2.1 added 26.6.2015
106
+ 'errSearchTimeout' : 'Timed out while searching "$1". Search result is partial.', // from v2.1 added 12.1.2016
107
+
108
+ /******************************* commands names ********************************/
109
+ 'cmdarchive' : 'Create archive',
110
+ 'cmdback' : 'Back',
111
+ 'cmdcopy' : 'Copy',
112
+ 'cmdcut' : 'Cut',
113
+ 'cmddownload' : 'Download',
114
+ 'cmdduplicate' : 'Duplicate',
115
+ 'cmdedit' : 'Edit file',
116
+ 'cmdextract' : 'Extract files from archive',
117
+ 'cmdforward' : 'Forward',
118
+ 'cmdgetfile' : 'Select files',
119
+ 'cmdhelp' : 'About this software',
120
+ 'cmdhome' : 'Home',
121
+ 'cmdinfo' : 'Get info',
122
+ 'cmdmkdir' : 'New folder',
123
+ 'cmdmkfile' : 'New text file',
124
+ 'cmdopen' : 'Open',
125
+ 'cmdpaste' : 'Paste',
126
+ 'cmdquicklook' : 'Preview',
127
+ 'cmdreload' : 'Reload',
128
+ 'cmdrename' : 'Rename',
129
+ 'cmdrm' : 'Delete',
130
+ 'cmdsearch' : 'Find files',
131
+ 'cmdup' : 'Go to parent directory',
132
+ 'cmdupload' : 'Upload files',
133
+ 'cmdview' : 'View',
134
+ 'cmdresize' : 'Resize & Rotate',
135
+ 'cmdsort' : 'Sort',
136
+ 'cmdnetmount' : 'Mount network volume', // added 18.04.2012
137
+ 'cmdnetunmount': 'Unmount', // from v2.1 added 30.04.2012
138
+ 'cmdplaces' : 'To Places', // added 28.12.2014
139
+ 'cmdchmod' : 'Change mode', // from v2.1 added 20.6.2015
140
+ 'cmdopendir' : 'Open a folder', // from v2.1 added 13.1.2016
141
+
142
+ /*********************************** buttons ***********************************/
143
+ 'btnClose' : 'Close',
144
+ 'btnSave' : 'Save',
145
+ 'btnRm' : 'Remove',
146
+ 'btnApply' : 'Apply',
147
+ 'btnCancel' : 'Cancel',
148
+ 'btnNo' : 'No',
149
+ 'btnYes' : 'Yes',
150
+ 'btnMount' : 'Mount', // added 18.04.2012
151
+ 'btnApprove': 'Goto $1 & approve', // from v2.1 added 26.04.2012
152
+ 'btnUnmount': 'Unmount', // from v2.1 added 30.04.2012
153
+ 'btnConv' : 'Convert', // from v2.1 added 08.04.2014
154
+ 'btnCwd' : 'Here', // from v2.1 added 22.5.2015
155
+ 'btnVolume' : 'Volume', // from v2.1 added 22.5.2015
156
+ 'btnAll' : 'All', // from v2.1 added 22.5.2015
157
+ 'btnMime' : 'MIME Type', // from v2.1 added 22.5.2015
158
+ 'btnFileName':'Filename', // from v2.1 added 22.5.2015
159
+ 'btnSaveClose': 'Save & Close', // from v2.1 added 12.6.2015
160
+ 'btnBackup' : 'Backup', // fromv2.1 added 28.11.2015
161
+
162
+ /******************************** notifications ********************************/
163
+ 'ntfopen' : 'Open folder',
164
+ 'ntffile' : 'Open file',
165
+ 'ntfreload' : 'Reload folder content',
166
+ 'ntfmkdir' : 'Creating directory',
167
+ 'ntfmkfile' : 'Creating files',
168
+ 'ntfrm' : 'Delete files',
169
+ 'ntfcopy' : 'Copy files',
170
+ 'ntfmove' : 'Move files',
171
+ 'ntfprepare' : 'Prepare to copy files',
172
+ 'ntfrename' : 'Rename files',
173
+ 'ntfupload' : 'Uploading files',
174
+ 'ntfdownload' : 'Downloading files',
175
+ 'ntfsave' : 'Save files',
176
+ 'ntfarchive' : 'Creating archive',
177
+ 'ntfextract' : 'Extracting files from archive',
178
+ 'ntfsearch' : 'Searching files',
179
+ 'ntfresize' : 'Resizing images',
180
+ 'ntfsmth' : 'Doing something',
181
+ 'ntfloadimg' : 'Loading image',
182
+ 'ntfnetmount' : 'Mounting network volume', // added 18.04.2012
183
+ 'ntfnetunmount': 'Unmounting network volume', // from v2.1 added 30.04.2012
184
+ 'ntfdim' : 'Acquiring image dimension', // added 20.05.2013
185
+ 'ntfreaddir' : 'Reading folder infomation', // from v2.1 added 01.07.2013
186
+ 'ntfurl' : 'Getting URL of link', // from v2.1 added 11.03.2014
187
+ 'ntfchmod' : 'Changing file mode', // from v2.1 added 20.6.2015
188
+ 'ntfpreupload': 'Verifying upload file name', // from v2.1 added 31.11.2015
189
+
190
+ /************************************ dates **********************************/
191
+ 'dateUnknown' : 'unknown',
192
+ 'Today' : 'Today',
193
+ 'Yesterday' : 'Yesterday',
194
+ 'msJan' : 'Jan',
195
+ 'msFeb' : 'Feb',
196
+ 'msMar' : 'Mar',
197
+ 'msApr' : 'Apr',
198
+ 'msMay' : 'May',
199
+ 'msJun' : 'Jun',
200
+ 'msJul' : 'Jul',
201
+ 'msAug' : 'Aug',
202
+ 'msSep' : 'Sep',
203
+ 'msOct' : 'Oct',
204
+ 'msNov' : 'Nov',
205
+ 'msDec' : 'Dec',
206
+ 'January' : 'January',
207
+ 'February' : 'February',
208
+ 'March' : 'March',
209
+ 'April' : 'April',
210
+ 'May' : 'May',
211
+ 'June' : 'June',
212
+ 'July' : 'July',
213
+ 'August' : 'August',
214
+ 'September' : 'September',
215
+ 'October' : 'October',
216
+ 'November' : 'November',
217
+ 'December' : 'December',
218
+ 'Sunday' : 'Sunday',
219
+ 'Monday' : 'Monday',
220
+ 'Tuesday' : 'Tuesday',
221
+ 'Wednesday' : 'Wednesday',
222
+ 'Thursday' : 'Thursday',
223
+ 'Friday' : 'Friday',
224
+ 'Saturday' : 'Saturday',
225
+ 'Sun' : 'Sun',
226
+ 'Mon' : 'Mon',
227
+ 'Tue' : 'Tue',
228
+ 'Wed' : 'Wed',
229
+ 'Thu' : 'Thu',
230
+ 'Fri' : 'Fri',
231
+ 'Sat' : 'Sat',
232
+
233
+ /******************************** sort variants ********************************/
234
+ 'sortname' : 'by name',
235
+ 'sortkind' : 'by kind',
236
+ 'sortsize' : 'by size',
237
+ 'sortdate' : 'by date',
238
+ 'sortFoldersFirst' : 'Folders first',
239
+
240
+ /********************************** new items **********************************/
241
+ 'untitled file.txt' : 'NewFile.txt', // added 10.11.2015
242
+ 'untitled folder' : 'NewFolder', // added 10.11.2015
243
+ 'Archive' : 'NewArchive', // from v2.1 added 10.11.2015
244
+
245
+ /********************************** messages **********************************/
246
+ 'confirmReq' : 'Confirmation required',
247
+ 'confirmRm' : 'Are you sure you want to remove files?<br/>This cannot be undone!',
248
+ 'confirmRepl' : 'Replace old file with new one?',
249
+ 'confirmConvUTF8' : 'Not in UTF-8<br/>Convert to UTF-8?<br/>Contents become UTF-8 by saving after conversion.', // from v2.1 added 08.04.2014
250
+ 'confirmNotSave' : 'It has been modified.<br/>Losing work if you do not save changes.', // from v2.1 added 15.7.2015
251
+ 'apllyAll' : 'Apply to all',
252
+ 'name' : 'Name',
253
+ 'size' : 'Size',
254
+ 'perms' : 'Permissions',
255
+ 'modify' : 'Modified',
256
+ 'kind' : 'Kind',
257
+ 'read' : 'read',
258
+ 'write' : 'write',
259
+ 'noaccess' : 'no access',
260
+ 'and' : 'and',
261
+ 'unknown' : 'unknown',
262
+ 'selectall' : 'Select all files',
263
+ 'selectfiles' : 'Select file(s)',
264
+ 'selectffile' : 'Select first file',
265
+ 'selectlfile' : 'Select last file',
266
+ 'viewlist' : 'List view',
267
+ 'viewicons' : 'Icons view',
268
+ 'places' : 'Places',
269
+ 'calc' : 'Calculate',
270
+ 'path' : 'Path',
271
+ 'aliasfor' : 'Alias for',
272
+ 'locked' : 'Locked',
273
+ 'dim' : 'Dimensions',
274
+ 'files' : 'Files',
275
+ 'folders' : 'Folders',
276
+ 'items' : 'Items',
277
+ 'yes' : 'yes',
278
+ 'no' : 'no',
279
+ 'link' : 'Link',
280
+ 'searcresult' : 'Search results',
281
+ 'selected' : 'selected items',
282
+ 'about' : 'About',
283
+ 'shortcuts' : 'Shortcuts',
284
+ 'help' : 'Help',
285
+ 'webfm' : 'Web file manager',
286
+ 'ver' : 'Version',
287
+ 'protocolver' : 'protocol version',
288
+ 'homepage' : 'Project home',
289
+ 'docs' : 'Documentation',
290
+ 'github' : 'Fork us on Github',
291
+ 'twitter' : 'Follow us on twitter',
292
+ 'facebook' : 'Join us on facebook',
293
+ 'team' : 'Team',
294
+ 'chiefdev' : 'chief developer',
295
+ 'developer' : 'developer',
296
+ 'contributor' : 'contributor',
297
+ 'maintainer' : 'maintainer',
298
+ 'translator' : 'translator',
299
+ 'icons' : 'Icons',
300
+ 'dontforget' : 'and don\'t forget to take your towel',
301
+ 'shortcutsof' : 'Shortcuts disabled',
302
+ 'dropFiles' : 'Drop files here',
303
+ 'or' : 'or',
304
+ 'selectForUpload' : 'Select files to upload',
305
+ 'moveFiles' : 'Move files',
306
+ 'copyFiles' : 'Copy files',
307
+ 'rmFromPlaces' : 'Remove from places',
308
+ 'aspectRatio' : 'Aspect ratio',
309
+ 'scale' : 'Scale',
310
+ 'width' : 'Width',
311
+ 'height' : 'Height',
312
+ 'resize' : 'Resize',
313
+ 'crop' : 'Crop',
314
+ 'rotate' : 'Rotate',
315
+ 'rotate-cw' : 'Rotate 90 degrees CW',
316
+ 'rotate-ccw' : 'Rotate 90 degrees CCW',
317
+ 'degree' : '°',
318
+ 'netMountDialogTitle' : 'Mount network volume', // added 18.04.2012
319
+ 'protocol' : 'Protocol', // added 18.04.2012
320
+ 'host' : 'Host', // added 18.04.2012
321
+ 'port' : 'Port', // added 18.04.2012
322
+ 'user' : 'User', // added 18.04.2012
323
+ 'pass' : 'Password', // added 18.04.2012
324
+ 'confirmUnmount' : 'Are you unmount $1?', // from v2.1 added 30.04.2012
325
+ 'dropFilesBrowser': 'Drop or Paste files from browser', // from v2.1 added 30.05.2012
326
+ 'dropPasteFiles' : 'Drop or Paste files and URLs here', // from v2.1 added 07.04.2014
327
+ 'encoding' : 'Encoding', // from v2.1 added 19.12.2014
328
+ 'locale' : 'Locale', // from v2.1 added 19.12.2014
329
+ 'searchTarget' : 'Target: $1', // from v2.1 added 22.5.2015
330
+ 'searchMime' : 'Search by input MIME Type', // from v2.1 added 22.5.2015
331
+ 'owner' : 'Owner', // from v2.1 added 20.6.2015
332
+ 'group' : 'Group', // from v2.1 added 20.6.2015
333
+ 'other' : 'Other', // from v2.1 added 20.6.2015
334
+ 'execute' : 'Execute', // from v2.1 added 20.6.2015
335
+ 'perm' : 'Permission', // from v2.1 added 20.6.2015
336
+ 'mode' : 'Mode', // from v2.1 added 20.6.2015
337
+ 'emptyFolder' : 'Folder is empty', // from v2.1.6 added 30.12.2015
338
+ 'emptyFolderDrop' : 'Folder is empty\\A Drop to add items', // from v2.1.6 added 30.12.2015
339
+ 'emptyFolderLTap' : 'Folder is empty\\A Long tap to add items', // from v2.1.6 added 30.12.2015
340
+ 'quality' : 'Quality', // from v2.1.6 added 5.1.2016
341
+ 'autoSync' : 'Auto sync', // from v2.1.6 added 10.1.2016
342
+ 'moveUp' : 'Move up', // from v2.1.6 added 18.1.2016
343
+
344
+ /********************************** mimetypes **********************************/
345
+ 'kindUnknown' : 'Unknown',
346
+ 'kindFolder' : 'Folder',
347
+ 'kindAlias' : 'Alias',
348
+ 'kindAliasBroken' : 'Broken alias',
349
+ // applications
350
+ 'kindApp' : 'Application',
351
+ 'kindPostscript' : 'Postscript document',
352
+ 'kindMsOffice' : 'Microsoft Office document',
353
+ 'kindMsWord' : 'Microsoft Word document',
354
+ 'kindMsExcel' : 'Microsoft Excel document',
355
+ 'kindMsPP' : 'Microsoft Powerpoint presentation',
356
+ 'kindOO' : 'Open Office document',
357
+ 'kindAppFlash' : 'Flash application',
358
+ 'kindPDF' : 'Portable Document Format (PDF)',
359
+ 'kindTorrent' : 'Bittorrent file',
360
+ 'kind7z' : '7z archive',
361
+ 'kindTAR' : 'TAR archive',
362
+ 'kindGZIP' : 'GZIP archive',
363
+ 'kindBZIP' : 'BZIP archive',
364
+ 'kindXZ' : 'XZ archive',
365
+ 'kindZIP' : 'ZIP archive',
366
+ 'kindRAR' : 'RAR archive',
367
+ 'kindJAR' : 'Java JAR file',
368
+ 'kindTTF' : 'True Type font',
369
+ 'kindOTF' : 'Open Type font',
370
+ 'kindRPM' : 'RPM package',
371
+ // texts
372
+ 'kindText' : 'Text document',
373
+ 'kindTextPlain' : 'Plain text',
374
+ 'kindPHP' : 'PHP source',
375
+ 'kindCSS' : 'Cascading style sheet',
376
+ 'kindHTML' : 'HTML document',
377
+ 'kindJS' : 'Javascript source',
378
+ 'kindRTF' : 'Rich Text Format',
379
+ 'kindC' : 'C source',
380
+ 'kindCHeader' : 'C header source',
381
+ 'kindCPP' : 'C++ source',
382
+ 'kindCPPHeader' : 'C++ header source',
383
+ 'kindShell' : 'Unix shell script',
384
+ 'kindPython' : 'Python source',
385
+ 'kindJava' : 'Java source',
386
+ 'kindRuby' : 'Ruby source',
387
+ 'kindPerl' : 'Perl script',
388
+ 'kindSQL' : 'SQL source',
389
+ 'kindXML' : 'XML document',
390
+ 'kindAWK' : 'AWK source',
391
+ 'kindCSV' : 'Comma separated values',
392
+ 'kindDOCBOOK' : 'Docbook XML document',
393
+ 'kindMarkdown' : 'Markdown text', // added 20.7.2015
394
+ // images
395
+ 'kindImage' : 'Image',
396
+ 'kindBMP' : 'BMP image',
397
+ 'kindJPEG' : 'JPEG image',
398
+ 'kindGIF' : 'GIF Image',
399
+ 'kindPNG' : 'PNG Image',
400
+ 'kindTIFF' : 'TIFF image',
401
+ 'kindTGA' : 'TGA image',
402
+ 'kindPSD' : 'Adobe Photoshop image',
403
+ 'kindXBITMAP' : 'X bitmap image',
404
+ 'kindPXM' : 'Pixelmator image',
405
+ // media
406
+ 'kindAudio' : 'Audio media',
407
+ 'kindAudioMPEG' : 'MPEG audio',
408
+ 'kindAudioMPEG4' : 'MPEG-4 audio',
409
+ 'kindAudioMIDI' : 'MIDI audio',
410
+ 'kindAudioOGG' : 'Ogg Vorbis audio',
411
+ 'kindAudioWAV' : 'WAV audio',
412
+ 'AudioPlaylist' : 'MP3 playlist',
413
+ 'kindVideo' : 'Video media',
414
+ 'kindVideoDV' : 'DV movie',
415
+ 'kindVideoMPEG' : 'MPEG movie',
416
+ 'kindVideoMPEG4' : 'MPEG-4 movie',
417
+ 'kindVideoAVI' : 'AVI movie',
418
+ 'kindVideoMOV' : 'Quick Time movie',
419
+ 'kindVideoWM' : 'Windows Media movie',
420
+ 'kindVideoFlash' : 'Flash movie',
421
+ 'kindVideoMKV' : 'Matroska movie',
422
+ 'kindVideoOGG' : 'Ogg movie'
423
+ }
424
+ };
425
+ }
426
+
elFinder/js/i18n/elfinder.ar.js ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Arabic translation (Syrian Localization, it may differ if you aren't from Syria or any Country in Middle East)
3
+ * @author Tawfek Daghistani <tawfekov@gmail.com>
4
+ * @version 2014-12-19
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.ar = {
8
+ translator : 'Tawfek Daghistani &lt;tawfekov@gmail.com&gt;',
9
+ language : 'العربية',
10
+ direction : 'rtl',
11
+ dateFormat : 'M d, Y h:i A', // Mar 13, 2012 05:27 PM
12
+ fancyDateFormat : '$1 h:i A', // will produce smth like: Today 12:25 PM
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'خطأ',
17
+ 'errUnknown' : 'خطأ غير معروف .',
18
+ 'errUnknownCmd' : 'أمر غير معروف .',
19
+ 'errJqui' : 'إعدادات jQuery UI غير كاملة الرجاء التأكد من وجود كل من selectable, draggable and droppable',
20
+ 'errNode' : '. موجود DOM إلى عنصر elFinder تحتاج ',
21
+ 'errURL' : 'إعدادات خاطئة , عليك وضع الرابط ضمن الإعدادات',
22
+ 'errAccess' : 'وصول مرفوض .',
23
+ 'errConnect' : 'غير قادر على الاتصال بالخادم الخلفي (backend)',
24
+ 'errAbort' : 'تم فصل الإتصال',
25
+ 'errTimeout' : 'مهلة الإتصال قد إنتهت .',
26
+ 'errNotFound' : 'الخادم الخلفي غير موجود .',
27
+ 'errResponse' : 'رد غير مقبول من الخادم الخلفي',
28
+ 'errConf' : 'خطأ في الإعدادات الخاصة بالخادم الخلفي ',
29
+ 'errJSON' : 'الميزة PHP JSON module غير موجودة ',
30
+ 'errNoVolumes' : 'لا يمكن القراءة من أي من الوسائط الموجودة ',
31
+ 'errCmdParams' : 'البيانات المرسلة للأمر غير مقبولة "$1".',
32
+ 'errDataNotJSON' : 'المعلومات المرسلة ليست من نوع JSON ',
33
+ 'errDataEmpty' : 'لا يوجد معلومات مرسلة',
34
+ 'errCmdReq' : 'الخادم الخلفي يطلب وجود اسم الأمر ',
35
+ 'errOpen' : 'غير قادر على فتح "$1".',
36
+ 'errNotFolder' : 'العنصر المختار ليس مجلد',
37
+ 'errNotFile' : 'العنصر المختار ليس ملف',
38
+ 'errRead' : 'غير قادر على القراءة "$1".',
39
+ 'errWrite' : 'غير قادر على الكتابة "$1".',
40
+ 'errPerm' : 'وصول مرفوض ',
41
+ 'errLocked' : ' محمي و لا يمكن التعديل أو النقل أو إعادة التسمية"$1"',
42
+ 'errExists' : ' موجود مسبقاً "$1"',
43
+ 'errInvName' : 'الاسم مرفوض',
44
+ 'errFolderNotFound' : 'المجلد غير موجود',
45
+ 'errFileNotFound' : 'الملف غير موجود',
46
+ 'errTrgFolderNotFound' : 'الملف الهدف "$1" غير موجود ',
47
+ 'errPopup' : 'يمنعني المتصفح من إنشاء نافذة منبثقة , الرجاء تعديل الخيارات الخاصة من إعدادات المتصفح ',
48
+ 'errMkdir' : ' غير قادر على إنشاء مجلد جديد "$1".',
49
+ 'errMkfile' : ' غير قادر على إنشاء ملف جديد"$1".',
50
+ 'errRename' : 'غير قادر على إعادة تسمية ال "$1".',
51
+ 'errCopyFrom' : 'نسخ الملفات من الوسط المحدد "$1"غير مسموح.',
52
+ 'errCopyTo' : 'نسخ الملفات إلى الوسط المحدد "$1" غير مسموح .',
53
+ 'errUpload' : 'خطأ أثناء عملية الرفع',
54
+ 'errUploadFile' : 'غير قادر على رفع "$1".',
55
+ 'errUploadNoFiles' : 'لم يتم رفع أي ملف ',
56
+ 'errUploadTotalSize' : 'حجم البيانات أكبر من الحجم المسموح به ',
57
+ 'errUploadFileSize' : 'حجم الملف أكبر من الحجم المسموح به',
58
+ 'errUploadMime' : 'نوع ملف غير مسموح ',
59
+ 'errUploadTransfer' : '"$1" خطأ أثناء عملية النقل',
60
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.',
61
+ 'errReplace' : 'Unable to replace "$1".',
62
+ 'errSave' : 'غير قادر على الحفظ في "$1".',
63
+ 'errCopy' : 'غير قادر على النسخ إلى"$1".',
64
+ 'errMove' : 'غير قادر على القص إلى "$1".',
65
+ 'errCopyInItself' : 'غير قادر على نسخ الملف "$1" ضمن الملف نفسه.',
66
+ 'errRm' : 'غير قادر على الحذف "$1".',
67
+ 'errRmSrc' : 'Unable remove source file(s).',
68
+ 'errExtract' : 'غير قادر على استخراج الملفات من "$1".',
69
+ 'errArchive' : 'غير قادر على إنشاء ملف مضغوط',
70
+ 'errArcType' : 'نوع الملف المضغوط غير مدعومة',
71
+ 'errNoArchive' : 'هذا الملف ليس ملف مضغوط أو ذو صسغة غير مدعومة ',
72
+ 'errCmdNoSupport' : 'الخادم الخلفي لا يدعم هذا الأمر ',
73
+ 'errReplByChild' : 'The folder “$1” can’t be replaced by an item it contains.',
74
+ 'errArcSymlinks' : 'For security reason denied to unpack archives contains symlinks.',
75
+ 'errArcMaxSize' : 'Archive files exceeds maximum allowed size.',
76
+ 'errResize' : 'Unable to resize "$1".',
77
+ 'errResizeDegree' : 'Invalid rotate degree.',
78
+ 'errResizeRotate' : 'Unable to rotate image.',
79
+ 'errResizeSize' : 'Invalid image size.',
80
+ 'errResizeNoChange' : 'Image size not changed.',
81
+ 'errUsupportType' : 'Unsupported file type.',
82
+ 'errNotUTF8Content' : 'File "$1" is not in UTF-8 and cannot be edited.',
83
+ 'errNetMount' : 'Unable to mount "$1".',
84
+ 'errNetMountNoDriver' : 'Unsupported protocol.',
85
+ 'errNetMountFailed' : 'Mount failed.',
86
+ 'errNetMountHostReq' : 'Host required.',
87
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
88
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
89
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
90
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
91
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
92
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
93
+ 'errExtractExec' : 'Error while extracting files: "$1"',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'أنشئ مجلد مضغوط',
97
+ 'cmdback' : 'الخلف',
98
+ 'cmdcopy' : 'نسخ',
99
+ 'cmdcut' : 'قص',
100
+ 'cmddownload' : 'تحميل',
101
+ 'cmdduplicate' : 'تكرار',
102
+ 'cmdedit' : 'تعديل الملف',
103
+ 'cmdextract' : 'استخراج الملفات',
104
+ 'cmdforward' : 'الأمام',
105
+ 'cmdgetfile' : 'أختيار الملفات',
106
+ 'cmdhelp' : 'عن هذا المشروع',
107
+ 'cmdhome' : 'المجلد الرئيسي',
108
+ 'cmdinfo' : 'معلومات ',
109
+ 'cmdmkdir' : 'مجلد جديد',
110
+ 'cmdmkfile' : 'ملف نصي جديد',
111
+ 'cmdopen' : 'فتح',
112
+ 'cmdpaste' : 'لصق',
113
+ 'cmdquicklook' : 'معاينة',
114
+ 'cmdreload' : 'إعادة تحميل',
115
+ 'cmdrename' : 'إعادة تسمية',
116
+ 'cmdrm' : 'حذف',
117
+ 'cmdsearch' : 'بحث عن ملفات',
118
+ 'cmdup' : 'تغيير المسار إلى مستوى أعلى',
119
+ 'cmdupload' : 'رفع ملفات',
120
+ 'cmdview' : 'عرض',
121
+ 'cmdresize' : 'Resize & Rotate',
122
+ 'cmdsort' : 'Sort',
123
+ 'cmdnetmount' : 'Mount network volume',
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'إغلاق',
127
+ 'btnSave' : 'حفظ',
128
+ 'btnRm' : 'إزالة',
129
+ 'btnApply' : 'Apply',
130
+ 'btnCancel' : 'إلغاء',
131
+ 'btnNo' : 'لا',
132
+ 'btnYes' : 'نعم',
133
+ 'btnMount' : 'Mount',
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'فتح مجلد',
137
+ 'ntffile' : 'فتح ملف',
138
+ 'ntfreload' : 'إعادة عرض محتويات المجلد ',
139
+ 'ntfmkdir' : 'ينشئ المجلدات',
140
+ 'ntfmkfile' : 'ينشئ الملفات',
141
+ 'ntfrm' : 'حذف الملفات',
142
+ 'ntfcopy' : 'نسخ الملفات',
143
+ 'ntfmove' : 'نقل الملفات',
144
+ 'ntfprepare' : 'تحضير لنسخ الملفات',
145
+ 'ntfrename' : 'إعادة تسمية الملفات',
146
+ 'ntfupload' : 'رفع الملفات',
147
+ 'ntfdownload' : 'تحميل الملفات',
148
+ 'ntfsave' : 'حفظ الملفات',
149
+ 'ntfarchive' : 'ينشئ ملف مضغوط',
150
+ 'ntfextract' : 'استخراج ملفات من الملف المضغوط ',
151
+ 'ntfsearch' : 'يبحث عن ملفات',
152
+ 'ntfresize' : 'Resizing images',
153
+ 'ntfsmth' : 'يحضر لشيء ما >_<',
154
+ 'ntfloadimg' : 'Loading image',
155
+ 'ntfnetmount' : 'Mounting network volume',
156
+ 'ntfdim' : 'Acquiring image dimension',
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'غير معلوم',
160
+ 'Today' : 'اليوم',
161
+ 'Yesterday' : 'البارحة',
162
+ 'msJan' : 'كانون الثاني',
163
+ 'msFeb' : 'شباط',
164
+ 'msMar' : 'آذار',
165
+ 'msApr' : 'نيسان',
166
+ 'msMay' : 'أيار',
167
+ 'msJun' : 'حزيران',
168
+ 'msJul' : 'تموز',
169
+ 'msAug' : 'آب',
170
+ 'msSep' : 'أيلول',
171
+ 'msOct' : 'تشرين الأول',
172
+ 'msNov' : 'تشرين الثاني',
173
+ 'msDec' : 'كانون الأول ',
174
+ 'January' : 'January',
175
+ 'February' : 'February',
176
+ 'March' : 'March',
177
+ 'April' : 'April',
178
+ 'May' : 'May',
179
+ 'June' : 'June',
180
+ 'July' : 'July',
181
+ 'August' : 'August',
182
+ 'September' : 'September',
183
+ 'October' : 'October',
184
+ 'November' : 'November',
185
+ 'December' : 'December',
186
+ 'Sunday' : 'Sunday',
187
+ 'Monday' : 'Monday',
188
+ 'Tuesday' : 'Tuesday',
189
+ 'Wednesday' : 'Wednesday',
190
+ 'Thursday' : 'Thursday',
191
+ 'Friday' : 'Friday',
192
+ 'Saturday' : 'Saturday',
193
+ 'Sun' : 'Sun',
194
+ 'Mon' : 'Mon',
195
+ 'Tue' : 'Tue',
196
+ 'Wed' : 'Wed',
197
+ 'Thu' : 'Thu',
198
+ 'Fri' : 'Fri',
199
+ 'Sat' : 'Sat',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'by name',
203
+ 'sortkind' : 'by kind',
204
+ 'sortsize' : 'by size',
205
+ 'sortdate' : 'by date',
206
+ 'sortFoldersFirst' : 'Folders first',
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'يرجى التأكيد',
210
+ 'confirmRm' : 'هل انت متأكد من انك تريد الحذف<br/>لا يمكن التراجع عن هذه العملية ',
211
+ 'confirmRepl' : 'استبدال الملف القديم بملف جديد ؟',
212
+ 'apllyAll' : 'تطبيق على الكل',
213
+ 'name' : 'الأسم',
214
+ 'size' : 'الحجم',
215
+ 'perms' : 'الصلاحيات',
216
+ 'modify' : 'أخر تعديل',
217
+ 'kind' : 'نوع الملف',
218
+ 'read' : 'قراءة',
219
+ 'write' : 'كتابة',
220
+ 'noaccess' : 'وصول ممنوع',
221
+ 'and' : 'و',
222
+ 'unknown' : 'غير معروف',
223
+ 'selectall' : 'تحديد كل الملفات',
224
+ 'selectfiles' : 'تحديد ملفات',
225
+ 'selectffile' : 'تحديد الملف الاول',
226
+ 'selectlfile' : 'تحديد الملف الأخير',
227
+ 'viewlist' : 'اعرض ك قائمة',
228
+ 'viewicons' : 'اعرض ك ايقونات',
229
+ 'places' : 'المواقع',
230
+ 'calc' : 'حساب',
231
+ 'path' : 'مسار',
232
+ 'aliasfor' : 'Alias for',
233
+ 'locked' : 'مقفول',
234
+ 'dim' : 'الابعاد',
235
+ 'files' : 'ملفات',
236
+ 'folders' : 'مجلدات',
237
+ 'items' : 'عناصر',
238
+ 'yes' : 'نعم',
239
+ 'no' : 'لا',
240
+ 'link' : 'اربتاط',
241
+ 'searcresult' : 'نتائج البحث',
242
+ 'selected' : 'العناصر المحددة',
243
+ 'about' : 'عن البرنامج',
244
+ 'shortcuts' : 'الاختصارات',
245
+ 'help' : 'مساعدة',
246
+ 'webfm' : 'مدير ملفات الويب',
247
+ 'ver' : 'رقم الإصدار',
248
+ 'protocolver' : 'اصدار البرتوكول',
249
+ 'homepage' : 'الصفحة الرئيسية',
250
+ 'docs' : 'التعليمات',
251
+ 'github' : 'شاركنا بتطوير المشروع على Github',
252
+ 'twitter' : 'تابعنا على تويتر',
253
+ 'facebook' : 'انضم إلينا على الفيس بوك',
254
+ 'team' : 'الفريق',
255
+ 'chiefdev' : 'رئيس المبرمجين',
256
+ 'developer' : 'مبرمح',
257
+ 'contributor' : 'مبرمح',
258
+ 'maintainer' : 'مشارك',
259
+ 'translator' : 'مترجم',
260
+ 'icons' : 'أيقونات',
261
+ 'dontforget' : 'and don\'t forget to take your towel',
262
+ 'shortcutsof' : 'الاختصارات غير مفعلة',
263
+ 'dropFiles' : 'لصق الملفات هنا',
264
+ 'or' : 'أو',
265
+ 'selectForUpload' : 'اختر الملفات التي تريد رفعها',
266
+ 'moveFiles' : 'قص الملفات',
267
+ 'copyFiles' : 'نسخ الملفات',
268
+ 'rmFromPlaces' : 'Remove from places',
269
+ 'aspectRatio' : 'Aspect ratio',
270
+ 'scale' : 'Scale',
271
+ 'width' : 'Width',
272
+ 'height' : 'Height',
273
+ 'resize' : 'Resize',
274
+ 'crop' : 'Crop',
275
+ 'rotate' : 'Rotate',
276
+ 'rotate-cw' : 'Rotate 90 degrees CW',
277
+ 'rotate-ccw' : 'Rotate 90 degrees CCW',
278
+ 'degree' : '°',
279
+ 'netMountDialogTitle' : 'Mount network volume',
280
+ 'protocol' : 'Protocol',
281
+ 'host' : 'Host',
282
+ 'port' : 'Port',
283
+ 'user' : 'User',
284
+ 'pass' : 'Password',
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'غير معروف',
288
+ 'kindFolder' : 'مجلد',
289
+ 'kindAlias' : 'اختصار',
290
+ 'kindAliasBroken' : 'اختصار غير صالح',
291
+ // applications
292
+ 'kindApp' : 'برنامج',
293
+ 'kindPostscript' : 'Postscript ملف',
294
+ 'kindMsOffice' : 'Microsoft Office ملف',
295
+ 'kindMsWord' : 'Microsoft Word ملف',
296
+ 'kindMsExcel' : 'Microsoft Excel ملف',
297
+ 'kindMsPP' : 'Microsoft Powerpoint عرض تقديمي ',
298
+ 'kindOO' : 'Open Office ملف',
299
+ 'kindAppFlash' : 'تطبيق فلاش',
300
+ 'kindPDF' : 'ملف (PDF)',
301
+ 'kindTorrent' : 'Bittorrent ملف',
302
+ 'kind7z' : '7z ملف',
303
+ 'kindTAR' : 'TAR ملف',
304
+ 'kindGZIP' : 'GZIP ملف',
305
+ 'kindBZIP' : 'BZIP ملف',
306
+ 'kindXZ' : 'XZ ملف',
307
+ 'kindZIP' : 'ZIP ملف',
308
+ 'kindRAR' : 'RAR ملف',
309
+ 'kindJAR' : 'Java JAR ملف',
310
+ 'kindTTF' : 'True Type خط ',
311
+ 'kindOTF' : 'Open Type خط ',
312
+ 'kindRPM' : 'RPM ملف تنصيب',
313
+ // texts
314
+ 'kindText' : 'Text ملف',
315
+ 'kindTextPlain' : 'مستند نصي',
316
+ 'kindPHP' : 'PHP ملف نصي برمجي لـ',
317
+ 'kindCSS' : 'Cascading style sheet',
318
+ 'kindHTML' : 'HTML ملف',
319
+ 'kindJS' : 'Javascript ملف نصي برمجي لـ',
320
+ 'kindRTF' : 'Rich Text Format',
321
+ 'kindC' : 'C ملف نصي برمجي لـ',
322
+ 'kindCHeader' : 'C header ملف نصي برمجي لـ',
323
+ 'kindCPP' : 'C++ ملف نصي برمجي لـ',
324
+ 'kindCPPHeader' : 'C++ header ملف نصي برمجي لـ',
325
+ 'kindShell' : 'Unix shell script',
326
+ 'kindPython' : 'Python ملف نصي برمجي لـ',
327
+ 'kindJava' : 'Java ملف نصي برمجي لـ',
328
+ 'kindRuby' : 'Ruby ملف نصي برمجي لـ',
329
+ 'kindPerl' : 'Perl script',
330
+ 'kindSQL' : 'SQL ملف نصي برمجي لـ',
331
+ 'kindXML' : 'XML ملف',
332
+ 'kindAWK' : 'AWK ملف نصي برمجي لـ',
333
+ 'kindCSV' : 'ملف CSV',
334
+ 'kindDOCBOOK' : 'Docbook XML ملف',
335
+ // images
336
+ 'kindImage' : 'صورة',
337
+ 'kindBMP' : 'BMP صورة',
338
+ 'kindJPEG' : 'JPEG صورة',
339
+ 'kindGIF' : 'GIF صورة',
340
+ 'kindPNG' : 'PNG صورة',
341
+ 'kindTIFF' : 'TIFF صورة',
342
+ 'kindTGA' : 'TGA صورة',
343
+ 'kindPSD' : 'Adobe Photoshop صورة',
344
+ 'kindXBITMAP' : 'X bitmap صورة',
345
+ 'kindPXM' : 'Pixelmator صورة',
346
+ // media
347
+ 'kindAudio' : 'ملف صوتي',
348
+ 'kindAudioMPEG' : 'MPEG ملف صوتي',
349
+ 'kindAudioMPEG4' : 'MPEG-4 ملف صوتي',
350
+ 'kindAudioMIDI' : 'MIDI ملف صوتي',
351
+ 'kindAudioOGG' : 'Ogg Vorbis ملف صوتي',
352
+ 'kindAudioWAV' : 'WAV ملف صوتي',
353
+ 'AudioPlaylist' : 'MP3 قائمة تشغيل',
354
+ 'kindVideo' : 'ملف فيديو',
355
+ 'kindVideoDV' : 'DV ملف فيديو',
356
+ 'kindVideoMPEG' : 'MPEG ملف فيديو',
357
+ 'kindVideoMPEG4' : 'MPEG-4 ملف فيديو',
358
+ 'kindVideoAVI' : 'AVI ملف فيديو',
359
+ 'kindVideoMOV' : 'Quick Time ملف فيديو',
360
+ 'kindVideoWM' : 'Windows Media ملف فيديو',
361
+ 'kindVideoFlash' : 'Flash ملف فيديو',
362
+ 'kindVideoMKV' : 'Matroska ملف فيديو',
363
+ 'kindVideoOGG' : 'Ogg ملف فيديو'
364
+ }
365
+ };
366
+ }
367
+
elFinder/js/i18n/elfinder.bg.js ADDED
@@ -0,0 +1,404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Bulgarian translation
3
+ * @author Stamo Petkov <stamo.petkov@gmail.com>
4
+ * @version 2014-12-19, 2015-10-20
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.bg = {
8
+ translator : 'Stamo Petkov &lt;stamo.petkov@gmail.com&gt;',
9
+ language : 'Български',
10
+ direction : 'ltr',
11
+ dateFormat : 'd M Y h:i A', // 13 Mar 2012 05:27 PM
12
+ fancyDateFormat : '$1 h:i A', // will produce smth like: Today 12:25 PM
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'Грешка',
17
+ 'errUnknown' : 'Непозната грешка.',
18
+ 'errUnknownCmd' : 'Непозната команда.',
19
+ 'errJqui' : 'Грешна конфигурация на jQuery UI. Компонентите selectable, draggable и droppable трябва да са включени.',
20
+ 'errNode' : 'elFinder изисква да бъде създаден DOM елемент.',
21
+ 'errURL' : 'Грешка в настройките на elFinder! не е зададена стойност на URL.',
22
+ 'errAccess' : 'Достъп отказан.',
23
+ 'errConnect' : 'Няма връзка със сървъра.',
24
+ 'errAbort' : 'Връзката е прекъсната.',
25
+ 'errTimeout' : 'Просрочена връзка.',
26
+ 'errNotFound' : 'Сървърът не е намерен.',
27
+ 'errResponse' : 'Грешен отговор от сървъра.',
28
+ 'errConf' : 'Грешни настройки на сървъра.',
29
+ 'errJSON' : 'Не е инсталиран модул на PHP за JSON.',
30
+ 'errNoVolumes' : 'Няма дялове достъпни за четене.',
31
+ 'errCmdParams' : 'Грешни параметри на командата "$1".',
32
+ 'errDataNotJSON' : 'Данните не са JSON.',
33
+ 'errDataEmpty' : 'Липсват данни.',
34
+ 'errCmdReq' : 'Запитването от сървъра изисква име на команда.',
35
+ 'errOpen' : 'Не мога да отворя "$1".',
36
+ 'errNotFolder' : 'Обектът не е папка.',
37
+ 'errNotFile' : 'Обектът не е файл.',
38
+ 'errRead' : 'Не мога да прочета "$1".',
39
+ 'errWrite' : 'Не мога да пиша в "$1".',
40
+ 'errPerm' : 'Разрешение отказано.',
41
+ 'errLocked' : '"$1" е заключен и не може да бъде преименуван, местен или премахван.',
42
+ 'errExists' : 'Вече съществува файл с име "$1"',
43
+ 'errInvName' : 'Грешно име на файл.',
44
+ 'errFolderNotFound' : 'Папката не е открита.',
45
+ 'errFileNotFound' : 'Файлът не е открит.',
46
+ 'errTrgFolderNotFound' : 'Целевата папка "$1" не е намерена.',
47
+ 'errPopup' : 'Браузъра блокира отварянето на прозорец. За да отворите файла, разрешете отварянето в настройките на браузъра.',
48
+ 'errMkdir' : 'Не мога да създам папка"$1".',
49
+ 'errMkfile' : 'Не мога да създам файл "$1".',
50
+ 'errRename' : 'Не мога да преименувам "$1".',
51
+ 'errCopyFrom' : 'Копирането на файлове от том "$1" не е разрешено.',
52
+ 'errCopyTo' : 'Копирането на файлове в том "$1" не е разрешено.',
53
+ 'errMkOutLink' : 'Не мога да създам връзка извън началото на ресурса.',
54
+ 'errUpload' : 'Грешка при качване.',
55
+ 'errUploadFile' : 'Не мога да кача "$1".',
56
+ 'errUploadNoFiles' : 'Не са намерени файлове за качване.',
57
+ 'errUploadTotalSize' : 'Данните превишават максимално допостумия размер.',
58
+ 'errUploadFileSize' : 'Файла превишава максимално допустимия размер.',
59
+ 'errUploadMime' : 'Не е позволен тип на файла.',
60
+ 'errUploadTransfer' : '"$1" грешка при предаване.',
61
+ 'errUploadTemp' : 'Не мога да създам временен файл за качване.',
62
+ 'errNotReplace' : 'Обект "$1" вече съществува на това място и не може да бъде заменен от обект от друг тип.',
63
+ 'errReplace' : 'Не мога да заменя "$1".',
64
+ 'errSave' : 'Не мога да запиша "$1".',
65
+ 'errCopy' : 'Не мога да копирам "$1".',
66
+ 'errMove' : 'Не мога да преместя "$1".',
67
+ 'errCopyInItself' : 'Не мога да копирам "$1" върху самия него.',
68
+ 'errRm' : 'Не мога да премахна "$1".',
69
+ 'errRmSrc' : 'Не мога да премахна изходния файл(ове).',
70
+ 'errExtract' : 'Не мога да извлеча файловете от "$1".',
71
+ 'errArchive' : 'Не мога да създам архив.',
72
+ 'errArcType' : 'Неподдържан тип на архива.',
73
+ 'errNoArchive' : 'Файлът не е архив или е от неподдържан тип.',
74
+ 'errCmdNoSupport' : 'Сървъра не поддържа тази команда.',
75
+ 'errReplByChild' : 'Папката “$1” не може да бъде заменена от съдържащ се в нея елемент.',
76
+ 'errArcSymlinks' : 'От съображения за сигурност няма да бъдат разопаковани архиви съдържащи symlinks.',
77
+ 'errArcMaxSize' : 'Архивните файлове превишават максимално допустимия размер.',
78
+ 'errResize' : 'Не мога да преоразмеря "$1".',
79
+ 'errResizeDegree' : 'Невалиден градус за ротация.',
80
+ 'errResizeRotate' : 'Изображението не е ротирано.',
81
+ 'errResizeSize' : 'Невалиден размер на изображение.',
82
+ 'errResizeNoChange' : 'Размерът на изображението не е променен.',
83
+ 'errUsupportType' : 'Неподдържан тип на файл.',
84
+ 'errNotUTF8Content' : 'Файл "$1" не е в UTF-8 формат и не може да бъде редактиран.',
85
+ 'errNetMount' : 'Не мога да монтирам "$1".',
86
+ 'errNetMountNoDriver' : 'Неподдържан протокол.',
87
+ 'errNetMountFailed' : 'Монтирането не е успешно.',
88
+ 'errNetMountHostReq' : 'Хост се изисква.',
89
+ 'errSessionExpires' : 'Сесията ви изтече поради липса на активност.',
90
+ 'errCreatingTempDir' : 'Не мога да създам временна директория: "$1"',
91
+ 'errFtpDownloadFile' : 'Не мога да изтегля файл от FTP: "$1"',
92
+ 'errFtpUploadFile' : 'Не мога да кача файл на FTP: "$1"',
93
+ 'errFtpMkdir' : 'Не мога да създам директория на FTP: "$1"',
94
+ 'errArchiveExec' : 'Грешка при архивиране на файлове: "$1"',
95
+ 'errExtractExec' : 'Грешка при разархивиране на файлове: "$1"',
96
+ 'errNetUnMount' : 'Не мога да размонтирам',
97
+ 'errConvUTF8' : 'Не е конвертируем до UTF-8',
98
+ 'errFolderUpload' : 'Опитайте Google Chrome, ако искате да качите папка.',
99
+
100
+ /******************************* commands names ********************************/
101
+ 'cmdarchive' : 'Създай архив',
102
+ 'cmdback' : 'Назад',
103
+ 'cmdcopy' : 'Копирай',
104
+ 'cmdcut' : 'Изрежи',
105
+ 'cmddownload' : 'Свали',
106
+ 'cmdduplicate' : 'Дублирай',
107
+ 'cmdedit' : 'Редактирай файл',
108
+ 'cmdextract' : 'Извлечи файловете от архива',
109
+ 'cmdforward' : 'Напред',
110
+ 'cmdgetfile' : 'Избери файлове',
111
+ 'cmdhelp' : 'За тази програма',
112
+ 'cmdhome' : 'Начало',
113
+ 'cmdinfo' : 'Информация',
114
+ 'cmdmkdir' : 'Нова папка',
115
+ 'cmdmkfile' : 'Нов текстови файл',
116
+ 'cmdopen' : 'Отвори',
117
+ 'cmdpaste' : 'Вмъкни',
118
+ 'cmdquicklook' : 'Преглед',
119
+ 'cmdreload' : 'Презареди',
120
+ 'cmdrename' : 'Преименувай',
121
+ 'cmdrm' : 'Изтрий',
122
+ 'cmdsearch' : 'Намери файлове',
123
+ 'cmdup' : 'Една директория нагоре',
124
+ 'cmdupload' : 'Качи файлове',
125
+ 'cmdview' : 'Виж',
126
+ 'cmdresize' : 'Размер на изображение',
127
+ 'cmdsort' : 'Подреди',
128
+ 'cmdnetmount' : 'Монтирай мрежов ресурс',
129
+ 'cmdnetunmount': 'Размонтирай',
130
+ 'cmdplaces' : 'To Places', // added 28.12.2014
131
+ 'cmdchmod' : 'Change mode', // from v2.1 added 20.6.2015
132
+
133
+ /*********************************** buttons ***********************************/
134
+ 'btnClose' : 'Затвори',
135
+ 'btnSave' : 'Запиши',
136
+ 'btnRm' : 'Премахни',
137
+ 'btnApply' : 'Приложи',
138
+ 'btnCancel' : 'Отказ',
139
+ 'btnNo' : 'Не',
140
+ 'btnYes' : 'Да',
141
+ 'btnMount' : 'Монтирай',
142
+ 'btnApprove': 'Отиди на $1 и одобри',
143
+ 'btnUnmount': 'Размонтирай',
144
+ 'btnConv' : 'Конвертирай',
145
+ 'btnCwd' : 'Тук',
146
+ 'btnVolume' : 'Ресурс',
147
+ 'btnAll' : 'Всички',
148
+ 'btnMime' : 'MIME тип',
149
+ 'btnFileName':'Име на файл',
150
+ 'btnSaveClose': 'Запази и затвори',
151
+
152
+ /******************************** notifications ********************************/
153
+ 'ntfopen' : 'Отваряне на папка',
154
+ 'ntffile' : 'Отваряне на файл',
155
+ 'ntfreload' : 'Презареждане съдържанието на папка',
156
+ 'ntfmkdir' : 'Създавам директория',
157
+ 'ntfmkfile' : 'Създавам файл',
158
+ 'ntfrm' : 'Изтриване на файлове',
159
+ 'ntfcopy' : 'Копиране на файлове',
160
+ 'ntfmove' : 'Преместване на файлове',
161
+ 'ntfprepare' : 'Подготовка за копиране на файлове',
162
+ 'ntfrename' : 'Преименуване на файлове',
163
+ 'ntfupload' : 'Качвам файлове',
164
+ 'ntfdownload' : 'Свалям файлове',
165
+ 'ntfsave' : 'Запис на файлове',
166
+ 'ntfarchive' : 'Създавам архив',
167
+ 'ntfextract' : 'Извличам файловете от архив',
168
+ 'ntfsearch' : 'Търся файлове',
169
+ 'ntfresize' : 'Преоразмерявам изображения',
170
+ 'ntfsmth' : 'Зает съм >_<',
171
+ 'ntfloadimg' : 'Зареждам изображения',
172
+ 'ntfnetmount' : 'Монтирам мрежов ресурс',
173
+ 'ntfnetunmount': 'Размонтирам мрежов ресурс',
174
+ 'ntfdim' : 'Извличам размерите на изображение',
175
+ 'ntfreaddir' : 'Извличам информация за папка',
176
+ 'ntfurl' : 'Взимам URL от връзка',
177
+ 'ntfchmod' : 'Променям характеристики на файл',
178
+
179
+ /************************************ dates **********************************/
180
+ 'dateUnknown' : 'неизвестна',
181
+ 'Today' : 'Днес',
182
+ 'Yesterday' : 'Вчера',
183
+ 'msJan' : 'яну',
184
+ 'msFeb' : 'фев',
185
+ 'msMar' : 'мар',
186
+ 'msApr' : 'апр',
187
+ 'msMay' : 'май',
188
+ 'msJun' : 'юни',
189
+ 'msJul' : 'юли',
190
+ 'msAug' : 'авг',
191
+ 'msSep' : 'сеп',
192
+ 'msOct' : 'окт',
193
+ 'msNov' : 'ное',
194
+ 'msDec' : 'дек',
195
+ 'January' : 'януари',
196
+ 'February' : 'февруари',
197
+ 'March' : 'март',
198
+ 'April' : 'април',
199
+ 'May' : 'май',
200
+ 'June' : 'юни',
201
+ 'July' : 'юли',
202
+ 'August' : 'август',
203
+ 'September' : 'септември',
204
+ 'October' : 'октомври',
205
+ 'November' : 'ноември',
206
+ 'December' : 'декември',
207
+ 'Sunday' : 'неделя',
208
+ 'Monday' : 'понеделник',
209
+ 'Tuesday' : 'вторник',
210
+ 'Wednesday' : 'сряда',
211
+ 'Thursday' : 'четвъртък',
212
+ 'Friday' : 'петък',
213
+ 'Saturday' : 'събота',
214
+ 'Sun' : 'нед',
215
+ 'Mon' : 'пон',
216
+ 'Tue' : 'вто',
217
+ 'Wed' : 'сря',
218
+ 'Thu' : 'чет',
219
+ 'Fri' : 'пет',
220
+ 'Sat' : 'съб',
221
+
222
+ /******************************** sort variants ********************************/
223
+ 'sortname' : 'по име',
224
+ 'sortkind' : 'по вид',
225
+ 'sortsize' : 'по размер',
226
+ 'sortdate' : 'по дата',
227
+ 'sortFoldersFirst' : 'Папките първи',
228
+
229
+ /********************************** messages **********************************/
230
+ 'confirmReq' : 'Изисква се подтвърждение',
231
+ 'confirmRm' : 'Сигурни ли сте, че желаете да премахнете файловете?<br/>Това действие е необратимо!',
232
+ 'confirmRepl' : 'Да заменя ли стария файл с новия?',
233
+ 'confirmConvUTF8' : 'Не е в UTF-8 формат<br/>Конвертиране до UTF-8?<br/>Съдържанието става в UTF-8 формат при запазване след конверсията.',
234
+ 'confirmNotSave' : 'Има направени промени.<br/>Те ще бъдат загубени, ако не запишете промените.',
235
+ 'apllyAll' : 'Приложи за всички',
236
+ 'name' : 'Име',
237
+ 'size' : 'Размер',
238
+ 'perms' : 'Привилегии',
239
+ 'modify' : 'Променен',
240
+ 'kind' : 'Вид',
241
+ 'read' : 'четене',
242
+ 'write' : 'запис',
243
+ 'noaccess' : 'без достъп',
244
+ 'and' : 'и',
245
+ 'unknown' : 'непознат',
246
+ 'selectall' : 'Избери всички файлове',
247
+ 'selectfiles' : 'Избери файл(ове)',
248
+ 'selectffile' : 'Избери първият файл',
249
+ 'selectlfile' : 'Избери последният файл',
250
+ 'viewlist' : 'Изглед списък',
251
+ 'viewicons' : 'Изглед икони',
252
+ 'places' : 'Места',
253
+ 'calc' : 'Изчисли',
254
+ 'path' : 'Път',
255
+ 'aliasfor' : 'Връзка към',
256
+ 'locked' : 'Заключен',
257
+ 'dim' : 'Размери',
258
+ 'files' : 'Файлове',
259
+ 'folders' : 'Папки',
260
+ 'items' : 'Елементи',
261
+ 'yes' : 'да',
262
+ 'no' : 'не',
263
+ 'link' : 'Връзка',
264
+ 'searcresult' : 'Резултати от търсенето',
265
+ 'selected' : 'Избрани елементи',
266
+ 'about' : 'За',
267
+ 'shortcuts' : 'Бързи клавиши',
268
+ 'help' : 'Помощ',
269
+ 'webfm' : 'Файлов менаджер за Интернет',
270
+ 'ver' : 'Версия',
271
+ 'protocolver' : 'версия на протокола',
272
+ 'homepage' : 'Начало',
273
+ 'docs' : 'Документация',
274
+ 'github' : 'Разклонение в Github',
275
+ 'twitter' : 'Последвайте ни в Twitter',
276
+ 'facebook' : 'Присъединете се към нас във Facebook',
277
+ 'team' : 'Екип',
278
+ 'chiefdev' : 'Главен разработчик',
279
+ 'developer' : 'разработчик',
280
+ 'contributor' : 'сътрудник',
281
+ 'maintainer' : 'поддръжка',
282
+ 'translator' : 'преводач',
283
+ 'icons' : 'Икони',
284
+ 'dontforget' : 'и не забравяйте да си вземете кърпата',
285
+ 'shortcutsof' : 'Преките пътища са изключени',
286
+ 'dropFiles' : 'Пуснете файловете тук',
287
+ 'or' : 'или',
288
+ 'selectForUpload' : 'Избери файлове за качване',
289
+ 'moveFiles' : 'Премести файлове',
290
+ 'copyFiles' : 'Копирай файлове',
291
+ 'rmFromPlaces' : 'Премахни от Места',
292
+ 'aspectRatio' : 'Отношение',
293
+ 'scale' : 'Мащаб',
294
+ 'width' : 'Ширина',
295
+ 'height' : 'Височина',
296
+ 'resize' : 'Преоразмери',
297
+ 'crop' : 'Отрежи',
298
+ 'rotate' : 'Ротирай',
299
+ 'rotate-cw' : 'Ротирай 90 градуса CW',
300
+ 'rotate-ccw' : 'Ротирай 90 градуса CCW',
301
+ 'degree' : '°',
302
+ 'netMountDialogTitle' : 'Монтиране на мрежов ресурс',
303
+ 'protocol' : 'Протокол',
304
+ 'host' : 'Хост',
305
+ 'port' : 'Порт',
306
+ 'user' : 'Потребител',
307
+ 'pass' : 'Парола',
308
+ 'confirmUnmount' : 'Ще размонтирате $1?',
309
+ 'dropFilesBrowser': 'Пусни или вмъкни файлове от браузера',
310
+ 'dropPasteFiles' : 'Пусни или вмъкни файлове тук',
311
+ 'encoding' : 'Кодировка',
312
+ 'locale' : 'Локали',
313
+ 'searchTarget' : 'Цел: $1',
314
+ 'searchMime' : 'Търсене по въведен MIME тип',
315
+ 'owner' : 'Собственик',
316
+ 'group' : 'Група',
317
+ 'other' : 'Други',
318
+ 'execute' : 'Изпълнява',
319
+ 'perm' : 'Разрешение',
320
+ 'mode' : 'Поведение',
321
+
322
+ /********************************** mimetypes **********************************/
323
+ 'kindUnknown' : 'Непознат',
324
+ 'kindFolder' : 'Папка',
325
+ 'kindAlias' : 'Връзка',
326
+ 'kindAliasBroken' : 'Счупена връзка',
327
+ // applications
328
+ 'kindApp' : 'Приложение',
329
+ 'kindPostscript' : 'Postscript документ',
330
+ 'kindMsOffice' : 'Microsoft Office документ',
331
+ 'kindMsWord' : 'Microsoft Word документ',
332
+ 'kindMsExcel' : 'Microsoft Excel документ',
333
+ 'kindMsPP' : 'Microsoft Powerpoint презентация',
334
+ 'kindOO' : 'Open Office документ',
335
+ 'kindAppFlash' : 'Flash приложение',
336
+ 'kindPDF' : 'PDF документ',
337
+ 'kindTorrent' : 'Bittorrent файл',
338
+ 'kind7z' : '7z архив',
339
+ 'kindTAR' : 'TAR архив',
340
+ 'kindGZIP' : 'GZIP архив',
341
+ 'kindBZIP' : 'BZIP архив',
342
+ 'kindXZ' : 'XZ архив',
343
+ 'kindZIP' : 'ZIP архив',
344
+ 'kindRAR' : 'RAR архив',
345
+ 'kindJAR' : 'Java JAR файл',
346
+ 'kindTTF' : 'True Type шрифт',
347
+ 'kindOTF' : 'Open Type шрифт',
348
+ 'kindRPM' : 'RPM пакет',
349
+ // texts
350
+ 'kindText' : 'Текстов документ',
351
+ 'kindTextPlain' : 'Чист текст',
352
+ 'kindPHP' : 'PHP изходен код',
353
+ 'kindCSS' : 'CSS таблица със стилове',
354
+ 'kindHTML' : 'HTML документ',
355
+ 'kindJS' : 'Javascript изходен код',
356
+ 'kindRTF' : 'RTF текстови файл',
357
+ 'kindC' : 'C изходен код',
358
+ 'kindCHeader' : 'C header изходен код',
359
+ 'kindCPP' : 'C++ изходен код',
360
+ 'kindCPPHeader' : 'C++ header изходен код',
361
+ 'kindShell' : 'Unix shell script',
362
+ 'kindPython' : 'Python изходен код',
363
+ 'kindJava' : 'Java изходен код',
364
+ 'kindRuby' : 'Ruby изходен код',
365
+ 'kindPerl' : 'Perl изходен код',
366
+ 'kindSQL' : 'SQL изходен код',
367
+ 'kindXML' : 'XML документ',
368
+ 'kindAWK' : 'AWK изходен код',
369
+ 'kindCSV' : 'CSV стойности разделени със запетая',
370
+ 'kindDOCBOOK' : 'Docbook XML документ',
371
+ 'kindMarkdown' : 'Markdown текст',
372
+ // images
373
+ 'kindImage' : 'Изображение',
374
+ 'kindBMP' : 'BMP изображение',
375
+ 'kindJPEG' : 'JPEG изображение',
376
+ 'kindGIF' : 'GIF изображение',
377
+ 'kindPNG' : 'PNG изображение',
378
+ 'kindTIFF' : 'TIFF изображение',
379
+ 'kindTGA' : 'TGA изображение',
380
+ 'kindPSD' : 'Adobe Photoshop изображение',
381
+ 'kindXBITMAP' : 'X bitmap изображение',
382
+ 'kindPXM' : 'Pixelmator изображение',
383
+ // media
384
+ 'kindAudio' : 'Аудио медия',
385
+ 'kindAudioMPEG' : 'MPEG звук',
386
+ 'kindAudioMPEG4' : 'MPEG-4 звук',
387
+ 'kindAudioMIDI' : 'MIDI звук',
388
+ 'kindAudioOGG' : 'Ogg Vorbis звук',
389
+ 'kindAudioWAV' : 'WAV звук',
390
+ 'AudioPlaylist' : 'MP3 списък за изпълнение',
391
+ 'kindVideo' : 'Видео медия',
392
+ 'kindVideoDV' : 'DV филм',
393
+ 'kindVideoMPEG' : 'MPEG филм',
394
+ 'kindVideoMPEG4' : 'MPEG-4 филм',
395
+ 'kindVideoAVI' : 'AVI филм',
396
+ 'kindVideoMOV' : 'Quick Time филм',
397
+ 'kindVideoWM' : 'Windows Media филм',
398
+ 'kindVideoFlash' : 'Flash филм',
399
+ 'kindVideoMKV' : 'Matroska филм',
400
+ 'kindVideoOGG' : 'Ogg филм'
401
+ }
402
+ };
403
+ }
404
+
elFinder/js/i18n/elfinder.ca.js ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Catalan translation
3
+ * @author Sergio Jovani <lesergi@gmail.com>
4
+ * @version 2014-12-19
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.ca = {
8
+ translator : 'Sergio Jovani &lt;lesergi@gmail.com&gt;',
9
+ language : 'Català',
10
+ direction : 'ltr',
11
+ dateFormat : 'M d, Y h:i A', // Mar 13, 2012 05:27 PM
12
+ fancyDateFormat : '$1 h:i A', // will produce smth like: Today 12:25 PM
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'Error',
17
+ 'errUnknown' : 'Error desconegut.',
18
+ 'errUnknownCmd' : 'Ordre desconeguda.',
19
+ 'errJqui' : 'La configuració de jQuery UI no és vàlida. S\'han d\'incloure els components "selectable", "draggable" i "droppable".',
20
+ 'errNode' : 'elFinder necessita crear elements DOM.',
21
+ 'errURL' : 'La configuració de l\'elFinder no és vàlida! L\'opció URL no està configurada.',
22
+ 'errAccess' : 'Accés denegat.',
23
+ 'errConnect' : 'No s\'ha pogut connectar amb el rerefons.',
24
+ 'errAbort' : 'S\'ha interromput la connexió.',
25
+ 'errTimeout' : 'Temps de connexió excedit.',
26
+ 'errNotFound' : 'No s\'ha trobat el rerefons.',
27
+ 'errResponse' : 'La resposta del rerefons no és vàlida.',
28
+ 'errConf' : 'La configuració del rerefons no és vàlida.',
29
+ 'errJSON' : 'No està instal·lat el mòdul JSON del PHP.',
30
+ 'errNoVolumes' : 'No s\'han trobat volums llegibles.',
31
+ 'errCmdParams' : 'Els paràmetres per l\'ordre "$1" no són vàlids.',
32
+ 'errDataNotJSON' : 'Les dades no són JSON.',
33
+ 'errDataEmpty' : 'Les dades estan buides.',
34
+ 'errCmdReq' : 'La sol·licitud del rerefons necessita el nom de l\'ordre.',
35
+ 'errOpen' : 'No s\'ha pogut obrir "$1".',
36
+ 'errNotFolder' : 'L\'objecte no és una carpeta.',
37
+ 'errNotFile' : 'L\'objecte no és un fitxer.',
38
+ 'errRead' : 'No s\'ha pogut llegir "$1".',
39
+ 'errWrite' : 'No s\'ha pogut escriure a "$1".',
40
+ 'errPerm' : 'Permís denegat.',
41
+ 'errLocked' : '"$1" està bloquejat i no podeu canviar-li el nom, moure-lo ni suprimir-lo.',
42
+ 'errExists' : 'Ja existeix un fitxer anomenat "$1".',
43
+ 'errInvName' : 'El nom de fitxer no és vàlid.',
44
+ 'errFolderNotFound' : 'No s\'ha trobat la carpeta.',
45
+ 'errFileNotFound' : 'No s\'ha trobat el fitxer.',
46
+ 'errTrgFolderNotFound' : 'No s\'ha trobat la carpeta de destí "$1".',
47
+ 'errPopup' : 'El navegador ha evitat obrir una finestra emergent. Autoritzeu-la per obrir el fitxer.',
48
+ 'errMkdir' : 'No s\'ha pogut crear la carpeta "$1".',
49
+ 'errMkfile' : 'No s\'ha pogut crear el fitxer "$1".',
50
+ 'errRename' : 'No s\'ha pogut canviar el nom de "$1".',
51
+ 'errCopyFrom' : 'No està permès copiar fitxers des del volum "$1".',
52
+ 'errCopyTo' : 'No està permès copiar fitxers al volum "$1".',
53
+ 'errUpload' : 'S\'ha produït un error en la càrrega.',
54
+ 'errUploadFile' : 'No s\'ha pogut carregar "$1".',
55
+ 'errUploadNoFiles' : 'No s\'han trobat fitxers per carregar.',
56
+ 'errUploadTotalSize' : 'Les dades excedeixen la mida màxima permesa.',
57
+ 'errUploadFileSize' : 'El fitxer excedeix la mida màxima permesa.',
58
+ 'errUploadMime' : 'El tipus de fitxer no està permès.',
59
+ 'errUploadTransfer' : 'S\'ha produït un error en transferir "$1".',
60
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.',
61
+ 'errReplace' : 'Unable to replace "$1".',
62
+ 'errSave' : 'No s\'ha pogut desar "$1".',
63
+ 'errCopy' : 'No s\'ha pogut copiar "$1".',
64
+ 'errMove' : 'No s\'ha pogut moure "$1".',
65
+ 'errCopyInItself' : 'No s\'ha pogut copiar "$1" a si mateix.',
66
+ 'errRm' : 'No s\'ha pogut suprimir "$1".',
67
+ 'errRmSrc' : 'Unable remove source file(s).',
68
+ 'errExtract' : 'No s\'han pogut extreure els fitxers de "$1".',
69
+ 'errArchive' : 'No s\'ha pogut crear l\'arxiu.',
70
+ 'errArcType' : 'El tipus d\'arxiu no està suportat.',
71
+ 'errNoArchive' : 'El fitxer no és un arxiu o és un tipus no suportat.',
72
+ 'errCmdNoSupport' : 'El rerefons no suporta aquesta ordre.',
73
+ 'errReplByChild' : 'No es pot reemplaçar la carpeta “$1” per un element que conté.',
74
+ 'errArcSymlinks' : 'Per raons de seguretat, no es permet extreure arxius que contenen enllaços simbòlics.',
75
+ 'errArcMaxSize' : 'Els fitxers de l\'arxiu excedeixen la mida màxima permesa.',
76
+ 'errResize' : 'No s\'ha pogut redimensionar "$1".',
77
+ 'errResizeDegree' : 'Invalid rotate degree.',
78
+ 'errResizeRotate' : 'Unable to rotate image.',
79
+ 'errResizeSize' : 'Invalid image size.',
80
+ 'errResizeNoChange' : 'Image size not changed.',
81
+ 'errUsupportType' : 'El tipus de fitxer no està suportat.',
82
+ 'errNotUTF8Content' : 'File "$1" is not in UTF-8 and cannot be edited.',
83
+ 'errNetMount' : 'Unable to mount "$1".',
84
+ 'errNetMountNoDriver' : 'Unsupported protocol.',
85
+ 'errNetMountFailed' : 'Mount failed.',
86
+ 'errNetMountHostReq' : 'Host required.',
87
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
88
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
89
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
90
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
91
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
92
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
93
+ 'errExtractExec' : 'Error while extracting files: "$1"',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'Crea arxiu',
97
+ 'cmdback' : 'Enrere',
98
+ 'cmdcopy' : 'Copia',
99
+ 'cmdcut' : 'Retalla',
100
+ 'cmddownload' : 'Descarrega',
101
+ 'cmdduplicate' : 'Duplica',
102
+ 'cmdedit' : 'Edita el fitxer',
103
+ 'cmdextract' : 'Extreu els fitxers de l\'arxiu',
104
+ 'cmdforward' : 'Endavant',
105
+ 'cmdgetfile' : 'Selecciona els fitxers',
106
+ 'cmdhelp' : 'Quant a aquest programari',
107
+ 'cmdhome' : 'Inici',
108
+ 'cmdinfo' : 'Obté informació',
109
+ 'cmdmkdir' : 'Nova carpeta',
110
+ 'cmdmkfile' : 'Nou fitxer de text',
111
+ 'cmdopen' : 'Obre',
112
+ 'cmdpaste' : 'Enganxa',
113
+ 'cmdquicklook' : 'Previsualitza',
114
+ 'cmdreload' : 'Torna a carregar',
115
+ 'cmdrename' : 'Canvia el nom',
116
+ 'cmdrm' : 'Suprimeix',
117
+ 'cmdsearch' : 'Cerca fitxers',
118
+ 'cmdup' : 'Vés al directori superior',
119
+ 'cmdupload' : 'Carrega fitxers',
120
+ 'cmdview' : 'Visualitza',
121
+ 'cmdresize' : 'Redimensiona la imatge',
122
+ 'cmdsort' : 'Ordena',
123
+ 'cmdnetmount' : 'Mount network volume',
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'Tanca',
127
+ 'btnSave' : 'Desa',
128
+ 'btnRm' : 'Suprimeix',
129
+ 'btnApply' : 'Aplica',
130
+ 'btnCancel' : 'Cancel·la',
131
+ 'btnNo' : 'No',
132
+ 'btnYes' : 'Sí',
133
+ 'btnMount' : 'Mount',
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'S\'està obrint la carpeta',
137
+ 'ntffile' : 'S\'està obrint el fitxer',
138
+ 'ntfreload' : 'S\'està tornant a carregar el contingut de la carpeta',
139
+ 'ntfmkdir' : 'S\'està creant el directori',
140
+ 'ntfmkfile' : 'S\'estan creant el fitxers',
141
+ 'ntfrm' : 'S\'estan suprimint els fitxers',
142
+ 'ntfcopy' : 'S\'estan copiant els fitxers',
143
+ 'ntfmove' : 'S\'estan movent els fitxers',
144
+ 'ntfprepare' : 'S\'està preparant per copiar fitxers',
145
+ 'ntfrename' : 'S\'estan canviant els noms del fitxers',
146
+ 'ntfupload' : 'S\'estan carregant els fitxers',
147
+ 'ntfdownload' : 'S\'estan descarregant els fitxers',
148
+ 'ntfsave' : 'S\'estan desant els fitxers',
149
+ 'ntfarchive' : 'S\'està creant l\'arxiu',
150
+ 'ntfextract' : 'S\'estan extreient els fitxers de l\'arxiu',
151
+ 'ntfsearch' : 'S\'estan cercant els fitxers',
152
+ 'ntfresize' : 'Resizing images',
153
+ 'ntfsmth' : 'S\'estan realitzant operacions',
154
+ 'ntfloadimg' : 'S\'està carregant la imatge',
155
+ 'ntfnetmount' : 'Mounting network volume',
156
+ 'ntfdim' : 'Acquiring image dimension',
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'desconegut',
160
+ 'Today' : 'Avui',
161
+ 'Yesterday' : 'Ahir',
162
+ 'msJan' : 'gen.',
163
+ 'msFeb' : 'febr.',
164
+ 'msMar' : 'març',
165
+ 'msApr' : 'abr.',
166
+ 'msMay' : 'maig',
167
+ 'msJun' : 'juny',
168
+ 'msJul' : 'jul.',
169
+ 'msAug' : 'ag.',
170
+ 'msSep' : 'set.',
171
+ 'msOct' : 'oct.',
172
+ 'msNov' : 'nov.',
173
+ 'msDec' : 'des.',
174
+ 'January' : 'January',
175
+ 'February' : 'February',
176
+ 'March' : 'March',
177
+ 'April' : 'April',
178
+ 'May' : 'May',
179
+ 'June' : 'June',
180
+ 'July' : 'July',
181
+ 'August' : 'August',
182
+ 'September' : 'September',
183
+ 'October' : 'October',
184
+ 'November' : 'November',
185
+ 'December' : 'December',
186
+ 'Sunday' : 'Sunday',
187
+ 'Monday' : 'Monday',
188
+ 'Tuesday' : 'Tuesday',
189
+ 'Wednesday' : 'Wednesday',
190
+ 'Thursday' : 'Thursday',
191
+ 'Friday' : 'Friday',
192
+ 'Saturday' : 'Saturday',
193
+ 'Sun' : 'Sun',
194
+ 'Mon' : 'Mon',
195
+ 'Tue' : 'Tue',
196
+ 'Wed' : 'Wed',
197
+ 'Thu' : 'Thu',
198
+ 'Fri' : 'Fri',
199
+ 'Sat' : 'Sat',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'per nom',
203
+ 'sortkind' : 'per tipus',
204
+ 'sortsize' : 'per mida',
205
+ 'sortdate' : 'per data',
206
+ 'sortFoldersFirst' : 'Folders first',
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'Es necessita confirmació',
210
+ 'confirmRm' : 'Voleu suprimir els fitxers?<br />L\'acció es podrà desfer!',
211
+ 'confirmRepl' : 'Voleu reemplaçar el fitxer antic amb el nou?',
212
+ 'apllyAll' : 'Aplica a tot',
213
+ 'name' : 'Nom',
214
+ 'size' : 'Mida',
215
+ 'perms' : 'Permisos',
216
+ 'modify' : 'Modificat',
217
+ 'kind' : 'Tipus',
218
+ 'read' : 'llegir',
219
+ 'write' : 'escriure',
220
+ 'noaccess' : 'sense accés',
221
+ 'and' : 'i',
222
+ 'unknown' : 'desconegut',
223
+ 'selectall' : 'Selecciona tots els fitxers',
224
+ 'selectfiles' : 'Selecciona el(s) fitxer(s)',
225
+ 'selectffile' : 'Selecciona el primer fitxer',
226
+ 'selectlfile' : 'Selecciona l\'últim fitxer',
227
+ 'viewlist' : 'Vista en llista',
228
+ 'viewicons' : 'Vista en icones',
229
+ 'places' : 'Llocs',
230
+ 'calc' : 'Calcula',
231
+ 'path' : 'Camí',
232
+ 'aliasfor' : 'Àlies per',
233
+ 'locked' : 'Bloquejat',
234
+ 'dim' : 'Dimensions',
235
+ 'files' : 'Fitxers',
236
+ 'folders' : 'Carpetes',
237
+ 'items' : 'Elements',
238
+ 'yes' : 'sí',
239
+ 'no' : 'no',
240
+ 'link' : 'Enllaç',
241
+ 'searcresult' : 'Resultats de la cerca',
242
+ 'selected' : 'Elements seleccionats',
243
+ 'about' : 'Quant a',
244
+ 'shortcuts' : 'Dreceres',
245
+ 'help' : 'Ajuda',
246
+ 'webfm' : 'Gestor de fitxers web',
247
+ 'ver' : 'Versió',
248
+ 'protocolver' : 'versió de protocol',
249
+ 'homepage' : 'Pàgina del projecte',
250
+ 'docs' : 'Documentació',
251
+ 'github' : 'Bifurca\'ns a GitHub',
252
+ 'twitter' : 'Segueix-nos a Twitter',
253
+ 'facebook' : 'Uniu-vos a Facebook',
254
+ 'team' : 'Equip',
255
+ 'chiefdev' : 'cap desenvolupador',
256
+ 'developer' : 'desenvolupador',
257
+ 'contributor' : 'col·laborador',
258
+ 'maintainer' : 'mantenidor',
259
+ 'translator' : 'traductor',
260
+ 'icons' : 'Icones',
261
+ 'dontforget' : 'i no oblideu agafar la vostra tovallola',
262
+ 'shortcutsof' : 'Les dreceres estan inhabilitades',
263
+ 'dropFiles' : 'Arrossegueu els fitxers aquí',
264
+ 'or' : 'o',
265
+ 'selectForUpload' : 'Seleccioneu els fitxer a carregar',
266
+ 'moveFiles' : 'Mou els fitxers',
267
+ 'copyFiles' : 'Copia els fitxers',
268
+ 'rmFromPlaces' : 'Suprimeix dels llocs',
269
+ 'aspectRatio' : 'Relació d\'aspecte',
270
+ 'scale' : 'Escala',
271
+ 'width' : 'Amplada',
272
+ 'height' : 'Alçada',
273
+ 'resize' : 'Redimensiona',
274
+ 'crop' : 'Retalla',
275
+ 'rotate' : 'Rotate',
276
+ 'rotate-cw' : 'Rotate 90 degrees CW',
277
+ 'rotate-ccw' : 'Rotate 90 degrees CCW',
278
+ 'degree' : '°',
279
+ 'netMountDialogTitle' : 'Mount network volume',
280
+ 'protocol' : 'Protocol',
281
+ 'host' : 'Host',
282
+ 'port' : 'Port',
283
+ 'user' : 'User',
284
+ 'pass' : 'Password',
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'Desconegut',
288
+ 'kindFolder' : 'Carpeta',
289
+ 'kindAlias' : 'Àlies',
290
+ 'kindAliasBroken' : 'Àlies no vàlid',
291
+ // applications
292
+ 'kindApp' : 'Aplicació',
293
+ 'kindPostscript' : 'Document Postscript',
294
+ 'kindMsOffice' : 'Document del Microsoft Office',
295
+ 'kindMsWord' : 'Document del Microsoft Word',
296
+ 'kindMsExcel' : 'Document del Microsoft Excel',
297
+ 'kindMsPP' : 'Presentació del Microsoft Powerpoint',
298
+ 'kindOO' : 'Document de l\'Open Office',
299
+ 'kindAppFlash' : 'Aplicació Flash',
300
+ 'kindPDF' : 'Document PDF',
301
+ 'kindTorrent' : 'Fitxer Bittorrent',
302
+ 'kind7z' : 'Arxiu 7z',
303
+ 'kindTAR' : 'Arxiu TAR',
304
+ 'kindGZIP' : 'Arxiu GZIP',
305
+ 'kindBZIP' : 'Arxiu BZIP',
306
+ 'kindXZ' : 'Arxiu XZ',
307
+ 'kindZIP' : 'Arxiu ZIP',
308
+ 'kindRAR' : 'Arxiu RAR',
309
+ 'kindJAR' : 'Fitxer JAR de Java',
310
+ 'kindTTF' : 'Tipus de lletra True Type',
311
+ 'kindOTF' : 'Tipus de lletra Open Type',
312
+ 'kindRPM' : 'Paquet RPM',
313
+ // texts
314
+ 'kindText' : 'Document de text',
315
+ 'kindTextPlain' : 'Document de text net',
316
+ 'kindPHP' : 'Codi PHP',
317
+ 'kindCSS' : 'Full d\'estils CSS',
318
+ 'kindHTML' : 'Document HTML',
319
+ 'kindJS' : 'Codi Javascript',
320
+ 'kindRTF' : 'Document RTF',
321
+ 'kindC' : 'Codi C',
322
+ 'kindCHeader' : 'Codi de caçalera C',
323
+ 'kindCPP' : 'Codi C++',
324
+ 'kindCPPHeader' : 'Codi de caçalera C++',
325
+ 'kindShell' : 'Script Unix',
326
+ 'kindPython' : 'Codi Python',
327
+ 'kindJava' : 'Codi Java',
328
+ 'kindRuby' : 'Codi Ruby',
329
+ 'kindPerl' : 'Script Perl',
330
+ 'kindSQL' : 'Codi SQL',
331
+ 'kindXML' : 'Document XML',
332
+ 'kindAWK' : 'Codi AWK',
333
+ 'kindCSV' : 'Document CSV',
334
+ 'kindDOCBOOK' : 'Document XML de Docbook',
335
+ // images
336
+ 'kindImage' : 'Imatge',
337
+ 'kindBMP' : 'Imatge BMP',
338
+ 'kindJPEG' : 'Imatge JPEG',
339
+ 'kindGIF' : 'Imatge GIF',
340
+ 'kindPNG' : 'Imatge PNG',
341
+ 'kindTIFF' : 'Imatge TIFF',
342
+ 'kindTGA' : 'Imatge TGA',
343
+ 'kindPSD' : 'Imatge Adobe Photoshop',
344
+ 'kindXBITMAP' : 'Imatge X bitmap',
345
+ 'kindPXM' : 'Imatge Pixelmator',
346
+ // media
347
+ 'kindAudio' : 'Fitxer d\'àudio',
348
+ 'kindAudioMPEG' : 'Fitxer d\'àudio MPEG',
349
+ 'kindAudioMPEG4' : 'Fitxer d\'àudio MPEG-4',
350
+ 'kindAudioMIDI' : 'Fitxer d\'àudio MIDI',
351
+ 'kindAudioOGG' : 'Fitxer d\'àudio Ogg Vorbis',
352
+ 'kindAudioWAV' : 'Fitxer d\'àudio WAV',
353
+ 'AudioPlaylist' : 'Llista de reproducció MP3',
354
+ 'kindVideo' : 'Fitxer de vídeo',
355
+ 'kindVideoDV' : 'Fitxer de vídeo DV',
356
+ 'kindVideoMPEG' : 'Fitxer de vídeo MPEG',
357
+ 'kindVideoMPEG4' : 'Fitxer de vídeo MPEG-4',
358
+ 'kindVideoAVI' : 'Fitxer de vídeo AVI',
359
+ 'kindVideoMOV' : 'Fitxer de vídeo Quick Time',
360
+ 'kindVideoWM' : 'Fitxer de vídeo Windows Media',
361
+ 'kindVideoFlash' : 'Fitxer de vídeo Flash',
362
+ 'kindVideoMKV' : 'Fitxer de vídeo Matroska',
363
+ 'kindVideoOGG' : 'Fitxer de vídeo Ogg'
364
+ }
365
+ };
366
+ }
367
+
elFinder/js/i18n/elfinder.cs.js ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Czech translation
3
+ * @author Jay Gridley <gridley.jay@hotmail.com>
4
+ * @version 2014-12-19
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.cs = {
8
+ translator : 'Jay Gridley &lt;gridley.jay@hotmail.com&gt;',
9
+ language : 'čeština',
10
+ direction : 'ltr',
11
+ dateFormat : 'd. m. Y H:i',
12
+ fancyDateFormat : '$1 H:i',
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'Chyba',
17
+ 'errUnknown' : 'Neznámá chyba.',
18
+ 'errUnknownCmd' : 'Neznámý příkaz.',
19
+ 'errJqui' : 'Nedostačující konfigurace jQuery UI. Musí být zahrnuty komponenty Selectable, Draggable a Droppable.',
20
+ 'errNode' : 'elFinder vyžaduje vytvořený DOM Element.',
21
+ 'errURL' : 'Chybná konfigurace elFinderu! Není nastavena hodnota URL.',
22
+ 'errAccess' : 'Přístup zamítnut.',
23
+ 'errConnect' : 'Nepodařilo se připojit k backendu (konektoru).',
24
+ 'errAbort' : 'Připojení zrušeno.',
25
+ 'errTimeout' : 'Vypšel limit pro připojení.',
26
+ 'errNotFound' : 'Backend nenalezen.',
27
+ 'errResponse' : 'Nesprávná odpověď backendu.',
28
+ 'errConf' : 'Nepsrávná konfigurace backendu.',
29
+ 'errJSON' : 'PHP modul JSON není nainstalován.',
30
+ 'errNoVolumes' : 'Není dostupný čitelný oddíl.',
31
+ 'errCmdParams' : 'Nesprávné parametry příkazu "$1".',
32
+ 'errDataNotJSON' : 'Data nejsou ve formátu JSON.',
33
+ 'errDataEmpty' : 'Data jsou prázdná.',
34
+ 'errCmdReq' : 'Dotaz backendu vyžaduje název příkazu.',
35
+ 'errOpen' : 'Chyba při otevírání "$1".',
36
+ 'errNotFolder' : 'Objekt není složka.',
37
+ 'errNotFile' : 'Objekt není soubor.',
38
+ 'errRead' : 'Chyba při čtení "$1".',
39
+ 'errWrite' : 'Chyba při zápisu do "$1".',
40
+ 'errPerm' : 'Přístup odepřen.',
41
+ 'errLocked' : '"$1" je uzamčený a nemůže být přejmenován, přesunut nebo smazán.',
42
+ 'errExists' : 'Soubor s názvem "$1" již existuje.',
43
+ 'errInvName' : 'Nesprávný název souboru.',
44
+ 'errFolderNotFound' : 'Složka nenalezena.',
45
+ 'errFileNotFound' : 'Soubor nenalezen.',
46
+ 'errTrgFolderNotFound' : 'Cílová složka "$1" nenalezena.',
47
+ 'errPopup' : 'Prohlížeč zabránil otevření vyskakovacího okna. K otevření souboru, povolte vyskakovací okno v prohlížeči.',
48
+ 'errMkdir' : 'Nepodařilo se vytvořit složku "$1".',
49
+ 'errMkfile' : 'Nepodařilo se vytvořit soubor "$1".',
50
+ 'errRename' : 'Nepodařilo se přejmenovat "$1".',
51
+ 'errCopyFrom' : 'Kopírování souborů z oddílu "$1" není povoleno.',
52
+ 'errCopyTo' : 'Kopírování souborů do oddílu "$1" není povoleno.',
53
+ 'errUpload' : 'Chyba nahrávání.', // old name - errUploadCommon
54
+ 'errUploadFile' : 'Nepodařilo se nahrát "$1".', // old name - errUpload
55
+ 'errUploadNoFiles' : 'Nejsou vybrány žádné soubory k nahrání.',
56
+ 'errUploadTotalSize' : 'Překročena maximální povolená velikost dat.', // old name - errMaxSize
57
+ 'errUploadFileSize' : 'Překročena maximální povolená velikost souboru.', // old name - errFileMaxSize
58
+ 'errUploadMime' : 'Nepovolený typ souboru.',
59
+ 'errUploadTransfer' : '"$1" chyba přenosu.',
60
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.', // new
61
+ 'errReplace' : 'Unable to replace "$1".',
62
+ 'errSave' : '"$1" nelze uložit.',
63
+ 'errCopy' : '"$1" nelze zkopírovat.',
64
+ 'errMove' : '"$1" nelze přemístit.',
65
+ 'errCopyInItself' : '"$1" nelze zkopírovat do sebe sama.',
66
+ 'errRm' : '"$1" nelze odstranit.',
67
+ 'errRmSrc' : 'Unable remove source file(s).',
68
+ 'errExtract' : 'Nelze extrahovat soubory z "$1".',
69
+ 'errArchive' : 'Nelze vytvořit archív.',
70
+ 'errArcType' : 'Nepodporovaný typ archívu.',
71
+ 'errNoArchive' : 'Soubor není archív nebo má nepodporovaný formát.',
72
+ 'errCmdNoSupport' : 'Backend tento příkaz nepodporuje.',
73
+ 'errReplByChild' : 'Složka "$1" nemůže být nahrazena souborem, který sama obsahuje.',
74
+ 'errArcSymlinks' : 'Z bezpečnostních důvodů je zakázáno rozbalit archívy obsahující symlinky.',
75
+ 'errArcMaxSize' : 'Soubory archívu překračují maximální povolenou velikost.',
76
+ 'errResize' : 'Nepodařilo se změnit velikost obrázku "$1".',
77
+ 'errResizeDegree' : 'Invalid rotate degree.', // added 7.3.2013
78
+ 'errResizeRotate' : 'Unable to rotate image.', // added 7.3.2013
79
+ 'errResizeSize' : 'Invalid image size.', // added 7.3.2013
80
+ 'errResizeNoChange' : 'Image size not changed.', // added 7.3.2013
81
+ 'errUsupportType' : 'Nepodporovaný typ souboru.',
82
+ 'errNotUTF8Content' : 'File "$1" is not in UTF-8 and cannot be edited.', // added 9.11.2011
83
+ 'errNetMount' : 'Unable to mount "$1".', // added 17.04.2012
84
+ 'errNetMountNoDriver' : 'Unsupported protocol.', // added 17.04.2012
85
+ 'errNetMountFailed' : 'Mount failed.', // added 17.04.2012
86
+ 'errNetMountHostReq' : 'Host required.', // added 18.04.2012
87
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
88
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
89
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
90
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
91
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
92
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
93
+ 'errExtractExec' : 'Error while extracting files: "$1"',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'Vytvořit archív',
97
+ 'cmdback' : 'Zpět',
98
+ 'cmdcopy' : 'Kopírovat',
99
+ 'cmdcut' : 'Vyjmout',
100
+ 'cmddownload' : 'Stáhnout',
101
+ 'cmdduplicate' : 'Duplikovat',
102
+ 'cmdedit' : 'Upravit soubor',
103
+ 'cmdextract' : 'Rozbalit archív',
104
+ 'cmdforward' : 'Vpřed',
105
+ 'cmdgetfile' : 'Vybrat soubory',
106
+ 'cmdhelp' : 'O softwaru',
107
+ 'cmdhome' : 'Domů',
108
+ 'cmdinfo' : 'Zobrazit informace',
109
+ 'cmdmkdir' : 'Nová složka',
110
+ 'cmdmkfile' : 'Nový textový soubor',
111
+ 'cmdopen' : 'Otevřít',
112
+ 'cmdpaste' : 'Vložit',
113
+ 'cmdquicklook' : 'Náhled',
114
+ 'cmdreload' : 'Obnovit',
115
+ 'cmdrename' : 'Přejmenovat',
116
+ 'cmdrm' : 'Smazat',
117
+ 'cmdsearch' : 'Najít soubory',
118
+ 'cmdup' : 'Přejít do nadřazené složky',
119
+ 'cmdupload' : 'Nahrát soubor(y)',
120
+ 'cmdview' : 'Zobrazit',
121
+ 'cmdresize' : 'Změnit velikost',
122
+ 'cmdsort' : 'Seřadit',
123
+ 'cmdnetmount' : 'Připojit síťovou jednotku', // added 18.04.2012
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'Zavřít',
127
+ 'btnSave' : 'Uložit',
128
+ 'btnRm' : 'Odstranit',
129
+ 'btnApply' : 'Použít',
130
+ 'btnCancel' : 'Zrušit',
131
+ 'btnNo' : 'Ne',
132
+ 'btnYes' : 'Ano',
133
+ 'btnMount' : 'Připojit', // added 18.04.2012
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'Otevírání složky',
137
+ 'ntffile' : 'Otevírání souboru',
138
+ 'ntfreload' : 'Obnovování obsahu složky',
139
+ 'ntfmkdir' : 'Vytváření složky',
140
+ 'ntfmkfile' : 'Vytváření souborů',
141
+ 'ntfrm' : 'Mazání souborů',
142
+ 'ntfcopy' : 'Kopírování souborů',
143
+ 'ntfmove' : 'Přesunování souborů',
144
+ 'ntfprepare' : 'Příprava ke kopírování souborů',
145
+ 'ntfrename' : 'Přejmenovávání souborů',
146
+ 'ntfupload' : 'Nahrávání souborů',
147
+ 'ntfdownload' : 'Stahování souborů',
148
+ 'ntfsave' : 'Ukládání souborů',
149
+ 'ntfarchive' : 'Vytváření archívu',
150
+ 'ntfextract' : 'Rozbalování souborů z archívu',
151
+ 'ntfsearch' : 'Vyhledávání souborů',
152
+ 'ntfresize' : 'Resizing images',
153
+ 'ntfsmth' : 'Čekejte prosím...',
154
+ 'ntfloadimg' : 'Načítání obrázků',
155
+ 'ntfnetmount' : 'Mounting network volume', // added 18.04.2012
156
+ 'ntfdim' : 'Acquiring image dimension', // added 20.05.2013
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'neznámý',
160
+ 'Today' : 'Dnes',
161
+ 'Yesterday' : 'Včera',
162
+ 'msJan' : 'Led',
163
+ 'msFeb' : 'Úno',
164
+ 'msMar' : 'Bře',
165
+ 'msApr' : 'Dub',
166
+ 'msMay' : 'Kvě',
167
+ 'msJun' : 'Čer',
168
+ 'msJul' : 'Čec',
169
+ 'msAug' : 'Srp',
170
+ 'msSep' : 'Zář',
171
+ 'msOct' : 'Říj',
172
+ 'msNov' : 'Lis',
173
+ 'msDec' : 'Pro',
174
+ 'January' : 'Leden',
175
+ 'February' : 'Únor',
176
+ 'March' : 'Březen',
177
+ 'April' : 'Duben',
178
+ 'May' : 'Květen',
179
+ 'June' : 'Červen',
180
+ 'July' : 'Červenec',
181
+ 'August' : 'Srpen',
182
+ 'September' : 'Září',
183
+ 'October' : 'Říjen',
184
+ 'November' : 'Listopad',
185
+ 'December' : 'Prosinec',
186
+ 'Sunday' : 'Neděle',
187
+ 'Monday' : 'Pondělí',
188
+ 'Tuesday' : 'Úterý',
189
+ 'Wednesday' : 'Středa',
190
+ 'Thursday' : 'Čtvrtek',
191
+ 'Friday' : 'Pátek',
192
+ 'Saturday' : 'Sobota',
193
+ 'Sun' : 'Ne',
194
+ 'Mon' : 'Po',
195
+ 'Tue' : 'Út',
196
+ 'Wed' : 'St',
197
+ 'Thu' : 'Čt',
198
+ 'Fri' : 'Pá',
199
+ 'Sat' : 'So',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'dle jména',
203
+ 'sortkind' : 'dle typu',
204
+ 'sortsize' : 'dle velikosti',
205
+ 'sortdate' : 'dle data',
206
+ 'sortFoldersFirst' : 'Napřed složky',
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'Požadováno potvrzení',
210
+ 'confirmRm' : 'Opravdu chcete odstranit tyto soubory?<br/>Operace nelze vrátit!',
211
+ 'confirmRepl' : 'Nahradit staré soubory novými?',
212
+ 'apllyAll' : 'Pro všechny',
213
+ 'name' : 'Název',
214
+ 'size' : 'Velikost',
215
+ 'perms' : 'Práva',
216
+ 'modify' : 'Upravený',
217
+ 'kind' : 'Typ',
218
+ 'read' : 'čtení',
219
+ 'write' : 'zápis',
220
+ 'noaccess' : 'přístup odepřen',
221
+ 'and' : 'a',
222
+ 'unknown' : 'neznámý',
223
+ 'selectall' : 'Vybrat všechny soubory',
224
+ 'selectfiles' : 'Vybrat soubor(y)',
225
+ 'selectffile' : 'Vybrat první soubor',
226
+ 'selectlfile' : 'Vybrat poslední soubor',
227
+ 'viewlist' : 'Seznam',
228
+ 'viewicons' : 'Ikony',
229
+ 'places' : 'Místa',
230
+ 'calc' : 'Vypočítat',
231
+ 'path' : 'Cesta',
232
+ 'aliasfor' : 'Zástupce pro',
233
+ 'locked' : 'Uzamčený',
234
+ 'dim' : 'Rozměry',
235
+ 'files' : 'Soubory',
236
+ 'folders' : 'Složky',
237
+ 'items' : 'Položky',
238
+ 'yes' : 'ano',
239
+ 'no' : 'ne',
240
+ 'link' : 'Odkaz',
241
+ 'searcresult' : 'Výsledky hledání',
242
+ 'selected' : 'vybrané položky',
243
+ 'about' : 'O softwaru',
244
+ 'shortcuts' : 'Zkratky',
245
+ 'help' : 'Nápověda',
246
+ 'webfm' : 'Webový správce souborů',
247
+ 'ver' : 'Verze',
248
+ 'protocolver' : 'verze protokolu',
249
+ 'homepage' : 'Domovská stránka projektu',
250
+ 'docs' : 'Dokumentace',
251
+ 'github' : 'Fork us on Github',
252
+ 'twitter' : 'Follow us on Twitter',
253
+ 'facebook' : 'Join us on Facebook',
254
+ 'team' : 'Tým',
255
+ 'chiefdev' : 'séf vývojářů',
256
+ 'developer' : 'vývojár',
257
+ 'contributor' : 'spolupracovník',
258
+ 'maintainer' : 'údržba',
259
+ 'translator' : 'překlad',
260
+ 'icons' : 'Ikony',
261
+ 'dontforget' : 'a nezapomeňte si vzít plavky',
262
+ 'shortcutsof' : 'Zkratky nejsou povoleny',
263
+ 'dropFiles' : 'Sem přetáhněte soubory',
264
+ 'or' : 'nebo',
265
+ 'selectForUpload' : 'Vyberte soubory',
266
+ 'moveFiles' : 'Přesunout sobory',
267
+ 'copyFiles' : 'Zkopírovat soubory',
268
+ 'rmFromPlaces' : 'Odstranit z míst',
269
+ 'aspectRatio' : 'Poměr stran',
270
+ 'scale' : 'Měřítko',
271
+ 'width' : 'Šířka',
272
+ 'height' : 'Výška',
273
+ 'resize' : 'Změnit vel.',
274
+ 'crop' : 'Ořezat',
275
+ 'rotate' : 'Otočit',
276
+ 'rotate-cw' : 'Otočit o +90 stupňů',
277
+ 'rotate-ccw' : 'Otočit o -90 stupňů',
278
+ 'degree' : ' stupňů',
279
+ 'netMountDialogTitle' : 'Mount network volume', // added 18.04.2012
280
+ 'protocol' : 'Protocol', // added 18.04.2012
281
+ 'host' : 'Host', // added 18.04.2012
282
+ 'port' : 'Port', // added 18.04.2012
283
+ 'user' : 'User', // added 18.04.2012
284
+ 'pass' : 'Password', // added 18.04.2012
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'Neznámý',
288
+ 'kindFolder' : 'Složka',
289
+ 'kindAlias' : 'Odkaz',
290
+ 'kindAliasBroken' : 'Neplatný odkaz',
291
+ // applications
292
+ 'kindApp' : 'Aplikace',
293
+ 'kindPostscript' : 'Dokument Postscriptu',
294
+ 'kindMsOffice' : 'Dokument Microsoft Office',
295
+ 'kindMsWord' : 'Dokument Microsoft Word',
296
+ 'kindMsExcel' : 'Dokument Microsoft Excel',
297
+ 'kindMsPP' : 'Prezentace Microsoft Powerpoint',
298
+ 'kindOO' : 'Otevřít dokument Office',
299
+ 'kindAppFlash' : 'Flash aplikace',
300
+ 'kindPDF' : 'PDF',
301
+ 'kindTorrent' : 'Soubor BitTorrent',
302
+ 'kind7z' : 'Archív 7z',
303
+ 'kindTAR' : 'Archív TAR',
304
+ 'kindGZIP' : 'Archív GZIP',
305
+ 'kindBZIP' : 'Archív BZIP',
306
+ 'kindXZ' : 'Archív XZ',
307
+ 'kindZIP' : 'Archív ZIP',
308
+ 'kindRAR' : 'Archív RAR',
309
+ 'kindJAR' : 'Soubor Java JAR',
310
+ 'kindTTF' : 'True Type font',
311
+ 'kindOTF' : 'Open Type font',
312
+ 'kindRPM' : 'RPM balíček',
313
+ // texts
314
+ 'kindText' : 'Textový dokument',
315
+ 'kindTextPlain' : 'Čistý text',
316
+ 'kindPHP' : 'PHP zdrojový kód',
317
+ 'kindCSS' : 'Kaskádové styly',
318
+ 'kindHTML' : 'HTML dokument',
319
+ 'kindJS' : 'Javascript zdrojový kód',
320
+ 'kindRTF' : 'Rich Text Format',
321
+ 'kindC' : 'C zdrojový kód',
322
+ 'kindCHeader' : 'C hlavička',
323
+ 'kindCPP' : 'C++ zdrojový kód',
324
+ 'kindCPPHeader' : 'C++ hlavička',
325
+ 'kindShell' : 'Unix shell skript',
326
+ 'kindPython' : 'Python zdrojový kód',
327
+ 'kindJava' : 'Java zdrojový kód',
328
+ 'kindRuby' : 'Ruby zdrojový kód',
329
+ 'kindPerl' : 'Perl skript',
330
+ 'kindSQL' : 'SQL zdrojový kód',
331
+ 'kindXML' : 'Dokument XML',
332
+ 'kindAWK' : 'AWK zdrojový kód',
333
+ 'kindCSV' : 'CSV',
334
+ 'kindDOCBOOK' : 'Docbook XML dokument',
335
+ // images
336
+ 'kindImage' : 'Obrázek',
337
+ 'kindBMP' : 'Obrázek BMP',
338
+ 'kindJPEG' : 'Obrázek JPEG',
339
+ 'kindGIF' : 'Obrázek GIF',
340
+ 'kindPNG' : 'Obrázek PNG',
341
+ 'kindTIFF' : 'Obrázek TIFF',
342
+ 'kindTGA' : 'Obrázek TGA',
343
+ 'kindPSD' : 'Obrázek Adobe Photoshop',
344
+ 'kindXBITMAP' : 'Obrázek X bitmapa',
345
+ 'kindPXM' : 'Obrázek Pixelmator',
346
+ // media
347
+ 'kindAudio' : 'Audio sobory',
348
+ 'kindAudioMPEG' : 'MPEG audio',
349
+ 'kindAudioMPEG4' : 'MPEG-4 audio',
350
+ 'kindAudioMIDI' : 'MIDI audio',
351
+ 'kindAudioOGG' : 'Ogg Vorbis audio',
352
+ 'kindAudioWAV' : 'WAV audio',
353
+ 'AudioPlaylist' : 'MP3 playlist',
354
+ 'kindVideo' : 'Video sobory',
355
+ 'kindVideoDV' : 'DV video',
356
+ 'kindVideoMPEG' : 'MPEG video',
357
+ 'kindVideoMPEG4' : 'MPEG-4 video',
358
+ 'kindVideoAVI' : 'AVI video',
359
+ 'kindVideoMOV' : 'Quick Time video',
360
+ 'kindVideoWM' : 'Windows Media video',
361
+ 'kindVideoFlash' : 'Flash video',
362
+ 'kindVideoMKV' : 'Matroska video',
363
+ 'kindVideoOGG' : 'Ogg video'
364
+ }
365
+ };
366
+ }
367
+
elFinder/js/i18n/elfinder.da.js ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Danish translation
3
+ * @author Mark Topper (webman.io)
4
+ * @version 2014-12-19
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.da = {
8
+ translator : 'Mark Topper (webman.io)',
9
+ language : 'Language of translation in Danish',
10
+ direction : 'ltr',
11
+ dateFormat : 'd.m.Y H:i',
12
+ fancyDateFormat : '$1 H:i',
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'Fejl',
17
+ 'errUnknown' : 'Ukendt fejl.',
18
+ 'errUnknownCmd' : 'Ukendt kommando.',
19
+ 'errJqui' : 'Ugyldig jQuery UI konfiguration. Valgbare, som kan trækkes rundt og droppable komponenter skal medtages.',
20
+ 'errNode' : 'elFinder kræver DOM Element oprettet.',
21
+ 'errURL' : 'Ugyldig elFinder konfiguration! URL option er ikke sat.',
22
+ 'errAccess' : 'Adgang nægtet.',
23
+ 'errConnect' : 'Kan ikke få kontatkt med backend.',
24
+ 'errAbort' : 'Forbindelse afbrudt.',
25
+ 'errTimeout' : 'Connection timeout.',
26
+ 'errNotFound' : 'Backend ikke fundet.',
27
+ 'errResponse' : 'Ugyldigt backend svar.',
28
+ 'errConf' : 'Ugyldig backend konfiguration.',
29
+ 'errJSON' : 'PHP JSON module ikke installeret.',
30
+ 'errNoVolumes' : 'Læsbare volumener ikke tilgængelig.',
31
+ 'errCmdParams' : 'Ugyldige parametre for kommando "$1".',
32
+ 'errDataNotJSON' : 'Data er ikke JSON.',
33
+ 'errDataEmpty' : 'Data er tomt.',
34
+ 'errCmdReq' : 'Backend request kræver kommando navn.',
35
+ 'errOpen' : 'Kunne ikke åbne "$1".',
36
+ 'errNotFolder' : 'Objektet er ikke en mappe.',
37
+ 'errNotFile' : 'Objektet er ikke en fil.',
38
+ 'errRead' : 'Kunne ikke læse "$1".',
39
+ 'errWrite' : 'Kunne ikke skrive til "$1".',
40
+ 'errPerm' : 'Adgang nægtet.',
41
+ 'errLocked' : '"$1" er låst og kan ikke blive omdøbt, flyttet eller slettet.',
42
+ 'errExists' : 'Der findes allerede en fil ved navn "$1".',
43
+ 'errInvName' : 'Ugyldigt fil navn.',
44
+ 'errFolderNotFound' : 'Mappe ikke fundet.',
45
+ 'errFileNotFound' : 'Fil ikke fundet.',
46
+ 'errTrgFolderNotFound' : 'Mappen "$1" blev ikke fundet.',
47
+ 'errPopup' : 'Browseren forhindrede åbne popup-vindue. For at åbne filen aktivere popup-vinduer i browserindstillinger.',
48
+ 'errMkdir' : 'Kunne ikke oprette mappen "$1".',
49
+ 'errMkfile' : 'Kunne ikke oprette filen "$1".',
50
+ 'errRename' : 'Kunne ikke omdøbe "$1".',
51
+ 'errCopyFrom' : 'Kopiering af filer fra volumen "$1" er ikke tilladt.',
52
+ 'errCopyTo' : 'Kopiering af filer til volumen "$1" er ikke tilladt.',
53
+ 'errUpload' : 'Upload fejl.',
54
+ 'errUploadFile' : 'Kunne ikke uploade "$1".',
55
+ 'errUploadNoFiles' : 'Ingen filer fundet til upload.',
56
+ 'errUploadTotalSize' : 'Dataen overskrider den maksimalt tilladte størrelse.',
57
+ 'errUploadFileSize' : 'Fil overskrider den maksimalt tilladte størrelse.',
58
+ 'errUploadMime' : 'Fil type ikke godkendt.',
59
+ 'errUploadTransfer' : '"$1" overførsels fejl.',
60
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.',
61
+ 'errReplace' : 'Unable to replace "$1".',
62
+ 'errSave' : 'Kunne ikke gemme "$1".',
63
+ 'errCopy' : 'Kunne ikke kopier "$1".',
64
+ 'errMove' : 'Kunne ikke flytte "$1".',
65
+ 'errCopyInItself' : 'Kunne ikke kopier "$1" ind i sig selv.',
66
+ 'errRm' : 'Kunne ikke slette "$1".',
67
+ 'errRmSrc' : 'Unable remove source file(s).',
68
+ 'errExtract' : 'Kunne ikke udpakke filer fra "$1".',
69
+ 'errArchive' : 'Kunne ikke oprette arkiv.',
70
+ 'errArcType' : 'Arkiv typen er ikke understøttet.',
71
+ 'errNoArchive' : 'Filen er ikke et arkiv eller har ikke-understøttet arkiv type.',
72
+ 'errCmdNoSupport' : 'Backend understøtter ikke denne kommando.',
73
+ 'errReplByChild' : 'Mappen "$1" kan ikke erstattes af en vare, den indeholder.',
74
+ 'errArcSymlinks' : 'Af sikkerhedsmæssige årsager nægtede at udpakke arkiver der indeholder symlinks eller filer med ikke tilladte navne.', // edited 24.06.2012
75
+ 'errArcMaxSize' : 'Arkivfiler overskrider den maksimalt tilladte størrelse.',
76
+ 'errResize' : 'Kunne ikke ændre størrelsen på "$1".',
77
+ 'errResizeDegree' : 'Invalid rotate degree.',
78
+ 'errResizeRotate' : 'Unable to rotate image.',
79
+ 'errResizeSize' : 'Invalid image size.',
80
+ 'errResizeNoChange' : 'Image size not changed.',
81
+ 'errUsupportType' : 'Ikke-understøttet fil type.',
82
+ 'errNotUTF8Content' : 'Filen "$1" er ikke i UTF-8 og kan ikke blive redigeret.', // added 9.11.2011
83
+ 'errNetMount' : 'Kunne ikke mounte "$1".', // added 17.04.2012
84
+ 'errNetMountNoDriver' : 'Ikke-understøttet protocol.', // added 17.04.2012
85
+ 'errNetMountFailed' : 'Mount mislykkedes.', // added 17.04.2012
86
+ 'errNetMountHostReq' : 'Host krævet.', // added 18.04.2012
87
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
88
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
89
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
90
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
91
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
92
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
93
+ 'errExtractExec' : 'Error while extracting files: "$1"',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'Lav arkiv',
97
+ 'cmdback' : 'Tilbage',
98
+ 'cmdcopy' : 'Kopier',
99
+ 'cmdcut' : 'Klip',
100
+ 'cmddownload' : 'Download',
101
+ 'cmdduplicate' : 'Dupliker',
102
+ 'cmdedit' : 'Rediger Fil',
103
+ 'cmdextract' : 'Udpak filer fra arkiv',
104
+ 'cmdforward' : 'Frem',
105
+ 'cmdgetfile' : 'Vælg filer',
106
+ 'cmdhelp' : 'Om dette produkt',
107
+ 'cmdhome' : 'Hjem',
108
+ 'cmdinfo' : 'Information',
109
+ 'cmdmkdir' : 'Ny mappe',
110
+ 'cmdmkfile' : 'Ny tekst fil',
111
+ 'cmdopen' : 'Åben',
112
+ 'cmdpaste' : 'Indsæt',
113
+ 'cmdquicklook' : 'Vis',
114
+ 'cmdreload' : 'Reload',
115
+ 'cmdrename' : 'Omdøb',
116
+ 'cmdrm' : 'Slet',
117
+ 'cmdsearch' : 'Find filer',
118
+ 'cmdup' : 'Gå til forældre mappe',
119
+ 'cmdupload' : 'Upload filer',
120
+ 'cmdview' : 'Vis',
121
+ 'cmdresize' : 'Ændre størrelse',
122
+ 'cmdsort' : 'Sorter',
123
+ 'cmdnetmount' : 'Mount network volume',
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'Luk',
127
+ 'btnSave' : 'Gem',
128
+ 'btnRm' : 'Slet',
129
+ 'btnApply' : 'Anvend',
130
+ 'btnCancel' : 'Annuler',
131
+ 'btnNo' : 'Nej',
132
+ 'btnYes' : 'Ja',
133
+ 'btnMount' : 'Mount',
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'Åben mappe',
137
+ 'ntffile' : 'Åben fil',
138
+ 'ntfreload' : 'Reload mappe indhold',
139
+ 'ntfmkdir' : 'Opretter mappe',
140
+ 'ntfmkfile' : 'Opretter filer',
141
+ 'ntfrm' : 'Sletter filer',
142
+ 'ntfcopy' : 'Kopier filer',
143
+ 'ntfmove' : 'Flytter filer',
144
+ 'ntfprepare' : 'Forbereder kopering af filer',
145
+ 'ntfrename' : 'Omdøb filer',
146
+ 'ntfupload' : 'Uploader filer',
147
+ 'ntfdownload' : 'Downloader filer',
148
+ 'ntfsave' : 'Gemmer filer',
149
+ 'ntfarchive' : 'Opretter arkiv',
150
+ 'ntfextract' : 'Udpakker filer fra arkiv',
151
+ 'ntfsearch' : 'Søger filer',
152
+ 'ntfresize' : 'Resizing images',
153
+ 'ntfsmth' : 'Gør noget >_<',
154
+ 'ntfloadimg' : 'Loader billede',
155
+ 'ntfnetmount' : 'Montere netværks volume', // added 18.04.2012
156
+ 'ntfdim' : 'Acquiring image dimension',
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'Ukendt',
160
+ 'Today' : 'I dag',
161
+ 'Yesterday' : 'I går',
162
+ 'msJan' : 'Jan',
163
+ 'msFeb' : 'Feb',
164
+ 'msMar' : 'Mar',
165
+ 'msApr' : 'Apr',
166
+ 'msMay' : 'Maj',
167
+ 'msJun' : 'Jun',
168
+ 'msJul' : 'Jul',
169
+ 'msAug' : 'Aug',
170
+ 'msSep' : 'Sep',
171
+ 'msOct' : 'Okt',
172
+ 'msNov' : 'Nov',
173
+ 'msDec' : 'Dec',
174
+ 'January' : 'Januar',
175
+ 'February' : 'Februar',
176
+ 'March' : 'Marts',
177
+ 'April' : 'April',
178
+ 'May' : 'Maj',
179
+ 'June' : 'Juni',
180
+ 'July' : 'Juli',
181
+ 'August' : 'August',
182
+ 'September' : 'September',
183
+ 'October' : 'Oktober',
184
+ 'November' : 'November',
185
+ 'December' : 'December',
186
+ 'Sunday' : 'Søndag',
187
+ 'Monday' : 'Mandag',
188
+ 'Tuesday' : 'Tirsdag',
189
+ 'Wednesday' : 'Onsdag',
190
+ 'Thursday' : 'Torsdag',
191
+ 'Friday' : 'Fredag',
192
+ 'Saturday' : 'Lørdag',
193
+ 'Sun' : 'Søn',
194
+ 'Mon' : 'Man',
195
+ 'Tue' : 'Tir',
196
+ 'Wed' : 'Ons',
197
+ 'Thu' : 'Tor',
198
+ 'Fri' : 'Fre',
199
+ 'Sat' : 'Lør',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'efter navn',
203
+ 'sortkind' : 'efter type',
204
+ 'sortsize' : 'efter størrelse',
205
+ 'sortdate' : 'efter dato',
206
+ 'sortFoldersFirst' : 'Mapper først', // added 22.06.2012
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'Bekræftelse påkrævet',
210
+ 'confirmRm' : 'Er du sikker på du vil slette valgte filer?<br/>Dette kan ikke blive fortrudt!',
211
+ 'confirmRepl' : 'Erstat gammel fil med ny fil?',
212
+ 'apllyAll' : 'Anvend ved alle',
213
+ 'name' : 'Navn',
214
+ 'size' : 'Størrelse',
215
+ 'perms' : 'Rettigheder',
216
+ 'modify' : 'Ændret',
217
+ 'kind' : 'Type',
218
+ 'read' : 'Læse',
219
+ 'write' : 'Skrive',
220
+ 'noaccess' : 'ingen adgang',
221
+ 'and' : 'og',
222
+ 'unknown' : 'ukendt',
223
+ 'selectall' : 'Vælg alle filer',
224
+ 'selectfiles' : 'Vælg fil(er)',
225
+ 'selectffile' : 'Vælg første fil',
226
+ 'selectlfile' : 'Vælg sidste fil',
227
+ 'viewlist' : 'Liste visning',
228
+ 'viewicons' : 'Ikon visning',
229
+ 'places' : 'Plaseringer',
230
+ 'calc' : 'Udregn',
231
+ 'path' : 'Sti',
232
+ 'aliasfor' : 'Alias for',
233
+ 'locked' : 'Låst',
234
+ 'dim' : 'Størrelser',
235
+ 'files' : 'Filer',
236
+ 'folders' : 'Mapper',
237
+ 'items' : 'Varer',
238
+ 'yes' : 'ja',
239
+ 'no' : 'nej',
240
+ 'link' : 'Link',
241
+ 'searcresult' : 'Søge resultater',
242
+ 'selected' : 'valgte varer',
243
+ 'about' : 'Om',
244
+ 'shortcuts' : 'Genveje',
245
+ 'help' : 'Hjælp',
246
+ 'webfm' : 'Internet fil manager',
247
+ 'ver' : 'Version',
248
+ 'protocolver' : 'protocol version',
249
+ 'homepage' : 'Projeckt side',
250
+ 'docs' : 'Dokumentation',
251
+ 'github' : 'Fork os på Github',
252
+ 'twitter' : 'Følg os på twitter',
253
+ 'facebook' : 'Følg os på facebook',
254
+ 'team' : 'Hold',
255
+ 'chiefdev' : 'hovede udvikler',
256
+ 'developer' : 'udvikler',
257
+ 'contributor' : 'bidragyder',
258
+ 'maintainer' : 'vedligeholder',
259
+ 'translator' : 'oversætter',
260
+ 'icons' : 'Ikoner',
261
+ 'dontforget' : 'og glemt ikke at tag dit håndklæde',
262
+ 'shortcutsof' : 'Gemveje deaktiveret',
263
+ 'dropFiles' : 'Drop filer hertil',
264
+ 'or' : 'eller',
265
+ 'selectForUpload' : 'Vælg filer at uploade',
266
+ 'moveFiles' : 'Flyt filer',
267
+ 'copyFiles' : 'Kopier filer',
268
+ 'rmFromPlaces' : 'Slet fra placering',
269
+ 'aspectRatio' : 'Skærmformat',
270
+ 'scale' : 'Skala',
271
+ 'width' : 'Bredte',
272
+ 'height' : 'Højde',
273
+ 'resize' : 'Ændre størrelse',
274
+ 'crop' : 'Beskær',
275
+ 'rotate' : 'Roter',
276
+ 'rotate-cw' : 'Roter 90 grader med uret',
277
+ 'rotate-ccw' : 'Roter 90 grader imod uret',
278
+ 'degree' : 'Grader',
279
+ 'netMountDialogTitle' : 'Monter netwærks volume', // added 18.04.2012
280
+ 'protocol' : 'Protokol', // added 18.04.2012
281
+ 'host' : 'Host', // added 18.04.2012
282
+ 'port' : 'Port', // added 18.04.2012
283
+ 'user' : 'Bruger', // added 18.04.2012
284
+ 'pass' : 'Kodeord', // added 18.04.2012
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'Ukendt',
288
+ 'kindFolder' : 'Mappe',
289
+ 'kindAlias' : 'Alias',
290
+ 'kindAliasBroken' : 'Ødelagt alias',
291
+ // applications
292
+ 'kindApp' : 'Applikation',
293
+ 'kindPostscript' : 'Postscript dokument',
294
+ 'kindMsOffice' : 'Microsoft Office dokument',
295
+ 'kindMsWord' : 'Microsoft Word dokument',
296
+ 'kindMsExcel' : 'Microsoft Excel dokument',
297
+ 'kindMsPP' : 'Microsoft Powerpoint præsentation',
298
+ 'kindOO' : 'Open Office dokument',
299
+ 'kindAppFlash' : 'Flash applikation',
300
+ 'kindPDF' : 'Flytbart Dokument Format (PDF)',
301
+ 'kindTorrent' : 'Bittorrent fil',
302
+ 'kind7z' : '7z arkiv',
303
+ 'kindTAR' : 'TAR arkiv',
304
+ 'kindGZIP' : 'GZIP arkiv',
305
+ 'kindBZIP' : 'BZIP arkiv',
306
+ 'kindXZ' : 'XZ arkiv',
307
+ 'kindZIP' : 'ZIP arkiv',
308
+ 'kindRAR' : 'RAR arkiv',
309
+ 'kindJAR' : 'Java JAR fil',
310
+ 'kindTTF' : 'True Type skrift',
311
+ 'kindOTF' : 'Open Type skrift',
312
+ 'kindRPM' : 'RPM pakke',
313
+ // texts
314
+ 'kindText' : 'Tekst dokument',
315
+ 'kindTextPlain' : 'Ren tekst',
316
+ 'kindPHP' : 'PHP kode',
317
+ 'kindCSS' : 'Cascading style sheet',
318
+ 'kindHTML' : 'HTML document',
319
+ 'kindJS' : 'Javascript kode',
320
+ 'kindRTF' : 'Rich Tekst Format',
321
+ 'kindC' : 'C kode',
322
+ 'kindCHeader' : 'C header kode',
323
+ 'kindCPP' : 'C++ kode',
324
+ 'kindCPPHeader' : 'C++ header kode',
325
+ 'kindShell' : 'Unix shell script',
326
+ 'kindPython' : 'Python kode',
327
+ 'kindJava' : 'Java kode',
328
+ 'kindRuby' : 'Ruby kode',
329
+ 'kindPerl' : 'Perl script',
330
+ 'kindSQL' : 'SQL kode',
331
+ 'kindXML' : 'XML dokument',
332
+ 'kindAWK' : 'AWK kode',
333
+ 'kindCSV' : 'Komma seperaret værdier',
334
+ 'kindDOCBOOK' : 'Docbook XML dokument',
335
+ // images
336
+ 'kindImage' : 'Billede',
337
+ 'kindBMP' : 'BMP billede',
338
+ 'kindJPEG' : 'JPEG billede',
339
+ 'kindGIF' : 'GIF billede',
340
+ 'kindPNG' : 'PNG billede',
341
+ 'kindTIFF' : 'TIFF billede',
342
+ 'kindTGA' : 'TGA billede',
343
+ 'kindPSD' : 'Adobe Photoshop billede',
344
+ 'kindXBITMAP' : 'X bitmap billede',
345
+ 'kindPXM' : 'Pixelmator billede',
346
+ // media
347
+ 'kindAudio' : 'Lyd medie',
348
+ 'kindAudioMPEG' : 'MPEG lyd',
349
+ 'kindAudioMPEG4' : 'MPEG-4 lyd',
350
+ 'kindAudioMIDI' : 'MIDI lyd',
351
+ 'kindAudioOGG' : 'Ogg Vorbis lyd',
352
+ 'kindAudioWAV' : 'WAV lyd',
353
+ 'AudioPlaylist' : 'MP3 spilleliste',
354
+ 'kindVideo' : 'Video medie',
355
+ 'kindVideoDV' : 'DV video',
356
+ 'kindVideoMPEG' : 'MPEG video',
357
+ 'kindVideoMPEG4' : 'MPEG-4 video',
358
+ 'kindVideoAVI' : 'AVI video',
359
+ 'kindVideoMOV' : 'Hurtig tids video',
360
+ 'kindVideoWM' : 'Windows Medie video',
361
+ 'kindVideoFlash' : 'Flash video',
362
+ 'kindVideoMKV' : 'Matroska video',
363
+ 'kindVideoOGG' : 'Ogg video'
364
+ }
365
+ };
366
+ }
elFinder/js/i18n/elfinder.de.js ADDED
@@ -0,0 +1,411 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * German translation
3
+ * @author JPG & Mace <dev@flying-datacenter.de>
4
+ * @author tora60 from pragmaMx.org
5
+ * @author Timo-Linde <info@timo-linde.de>
6
+ * @version 2015-11-16
7
+ */
8
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
9
+ elFinder.prototype.i18.de = {
10
+ translator : 'JPG & Mace &lt;dev@flying-datacenter.de&gt;, tora60 from pragmaMx.org, osworx.net',
11
+ language : 'Deutsch',
12
+ direction : 'ltr',
13
+ dateFormat : 'd. M Y h:i', // 13. Mai 2012 05:27
14
+ fancyDateFormat : '$1 h:i', // will produce smth like: Today 12:25 PM
15
+ messages : {
16
+
17
+ /********************************** errors **********************************/
18
+ 'error' : 'Fehler',
19
+ 'errUnknown' : 'Unbekannter Fehler.',
20
+ 'errUnknownCmd' : 'Unbekannter Befehl.',
21
+ 'errJqui' : 'Ungültige jQuery UI Konfiguration. Die Komponenten Selectable, draggable und droppable müssen inkludiert sein.',
22
+ 'errNode' : 'Für elFinder muss das DOM Element erstellt werden.',
23
+ 'errURL' : 'Ungültige elFinder Konfiguration! Die URL Option ist nicht gesetzt.',
24
+ 'errAccess' : 'Zugriff verweigert.',
25
+ 'errConnect' : 'Verbindung zum Backend fehlgeschlagen.',
26
+ 'errAbort' : 'Verbindung abgebrochen.',
27
+ 'errTimeout' : 'Zeitüberschreitung der Verbindung.',
28
+ 'errNotFound' : 'Backend nicht gefunden.',
29
+ 'errResponse' : 'Ungültige Backend Antwort.',
30
+ 'errConf' : 'Ungültige Backend Konfiguration.',
31
+ 'errJSON' : 'PHP JSON Modul nicht vorhanden.',
32
+ 'errNoVolumes' : 'Lesbare Volumes nicht vorhanden.',
33
+ 'errCmdParams' : 'Ungültige Parameter für Befehl: "$1".',
34
+ 'errDataNotJSON' : 'Daten nicht im JSON Format.',
35
+ 'errDataEmpty' : 'Daten sind leer.',
36
+ 'errCmdReq' : 'Backend Anfrage benötigt Befehl.',
37
+ 'errOpen' : 'Kann "$1" nicht öffnen.',
38
+ 'errNotFolder' : 'Objekt ist kein Ordner.',
39
+ 'errNotFile' : 'Objekt ist keine Datei.',
40
+ 'errRead' : 'Kann "$1" nicht öffnen.',
41
+ 'errWrite' : 'Kann nicht in "$1" schreiben.',
42
+ 'errPerm' : 'Zugriff verweigert.',
43
+ 'errLocked' : '"$1" ist gesperrt und kann nicht umbenannt, verschoben oder gelöscht werden.',
44
+ 'errExists' : 'Die Datei "$1" existiert bereits.',
45
+ 'errInvName' : 'Ungültiger Dateiname.',
46
+ 'errFolderNotFound' : 'Ordner nicht gefunden.',
47
+ 'errFileNotFound' : 'Datei nicht gefunden.',
48
+ 'errTrgFolderNotFound' : 'Zielordner "$1" nicht gefunden.',
49
+ 'errPopup' : 'Der Browser hat das Pop-Up-Fenster unterbunden. Um die Datei zu öffnen, Pop-Ups in den Browser Einstellungen aktivieren.',
50
+ 'errMkdir' : 'Kann Ordner "$1" nicht erstellen.',
51
+ 'errMkfile' : 'Kann Datei "$1" nicht erstellen.',
52
+ 'errRename' : 'Kann "$1" nicht umbenennen.',
53
+ 'errCopyFrom' : 'Kopieren von Dateien von "$1" nicht erlaubt.',
54
+ 'errCopyTo' : 'Kopieren von Dateien nach "$1" nicht erlaubt.',
55
+ 'errMkOutLink' : 'Der Link kann nicht außerhalb der Partition führen.',
56
+ 'errUpload' : 'Upload Fehler.',
57
+ 'errUploadFile' : 'Kann "$1" nicht hochladen.',
58
+ 'errUploadNoFiles' : 'Keine Dateien zum Hochladen gefunden.',
59
+ 'errUploadTotalSize' : 'Daten überschreiten die Maximalgröße.',
60
+ 'errUploadFileSize' : 'Die Datei überschreitet die Maximalgröße.',
61
+ 'errUploadMime' : 'Dateiart nicht zulässig.',
62
+ 'errUploadTransfer' : '"$1" Transfer Fehler.',
63
+ 'errUploadTemp' : 'Kann Temporäre Datei nicht erstellen.',
64
+ 'errNotReplace' : 'Das Objekt "$1" existiert bereits an dieser Stelle und kann nicht durch ein Objekt eines anderen Typs ersetzt werden.',
65
+ 'errReplace' : 'Kann "$1" nicht ersetzen.',
66
+ 'errSave' : 'Kann "$1" nicht speichern.',
67
+ 'errCopy' : 'Kann "$1" nicht kopieren.',
68
+ 'errMove' : 'Kann "$1" nicht verschieben.',
69
+ 'errCopyInItself' : '"$1" kann sich nicht in sich selbst kopieren.',
70
+ 'errRm' : 'Kann "$1" nicht entfernen.',
71
+ 'errRmSrc' : 'Kann Quelldatei(en) nicht entfernen.',
72
+ 'errExtract' : 'Kann "$1" nicht entpacken.',
73
+ 'errArchive' : 'Archiv konnte nicht erstellt werden.',
74
+ 'errArcType' : 'Archivtyp nicht untersützt.',
75
+ 'errNoArchive' : 'Bei der Datei handelt es sich nicht um ein Archiv oder der Archivtyp wird nicht unterstützt.',
76
+ 'errCmdNoSupport' : 'Das Backend unterstützt diesen Befehl nicht.',
77
+ 'errReplByChild' : 'Der Ordner "$1" kann nicht durch etwas ersetzt werden, das ihn selbst enthält.',
78
+ 'errArcSymlinks' : 'Aus Sicherheitsgründen ist es verboten, ein Archiv mit symbolischen Links zu extrahieren.',
79
+ 'errArcMaxSize' : 'Die Archiv Dateien übersteigen die maximal erlaubte Größe.',
80
+ 'errResize' : 'Größe von "$1" kann nicht geändert werden.',
81
+ 'errResizeDegree' : 'Ungültiger Rotationswert.',
82
+ 'errResizeRotate' : 'Bild konnte nicht gedreht werden.',
83
+ 'errResizeSize' : 'Ungültige Bildgröße.',
84
+ 'errResizeNoChange' : 'Bildmaße nicht geändert.',
85
+ 'errUsupportType' : 'Nicht unterstützte Dateiart.',
86
+ 'errNotUTF8Content' : 'Die Datei "$1" ist nicht im UTF-8 Format und kann nicht editiert werden.',
87
+ 'errNetMount' : 'Verbindung mit "$1" nicht möglich.',
88
+ 'errNetMountNoDriver' : 'Nicht unterstütztes Protokoll.',
89
+ 'errNetMountFailed' : 'Verbindung fehlgeschlagen.',
90
+ 'errNetMountHostReq' : 'Host benötigt.',
91
+ 'errSessionExpires' : 'Diese Sitzung ist aufgrund von Inaktivität abgelaufen.',
92
+ 'errCreatingTempDir' : 'Erstellung des temporären Ordners nicht möglich: "$1"',
93
+ 'errFtpDownloadFile' : 'Download der Datei über FTP nicht möglich: "$1"',
94
+ 'errFtpUploadFile' : 'Upload der Datei zu FTP nicht möglich: "$1"',
95
+ 'errFtpMkdir' : 'Erstellung des Remote-Ordners auf FTP nicht möglich: "$1"',
96
+ 'errArchiveExec' : 'Fehler beim archivieren der Dateien: "$1"',
97
+ 'errExtractExec' : 'Fehler beim extrahieren der Dateien: "$1"',
98
+ 'errNetUnMount' : 'Kann nicht ausgeworfen werden.',
99
+ 'errConvUTF8' : 'Kann nicht zu UTF-8 konvertiert werden.',
100
+ 'errFolderUpload' : 'Versuchen Sie es mit Google Chrome, wenn Sie einen Ordner hochladen möchten.',
101
+
102
+ /******************************* commands names ********************************/
103
+ 'cmdarchive' : 'Archiv erstellen',
104
+ 'cmdback' : 'Zurück',
105
+ 'cmdcopy' : 'Kopieren',
106
+ 'cmdcut' : 'Ausschneiden',
107
+ 'cmddownload' : 'Herunterladen',
108
+ 'cmdduplicate' : 'Duplizieren',
109
+ 'cmdedit' : 'Datei bearbeiten',
110
+ 'cmdextract' : 'Archiv entpacken',
111
+ 'cmdforward' : 'Vorwärts',
112
+ 'cmdgetfile' : 'Datei auswählen',
113
+ 'cmdhelp' : 'Über diese Software',
114
+ 'cmdhome' : 'Startordner',
115
+ 'cmdinfo' : 'Informationen',
116
+ 'cmdmkdir' : 'Neuer Ordner',
117
+ 'cmdmkfile' : 'Neue Textdatei',
118
+ 'cmdopen' : 'Öffnen',
119
+ 'cmdpaste' : 'Einfügen',
120
+ 'cmdquicklook' : 'Vorschau',
121
+ 'cmdreload' : 'Aktualisieren',
122
+ 'cmdrename' : 'Umbenennen',
123
+ 'cmdrm' : 'Löschen',
124
+ 'cmdsearch' : 'Suchen',
125
+ 'cmdup' : 'In übergeordneten Ordner wechseln',
126
+ 'cmdupload' : 'Datei hochladen',
127
+ 'cmdview' : 'Ansehen',
128
+ 'cmdresize' : 'Größe ändern & drehen',
129
+ 'cmdsort' : 'Sortieren',
130
+ 'cmdnetmount' : 'Verbinde mit Netzwerkspeicher',
131
+ 'cmdnetunmount': 'Auswerfen',
132
+ 'cmdplaces' : 'Orte',
133
+ 'cmdchmod' : 'Berechtigung ändern',
134
+
135
+
136
+ /*********************************** buttons ***********************************/
137
+ 'btnClose' : 'Schließen',
138
+ 'btnSave' : 'Speichern',
139
+ 'btnRm' : 'Entfernen',
140
+ 'btnApply' : 'Anwenden',
141
+ 'btnCancel' : 'Abbrechen',
142
+ 'btnNo' : 'Nein',
143
+ 'btnYes' : 'Ja',
144
+ 'btnMount' : 'Verbinden',
145
+ 'btnApprove': 'Goto $1 & approve',
146
+ 'btnUnmount': 'Auswerfen',
147
+ 'btnConv' : 'Konvertieren',
148
+ 'btnCwd' : 'Arbeitspfad',
149
+ 'btnVolume' : 'Partition',
150
+ 'btnAll' : 'Alle',
151
+ 'btnMime' : 'MIME Typ',
152
+ 'btnFileName':'Dateiname',
153
+ 'btnSaveClose': 'Speichern & Schließen',
154
+
155
+ /******************************** notifications ********************************/
156
+ 'ntfopen' : 'Öffne Ordner',
157
+ 'ntffile' : 'Öffne Datei',
158
+ 'ntfreload' : 'Ordnerinhalt neu',
159
+ 'ntfmkdir' : 'Erstelle Ordner',
160
+ 'ntfmkfile' : 'Erstelle Dateien',
161
+ 'ntfrm' : 'Lösche Dateien',
162
+ 'ntfcopy' : 'Kopiere Dateien',
163
+ 'ntfmove' : 'Verschiebe Dateien',
164
+ 'ntfprepare' : 'Kopiervorgang initialisieren',
165
+ 'ntfrename' : 'Benenne Dateien um',
166
+ 'ntfupload' : 'Dateien hochladen',
167
+ 'ntfdownload' : 'Dateien herunterladen',
168
+ 'ntfsave' : 'Speichere Datei',
169
+ 'ntfarchive' : 'Erstelle Archiv',
170
+ 'ntfextract' : 'Entpacke Dateien',
171
+ 'ntfsearch' : 'Suche',
172
+ 'ntfresize' : 'Bildgrößen ändern',
173
+ 'ntfsmth' : 'Bin beschäftigt',
174
+ 'ntfloadimg' : 'Bild laden',
175
+ 'ntfnetmount' : 'Mit Netzwerkspeicher verbinden',
176
+ 'ntfnetunmount': 'Netzwerkspeicher auswerfen',
177
+ 'ntfdim' : 'Bildgröße erfassen',
178
+ 'ntfreaddir' : 'Lese Ordner Informationen',
179
+ 'ntfurl' : 'Hole URL von Link',
180
+ 'ntfchmod' : 'Ändere Datei berechtigungen',
181
+
182
+ /************************************ dates **********************************/
183
+ 'dateUnknown' : 'unbekannt',
184
+ 'Today' : 'Heute',
185
+ 'Yesterday' : 'Gestern',
186
+ 'msJan' : 'Jan',
187
+ 'msFeb' : 'Feb',
188
+ 'msMar' : 'Mär',
189
+ 'msApr' : 'Apr',
190
+ 'msMay' : 'Mai',
191
+ 'msJun' : 'Jun',
192
+ 'msJul' : 'Jul',
193
+ 'msAug' : 'Aug',
194
+ 'msSep' : 'Sep',
195
+ 'msOct' : 'Okt',
196
+ 'msNov' : 'Nov',
197
+ 'msDec' : 'Dez',
198
+ 'January' : 'Januar',
199
+ 'February' : 'Februar',
200
+ 'March' : 'März',
201
+ 'April' : 'April',
202
+ 'May' : 'Mai',
203
+ 'June' : 'Juni',
204
+ 'July' : 'Juli',
205
+ 'August' : 'August',
206
+ 'September' : 'September',
207
+ 'October' : 'Oktober',
208
+ 'November' : 'November',
209
+ 'December' : 'Dezember',
210
+ 'Sunday' : 'Sonntag',
211
+ 'Monday' : 'Montag',
212
+ 'Tuesday' : 'Dienstag',
213
+ 'Wednesday' : 'Mittwoch',
214
+ 'Thursday' : 'Donnerstag',
215
+ 'Friday' : 'Freitag',
216
+ 'Saturday' : 'Samstag',
217
+ 'Sun' : 'So',
218
+ 'Mon' : 'Mo',
219
+ 'Tue' : 'Di',
220
+ 'Wed' : 'Mi',
221
+ 'Thu' : 'Do',
222
+ 'Fri' : 'Fr',
223
+ 'Sat' : 'Sa',
224
+
225
+ /******************************** sort variants ********************************/
226
+ 'sortname' : 'nach Name',
227
+ 'sortkind' : 'nach Art',
228
+ 'sortsize' : 'nach Größe',
229
+ 'sortdate' : 'nach Datum',
230
+ 'sortFoldersFirst' : 'Ordner zuerst',
231
+
232
+ /********************************** new items **********************************/
233
+ 'untitled file.txt' : 'Neues Textdokument.txt',
234
+ 'untitled folder' : 'Neuer Ordner',
235
+ 'Archive' : 'Neues Archiv',
236
+
237
+ /********************************** messages **********************************/
238
+ 'confirmReq' : 'Bestätigung benötigt',
239
+ 'confirmRm' : 'Sollen die Dateien gelöscht werden?<br/>Dies kann nicht rückgängig gemacht werden!',
240
+ 'confirmConvUTF8' : 'Nicht in UTF-8<br/>Zu UTF-8 konvertieren?<br/>Inhalte werden zu UTF-8 konvertiert wenn Sie speichern.',
241
+ 'confirmNotSave' : 'Die Datei wurde geändert.<br/>Sie werden die Änderungen verlieren wenn Sie nicht speichern.',
242
+ 'confirmRepl' : 'Datei ersetzen?',
243
+ 'apllyAll' : 'Alles bestätigen',
244
+ 'name' : 'Name',
245
+ 'size' : 'Größe',
246
+ 'perms' : 'Berechtigungen',
247
+ 'modify' : 'Änderungsdatum',
248
+ 'kind' : 'Typ',
249
+ 'read' : 'lesen',
250
+ 'write' : 'schreiben',
251
+ 'noaccess' : 'Kein Zugriff',
252
+ 'and' : 'und',
253
+ 'unknown' : 'unbekannt',
254
+ 'selectall' : 'Alle Dateien auswählen',
255
+ 'selectfiles' : 'Dateien auswählen',
256
+ 'selectffile' : 'Erste Datei auswählen',
257
+ 'selectlfile' : 'Letzte Datei auswählen',
258
+ 'viewlist' : 'Spaltenansicht',
259
+ 'viewicons' : 'Symbolansicht',
260
+ 'places' : 'Orte',
261
+ 'calc' : 'Berechne',
262
+ 'path' : 'Pfad',
263
+ 'aliasfor' : 'Verknüpfung zu',
264
+ 'locked' : 'Gesperrt',
265
+ 'dim' : 'Bildgröße',
266
+ 'files' : 'Dateien',
267
+ 'folders' : 'Ordner',
268
+ 'items' : 'Objekte',
269
+ 'yes' : 'ja',
270
+ 'no' : 'nein',
271
+ 'link' : 'Link',
272
+ 'searcresult' : 'Suchergebnisse',
273
+ 'selected' : 'Objekte ausgewählt',
274
+ 'about' : 'Über',
275
+ 'shortcuts' : 'Tastenkombinationen',
276
+ 'help' : 'Hilfe',
277
+ 'webfm' : 'Web Dateiverwaltung',
278
+ 'ver' : 'Version',
279
+ 'protocolver' : 'Protokoll Version',
280
+ 'homepage' : 'Projekt Webseite',
281
+ 'docs' : 'Dokumentation',
282
+ 'github' : 'Forke uns auf Github',
283
+ 'twitter' : 'Folge uns auf twitter',
284
+ 'facebook' : 'Begleite uns auf facebook',
285
+ 'team' : 'Team',
286
+ 'chiefdev' : 'Chefentwickler',
287
+ 'developer' : 'Entwickler',
288
+ 'contributor' : 'Unterstützer',
289
+ 'maintainer' : 'Maintainer',
290
+ 'translator' : 'Übersetzer',
291
+ 'icons' : 'Icons',
292
+ 'dontforget' : 'und vergiss dein Handtuch nicht',
293
+ 'shortcutsof' : 'Tastenkombinationen deaktiviert',
294
+ 'dropFiles' : 'Dateien hier ablegen',
295
+ 'or' : 'oder',
296
+ 'selectForUpload' : 'Dateien zum Upload auswählen',
297
+ 'moveFiles' : 'Dateien verschieben',
298
+ 'copyFiles' : 'Dateien kopieren',
299
+ 'rmFromPlaces' : 'Lösche von Orten',
300
+ 'aspectRatio' : 'Seitenverhältnis',
301
+ 'scale' : 'Maßstab',
302
+ 'width' : 'Breite',
303
+ 'height' : 'Höhe',
304
+ 'resize' : 'Größe ändern',
305
+ 'crop' : 'Zuschneiden',
306
+ 'rotate' : 'Drehen',
307
+ 'rotate-cw' : 'Drehe 90° im Uhrzeigersinn',
308
+ 'rotate-ccw' : 'Drehe 90° gegen Uhrzeigersinn',
309
+ 'degree' : '°',
310
+ 'netMountDialogTitle' : 'verbinde Netzwerkspeicher',
311
+ 'protocol' : 'Protokoll',
312
+ 'host' : 'Host',
313
+ 'port' : 'Port',
314
+ 'user' : 'Benutzer',
315
+ 'pass' : 'Passwort',
316
+ 'confirmUnmount' : 'Möchten Sie "$1" auswerfen?',
317
+ 'dropFilesBrowser': 'Sie können Dateien in den Browser ziehen',
318
+ 'dropPasteFiles' : 'Lassen Sie die Dateien hier Los',
319
+ 'encoding' : 'Codierung',
320
+ 'locale' : 'Locale',
321
+ 'searchTarget' : 'Ziel: $1',
322
+ 'searchMime' : 'Suche nach MIME Typ',
323
+ 'owner' : 'Besitzer',
324
+ 'group' : 'Gruppe',
325
+ 'other' : 'Andere',
326
+ 'execute' : 'Ausführen',
327
+ 'perm' : 'Berechtigung',
328
+ 'mode' : 'Modus',
329
+
330
+ /********************************** mimetypes **********************************/
331
+ 'kindUnknown' : 'Unbekannt',
332
+ 'kindFolder' : 'Ordner',
333
+ 'kindAlias' : 'Verknüpfung',
334
+ 'kindAliasBroken' : 'Defekte Verknüpfung',
335
+ // applications
336
+ 'kindApp' : 'Programm',
337
+ 'kindPostscript' : 'Postscript Dokument',
338
+ 'kindMsOffice' : 'Microsoft Office Dokument',
339
+ 'kindMsWord' : 'Microsoft Word Dokument',
340
+ 'kindMsExcel' : 'Microsoft Excel Dokument',
341
+ 'kindMsPP' : 'Microsoft Powerpoint Präsentation',
342
+ 'kindOO' : 'Open Office Dokument',
343
+ 'kindAppFlash' : 'Flash Programm',
344
+ 'kindPDF' : 'Portables Dokumentenformat (PDF)',
345
+ 'kindTorrent' : 'Bittorrent Datei',
346
+ 'kind7z' : '7z Archiv',
347
+ 'kindTAR' : 'TAR Archiv',
348
+ 'kindGZIP' : 'GZIP Archiv',
349
+ 'kindBZIP' : 'BZIP Archiv',
350
+ 'kindXZ' : 'XZ Archiv',
351
+ 'kindZIP' : 'ZIP Archiv',
352
+ 'kindRAR' : 'RAR Archiv',
353
+ 'kindJAR' : 'Java JAR Datei',
354
+ 'kindTTF' : 'True Type Schrift',
355
+ 'kindOTF' : 'Open Type Schrift',
356
+ 'kindRPM' : 'RPM Paket',
357
+ // texts
358
+ 'kindText' : 'Text Dokument',
359
+ 'kindTextPlain' : 'Text Dokument',
360
+ 'kindPHP' : 'PHP Quelltext',
361
+ 'kindCSS' : 'Cascading Stylesheet',
362
+ 'kindHTML' : 'HTML Dokument',
363
+ 'kindJS' : 'Javascript Quelltext',
364
+ 'kindRTF' : 'Formatierte Textdatei',
365
+ 'kindC' : 'C Quelltext',
366
+ 'kindCHeader' : 'C Header Quelltext',
367
+ 'kindCPP' : 'C++ Quelltext',
368
+ 'kindCPPHeader' : 'C++ Header Quelltext',
369
+ 'kindShell' : 'Unix-Shell-Skript',
370
+ 'kindPython' : 'Python Quelltext',
371
+ 'kindJava' : 'Java Quelltext',
372
+ 'kindRuby' : 'Ruby Quelltext',
373
+ 'kindPerl' : 'Perl Script',
374
+ 'kindSQL' : 'SQL Quelltext',
375
+ 'kindXML' : 'XML Dokument',
376
+ 'kindAWK' : 'AWK Quelltext',
377
+ 'kindCSV' : 'Komma getrennte Daten',
378
+ 'kindDOCBOOK' : 'Docbook XML Dokument',
379
+ 'kindMarkdown' : 'Markdown Text',
380
+ // images
381
+ 'kindImage' : 'Bild',
382
+ 'kindBMP' : 'Bitmap Bild',
383
+ 'kindJPEG' : 'JPEG Bild',
384
+ 'kindGIF' : 'GIF Bild',
385
+ 'kindPNG' : 'PNG Bild',
386
+ 'kindTIFF' : 'TIFF Bild',
387
+ 'kindTGA' : 'TGA Bild',
388
+ 'kindPSD' : 'Adobe Photoshop Dokument',
389
+ 'kindXBITMAP' : 'X Bitmap Bild',
390
+ 'kindPXM' : 'Pixelmator Bild',
391
+ // media
392
+ 'kindAudio' : 'Audiodatei',
393
+ 'kindAudioMPEG' : 'MPEG Audio',
394
+ 'kindAudioMPEG4' : 'MPEG-4 Audio',
395
+ 'kindAudioMIDI' : 'MIDI Audio',
396
+ 'kindAudioOGG' : 'Ogg Vorbis Audio',
397
+ 'kindAudioWAV' : 'WAV Audio',
398
+ 'AudioPlaylist' : 'MP3 Playlist',
399
+ 'kindVideo' : 'Videodatei',
400
+ 'kindVideoDV' : 'DV Film',
401
+ 'kindVideoMPEG' : 'MPEG Film',
402
+ 'kindVideoMPEG4' : 'MPEG-4 Film',
403
+ 'kindVideoAVI' : 'AVI Film',
404
+ 'kindVideoMOV' : 'Quick Time Film',
405
+ 'kindVideoWM' : 'Windows Media Film',
406
+ 'kindVideoFlash' : 'Flash Film',
407
+ 'kindVideoMKV' : 'Matroska Film',
408
+ 'kindVideoOGG' : 'Ogg Film'
409
+ }
410
+ };
411
+ }
elFinder/js/i18n/elfinder.el.js ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Greek translation
3
+ * @author yawd <info@yawd.eu>, Romanos
4
+ * @version 2014-12-19
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.el = {
8
+ translator : 'yawd &lt;ingo@yawd.eu&gt;',
9
+ language : 'Ελληνικά',
10
+ direction : 'ltr',
11
+ dateFormat : 'd.m.Y H:i',
12
+ fancyDateFormat : '$1 H:i',
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'Πρόβλημα',
17
+ 'errUnknown' : 'Άγνωστο πρόβλημα.',
18
+ 'errUnknownCmd' : 'Άγνωστη εντολή.',
19
+ 'errJqui' : 'Μη έγκυρη ρύθμιση του jQuery UI. Τα components "selectable", "draggable" και "droppable" πρέπει να περιληφούν.',
20
+ 'errNode' : 'το elFinder χρειάζεται να έχει δημιουργηθεί το DOM Element.',
21
+ 'errURL' : 'Μη έγκυρες ρυθμίσεις για το elFinder! η επιλογή URL δεν έχει οριστεί.',
22
+ 'errAccess' : 'Απαγορεύεται η πρόσβαση.',
23
+ 'errConnect' : 'Δεν ήταν δυνατή η σύνδεση με το backend.',
24
+ 'errAbort' : 'Η σύνδεση εγκαταλείφθηκε.',
25
+ 'errTimeout' : 'Η σύνδεση έληξε.',
26
+ 'errNotFound' : 'Δε βρέθηκε το backend.',
27
+ 'errResponse' : 'Μή έγκυρη απάντηση από το backend.',
28
+ 'errConf' : 'Μη έγκυρες ρυθμίσεις για το backend.',
29
+ 'errJSON' : 'Το PHP JSON module δεν είναι εγκατεστημένο.',
30
+ 'errNoVolumes' : 'Δεν βρέθηκαν αναγνώσιμα volumes.',
31
+ 'errCmdParams' : 'Μη έγκυρες παράμετροι για την εντολή "$1".',
32
+ 'errDataNotJSON' : 'Τα δεδομένα δεν είναι JSON.',
33
+ 'errDataEmpty' : 'Τα δεδομένα είναι άδεια.',
34
+ 'errCmdReq' : 'Το Backend request χρειάζεται όνομα εντολής.',
35
+ 'errOpen' : 'Δεν ήταν δυνατό να ανοίξει το "$1".',
36
+ 'errNotFolder' : 'Το αντικείμενο δεν είναι φάκελος.',
37
+ 'errNotFile' : 'Το αντικείμενο δεν είναι αρχείο.',
38
+ 'errRead' : 'Δεν ήταν δυνατόν να διαβαστεί το "$1".',
39
+ 'errWrite' : 'Δεν ήταν δυνατή η εγγραφή στο "$1".',
40
+ 'errPerm' : 'Απαγορεύεται η πρόσβαση.',
41
+ 'errLocked' : '"$1" είναι κλειδωμένο και δεν μπορεί να μετονομαστεί, μετακινηθεί ή διαγραφεί.',
42
+ 'errExists' : 'Το αρχείο με όνομα "$1" υπάρχει ήδη.',
43
+ 'errInvName' : 'Μη έγκυρο όνομα αρχείου.',
44
+ 'errFolderNotFound' : 'Ο φάκελος δε βρέθηκε.',
45
+ 'errFileNotFound' : 'Το αρχείο δε βρέθηκε.',
46
+ 'errTrgFolderNotFound' : 'Ο φάκελος "$1" δε βρέθηκε.',
47
+ 'errPopup' : 'Το πρόγραμμα πλήγησης εμπόδισε το άνοιγμα αναδυόμενου παραθύρου. Για ανοίξετε το αρχείο ενεργοποιήστε το στις επιλογές του περιηγητή.',
48
+ 'errMkdir' : 'Η δυμιουργία του φακέλου "$1" δεν ήταν δυνατή.',
49
+ 'errMkfile' : 'Η δημιουργία του αρχείου "$1" δεν ήταν δυνατή.',
50
+ 'errRename' : 'Η μετονομασία του αρχείου "$1" δεν ήταν δυνατή.',
51
+ 'errCopyFrom' : 'Δεν επιτρέπεται η αντιγραφή αρχείων από το volume "$1".',
52
+ 'errCopyTo' : 'Δεν επιτρέπεται η αντιγραφή αρχείων στο volume "$1".',
53
+ 'errUpload' : 'Πρόβλημα κατά το upload.',
54
+ 'errUploadFile' : 'Το αρχείο "$1" δεν μπόρεσε να γίνει upload.',
55
+ 'errUploadNoFiles' : 'Δεν βρέθηκαν αρχεία για upload.',
56
+ 'errUploadTotalSize' : 'Τα δεδομένα υπερβαίνουν το επιτρεπόμενο μέγιστο μέγεθος δεδομένων.',
57
+ 'errUploadFileSize' : 'Το αρχείο υπερβαίνει το επιτρεπόμενο μέγιστο μέγεθος.',
58
+ 'errUploadMime' : 'Ο τύπος αρχείου δεν επιτρέπεται.',
59
+ 'errUploadTransfer' : 'Πρόβλημα μεταφοράς για το "$1".',
60
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.',
61
+ 'errReplace' : 'Unable to replace "$1".',
62
+ 'errSave' : 'Το "$1" δεν ήταν δυνατόν να αποθηκευτεί.',
63
+ 'errCopy' : 'Δεν ήταν δυνατή η αντιγραφή του "$1".',
64
+ 'errMove' : 'Δεν ήταν δυνατή η μετακίνηση του "$1".',
65
+ 'errCopyInItself' : 'Δεν είναι δυνατή η αντιγραφή του "$1" στον εαυτό του.',
66
+ 'errRm' : 'Δεν ήταν δυνατή η αφαίρεση του "$1".',
67
+ 'errRmSrc' : 'Unable remove source file(s).',
68
+ 'errExtract' : 'Δεν ήταν δυνατή η ανάγνωση των αρχείων από "$1".',
69
+ 'errArchive' : 'Δεν ήταν δυνατή η δημιουργία του αρχείου.',
70
+ 'errArcType' : 'Ο τύπος αρχείου δεν υποστηρίζεται.',
71
+ 'errNoArchive' : 'Το αρχείο δεν είναι έγκυρο ή δεν υποστηρίζεται ο τύπος του.',
72
+ 'errCmdNoSupport' : 'Το backend δεν υποστηρίζει αυτή την εντολή.',
73
+ 'errReplByChild' : 'Ο φάκελος “$1” δεν μπορεί να αντικατασταθεί από οποιοδήποτε αρχείο περιέχεται σε αυτόν.',
74
+ 'errArcSymlinks' : 'Για λόγους ασφαλείας δεν είναι δυνατόν να διαβαστούν αρχεία που περιέχουν symlinks orη αρχεία με μη επιτρεπτά ονόματα.', // edited 24.06.2012
75
+ 'errArcMaxSize' : 'Το μέγεθος του αρχείου υπερβαίνει το μέγιστο επιτρεπτό όριο.',
76
+ 'errResize' : 'Δεν ήταν δυνατή η αλλαγή μεγέθους του "$1".',
77
+ 'errResizeDegree' : 'Invalid rotate degree.',
78
+ 'errResizeRotate' : 'Unable to rotate image.',
79
+ 'errResizeSize' : 'Invalid image size.',
80
+ 'errResizeNoChange' : 'Image size not changed.',
81
+ 'errUsupportType' : 'Ο τύπος αρχείου δεν υποστηρίζεται.',
82
+ 'errNotUTF8Content' : 'Το αρχείο "$1" δεν είναι UTF-8 και δεν μπορεί να επεξεργασθεί.', // added 9.11.2011
83
+ 'errNetMount' : 'Δεν ήταν δυνατή η φόρτωση του "$1".', // added 17.04.2012
84
+ 'errNetMountNoDriver' : 'Μη υποστηριζόμενο πρωτόκολο.', // added 17.04.2012
85
+ 'errNetMountFailed' : 'Η φόρτωση απέτυχε.', // added 17.04.2012
86
+ 'errNetMountHostReq' : 'Απαιτείται host εξυπηρετητής.', // added 18.04.2012
87
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
88
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
89
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
90
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
91
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
92
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
93
+ 'errExtractExec' : 'Error while extracting files: "$1"',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'Δημιουργία archive αρχείου',
97
+ 'cmdback' : 'Πίσω',
98
+ 'cmdcopy' : 'Αντιγραφή',
99
+ 'cmdcut' : 'Αφαίρεση',
100
+ 'cmddownload' : 'Μεταφόρτωση',
101
+ 'cmdduplicate' : 'Αντίγραφο',
102
+ 'cmdedit' : 'Επεξεργασία αρχείου',
103
+ 'cmdextract' : 'Εξαγωγή αρχείων από archive',
104
+ 'cmdforward' : 'Προώθηση',
105
+ 'cmdgetfile' : 'Επιλέξτε αρχεία',
106
+ 'cmdhelp' : 'Σχετικά με αυτό το λογισμικό',
107
+ 'cmdhome' : 'Home',
108
+ 'cmdinfo' : 'Πληροφορίες',
109
+ 'cmdmkdir' : 'Νέος φάκελος',
110
+ 'cmdmkfile' : 'Νέο αρχείο κειμένου',
111
+ 'cmdopen' : 'Άνοιγμα',
112
+ 'cmdpaste' : 'Επικόλληση',
113
+ 'cmdquicklook' : 'Προεπισκόπηση',
114
+ 'cmdreload' : 'Ανανέωση',
115
+ 'cmdrename' : 'Μετονομασία',
116
+ 'cmdrm' : 'Διαγραφή',
117
+ 'cmdsearch' : 'Έυρεση αρχείων',
118
+ 'cmdup' : 'Μετάβαση στο γονικό φάκελο',
119
+ 'cmdupload' : 'Ανέβασμα αρχείων',
120
+ 'cmdview' : 'Προβολή',
121
+ 'cmdresize' : 'Αλλαγή μεγέθους εικόνας',
122
+ 'cmdsort' : 'Ταξινόμηση',
123
+ 'cmdnetmount' : 'Mount network volume',
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'Κλείσιμο',
127
+ 'btnSave' : 'Αποθήκευση',
128
+ 'btnRm' : 'Αφαίρεση',
129
+ 'btnApply' : 'Εφαρμογή',
130
+ 'btnCancel' : 'Ακύρωση',
131
+ 'btnNo' : 'Όχι',
132
+ 'btnYes' : 'Ναι',
133
+ 'btnMount' : 'Mount',
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'Άνοιγμα φακέλου',
137
+ 'ntffile' : 'Άνοιγμα αρχείου',
138
+ 'ntfreload' : 'Ανανέωση περιεχομένων φακέλου',
139
+ 'ntfmkdir' : 'Δημιουργία φακέλου',
140
+ 'ntfmkfile' : 'Δημιουργία αρχείων',
141
+ 'ntfrm' : 'Διαγραφή αρχείων',
142
+ 'ntfcopy' : 'Αντιγραφή αρχείων',
143
+ 'ntfmove' : 'Μετακίνηση αρχείων',
144
+ 'ntfprepare' : 'Προετοιμασία αντιγραφής αρχείων',
145
+ 'ntfrename' : 'Μετονομασία αρχείων',
146
+ 'ntfupload' : 'Ανέβασμα αρχείων',
147
+ 'ntfdownload' : 'Μεταφόρτωση αρχείων',
148
+ 'ntfsave' : 'Αποθήκευση αρχείων',
149
+ 'ntfarchive' : 'Δημιουργία αρχείου',
150
+ 'ntfextract' : 'Εξαγωγή αρχείων από το archive',
151
+ 'ntfsearch' : 'Αναζήτηση αρχείων',
152
+ 'ntfresize' : 'Resizing images',
153
+ 'ntfsmth' : 'Σύστημα απασχολημένο>_<',
154
+ 'ntfloadimg' : 'Φόρτωση εικόνας',
155
+ 'ntfnetmount' : 'Φόρτωση δικτυακού δίσκου', // added 18.04.2012
156
+ 'ntfdim' : 'Acquiring image dimension',
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'άγνωστο',
160
+ 'Today' : 'Σήμερα',
161
+ 'Yesterday' : 'Χθές',
162
+ 'msJan' : 'Ιαν',
163
+ 'msFeb' : 'Φεβ',
164
+ 'msMar' : 'Μαρ',
165
+ 'msApr' : 'Απρ',
166
+ 'msMay' : 'Μαϊ',
167
+ 'msJun' : 'Ιουν',
168
+ 'msJul' : 'Ιουλ',
169
+ 'msAug' : 'Αυγ',
170
+ 'msSep' : 'Σεπ',
171
+ 'msOct' : 'Οκτ',
172
+ 'msNov' : 'Νοεμ',
173
+ 'msDec' : 'Δεκ',
174
+ 'January' : 'Ιανουάριος',
175
+ 'February' : 'Φεβρουάριος',
176
+ 'March' : 'Μάρτιος',
177
+ 'April' : 'Απρίλιος',
178
+ 'May' : 'Μάϊος',
179
+ 'June' : 'Ιούνιος',
180
+ 'July' : 'Ιούλιος',
181
+ 'August' : 'Αύγουστος',
182
+ 'September' : 'Σεπτέμβριος',
183
+ 'October' : 'Οκτώβριος',
184
+ 'November' : 'Νοέμβριος',
185
+ 'December' : 'Δεκέμβριος',
186
+ 'Sunday' : 'Κυριακή',
187
+ 'Monday' : 'Δευτέρα',
188
+ 'Tuesday' : 'Τρίτη',
189
+ 'Wednesday' : 'Τετάρτη',
190
+ 'Thursday' : 'Πέμπτη',
191
+ 'Friday' : 'Παρασκευή',
192
+ 'Saturday' : 'Σάββατο',
193
+ 'Sun' : 'Κυρ',
194
+ 'Mon' : 'Δευ',
195
+ 'Tue' : 'Τρ',
196
+ 'Wed' : 'Τετ',
197
+ 'Thu' : 'Πεμ',
198
+ 'Fri' : 'Παρ',
199
+ 'Sat' : 'Σαβ',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'κατά όνομα',
203
+ 'sortkind' : 'κατά είδος',
204
+ 'sortsize' : 'κατά μέγεθος',
205
+ 'sortdate' : 'κατά ημερομηνία',
206
+ 'sortFoldersFirst' : 'Πρώτα οι φάκελοι', // added 22.06.2012
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'Απαιτείται επιβεβαίωση',
210
+ 'confirmRm' : 'Είστε σίγουροι πως θέλετε να διαγράψετε τα αρχεία?<br/>Οι αλλαγές θα είναι μόνιμες!',
211
+ 'confirmRepl' : 'Αντικατάσταση του παλιού αρχείου με το νέο?',
212
+ 'apllyAll' : 'Εφαρμογή σε όλα',
213
+ 'name' : 'Όνομα',
214
+ 'size' : 'Μέγεθος',
215
+ 'perms' : 'Δικαιώματα',
216
+ 'modify' : 'Τροποποιήθηκε',
217
+ 'kind' : 'Είδος',
218
+ 'read' : 'ανάγνωση',
219
+ 'write' : 'εγγραφή',
220
+ 'noaccess' : 'δεν υπάρχει πρόσβαση',
221
+ 'and' : 'και',
222
+ 'unknown' : 'άγνωστο',
223
+ 'selectall' : 'Επιλογή όλων',
224
+ 'selectfiles' : 'Επιλογή αρχείων',
225
+ 'selectffile' : 'Επιλογή πρώτου αρχείου',
226
+ 'selectlfile' : 'Επιλογή τελευταίου αρχείου',
227
+ 'viewlist' : 'Προβολή λίστας',
228
+ 'viewicons' : 'Προβολή εικονιδίων',
229
+ 'places' : 'Τοποθεσίες',
230
+ 'calc' : 'Υπολογισμός',
231
+ 'path' : 'Διαδρομή',
232
+ 'aliasfor' : 'Ψευδώνυμο για',
233
+ 'locked' : 'Κλειδωμένο',
234
+ 'dim' : 'Διαστάσεις',
235
+ 'files' : 'Αρχεία',
236
+ 'folders' : 'Φάκελοι',
237
+ 'items' : 'Αντικείμενα',
238
+ 'yes' : 'ναι',
239
+ 'no' : 'όχι',
240
+ 'link' : 'Σύνδεσμος',
241
+ 'searcresult' : 'Αποτελέσματα αναζήτησης',
242
+ 'selected' : 'επιλεγμένα αντικείμενα',
243
+ 'about' : 'Σχετικά',
244
+ 'shortcuts' : 'Συντομεύσεις',
245
+ 'help' : 'Βοήθεια',
246
+ 'webfm' : 'εργαλείο διαχείρισης αρχείων από το web',
247
+ 'ver' : 'Έκδοση',
248
+ 'protocolver' : 'έκδοση πρωτοκόλλου',
249
+ 'homepage' : 'Σελίδα του project',
250
+ 'docs' : 'Τεκμηρίωση (documentation)',
251
+ 'github' : 'Κάντε μας fork στο Github',
252
+ 'twitter' : 'Ακολουθήστε μας στο twitter',
253
+ 'facebook' : 'Βρείτε μας στο facebook',
254
+ 'team' : 'Ομάδα',
255
+ 'chiefdev' : 'κύριος προγραμματιστής',
256
+ 'developer' : 'προγραμματιστής',
257
+ 'contributor' : 'συνεισφορά',
258
+ 'maintainer' : 'συντηρητής',
259
+ 'translator' : 'μεταφραστής',
260
+ 'icons' : 'Εικονίδια',
261
+ 'dontforget' : 'και μην ξεχάσεις την πετσέτα σου!',
262
+ 'shortcutsof' : 'Οι συντομεύσεις είναι απενεργοποιημένες',
263
+ 'dropFiles' : 'Κάντε drop τα αρχεία εδώ',
264
+ 'or' : 'ή',
265
+ 'selectForUpload' : 'Επιλογή αρχείων για ανέβασμα',
266
+ 'moveFiles' : 'Μετακίνηση αρχείων',
267
+ 'copyFiles' : 'Αντιγραφή αρχείων',
268
+ 'rmFromPlaces' : 'Αντιγραφή από τοποθεσίες',
269
+ 'aspectRatio' : 'Αναλογία διαστάσεων',
270
+ 'scale' : 'Κλίμακα',
271
+ 'width' : 'Πλάτος',
272
+ 'height' : 'Ύψος',
273
+ 'resize' : 'Αλλαγή μεγέθους',
274
+ 'crop' : 'Crop',
275
+ 'rotate' : 'Περιστροφή',
276
+ 'rotate-cw' : 'Περιστροφή κατά 90 βαθμούς CW',
277
+ 'rotate-ccw' : 'Περιστροφή κατά 90 βαθμούς CCW',
278
+ 'degree' : 'Βαθμός',
279
+ 'netMountDialogTitle' : 'Φορτώστε δικτυακό δίσκο', // added 18.04.2012
280
+ 'protocol' : 'Πρωτόκολλο', // added 18.04.2012
281
+ 'host' : 'Host', // added 18.04.2012
282
+ 'port' : 'Port', // added 18.04.2012
283
+ 'user' : 'Χρήστης', // added 18.04.2012
284
+ 'pass' : 'Κωδικός', // added 18.04.2012
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'Άγνωστο',
288
+ 'kindFolder' : 'Φάκελος',
289
+ 'kindAlias' : 'Ψευδώνυμο (alias)',
290
+ 'kindAliasBroken' : 'Μη έγκυρο ψευδώνυμο',
291
+ // applications
292
+ 'kindApp' : 'Εφαρμογή',
293
+ 'kindPostscript' : 'Έγγραφο Postscript',
294
+ 'kindMsOffice' : 'Έγγραφο Microsoft Office',
295
+ 'kindMsWord' : 'Έγγραφο Microsoft Word',
296
+ 'kindMsExcel' : 'Έγγραφο Microsoft Excel',
297
+ 'kindMsPP' : 'Παρουσίαση Microsoft Powerpoint',
298
+ 'kindOO' : 'Έγγραφο Open Office',
299
+ 'kindAppFlash' : 'Εφαρμογή Flash',
300
+ 'kindPDF' : 'Portable Document Format (PDF)',
301
+ 'kindTorrent' : 'Αρχείο Bittorrent',
302
+ 'kind7z' : 'Αρχείο 7z',
303
+ 'kindTAR' : 'Αρχείο TAR',
304
+ 'kindGZIP' : 'Αρχείο GZIP',
305
+ 'kindBZIP' : 'Αρχείο BZIP',
306
+ 'kindXZ' : 'Αρχείο XZ',
307
+ 'kindZIP' : 'Αρχείο ZIP',
308
+ 'kindRAR' : 'Αρχείο RAR',
309
+ 'kindJAR' : 'Αρχείο Java JAR',
310
+ 'kindTTF' : 'Γραμματοσειρά True Type',
311
+ 'kindOTF' : 'Γραμματοσειρά Open Type',
312
+ 'kindRPM' : 'Πακέτο RPM',
313
+ // texts
314
+ 'kindText' : 'Έγγραφο κειμένου',
315
+ 'kindTextPlain' : 'Απλό κείμενο',
316
+ 'kindPHP' : 'Κώδικας PHP',
317
+ 'kindCSS' : 'Cascading style sheet',
318
+ 'kindHTML' : 'Έγγραφο HTML',
319
+ 'kindJS' : 'Κώδικας Javascript',
320
+ 'kindRTF' : 'Rich Text Format',
321
+ 'kindC' : 'Κώδικας C',
322
+ 'kindCHeader' : 'Κώδικας κεφαλίδας C',
323
+ 'kindCPP' : 'Κώδικας C++',
324
+ 'kindCPPHeader' : 'Κώδικας κεφαλίδας C++',
325
+ 'kindShell' : 'Unix shell script',
326
+ 'kindPython' : 'Κώδικας Python',
327
+ 'kindJava' : 'Κώδικας Java',
328
+ 'kindRuby' : 'Κώδικας Ruby',
329
+ 'kindPerl' : 'Perl script',
330
+ 'kindSQL' : 'Κώδικας SQL',
331
+ 'kindXML' : 'Έγγραφο XML',
332
+ 'kindAWK' : 'Κώδικας AWK',
333
+ 'kindCSV' : 'Τιμές χωρισμένες με κόμμα',
334
+ 'kindDOCBOOK' : 'Έγγραφο Docbook XML',
335
+ // images
336
+ 'kindImage' : 'Εικόνα',
337
+ 'kindBMP' : 'Εικόνα BMP',
338
+ 'kindJPEG' : 'Εικόνα JPEG',
339
+ 'kindGIF' : 'Εικόνα GIF',
340
+ 'kindPNG' : 'Εικόνα PNG',
341
+ 'kindTIFF' : 'Εικόνα TIFF',
342
+ 'kindTGA' : 'Εικόνα TGA',
343
+ 'kindPSD' : 'Εικόνα Adobe Photoshop',
344
+ 'kindXBITMAP' : 'Εικόνα X bitmap',
345
+ 'kindPXM' : 'Εικόνα Pixelmator',
346
+ // media
347
+ 'kindAudio' : 'Αρχεία ήχου',
348
+ 'kindAudioMPEG' : 'Ήχος MPEG',
349
+ 'kindAudioMPEG4' : 'Εικόνα MPEG-4',
350
+ 'kindAudioMIDI' : 'Εικόνα MIDI',
351
+ 'kindAudioOGG' : 'Εικόνα Ogg Vorbis',
352
+ 'kindAudioWAV' : 'Εικόνα WAV',
353
+ 'AudioPlaylist' : 'MP3 playlist',
354
+ 'kindVideo' : 'Αρχεία media',
355
+ 'kindVideoDV' : 'Ταινία DV',
356
+ 'kindVideoMPEG' : 'Ταινία MPEG',
357
+ 'kindVideoMPEG4' : 'Ταινία MPEG-4',
358
+ 'kindVideoAVI' : 'Ταινία AVI',
359
+ 'kindVideoMOV' : 'Ταινία Quick Time',
360
+ 'kindVideoWM' : 'Ταινία Windows Media',
361
+ 'kindVideoFlash' : 'Ταινία flash',
362
+ 'kindVideoMKV' : 'Ταινία matroska',
363
+ 'kindVideoOGG' : 'Ταινία ogg'
364
+ }
365
+ };
366
+ }
elFinder/js/i18n/elfinder.es.js ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Español internacional translation
3
+ * @author Julián Torres <julian.torres@pabernosmatao.com>
4
+ * @author Luis Faura <luis@luisfaura.es>
5
+ * @version 2015-11-27
6
+ */
7
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
8
+ elFinder.prototype.i18.es = {
9
+ translator : 'Julián Torres &lt;julian.torres@pabernosmatao.com&gt;, Luis Faura &lt;luis@luisfaura.es&gt;',
10
+ language : 'Español internacional',
11
+ direction : 'ltr',
12
+ dateFormat : 'M d, Y h:i A', // Mar 13, 2012 05:27 PM
13
+ fancyDateFormat : '$1 h:i A', // will produce smth like: Today 12:25 PM
14
+ messages : {
15
+
16
+ /********************************** errors **********************************/
17
+ 'error' : 'Error',
18
+ 'errUnknown' : 'Error desconocido.',
19
+ 'errUnknownCmd' : 'Comando desconocido.',
20
+ 'errJqui' : 'Configuración no válida de jQuery UI. Deben estar incluidos los componentes selectable, draggable y droppable.',
21
+ 'errNode' : 'elFinder necesita crear elementos DOM.',
22
+ 'errURL' : '¡Configuración no válida de elFinder! La opción URL no está configurada.',
23
+ 'errAccess' : 'Acceso denegado.',
24
+ 'errConnect' : 'No se ha podido conectar con el backend.',
25
+ 'errAbort' : 'Conexión cancelada.',
26
+ 'errTimeout' : 'Conexión cancelada por timeout.',
27
+ 'errNotFound' : 'Backend no encontrado.',
28
+ 'errResponse' : 'Respuesta no válida del backend.',
29
+ 'errConf' : 'Configuración no válida del backend .',
30
+ 'errJSON' : 'El módulo PHP JSON no está instalado.',
31
+ 'errNoVolumes' : 'No hay disponibles volúmenes legibles.',
32
+ 'errCmdParams' : 'Parámetros no válidos para el comando "$1".',
33
+ 'errDataNotJSON' : 'los datos no estan en formato JSON.',
34
+ 'errDataEmpty' : 'No hay datos.',
35
+ 'errCmdReq' : 'La petición del backend necesita un nombre de comando.',
36
+ 'errOpen' : 'No se puede abrir "$1".',
37
+ 'errNotFolder' : 'El objeto no es una carpeta.',
38
+ 'errNotFile' : 'El objeto no es un archivo.',
39
+ 'errRead' : 'No se puede leer "$1".',
40
+ 'errWrite' : 'No se puede escribir en "$1".',
41
+ 'errPerm' : 'Permiso denegado.',
42
+ 'errLocked' : '"$1" está bloqueado y no puede ser renombrado, movido o borrado.',
43
+ 'errExists' : 'Ya existe un archivo llamado "$1".',
44
+ 'errInvName' : 'Nombre de archivo no válido.',
45
+ 'errFolderNotFound' : 'Carpeta no encontrada.',
46
+ 'errFileNotFound' : 'Archivo no encontrado.',
47
+ 'errTrgFolderNotFound' : 'Carpeta de destino "$1" no encontrada.',
48
+ 'errPopup' : 'El navegador impide abrir nuevas ventanas. Puede activarlo en las opciones del navegador.',
49
+ 'errMkdir' : 'No se puede crear la carpeta "$1".',
50
+ 'errMkfile' : 'No se puede crear el archivo "$1".',
51
+ 'errRename' : 'No se puede renombrar "$1".',
52
+ 'errCopyFrom' : 'No se permite copiar archivos desde el volumen "$1".',
53
+ 'errCopyTo' : 'No se permite copiar archivos al volumen "$1".',
54
+ 'errMkOutLink' : 'No se ha podido crear el enlace fuera del volumen raíz.', // from v2.1 added 03.10.2015
55
+ 'errUpload' : 'Error en el envio.', // old name - errUploadCommon
56
+ 'errUploadFile' : 'No se ha podido cargar "$1".', // old name - errUpload
57
+ 'errUploadNoFiles' : 'No hay archivos para subir.',
58
+ 'errUploadTotalSize' : 'El tamaño de los datos excede el máximo permitido.', // old name - errMaxSize
59
+ 'errUploadFileSize' : 'El tamaño del archivo excede el máximo permitido.', // old name - errFileMaxSize
60
+ 'errUploadMime' : 'Tipo de archivo no permitido.',
61
+ 'errUploadTransfer' : 'Error al transferir "$1".',
62
+ 'errUploadTemp' : 'No se ha podido crear el archivo temporal para la subida.', // from v2.1 added 26.09.2015
63
+ 'errNotReplace' : 'El objeto "$1" ya existe y no puede ser reemplazado por otro con otro tipo.', // new
64
+ 'errReplace' : 'No se puede reemplazar "$1".',
65
+ 'errSave' : 'No se puede guardar "$1".',
66
+ 'errCopy' : 'No se puede copiar "$1".',
67
+ 'errMove' : 'No se puede mover "$1".',
68
+ 'errCopyInItself' : 'No se puede copiar "$1" en si mismo.',
69
+ 'errRm' : 'No se puede borrar "$1".',
70
+ 'errRmSrc' : 'No se puede(n) borrar los archivo(s).',
71
+ 'errExtract' : 'No se puede extraer archivos desde "$1".',
72
+ 'errArchive' : 'No se puede crear el archivo.',
73
+ 'errArcType' : 'Tipo de archivo no soportado.',
74
+ 'errNoArchive' : 'El archivo no es de tipo archivo o es de un tipo no soportado.',
75
+ 'errCmdNoSupport' : 'El backend no soporta este comando.',
76
+ 'errReplByChild' : 'La carpeta “$1” no puede ser reemplazada por un elemento contenido en ella.',
77
+ 'errArcSymlinks' : 'Por razones de seguridad no se pueden descomprimir archivos que contengan enlaces simbólicos.', // edited 24.06.2012
78
+ 'errArcMaxSize' : 'El tamaño del archivo excede el máximo permitido.',
79
+ 'errResize' : 'Error al redimendionar "$1".',
80
+ 'errResizeDegree' : 'Grado de rotación inválido.', // added 7.3.2013
81
+ 'errResizeRotate' : 'Error al rotar la imagen.', // added 7.3.2013
82
+ 'errResizeSize' : 'Tamaño de imagen inválido.', // added 7.3.2013
83
+ 'errResizeNoChange' : 'No se puede cambiar el tamaño de la imagen.', // added 7.3.2013
84
+ 'errUsupportType' : 'Tipo de archivo no soportado.',
85
+ 'errNotUTF8Content' : 'El archivo "$1" no está en formato UTF-8 y no puede ser editado.', // added 9.11.2011
86
+ 'errNetMount' : 'Fallo al montar "$1".', // added 17.04.2012
87
+ 'errNetMountNoDriver' : 'Protocolo no soportado.', // added 17.04.2012
88
+ 'errNetMountFailed' : 'Fallo al montar.', // added 17.04.2012
89
+ 'errNetMountHostReq' : 'Dominio requerido.', // added 18.04.2012
90
+ 'errSessionExpires' : 'La sesión ha expirado por inactividad',
91
+ 'errCreatingTempDir' : 'No se ha podido crear al directorio temporal: "$1"',
92
+ 'errFtpDownloadFile' : 'No se ha podido descargar el archivo desde FTP: "$1"',
93
+ 'errFtpUploadFile' : 'No se ha podido cargar el archivo a FTP: "$1"',
94
+ 'errFtpMkdir' : 'No se ha podido crear el directorio remoto en FTP: "$1"',
95
+ 'errArchiveExec' : 'Se ha producido un error durante la archivación: "$1"',
96
+ 'errExtractExec' : 'Se ha producido un error durante la extracción de archivos: "$1"',
97
+ 'errNetUnMount' : 'Imposible montar', // from v2.1 added 30.04.2012
98
+ 'errConvUTF8' : 'No es convertible a UTF-8', // from v2.1 added 08.04.2014
99
+ 'errFolderUpload' : 'Prueba con Google Chrome si quieres subir la carpeta entera.', // from v2.1 added 26.6.2015
100
+
101
+ /******************************* commands names ********************************/
102
+ 'cmdarchive' : 'Crear archivo',
103
+ 'cmdback' : 'Atrás',
104
+ 'cmdcopy' : 'Copiar',
105
+ 'cmdcut' : 'Cortar',
106
+ 'cmddownload' : 'Descargar',
107
+ 'cmdduplicate' : 'Duplicar',
108
+ 'cmdedit' : 'Editar archivo',
109
+ 'cmdextract' : 'Extraer elementos del archivo',
110
+ 'cmdforward' : 'Adelante',
111
+ 'cmdgetfile' : 'Seleccionar archivos',
112
+ 'cmdhelp' : 'Acerca de este software',
113
+ 'cmdhome' : 'Inicio',
114
+ 'cmdinfo' : 'Obtener información',
115
+ 'cmdmkdir' : 'Nueva carpeta',
116
+ 'cmdmkfile' : 'Nuevo archivo de texto',
117
+ 'cmdopen' : 'Abrir',
118
+ 'cmdpaste' : 'Pegar',
119
+ 'cmdquicklook' : 'Previsualizar',
120
+ 'cmdreload' : 'Recargar',
121
+ 'cmdrename' : 'Cambiar nombre',
122
+ 'cmdrm' : 'Eliminar',
123
+ 'cmdsearch' : 'Buscar archivos',
124
+ 'cmdup' : 'Ir a la carpeta raíz',
125
+ 'cmdupload' : 'Subir archivos',
126
+ 'cmdview' : 'Ver',
127
+ 'cmdresize' : 'Redimensionar y rotar',
128
+ 'cmdsort' : 'Ordenar',
129
+ 'cmdnetmount' : 'Montar volumen en red', // added 18.04.2012
130
+ 'cmdnetunmount': 'Desmontar', // from v2.1 added 30.04.2012
131
+ 'cmdplaces' : 'A Lugares', // added 28.12.2014
132
+ 'cmdchmod' : 'Cambiar modo', // from v2.1 added 20.6.2015
133
+
134
+ /*********************************** buttons ***********************************/
135
+ 'btnClose' : 'Cerrar',
136
+ 'btnSave' : 'Guardar',
137
+ 'btnRm' : 'Eliminar',
138
+ 'btnApply' : 'Aplicar',
139
+ 'btnCancel' : 'Cancelar',
140
+ 'btnNo' : 'No',
141
+ 'btnYes' : 'Sí',
142
+ 'btnMount' : 'Montar', // added 18.04.2012
143
+ 'btnApprove': 'Ir a $1 y aprobar', // from v2.1 added 26.04.2012
144
+ 'btnUnmount': 'Desmontar', // from v2.1 added 30.04.2012
145
+ 'btnConv' : 'Convertir', // from v2.1 added 08.04.2014
146
+ 'btnCwd' : 'Aquí', // from v2.1 added 22.5.2015
147
+ 'btnVolume' : 'Volumen', // from v2.1 added 22.5.2015
148
+ 'btnAll' : 'Todos', // from v2.1 added 22.5.2015
149
+ 'btnMime' : 'Tipo MIME', // from v2.1 added 22.5.2015
150
+ 'btnFileName':'Nombre de archivo', // from v2.1 added 22.5.2015
151
+ 'btnSaveClose': 'Guardar y cerrar', // from v2.1 added 12.6.2015
152
+
153
+ /******************************** notifications ********************************/
154
+ 'ntfopen' : 'Abrir carpeta',
155
+ 'ntffile' : 'Abrir archivo',
156
+ 'ntfreload' : 'Actualizar contenido de la carpeta',
157
+ 'ntfmkdir' : 'Creando directorio',
158
+ 'ntfmkfile' : 'Creando archivos',
159
+ 'ntfrm' : 'Eliminando archivos',
160
+ 'ntfcopy' : 'Copiar archivos',
161
+ 'ntfmove' : 'Mover archivos',
162
+ 'ntfprepare' : 'Preparar copia de archivos',
163
+ 'ntfrename' : 'Renombrar archivos',
164
+ 'ntfupload' : 'Subiendo archivos',
165
+ 'ntfdownload' : 'Descargando archivos',
166
+ 'ntfsave' : 'Guardar archivos',
167
+ 'ntfarchive' : 'Creando archivo',
168
+ 'ntfextract' : 'Extrayendo elementos del archivo',
169
+ 'ntfsearch' : 'Buscando archivos',
170
+ 'ntfresize' : 'Redimensionando imágenes',
171
+ 'ntfsmth' : 'Haciendo algo',
172
+ 'ntfloadimg' : 'Cargando imagen',
173
+ 'ntfnetmount' : 'Montando volumen en red', // added 18.04.2012
174
+ 'ntfnetunmount': 'Desmontando volumen en red', // from v2.1 added 30.04.2012
175
+ 'ntfdim' : 'Adquiriendo tamaño de imagen', // added 20.05.2013
176
+ 'ntfreaddir' : 'Leyendo información de la carpeta', // from v2.1 added 01.07.2013
177
+ 'ntfurl' : 'Obteniendo URL del enlace', // from v2.1 added 11.03.2014
178
+ 'ntfchmod' : 'Cambiando el modo de archivo', // from v2.1 added 20.6.2015
179
+
180
+ /************************************ dates **********************************/
181
+ 'dateUnknown' : 'desconocida',
182
+ 'Today' : 'Hoy',
183
+ 'Yesterday' : 'Ayer',
184
+ 'msJan' : 'Ene',
185
+ 'msFeb' : 'Feb',
186
+ 'msMar' : 'Mar',
187
+ 'msApr' : 'Abr',
188
+ 'msMay' : 'May',
189
+ 'msJun' : 'Jun',
190
+ 'msJul' : 'Jul',
191
+ 'msAug' : 'Ago',
192
+ 'msSep' : 'Sep',
193
+ 'msOct' : 'Oct',
194
+ 'msNov' : 'Nov',
195
+ 'msDec' : 'Dic',
196
+ 'January' : 'Enero',
197
+ 'February' : 'Febrero',
198
+ 'March' : 'Marzo',
199
+ 'April' : 'Abril',
200
+ 'May' : 'Mayo',
201
+ 'June' : 'Junio',
202
+ 'July' : 'Julio',
203
+ 'August' : 'Agosto',
204
+ 'September' : 'Septiembre',
205
+ 'October' : 'Octubre',
206
+ 'November' : 'Noviembre',
207
+ 'December' : 'Diciembre',
208
+ 'Sunday' : 'Domingo',
209
+ 'Monday' : 'Lunes',
210
+ 'Tuesday' : 'Martes',
211
+ 'Wednesday' : 'Miércoles',
212
+ 'Thursday' : 'Jueves',
213
+ 'Friday' : 'Viernes',
214
+ 'Saturday' : 'Sábado',
215
+ 'Sun' : 'Dom',
216
+ 'Mon' : 'Lun',
217
+ 'Tue' : 'Mar',
218
+ 'Wed' : 'Mie',
219
+ 'Thu' : 'Jue',
220
+ 'Fri' : 'Vie',
221
+ 'Sat' : 'Sab',
222
+
223
+ /******************************** sort variants ********************************/
224
+ 'sortname' : 'por nombre',
225
+ 'sortkind' : 'por tipo',
226
+ 'sortsize' : 'por tamaño',
227
+ 'sortdate' : 'por fecha',
228
+ 'sortFoldersFirst' : 'Las carpetas primero',
229
+
230
+ /********************************** new items **********************************/
231
+ 'untitled file.txt' : 'NuevoArchivo.txt', // added 10.11.2015
232
+ 'untitled folder' : 'NuevaCarpeta', // added 10.11.2015
233
+ 'Archive' : 'NuevoArchivo', // from v2.1 added 10.11.2015
234
+
235
+ /********************************** messages **********************************/
236
+ 'confirmReq' : 'Se necesita confirmación',
237
+ 'confirmRm' : '¿Está seguro de querer eliminar archivos?<br/>¡Esto no se puede deshacer!',
238
+ 'confirmRepl' : '¿Reemplazar el antiguo archivo con el nuevo?',
239
+ 'confirmConvUTF8' : 'No está en UTF-8<br/>Convertir a UTF-8?<br/>Los contenidos se guardarán en UTF-8 tras la conversión.', // from v2.1 added 08.04.2014
240
+ 'confirmNotSave' : 'Ha sido modificado.<br/>Perderás los cambios si no los guardas.', // from v2.1 added 15.7.2015
241
+ 'apllyAll' : 'Aplicar a todo',
242
+ 'name' : 'Nombre',
243
+ 'size' : 'Tamaño',
244
+ 'perms' : 'Permisos',
245
+ 'modify' : 'Modificado',
246
+ 'kind' : 'Tipo',
247
+ 'read' : 'lectura',
248
+ 'write' : 'escritura',
249
+ 'noaccess' : 'sin acceso',
250
+ 'and' : 'y',
251
+ 'unknown' : 'desconocido',
252
+ 'selectall' : 'Seleccionar todos los archivos',
253
+ 'selectfiles' : 'Seleccionar archivo(s)',
254
+ 'selectffile' : 'Seleccionar primer archivo',
255
+ 'selectlfile' : 'Seleccionar último archivo',
256
+ 'viewlist' : 'ver como lista',
257
+ 'viewicons' : 'Ver como iconos',
258
+ 'places' : 'Lugares',
259
+ 'calc' : 'Calcular',
260
+ 'path' : 'Ruta',
261
+ 'aliasfor' : 'Alias para',
262
+ 'locked' : 'Bloqueado',
263
+ 'dim' : 'Dimensiones',
264
+ 'files' : 'Archivos',
265
+ 'folders' : 'Carpetas',
266
+ 'items' : 'Elementos',
267
+ 'yes' : 'sí',
268
+ 'no' : 'no',
269
+ 'link' : 'Enlace',
270
+ 'searcresult' : 'Resultados de la búsqueda',
271
+ 'selected' : 'elementos seleccionados',
272
+ 'about' : 'Acerca',
273
+ 'shortcuts' : 'Accesos directos',
274
+ 'help' : 'Ayuda',
275
+ 'webfm' : 'Administrador de archivos web',
276
+ 'ver' : 'Versión',
277
+ 'protocolver' : 'versión del protocolo',
278
+ 'homepage' : 'Inicio',
279
+ 'docs' : 'Documentación',
280
+ 'github' : 'Bifúrcanos en Github',
281
+ 'twitter' : 'Síguenos en Twitter',
282
+ 'facebook' : 'Únete a nosotros en Facebook',
283
+ 'team' : 'Equipo',
284
+ 'chiefdev' : 'desarrollador jefe',
285
+ 'developer' : 'desarrollador',
286
+ 'contributor' : 'contribuyente',
287
+ 'maintainer' : 'mantenedor',
288
+ 'translator' : 'traductor',
289
+ 'icons' : 'Iconos',
290
+ 'dontforget' : 'y no olvide traer su toalla',
291
+ 'shortcutsof' : 'Accesos directos desactivados',
292
+ 'dropFiles' : 'Arrastre archivos aquí',
293
+ 'or' : 'o',
294
+ 'selectForUpload' : 'Seleccione archivos para subir',
295
+ 'moveFiles' : 'Mover archivos',
296
+ 'copyFiles' : 'Copiar archivos',
297
+ 'rmFromPlaces' : 'Eliminar en sus ubicaciones',
298
+ 'aspectRatio' : 'Relación de aspecto',
299
+ 'scale' : 'Escala',
300
+ 'width' : 'Ancho',
301
+ 'height' : 'Alto',
302
+ 'resize' : 'Redimensionar',
303
+ 'crop' : 'Recortar',
304
+ 'rotate' : 'Rotar',
305
+ 'rotate-cw' : 'Rotar 90 grados en sentido horario',
306
+ 'rotate-ccw' : 'Rotar 90 grados en sentido antihorario',
307
+ 'degree' : '°',
308
+ 'netMountDialogTitle' : 'Montar volumen en red', // added 18.04.2012
309
+ 'protocol' : 'Protocolo', // added 18.04.2012
310
+ 'host' : 'Dominio', // added 18.04.2012
311
+ 'port' : 'Puerto', // added 18.04.2012
312
+ 'user' : 'Usuario', // added 18.04.2012
313
+ 'pass' : 'Contraseña', // added 18.04.2012
314
+ 'confirmUnmount' : '¿Desmontar $1?', // from v2.1 added 30.04.2012
315
+ 'dropFilesBrowser': 'Arrastra o pega archivos del navegador', // from v2.1 added 30.05.2012
316
+ 'dropPasteFiles' : 'Arrastra o pega enlaces URL aquí', // from v2.1 added 07.04.2014
317
+ 'encoding' : 'Codificando', // from v2.1 added 19.12.2014
318
+ 'locale' : 'Locale', // from v2.1 added 19.12.2014
319
+ 'searchTarget' : 'Destino: $1', // from v2.1 added 22.5.2015
320
+ 'searchMime' : 'Buscar entrada por tipo MIME', // from v2.1 added 22.5.2015
321
+ 'owner' : 'Propietario', // from v2.1 added 20.6.2015
322
+ 'group' : 'Grupo', // from v2.1 added 20.6.2015
323
+ 'other' : 'Otro', // from v2.1 added 20.6.2015
324
+ 'execute' : 'Ejecutar', // from v2.1 added 20.6.2015
325
+ 'perm' : 'Permiso', // from v2.1 added 20.6.2015
326
+ 'mode' : 'Modo', // from v2.1 added 20.6.2015
327
+
328
+ /********************************** mimetypes **********************************/
329
+ 'kindUnknown' : 'Desconocido',
330
+ 'kindFolder' : 'Carpeta',
331
+ 'kindAlias' : 'Alias',
332
+ 'kindAliasBroken' : 'Alias roto',
333
+ // applications
334
+ 'kindApp' : 'Aplicación',
335
+ 'kindPostscript' : 'Documento Postscript',
336
+ 'kindMsOffice' : 'Documento Microsoft Office',
337
+ 'kindMsWord' : 'Documento Microsoft Word',
338
+ 'kindMsExcel' : 'Documento Microsoft Excel',
339
+ 'kindMsPP' : 'Presentación Microsoft Powerpoint',
340
+ 'kindOO' : 'Documento Open Office',
341
+ 'kindAppFlash' : 'Aplicación Flash',
342
+ 'kindPDF' : 'Documento PDF',
343
+ 'kindTorrent' : 'Archivo Bittorrent',
344
+ 'kind7z' : 'Archivo 7z',
345
+ 'kindTAR' : 'Archivo TAR',
346
+ 'kindGZIP' : 'Archivo GZIP',
347
+ 'kindBZIP' : 'Archivo BZIP',
348
+ 'kindXZ' : 'Archivo XZ',
349
+ 'kindZIP' : 'Archivo ZIP',
350
+ 'kindRAR' : 'Archivo RAR',
351
+ 'kindJAR' : 'Archivo Java JAR',
352
+ 'kindTTF' : 'Fuente True Type',
353
+ 'kindOTF' : 'Fuente Open Type',
354
+ 'kindRPM' : 'Paquete RPM',
355
+ // texts
356
+ 'kindText' : 'Documento de texto',
357
+ 'kindTextPlain' : 'Texto plano',
358
+ 'kindPHP' : 'Código PHP',
359
+ 'kindCSS' : 'Hoja de estilos CSS',
360
+ 'kindHTML' : 'Documento HTML',
361
+ 'kindJS' : 'Código Javascript',
362
+ 'kindRTF' : 'Documento RTF',
363
+ 'kindC' : 'Código C',
364
+ 'kindCHeader' : 'Código C cabeceras',
365
+ 'kindCPP' : 'Código C++',
366
+ 'kindCPPHeader' : 'Código C++ cabeceras',
367
+ 'kindShell' : 'Script de terminal de Unix',
368
+ 'kindPython' : 'Código Python',
369
+ 'kindJava' : 'Código Java',
370
+ 'kindRuby' : 'Código Ruby',
371
+ 'kindPerl' : 'Código Perl',
372
+ 'kindSQL' : 'Código QL',
373
+ 'kindXML' : 'Documento XML',
374
+ 'kindAWK' : 'Código AWK',
375
+ 'kindCSV' : 'Documento CSV (valores separados por comas)',
376
+ 'kindDOCBOOK' : 'Documento Docbook XML',
377
+ 'kindMarkdown' : 'Texto Markdown', // added 20.7.2015
378
+ // images
379
+ 'kindImage' : 'Imagen',
380
+ 'kindBMP' : 'Imagen BMP',
381
+ 'kindJPEG' : 'Imagen JPEG',
382
+ 'kindGIF' : 'Imagen GIF',
383
+ 'kindPNG' : 'Imagen PNG',
384
+ 'kindTIFF' : 'Imagen TIFF',
385
+ 'kindTGA' : 'Imagen TGA',
386
+ 'kindPSD' : 'Imagen Adobe Photoshop',
387
+ 'kindXBITMAP' : 'Imagen X bitmap',
388
+ 'kindPXM' : 'Imagen Pixelmator',
389
+ // media
390
+ 'kindAudio' : 'Archivo de audio',
391
+ 'kindAudioMPEG' : 'Audio MPEG',
392
+ 'kindAudioMPEG4' : 'Audio MPEG-4',
393
+ 'kindAudioMIDI' : 'Audio MIDI',
394
+ 'kindAudioOGG' : 'Audio Ogg Vorbis',
395
+ 'kindAudioWAV' : 'Audio WAV',
396
+ 'AudioPlaylist' : 'Lista de reproducción MP3',
397
+ 'kindVideo' : 'Archivo de video',
398
+ 'kindVideoDV' : 'Película DV',
399
+ 'kindVideoMPEG' : 'Película MPEG',
400
+ 'kindVideoMPEG4' : 'Película MPEG-4',
401
+ 'kindVideoAVI' : 'Película AVI',
402
+ 'kindVideoMOV' : 'Película Quick Time',
403
+ 'kindVideoWM' : 'Película Windows Media',
404
+ 'kindVideoFlash' : 'Película Flash',
405
+ 'kindVideoMKV' : 'Película Matroska MKV',
406
+ 'kindVideoOGG' : 'Película Ogg'
407
+ }
408
+ };
409
+ }
410
+
elFinder/js/i18n/elfinder.fa.js ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Persian-Farsi Translation
3
+ * @author Keyhan Mohammadpour <keyhan_universityworks@yahoo.com>
4
+ * @version 2014-12-19
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.fa = {
8
+ translator : 'Keyhan Mohammadpour &lt;keyhan_universityworks@yahoo.com&gt;',
9
+ language : 'فارسی',
10
+ direction : 'rtl',
11
+ dateFormat : 'd.m.Y H:i',
12
+ fancyDateFormat : '$1 H:i',
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'خطا',
17
+ 'errUnknown' : 'خطای ناشناخته .',
18
+ 'errUnknownCmd' : 'دستور ناشناخته .',
19
+ 'errJqui' : 'تنظیمات کتابخانه JQuery UI شما به درستی تنظیم نشده است . این کتابخانه بایستی شامل Resizable ، Draggable و Droppable باشد .',
20
+ 'errNode' : 'شی elfinder به درستی ایجاد نشده است .',
21
+ 'errURL' : 'تنظیمات elfinder شما به درستی انجام نشده است . تنظیم Url را به درستی انجام دهید .',
22
+ 'errAccess' : 'محدودیت سطح دسترسی',
23
+ 'errConnect' : 'Unable to connect to backend.',
24
+ 'errAbort' : 'ارتباط قطع شده است .',
25
+ 'errTimeout' : 'مهلت زمانی Connection شما به انتها رسیده ایت .',
26
+ 'errNotFound' : 'تنظیم Backend یافت نشد .',
27
+ 'errResponse' : 'پاسخ دریافتی از Backend صحیح نمی باشد .',
28
+ 'errConf' : 'تنطیمات Backend به درستی انجام نشده است .',
29
+ 'errJSON' : 'ماژول PHP JSON نصب نگردیده است .',
30
+ 'errNoVolumes' : 'درایوهای قابل خواندن یافت نشدند .',
31
+ 'errCmdParams' : 'پارامترهای دستور "$1" به صورت صحیح داده نشده است .',
32
+ 'errDataNotJSON' : 'داده ها در قالب JSON نمی باشند .',
33
+ 'errDataEmpty' : 'داده ها تهی می باشند .',
34
+ 'errCmdReq' : 'درخواست از سمت Backend نیازمند نام دستور می باشد .',
35
+ 'errOpen' : 'قادر به باز نمودن "$1" نمی باشد .',
36
+ 'errNotFolder' : 'شی به صورت پوشه نمی باشد .',
37
+ 'errNotFile' : 'شی به صورت فایل نمی باشد .',
38
+ 'errRead' : 'قادر به خواندن "$1" نمی باشد .',
39
+ 'errWrite' : 'قادر به نوشتن در درون "$1" نمی باشد .',
40
+ 'errPerm' : 'شما مجاز به انجام این عمل نمی باشید .',
41
+ 'errLocked' : '"$1"قفل گردیده است و شما قادر به تغییر نام ، حذف و یا جابجایی آن نمی باشید .',
42
+ 'errExists' : 'فایلی با نام "$1" هم اکنون وجود دارد .',
43
+ 'errInvName' : 'نام انتخابی شما صحیح نمی باشد .',
44
+ 'errFolderNotFound' : 'پوشه مورد نظر شما یافت نشد .',
45
+ 'errFileNotFound' : 'فایل مورد نظر شما یافت نشد .',
46
+ 'errTrgFolderNotFound' : 'پوشه مقصد با نام "$1" یافت نشد .',
47
+ 'errPopup' : 'مرورگر شما ار باز شدن پنجره popup جلوگیری می نماید ، اطفا تنطیم مربوطه را در مرورگر خود فعال نمایید .',
48
+ 'errMkdir' : 'قادر به ایجاد نمودن پوشه ای با نام "$1" نمی باشد .',
49
+ 'errMkfile' : 'قادر به ابجاد نمودن فایلی با نبم "$1" نمی باشد .',
50
+ 'errRename' : 'قادر به تغییر نام فایل "$1" نمی باشد .',
51
+ 'errCopyFrom' : 'کپی نمودن از درایو با نام "$1" امکان پذیر نمی باشد .',
52
+ 'errCopyTo' : 'کپی نمودن به درایو با نام "$1" امکان پذیر نمی باشد .',
53
+ 'errUpload' : 'خطای بارگذاری ',
54
+ 'errUploadFile' : 'قادر به بارگذاری "$1" نمی باشد .',
55
+ 'errUploadNoFiles' : 'هیچ فایلی برای بارگذاری یافت نشد .',
56
+ 'errUploadTotalSize' : 'حجم داده ها بیشتر از حد مجاز تعیین شده است .',
57
+ 'errUploadFileSize' : 'حجم فایل بیشتر از حد مجاز تعیین شده است .',
58
+ 'errUploadMime' : 'نوع فایل انتخابی شما مجاز نمی باشد .',
59
+ 'errUploadTransfer' : 'در تبادل "$1" خطایی رخ داده است .',
60
+ 'errNotReplace' : 'Object "$1" already exists at this location and can not be replaced by object with another type.',
61
+ 'errReplace' : 'Unable to replace "$1".',
62
+ 'errSave' : 'قادر به دخیره کردن "$1" نمی باشد .',
63
+ 'errCopy' : 'قادر به کپی نمودن "$1" نمی باشد .',
64
+ 'errMove' : 'قادر به جابجایی "$1" نمی باشد .',
65
+ 'errCopyInItself' : 'قادر به کپی نمودن "$1" در درون خودش نمی باشد .',
66
+ 'errRm' : 'قادر به حذف نمودن "$1" نمی باشد .',
67
+ 'errRmSrc' : 'Unable remove source file(s).',
68
+ 'errExtract' : 'قادر به استخراج فایل فشرده "$1" نمی باشد .',
69
+ 'errArchive' : 'قادر به ایجاد آرشیو نمی باشد .',
70
+ 'errArcType' : 'نوع ناشناخته برای آرشیو .',
71
+ 'errNoArchive' : 'قادر به آرشیو نمودن فایل نمی باشد و یا نوع فایل در نوع های آرشیو تعیین نشده است .',
72
+ 'errCmdNoSupport' : 'Backend قادر به پشتیبانی از این دستور نمی باشد .',
73
+ 'errReplByChild' : 'پوشه با نام "$1"قادر به تغییر با محتویات درونی خود نمی باشد .',
74
+ 'errArcSymlinks' : 'به دلایل مسائل امنیتی قادر به استخراج آرشیو های دارای symlinks نمی باشد .',
75
+ 'errArcMaxSize' : 'فایل های آرشیو شده به حداکثر اندازه تعیین شده رسیده اند .',
76
+ 'errResize' : 'قادر به تغییر اندازه "$1" نمی باشد .',
77
+ 'errResizeDegree' : 'Invalid rotate degree.',
78
+ 'errResizeRotate' : 'Unable to rotate image.',
79
+ 'errResizeSize' : 'Invalid image size.',
80
+ 'errResizeNoChange' : 'Image size not changed.',
81
+ 'errUsupportType' : 'نوع فایل شما قابل پشتیبانی نمی باشد .',
82
+ 'errNotUTF8Content' : 'File "$1" is not in UTF-8 and cannot be edited.',
83
+ 'errNetMount' : 'Unable to mount "$1".',
84
+ 'errNetMountNoDriver' : 'Unsupported protocol.',
85
+ 'errNetMountFailed' : 'Mount failed.',
86
+ 'errNetMountHostReq' : 'Host required.',
87
+ 'errSessionExpires' : 'Your session has expired due to inactivity.',
88
+ 'errCreatingTempDir' : 'Unable to create temporary directory: "$1"',
89
+ 'errFtpDownloadFile' : 'Unable to download file from FTP: "$1"',
90
+ 'errFtpUploadFile' : 'Unable to upload file to FTP: "$1"',
91
+ 'errFtpMkdir' : 'Unable to create remote directory on FTP: "$1"',
92
+ 'errArchiveExec' : 'Error while archiving files: "$1"',
93
+ 'errExtractExec' : 'Error while extracting files: "$1"',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'ساختن آرشیو',
97
+ 'cmdback' : 'قبلی',
98
+ 'cmdcopy' : 'کپی',
99
+ 'cmdcut' : 'جابجایی',
100
+ 'cmddownload' : 'بارگیری',
101
+ 'cmdduplicate' : 'تکثیر نمودن',
102
+ 'cmdedit' : 'ویرایش فایل',
103
+ 'cmdextract' : 'از حالت فشرده خارج نمودن',
104
+ 'cmdforward' : 'بعدی',
105
+ 'cmdgetfile' : 'انتخاب فایل ها',
106
+ 'cmdhelp' : 'درباره این فایل',
107
+ 'cmdhome' : 'صفحه اصلی',
108
+ 'cmdinfo' : 'دریافت اطلاعات',
109
+ 'cmdmkdir' : 'پوشه جدید',
110
+ 'cmdmkfile' : 'فایل متنی جدید',
111
+ 'cmdopen' : 'باز نمودن',
112
+ 'cmdpaste' : 'چسباندن',
113
+ 'cmdquicklook' : 'پیش نمایش',
114
+ 'cmdreload' : 'بارگذاری مجدد',
115
+ 'cmdrename' : 'تغییر نام',
116
+ 'cmdrm' : 'حذف',
117
+ 'cmdsearch' : 'جستجو',
118
+ 'cmdup' : 'رفتن به پوشه والد',
119
+ 'cmdupload' : 'بارگذاری فایل ها',
120
+ 'cmdview' : 'نمایش',
121
+ 'cmdresize' : 'تغییر اندازه فایل',
122
+ 'cmdsort' : 'مرتب سازی',
123
+ 'cmdnetmount' : 'Mount network volume',
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'بستن',
127
+ 'btnSave' : 'ذخیره',
128
+ 'btnRm' : 'حذف',
129
+ 'btnApply' : 'اعمال',
130
+ 'btnCancel' : 'انصراف',
131
+ 'btnNo' : 'خیر',
132
+ 'btnYes' : 'بلی',
133
+ 'btnMount' : 'Mount',
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'باز نمودن پوشه',
137
+ 'ntffile' : 'باز نمدن فایل',
138
+ 'ntfreload' : 'بازخوانی مجدد محتویات پوشه',
139
+ 'ntfmkdir' : 'ساختن پوشه',
140
+ 'ntfmkfile' : 'ساختن فایل',
141
+ 'ntfrm' : 'حذف فایل',
142
+ 'ntfcopy' : 'کپی فایل',
143
+ 'ntfmove' : 'انتقال فایل',
144
+ 'ntfprepare' : 'آماده شدن برای کپی نمودن فایل ها',
145
+ 'ntfrename' : 'تغییر نام فایل',
146
+ 'ntfupload' : 'بارگذاری فایل',
147
+ 'ntfdownload' : 'بارگیری فایل',
148
+ 'ntfsave' : 'ذخیره نمودن فایل ها',
149
+ 'ntfarchive' : 'در حال ساختن آرشیو',
150
+ 'ntfextract' : 'استخراج فایل ها از آرشیو',
151
+ 'ntfsearch' : 'در حال جستجو فایل ها',
152
+ 'ntfresize' : 'Resizing images',
153
+ 'ntfsmth' : 'درحال انجام عملیات ....',
154
+ 'ntfloadimg' : 'در حال لود نمودن تصویر',
155
+ 'ntfnetmount' : 'Mounting network volume',
156
+ 'ntfdim' : 'Acquiring image dimension',
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'ناشناخته',
160
+ 'Today' : 'امروز',
161
+ 'Yesterday' : 'دیروز',
162
+ 'msJan' : 'ژانویه',
163
+ 'msFeb' : 'فوریه',
164
+ 'msMar' : 'مارس',
165
+ 'msApr' : 'آوریل',
166
+ 'msMay' : 'مه',
167
+ 'msJun' : 'ژوئن',
168
+ 'msJul' : 'ژوئیه',
169
+ 'msAug' : 'اوت',
170
+ 'msSep' : 'سپتامبر',
171
+ 'msOct' : 'اکتبر',
172
+ 'msNov' : 'نوامبر',
173
+ 'msDec' : 'دسامبر',
174
+ 'January' : 'ژانویه',
175
+ 'February' : 'فوریه',
176
+ 'March' : 'مارس',
177
+ 'April' : 'آوریل',
178
+ 'May' : 'مه',
179
+ 'June' : 'ژوئن',
180
+ 'July' : 'ژوئیه',
181
+ 'August' : 'اوت',
182
+ 'September' : 'سپتامبر',
183
+ 'October' : 'اکتبر',
184
+ 'November' : 'نوامبر',
185
+ 'December' : 'دسامبر',
186
+ 'Sunday' : 'یک شنبه',
187
+ 'Monday' : 'دوشنبه',
188
+ 'Tuesday' : 'سه شنبه',
189
+ 'Wednesday' : 'چهار شنبه',
190
+ 'Thursday' : 'پنج شنبه',
191
+ 'Friday' : 'جمعه',
192
+ 'Saturday' : 'شنبه',
193
+ 'Sun' : 'یک شنبه',
194
+ 'Mon' : 'دو شنبه',
195
+ 'Tue' : 'سه شنبه',
196
+ 'Wed' : 'چهار شنبه',
197
+ 'Thu' : 'پنج شنبه',
198
+ 'Fri' : 'جمعه',
199
+ 'Sat' : 'شنبه',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'بر اساس نام',
203
+ 'sortkind' : 'بر اساس نوع',
204
+ 'sortsize' : 'بر اساس اندازه',
205
+ 'sortdate' : 'بر اساس تاریخ',
206
+ 'sortFoldersFirst' : 'Folders first',
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'تاییدیه نهایی نیاز است .',
210
+ 'confirmRm' : 'آیا مطمثن به انجام عملیات حذف می باشید ؟ آیتم های حدف شده قابل بازیابی نمی باشند !',
211
+ 'confirmRepl' : 'آیا فایل قدیم با فایل جدید جایگزین شود ؟',
212
+ 'apllyAll' : 'اعمال تغییرات به همه',
213
+ 'name' : 'نام',
214
+ 'size' : 'اندازه',
215
+ 'perms' : 'مجوزها',
216
+ 'modify' : 'تغییر داده شده',
217
+ 'kind' : 'نوع',
218
+ 'read' : 'خواندن',
219
+ 'write' : 'نوشتن',
220
+ 'noaccess' : 'دسترسی وجود ندارد',
221
+ 'and' : 'و',
222
+ 'unknown' : 'ناشناخته',
223
+ 'selectall' : 'انتخاب همه فایل ها',
224
+ 'selectfiles' : 'انتخاب یکی یا همه فایل ها',
225
+ 'selectffile' : 'انتخاب اولین فایل',
226
+ 'selectlfile' : 'انتخاب آخرین فایل',
227
+ 'viewlist' : 'نمایش به صورت لیست',
228
+ 'viewicons' : 'نمایش با آیکون ها',
229
+ 'places' : 'محل ها',
230
+ 'calc' : 'محاسبه',
231
+ 'path' : 'مسیر',
232
+ 'aliasfor' : 'نام مستعار برای',
233
+ 'locked' : 'قفل شده',
234
+ 'dim' : 'ابعاد',
235
+ 'files' : 'فایل ها',
236
+ 'folders' : 'پوشه ها',
237
+ 'items' : 'آیتم ها',
238
+ 'yes' : 'بلی',
239
+ 'no' : 'خیر',
240
+ 'link' : 'پیوند',
241
+ 'searcresult' : 'جستجو در نتایج',
242
+ 'selected' : 'آیتم های انتخاب شده',
243
+ 'about' : 'درباره',
244
+ 'shortcuts' : 'میانبرها',
245
+ 'help' : 'راهنما',
246
+ 'webfm' : 'مدیر وب فایل',
247
+ 'ver' : 'نسخه',
248
+ 'protocolver' : 'protocol version',
249
+ 'homepage' : 'صفحه اصلی پروژه',
250
+ 'docs' : 'مستندات',
251
+ 'github' : 'دنبال کردن ما بر روی Github',
252
+ 'twitter' : 'دنبال کردن ما در Twitter',
253
+ 'facebook' : 'به ما در facebook بپیوندید',
254
+ 'team' : 'گروه',
255
+ 'chiefdev' : 'سازنده اصلی برنامه',
256
+ 'developer' : 'سازنده',
257
+ 'contributor' : 'همکار',
258
+ 'maintainer' : 'پشتیبان',
259
+ 'translator' : 'مترجم',
260
+ 'icons' : 'آیکون ها',
261
+ 'dontforget' : 'فراموش نشود',
262
+ 'shortcutsof' : 'میانبرها غیرفعال شده اند .',
263
+ 'dropFiles' : 'فایل های خود را در این محل رها نمایید .',
264
+ 'or' : 'یا',
265
+ 'selectForUpload' : 'انتخاب فایل ها برای بارگذاری',
266
+ 'moveFiles' : 'انتقال فایل ها',
267
+ 'copyFiles' : 'کپی فایل ها',
268
+ 'rmFromPlaces' : 'حدف',
269
+ 'aspectRatio' : 'نسبت تصویر',
270
+ 'scale' : 'مقیاس',
271
+ 'width' : 'طول',
272
+ 'height' : 'ارتفاع',
273
+ 'resize' : 'تغییر اندازه',
274
+ 'crop' : 'بریدن',
275
+ 'rotate' : 'چرخاندن',
276
+ 'rotate-cw' : 'چرخاندن 90 درجه در جهت عقربه های ساعت',
277
+ 'rotate-ccw' : 'چرخاندن 90 درجه در جهت خلاف عقربه های ساعت',
278
+ 'degree' : 'درجه',
279
+ 'netMountDialogTitle' : 'Mount network volume',
280
+ 'protocol' : 'نسخه پروتکل',
281
+ 'host' : 'Host',
282
+ 'port' : 'Port',
283
+ 'user' : 'User',
284
+ 'pass' : 'Password',
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'Unknown',
288
+ 'kindFolder' : 'Folder',
289
+ 'kindAlias' : 'Alias',
290
+ 'kindAliasBroken' : 'Broken alias',
291
+ // applications
292
+ 'kindApp' : 'Application',
293
+ 'kindPostscript' : 'Postscript document',
294
+ 'kindMsOffice' : 'Microsoft Office document',
295
+ 'kindMsWord' : 'Microsoft Word document',
296
+ 'kindMsExcel' : 'Microsoft Excel document',
297
+ 'kindMsPP' : 'Microsoft Powerpoint presentation',
298
+ 'kindOO' : 'Open Office document',
299
+ 'kindAppFlash' : 'Flash application',
300
+ 'kindPDF' : 'Portable Document Format (PDF)',
301
+ 'kindTorrent' : 'Bittorrent file',
302
+ 'kind7z' : '7z archive',
303
+ 'kindTAR' : 'TAR archive',
304
+ 'kindGZIP' : 'GZIP archive',
305
+ 'kindBZIP' : 'BZIP archive',
306
+ 'kindXZ' : 'XZ archive',
307
+ 'kindZIP' : 'ZIP archive',
308
+ 'kindRAR' : 'RAR archive',
309
+ 'kindJAR' : 'Java JAR file',
310
+ 'kindTTF' : 'True Type font',
311
+ 'kindOTF' : 'Open Type font',
312
+ 'kindRPM' : 'RPM package',
313
+ // texts
314
+ 'kindText' : 'Text document',
315
+ 'kindTextPlain' : 'Plain text',
316
+ 'kindPHP' : 'PHP source',
317
+ 'kindCSS' : 'Cascading style sheet',
318
+ 'kindHTML' : 'HTML document',
319
+ 'kindJS' : 'Javascript source',
320
+ 'kindRTF' : 'Rich Text Format',
321
+ 'kindC' : 'C source',
322
+ 'kindCHeader' : 'C header source',
323
+ 'kindCPP' : 'C++ source',
324
+ 'kindCPPHeader' : 'C++ header source',
325
+ 'kindShell' : 'Unix shell script',
326
+ 'kindPython' : 'Python source',
327
+ 'kindJava' : 'Java source',
328
+ 'kindRuby' : 'Ruby source',
329
+ 'kindPerl' : 'Perl script',
330
+ 'kindSQL' : 'SQL source',
331
+ 'kindXML' : 'XML document',
332
+ 'kindAWK' : 'AWK source',
333
+ 'kindCSV' : 'Comma separated values',
334
+ 'kindDOCBOOK' : 'Docbook XML document',
335
+ // images
336
+ 'kindImage' : 'Image',
337
+ 'kindBMP' : 'BMP image',
338
+ 'kindJPEG' : 'JPEG image',
339
+ 'kindGIF' : 'GIF Image',
340
+ 'kindPNG' : 'PNG Image',
341
+ 'kindTIFF' : 'TIFF image',
342
+ 'kindTGA' : 'TGA image',
343
+ 'kindPSD' : 'Adobe Photoshop image',
344
+ 'kindXBITMAP' : 'X bitmap image',
345
+ 'kindPXM' : 'Pixelmator image',
346
+ // media
347
+ 'kindAudio' : 'Audio media',
348
+ 'kindAudioMPEG' : 'MPEG audio',
349
+ 'kindAudioMPEG4' : 'MPEG-4 audio',
350
+ 'kindAudioMIDI' : 'MIDI audio',
351
+ 'kindAudioOGG' : 'Ogg Vorbis audio',
352
+ 'kindAudioWAV' : 'WAV audio',
353
+ 'AudioPlaylist' : 'MP3 playlist',
354
+ 'kindVideo' : 'Video media',
355
+ 'kindVideoDV' : 'DV movie',
356
+ 'kindVideoMPEG' : 'MPEG movie',
357
+ 'kindVideoMPEG4' : 'MPEG-4 movie',
358
+ 'kindVideoAVI' : 'AVI movie',
359
+ 'kindVideoMOV' : 'Quick Time movie',
360
+ 'kindVideoWM' : 'Windows Media movie',
361
+ 'kindVideoFlash' : 'Flash movie',
362
+ 'kindVideoMKV' : 'Matroska movie',
363
+ 'kindVideoOGG' : 'Ogg movie'
364
+ }
365
+ };
366
+ }
elFinder/js/i18n/elfinder.fo.js ADDED
@@ -0,0 +1,411 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Faroese translation
3
+ * @author Marius Hammer <marius@vrg.fo>
4
+ * @version 2015-12-03
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.fo = {
8
+ translator : 'Marius Hammer &lt;marius@vrg.fo&gt;',
9
+ language : 'Faroese',
10
+ direction : 'ltr',
11
+ dateFormat : 'd.m.Y H:i', // Mar 13, 2012 05:27 PM
12
+ fancyDateFormat : '$1 H:i', // will produce smth like: Today 12:25 PM
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'Villa íkomin',
17
+ 'errUnknown' : 'Ókend villa.',
18
+ 'errUnknownCmd' : 'Ókend boð.',
19
+ 'errJqui' : 'Ógildig jQuery UI konfiguratión. Vælbærar, sum kunnu hálast runt og kunnu sleppast skulu takast við.',
20
+ 'errNode' : 'elFinder krevur DOM Element stovna.',
21
+ 'errURL' : 'Ugyldig elFinder konfiguration! URL stilling er ikki ásett.',
22
+ 'errAccess' : 'Atgongd nokta.',
23
+ 'errConnect' : 'Far ikki samband við backend.',
24
+ 'errAbort' : 'Sambandi avbrotið.',
25
+ 'errTimeout' : 'Sambandi broti av.',
26
+ 'errNotFound' : 'Backend ikki funnið.',
27
+ 'errResponse' : 'Ógildugt backend svar.',
28
+ 'errConf' : 'Ógildugt backend konfiguratión.',
29
+ 'errJSON' : 'PHP JSON modulið er ikki innstallera.',
30
+ 'errNoVolumes' : 'Lesiligar mappur er ikki atkomulig.',
31
+ 'errCmdParams' : 'Ógildigar stillingar fyri kommando "$1".',
32
+ 'errDataNotJSON' : 'Dáta er ikki JSON.',
33
+ 'errDataEmpty' : 'Dáta er tømt.',
34
+ 'errCmdReq' : 'Backend krevur eitt kommando navn.',
35
+ 'errOpen' : 'Kundi ikki opna "$1".',
36
+ 'errNotFolder' : 'Luturin er ikki ein mappa.',
37
+ 'errNotFile' : 'Luturin er ikki ein fíla.',
38
+ 'errRead' : 'Kundi ikki lesa til "$1".',
39
+ 'errWrite' : 'Kundi ikki skriva til "$1".',
40
+ 'errPerm' : 'Atgongd nokta.',
41
+ 'errLocked' : '"$1" er løst og kann ikki umdoybast, flytast ella strikast.',
42
+ 'errExists' : 'Tað finst longu ein fíla við navn "$1".',
43
+ 'errInvName' : 'Ógildugt fíla navn.',
44
+ 'errFolderNotFound' : 'Mappa ikki funnin.',
45
+ 'errFileNotFound' : 'Fíla ikki funnin.',
46
+ 'errTrgFolderNotFound' : 'Mappan "$1" bleiv ikke funnin.',
47
+ 'errPopup' : 'Kagin forðaði í at opna eitt popup-vindeyga. Fyri at opna fíluna, aktivera popup-vindeygu í tínum kaga stillingum.',
48
+ 'errMkdir' : '\'Kundi ikki stovna mappu "$1".',
49
+ 'errMkfile' : 'Kundi ikki stovna mappu "$1".',
50
+ 'errRename' : 'Kundi ikki umdoyba "$1".',
51
+ 'errCopyFrom' : 'Kopiering av fílum frá mappuni "$1" er ikke loyvt.',
52
+ 'errCopyTo' : 'Kopiering av fílum til mappuna "$1" er ikke loyvt.',
53
+ 'errMkOutLink' : 'Ikki ført fyri at stovna leinkju til uttanfyri \'volume\' rót.', // from v2.1 added 03.10.2015
54
+ 'errUpload' : 'Innlegginar feilur.', // old name - errUploadCommon
55
+ 'errUploadFile' : 'Kundi ikki leggja "$1" inn.', // old name - errUpload
56
+ 'errUploadNoFiles' : 'Ongar fílar funnir at leggja inn.',
57
+ 'errUploadTotalSize' : 'Dátain er størri enn mest loyvda støddin.', // old name - errMaxSize
58
+ 'errUploadFileSize' : 'Fíla er størri enn mest loyvda støddin.', // old name - errFileMaxSize
59
+ 'errUploadMime' : 'Fílu slag ikki góðkent.',
60
+ 'errUploadTransfer' : '"$1" innleggingar feilur.',
61
+ 'errUploadTemp' : 'Ikki ført fyri at gera fyribils fílu fyri innlegging.', // from v2.1 added 26.09.2015
62
+ 'errNotReplace' : 'Lutur "$1" finst longu á hesum stað og can ikki skiftast út av lutið av øðrum slag.', // new
63
+ 'errReplace' : 'Ikki ført fyri at erstattae "$1".',
64
+ 'errSave' : 'Kundi ikki goyma "$1".',
65
+ 'errCopy' : 'Kundi ikki kopiera "$1".',
66
+ 'errMove' : 'Kundi ikki flyta "$1".',
67
+ 'errCopyInItself' : 'Kundi ikki kopiera "$1" inn í seg sjálva.',
68
+ 'errRm' : 'Kundi ikki strika "$1".',
69
+ 'errRmSrc' : 'Ikki ført fyri at strika keldu fíla(r).',
70
+ 'errExtract' : 'Kundi ikki útpakka fílar frá "$1".',
71
+ 'errArchive' : 'Kundi ikki stovna arkiv.',
72
+ 'errArcType' : 'Arkiv slagið er ikki stuðla.',
73
+ 'errNoArchive' : 'Fílan er ikki eitt arkiv ella er ikki eitt stuðla arkiva slag.',
74
+ 'errCmdNoSupport' : 'Backend stuðlar ikki hesi boð.',
75
+ 'errReplByChild' : 'appan "$1" kann ikki erstattast av einari vøru, hon inniheldur.',
76
+ 'errArcSymlinks' : 'Av trygdarávum grundum, noktaði skipanin at pakka út arkivir ið innihalda symlinks ella fílur við nøvn ið ikki eru loyvd.', // edited 24.06.2012
77
+ 'errArcMaxSize' : 'Arkiv fílar fylla meir enn mest loyvda støddin.',
78
+ 'errResize' : 'Kundi ikki broyta støddina á "$1".',
79
+ 'errResizeDegree' : 'Ógildugt roterings stig.', // added 7.3.2013
80
+ 'errResizeRotate' : 'Ikki ført fyri at rotera mynd.', // added 7.3.2013
81
+ 'errResizeSize' : 'Ógildug myndastødd.', // added 7.3.2013
82
+ 'errResizeNoChange' : 'Mynda stødd ikki broytt.', // added 7.3.2013
83
+ 'errUsupportType' : 'Ikki stuðla fíla slag.',
84
+ 'errNotUTF8Content' : 'Fílan "$1" er ikki í UTF-8 og kann ikki vera rættað.', // added 9.11.2011
85
+ 'errNetMount' : 'Kundi ikki "mounta" "$1".', // added 17.04.2012
86
+ 'errNetMountNoDriver' : 'Ikki stuðla protokol.', // added 17.04.2012
87
+ 'errNetMountFailed' : 'Mount miseydnaðist.', // added 17.04.2012
88
+ 'errNetMountHostReq' : 'Host kravt.', // added 18.04.2012
89
+ 'errSessionExpires' : 'Tín seta er útgingin vegna óvirkniy.',
90
+ 'errCreatingTempDir' : 'Ikki ført fyri at stovna fyribils fíluskrá: "$1"',
91
+ 'errFtpDownloadFile' : 'Ikki ført fyri at taka fílu niður frá FTP: "$1"',
92
+ 'errFtpUploadFile' : 'Ikki ført fyri at leggja fílu til FTP: "$1"',
93
+ 'errFtpMkdir' : 'Ikki ført fyri at stovna fjar-fílaskrá á FTP: "$1"',
94
+ 'errArchiveExec' : 'Villa íkomin undir arkiveran af fílar: "$1"',
95
+ 'errExtractExec' : 'Villa íkomin undir útpakking af fílum: "$1"',
96
+ 'errNetUnMount' : 'Unable to unmount', // from v2.1 added 30.04.2012
97
+ 'errConvUTF8' : 'Kann ikki broytast til UTF-8', // from v2.1 added 08.04.2014
98
+ 'errFolderUpload' : 'Royn Google Chrome, um tú ynskir at leggja mappu innn.', // from v2.1 added 26.6.2015
99
+
100
+ /******************************* commands names ********************************/
101
+ 'cmdarchive' : 'Stovna arkiv',
102
+ 'cmdback' : 'Aftur\'',
103
+ 'cmdcopy' : 'Kopier',
104
+ 'cmdcut' : 'Klipp',
105
+ 'cmddownload' : 'Tak niður',
106
+ 'cmdduplicate' : 'Tvífalda',
107
+ 'cmdedit' : 'Rætta fílu',
108
+ 'cmdextract' : 'Pakka út fílar úr arkiv',
109
+ 'cmdforward' : 'Fram',
110
+ 'cmdgetfile' : 'Vel fílar',
111
+ 'cmdhelp' : 'Um hesa software',
112
+ 'cmdhome' : 'Heim',
113
+ 'cmdinfo' : 'Fá upplýsingar',
114
+ 'cmdmkdir' : 'Nýggja mappu',
115
+ 'cmdmkfile' : 'Nýggja tekst fílu',
116
+ 'cmdopen' : 'Opna',
117
+ 'cmdpaste' : 'Set inn',
118
+ 'cmdquicklook' : 'Forsýning',
119
+ 'cmdreload' : 'Les inn umaftur',
120
+ 'cmdrename' : 'Umdoyp',
121
+ 'cmdrm' : 'Strika',
122
+ 'cmdsearch' : 'Finn fílar',
123
+ 'cmdup' : 'Eitt stig upp',
124
+ 'cmdupload' : 'Legg fílar inn',
125
+ 'cmdview' : 'Síggj',
126
+ 'cmdresize' : 'Tillaga stødd & Roter',
127
+ 'cmdsort' : 'Raða',
128
+ 'cmdnetmount' : 'Mount network volume', // added 18.04.2012
129
+ 'cmdnetunmount': 'Unmount', // from v2.1 added 30.04.2012
130
+ 'cmdplaces' : 'Til støð', // added 28.12.2014
131
+ 'cmdchmod' : 'Broytir stíl', // from v2.1 added 20.6.2015
132
+
133
+ /*********************************** buttons ***********************************/
134
+ 'btnClose' : 'Lat aftur',
135
+ 'btnSave' : 'Goym',
136
+ 'btnRm' : 'Strika',
137
+ 'btnApply' : 'Brúka',
138
+ 'btnCancel' : 'Angra',
139
+ 'btnNo' : 'Nei',
140
+ 'btnYes' : 'Ja',
141
+ 'btnMount' : 'Mount', // added 18.04.2012
142
+ 'btnApprove': 'Goto $1 & approve', // from v2.1 added 26.04.2012
143
+ 'btnUnmount': 'Unmount', // from v2.1 added 30.04.2012
144
+ 'btnConv' : 'Konverter', // from v2.1 added 08.04.2014
145
+ 'btnCwd' : 'Her', // from v2.1 added 22.5.2015
146
+ 'btnVolume' : 'Volume', // from v2.1 added 22.5.2015
147
+ 'btnAll' : 'Øll', // from v2.1 added 22.5.2015
148
+ 'btnMime' : 'MIME Slag', // from v2.1 added 22.5.2015
149
+ 'btnFileName':'Fílunavn', // from v2.1 added 22.5.2015
150
+ 'btnSaveClose': 'Goym & Lat aftur', // from v2.1 added 12.6.2015
151
+ 'btnBackup' : 'Backup', // fromv2.1 added 28.11.2015
152
+
153
+ /******************************** notifications ********************************/
154
+ 'ntfopen' : 'Opna mappu',
155
+ 'ntffile' : '\'Opna fílu',
156
+ 'ntfreload' : 'Les innaftur mappu innihald',
157
+ 'ntfmkdir' : 'Stovnar mappu',
158
+ 'ntfmkfile' : 'Stovnar fílur',
159
+ 'ntfrm' : 'Strikar fílur',
160
+ 'ntfcopy' : 'Kopierar fílur',
161
+ 'ntfmove' : 'Flytur fílar',
162
+ 'ntfprepare' : 'Ger klárt at kopiera fílar',
163
+ 'ntfrename' : 'Umdoyp fílar',
164
+ 'ntfupload' : 'Leggur inn fílar',
165
+ 'ntfdownload' : 'Tekur fílar niður',
166
+ 'ntfsave' : 'Goymir fílar',
167
+ 'ntfarchive' : 'Stovnar arkiv',
168
+ 'ntfextract' : 'Útpakkar fílar frá arkiv',
169
+ 'ntfsearch' : 'Leitar eftir fílum',
170
+ 'ntfresize' : 'Broytir stødd á fílur',
171
+ 'ntfsmth' : '\'Ger okkurt >_<',
172
+ 'ntfloadimg' : 'Lesur mynd inn',
173
+ 'ntfnetmount' : 'Mounting network volume', // added 18.04.2012
174
+ 'ntfnetunmount': 'Unmounting network volume', // from v2.1 added 30.04.2012
175
+ 'ntfdim' : 'Tekur mynda vídd', // added 20.05.2013
176
+ 'ntfreaddir' : 'Lesur mappu upplýsingar', // from v2.1 added 01.07.2013
177
+ 'ntfurl' : 'Far URL af leinkju', // from v2.1 added 11.03.2014
178
+ 'ntfchmod' : 'Broyti fílu stíl', // from v2.1 added 20.6.2015
179
+ 'ntfpreupload': 'Kannar fílunavnið á fílu', // from v2.1 added 31.11.2015
180
+
181
+ /************************************ dates **********************************/
182
+ 'dateUnknown' : 'ókent',
183
+ 'Today' : 'Í dag',
184
+ 'Yesterday' : 'Í gjár',
185
+ 'msJan' : 'Jan',
186
+ 'msFeb' : 'Feb',
187
+ 'msMar' : 'Mar',
188
+ 'msApr' : 'Apr',
189
+ 'msMay' : 'Mai',
190
+ 'msJun' : 'Jun',
191
+ 'msJul' : 'Jul',
192
+ 'msAug' : 'Aug',
193
+ 'msSep' : 'Sep',
194
+ 'msOct' : 'Okt',
195
+ 'msNov' : 'Nov',
196
+ 'msDec' : 'Des',
197
+ 'January' : 'Januar',
198
+ 'February' : 'Februar',
199
+ 'March' : 'Mars',
200
+ 'April' : 'Apríl',
201
+ 'May' : 'Mai',
202
+ 'June' : 'Juni',
203
+ 'July' : 'Juli',
204
+ 'August' : 'August',
205
+ 'September' : 'September',
206
+ 'October' : 'Oktober',
207
+ 'November' : 'November',
208
+ 'December' : 'Desember',
209
+ 'Sunday' : 'Sunnudag',
210
+ 'Monday' : 'Mánadag',
211
+ 'Tuesday' : 'Týsdag',
212
+ 'Wednesday' : 'Mikudag',
213
+ 'Thursday' : 'Hósdag',
214
+ 'Friday' : 'Fríggjadag',
215
+ 'Saturday' : 'Leygardag',
216
+ 'Sun' : 'Sun',
217
+ 'Mon' : 'Mán',
218
+ 'Tue' : 'Týs',
219
+ 'Wed' : 'Mik',
220
+ 'Thu' : 'Hós',
221
+ 'Fri' : 'Frí',
222
+ 'Sat' : 'Ley',
223
+
224
+ /******************************** sort variants ********************************/
225
+ 'sortname' : 'eftir navn',
226
+ 'sortkind' : 'eftir slag',
227
+ 'sortsize' : 'eftir stødd',
228
+ 'sortdate' : 'eftir dato',
229
+ 'sortFoldersFirst' : 'mappur fyrst',
230
+
231
+ /********************************** new items **********************************/
232
+ 'untitled file.txt' : 'NýggjaFílu.txt', // added 10.11.2015
233
+ 'untitled folder' : 'NýggjaMappu', // added 10.11.2015
234
+ 'Archive' : 'NýtArkiv', // from v2.1 added 10.11.2015
235
+
236
+ /********************************** messages **********************************/
237
+ 'confirmReq' : 'Váttan kravd',
238
+ 'confirmRm' : 'Ert tú vísur í at tú ynskir at strika fílarnar?<br/>Hetta kann ikki angrast!',
239
+ 'confirmRepl' : 'Erstatta gomlu fílu við nýggja?',
240
+ 'confirmConvUTF8' : 'Brúka á øll', // from v2.1 added 08.04.2014
241
+ 'confirmNotSave' : 'Er blivi rættað.<br/>Missir sínar broytingar um tú ikki goymir.', // from v2.1 added 15.7.2015
242
+ 'apllyAll' : 'Brúka til øll',
243
+ 'name' : 'Navn',
244
+ 'size' : 'Stødd',
245
+ 'perms' : 'Rættindi',
246
+ 'modify' : 'Rættað',
247
+ 'kind' : 'Slag',
248
+ 'read' : 'síggja',
249
+ 'write' : 'broyta',
250
+ 'noaccess' : 'onga atgongd',
251
+ 'and' : 'og',
252
+ 'unknown' : 'ókent',
253
+ 'selectall' : 'Vel allar fílur',
254
+ 'selectfiles' : 'Vel fílu(r)',
255
+ 'selectffile' : 'Vel fyrstu fílu',
256
+ 'selectlfile' : 'Vel síðstu fílu',
257
+ 'viewlist' : 'Lista vísing',
258
+ 'viewicons' : 'Ikon vísing',
259
+ 'places' : 'Støð',
260
+ 'calc' : 'Rokna',
261
+ 'path' : 'Stiga',
262
+ 'aliasfor' : 'Hjánavn fyri',
263
+ 'locked' : 'Læst',
264
+ 'dim' : 'Vídd',
265
+ 'files' : 'Fílur',
266
+ 'folders' : 'Mappur',
267
+ 'items' : 'Myndir',
268
+ 'yes' : 'ja',
269
+ 'no' : 'nei',
270
+ 'link' : 'Leinkja',
271
+ 'searcresult' : 'Leiti úrslit',
272
+ 'selected' : 'valdar myndir',
273
+ 'about' : 'Um',
274
+ 'shortcuts' : 'Snarvegir',
275
+ 'help' : 'Hjálp',
276
+ 'webfm' : 'Web fílu umsitan',
277
+ 'ver' : 'Útgáva',
278
+ 'protocolver' : 'protokol versión',
279
+ 'homepage' : 'Verkætlan heim',
280
+ 'docs' : 'Skjalfesting',
281
+ 'github' : 'Mynda okkum á Github',
282
+ 'twitter' : 'Fylg okkum á twitter',
283
+ 'facebook' : 'Fylg okkum á facebook',
284
+ 'team' : 'Lið',
285
+ 'chiefdev' : 'forritaleiðari',
286
+ 'developer' : 'forritari',
287
+ 'contributor' : 'stuðulsveitari',
288
+ 'maintainer' : 'viðlíkahaldari',
289
+ 'translator' : 'umsetari',
290
+ 'icons' : 'Ikonir',
291
+ 'dontforget' : 'and don\'t forget to take your towel',
292
+ 'shortcutsof' : 'Snarvegir sligi frá',
293
+ 'dropFiles' : 'Slepp fílur her',
294
+ 'or' : 'ella',
295
+ 'selectForUpload' : 'Vel fílur at leggja inn',
296
+ 'moveFiles' : 'Flyt fílur',
297
+ 'copyFiles' : 'Kopier fílur',
298
+ 'rmFromPlaces' : 'Flyt frá støð',
299
+ 'aspectRatio' : 'Skermformat',
300
+ 'scale' : 'Skalera',
301
+ 'width' : 'Longd',
302
+ 'height' : 'Hædd',
303
+ 'resize' : 'Tilliga stødd',
304
+ 'crop' : 'Sker til',
305
+ 'rotate' : 'Rotera',
306
+ 'rotate-cw' : 'Rotera 90 gradir við urið',
307
+ 'rotate-ccw' : 'otera 90 gradir móti urið',
308
+ 'degree' : '°',
309
+ 'netMountDialogTitle' : 'Mount network volume', // added 18.04.2012
310
+ 'protocol' : 'Protokol', // added 18.04.2012
311
+ 'host' : 'Host', // added 18.04.2012
312
+ 'port' : 'Port', // added 18.04.2012
313
+ 'user' : 'Brúkari', // added 18.04.2012
314
+ 'pass' : 'Loyniorð', // added 18.04.2012
315
+ 'confirmUnmount' : 'Are you unmount $1?', // from v2.1 added 30.04.2012
316
+ 'dropFilesBrowser': 'Hála ella set innn fílar frá kaga', // from v2.1 added 30.05.2012
317
+ 'dropPasteFiles' : 'Hála ella set inn fílar frá URls her', // from v2.1 added 07.04.2014
318
+ 'encoding' : 'Encoding', // from v2.1 added 19.12.2014
319
+ 'locale' : 'Locale', // from v2.1 added 19.12.2014
320
+ 'searchTarget' : 'Target: $1', // from v2.1 added 22.5.2015
321
+ 'searchMime' : 'Leita við input MIME Type', // from v2.1 added 22.5.2015
322
+ 'owner' : 'Eigari', // from v2.1 added 20.6.2015
323
+ 'group' : 'Bólkur', // from v2.1 added 20.6.2015
324
+ 'other' : 'Annað', // from v2.1 added 20.6.2015
325
+ 'execute' : 'Útfør', // from v2.1 added 20.6.2015
326
+ 'perm' : 'Rættindi', // from v2.1 added 20.6.2015
327
+ 'mode' : 'Mode', // from v2.1 added 20.6.2015
328
+
329
+ /********************************** mimetypes **********************************/
330
+ 'kindUnknown' : 'Ókent',
331
+ 'kindFolder' : 'Mappa',
332
+ 'kindAlias' : 'Hjánavn',
333
+ 'kindAliasBroken' : 'Óvirki hjánavn',
334
+ // applications
335
+ 'kindApp' : 'Applikatión',
336
+ 'kindPostscript' : 'Postscript skjal',
337
+ 'kindMsOffice' : 'Microsoft Office skjal',
338
+ 'kindMsWord' : 'Microsoft Word skjal',
339
+ 'kindMsExcel' : 'Microsoft Excel skjal',
340
+ 'kindMsPP' : 'Microsoft Powerpoint framløga',
341
+ 'kindOO' : 'Open Office skjal',
342
+ 'kindAppFlash' : 'Flash applikatión',
343
+ 'kindPDF' : 'Portable Document Format (PDF)',
344
+ 'kindTorrent' : 'Bittorrent fíla',
345
+ 'kind7z' : '7z arkiv',
346
+ 'kindTAR' : 'TAR arkiv',
347
+ 'kindGZIP' : 'GZIP arkiv',
348
+ 'kindBZIP' : 'BZIP arkiv',
349
+ 'kindXZ' : 'XZ arkiv',
350
+ 'kindZIP' : 'ZIP arkiv',
351
+ 'kindRAR' : 'RAR arkiv',
352
+ 'kindJAR' : 'Java JAR ffílaile',
353
+ 'kindTTF' : 'True Type font',
354
+ 'kindOTF' : 'Open Type font',
355
+ 'kindRPM' : 'RPM pakki',
356
+ // texts
357
+ 'kindText' : 'Text skjal',
358
+ 'kindTextPlain' : 'Reinur tekstur',
359
+ 'kindPHP' : 'PHP kelda',
360
+ 'kindCSS' : 'Cascading style sheet (CSS)',
361
+ 'kindHTML' : 'HTML skjal',
362
+ 'kindJS' : 'Javascript kelda',
363
+ 'kindRTF' : 'Rich Text Format (RTF)',
364
+ 'kindC' : 'C kelda',
365
+ 'kindCHeader' : 'C header kelda',
366
+ 'kindCPP' : 'C++ kelda',
367
+ 'kindCPPHeader' : 'C++ header kelda',
368
+ 'kindShell' : 'Unix shell script',
369
+ 'kindPython' : 'Python kelda',
370
+ 'kindJava' : 'Java kelda',
371
+ 'kindRuby' : 'Ruby kelda',
372
+ 'kindPerl' : 'Perl script',
373
+ 'kindSQL' : 'SQL kelda',
374
+ 'kindXML' : 'XML skjal',
375
+ 'kindAWK' : 'AWK kelda',
376
+ 'kindCSV' : 'Comma separated values (CSV)',
377
+ 'kindDOCBOOK' : 'Docbook XML skjal',
378
+ 'kindMarkdown' : 'Markdown text', // added 20.7.2015
379
+ // images
380
+ 'kindImage' : 'Mynd',
381
+ 'kindBMP' : 'BMP mynd',
382
+ 'kindJPEG' : 'JPEG mynd',
383
+ 'kindGIF' : 'GIF mynd',
384
+ 'kindPNG' : 'PNG mynd',
385
+ 'kindTIFF' : 'TIFF mynd',
386
+ 'kindTGA' : 'TGA mynd',
387
+ 'kindPSD' : 'Adobe Photoshop mynd',
388
+ 'kindXBITMAP' : 'X bitmap mynd',
389
+ 'kindPXM' : 'Pixelmator mynd',
390
+ // media
391
+ 'kindAudio' : 'Audio media',
392
+ 'kindAudioMPEG' : 'MPEG ljóðfíla',
393
+ 'kindAudioMPEG4' : 'MPEG-4 ljóðfíla',
394
+ 'kindAudioMIDI' : 'MIDI ljóðfíla',
395
+ 'kindAudioOGG' : 'Ogg Vorbis ljóðfíla',
396
+ 'kindAudioWAV' : 'WAV ljóðfíla',
397
+ 'AudioPlaylist' : 'MP3 playlisti',
398
+ 'kindVideo' : 'Video media',
399
+ 'kindVideoDV' : 'DV filmur',
400
+ 'kindVideoMPEG' : 'MPEG filmur',
401
+ 'kindVideoMPEG4' : 'MPEG-4 filmur',
402
+ 'kindVideoAVI' : 'AVI filmur',
403
+ 'kindVideoMOV' : 'Quick Time filmur',
404
+ 'kindVideoWM' : 'Windows Media filmur',
405
+ 'kindVideoFlash' : 'Flash filmur',
406
+ 'kindVideoMKV' : 'Matroska filmur',
407
+ 'kindVideoOGG' : 'Ogg filmur'
408
+ }
409
+ };
410
+ }
411
+
elFinder/js/i18n/elfinder.fr.js ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * French translation
3
+ * @author Régis Guyomarch <regisg@gmail.com>, Benoit Delachaux <benorde33@gmail.com>
4
+ * @version 2014-12-19
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.fr = {
8
+ translator : 'Régis Guyomarch &lt;regisg@gmail.com&gt;Benoit Delachaux &lt;benorde33@gmail.com&gt;',
9
+ language : 'française',
10
+ direction : 'ltr',
11
+ dateFormat : 'd M, Y H:i',
12
+ fancyDateFormat : '$1 H:i',
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'Erreur',
17
+ 'errUnknown' : 'Erreur inconnue.',
18
+ 'errUnknownCmd' : 'Commande inconnue.',
19
+ 'errJqui' : 'Mauvaise configuration de jQuery UI. Les composants Selectable, draggable et droppable doivent être inclus.',
20
+ 'errNode' : 'elFinder requiert que l\'élément DOM ait été créé.',
21
+ 'errURL' : 'Mauvaise configuration d\'elFinder ! L\'option URL n\a pas été définie.',
22
+ 'errAccess' : 'Accès refusé.',
23
+ 'errConnect' : 'Impossible de se connecter au backend.',
24
+ 'errAbort' : 'Connexion interrompue.',
25
+ 'errTimeout' : 'Délai de connexion dépassé.',
26
+ 'errNotFound' : 'Backend non trouvé.',
27
+ 'errResponse' : 'Mauvaise réponse du backend.',
28
+ 'errConf' : 'Mauvaise configuration du backend.',
29
+ 'errJSON' : 'Le module PHP JSON n\'est pas installé.',
30
+ 'errNoVolumes' : 'Aucun volume lisible.',
31
+ 'errCmdParams' : 'Mauvais Paramétrage de la commande "$1".',
32
+ 'errDataNotJSON' : 'Les données ne sont pas au format JSON.',
33
+ 'errDataEmpty' : 'Données inexistantes.',
34
+ 'errCmdReq' : 'La requête au Backend doit comporter le nom de la commande.',
35
+ 'errOpen' : 'Impossible d\'ouvrir "$1".',
36
+ 'errNotFolder' : 'Cet objet n\'est pas un dossier.',
37
+ 'errNotFile' : 'Cet objet n\'est pas un fichier.',
38
+ 'errRead' : 'Impossible de lire "$1".',
39
+ 'errWrite' : 'Impossible d\'écrire dans "$1".',
40
+ 'errPerm' : 'Permission refusée.',
41
+ 'errLocked' : '"$1" est verrouillé et ne peut être déplacé ou supprimé.',
42
+ 'errExists' : 'Un fichier nommé "$1" existe déjà.',
43
+ 'errInvName' : 'Nom de fichier incorrect.',
44
+ 'errFolderNotFound' : 'Dossier non trouvé.',
45
+ 'errFileNotFound' : 'Fichier non trouvé.',
46
+ 'errTrgFolderNotFound' : 'Dossier destination "$1" non trouvé.',
47
+ 'errPopup' : 'Le navigateur web a empêché l\'ouverture d\'une fenêtre "popup". Pour ouvrir le fichier, modifiez les options du navigateur web.',
48
+ 'errMkdir' : 'Impossible de créer le dossier "$1".',
49
+ 'errMkfile' : 'impossible de créer le fichier "$1".',
50
+ 'errRename' : 'Impossible de renommer "$1".',
51
+ 'errCopyFrom' : 'Interdiction de copier des fichiers depuis le volume "$1".',
52
+ 'errCopyTo' : 'Interdiction de copier des fichiers vers le volume "$1".',
53
+ 'errUpload' : 'Erreur lors de l\'envoi du fichier.',
54
+ 'errUploadFile' : 'Impossible d\'envoyer "$1".',
55
+ 'errUploadNoFiles' : 'Aucun fichier à envoyer.',
56
+ 'errUploadTotalSize' : 'Les données dépassent la taille maximale allouée.',
57
+ 'errUploadFileSize' : 'Le fichier dépasse la taille maximale allouée.',
58
+ 'errUploadMime' : 'Type de fichier non autorisé.',
59
+ 'errUploadTransfer' : '"$1" erreur transfert.',
60
+ 'errNotReplace' : 'L\'objet "$1" existe déjà à cet endroit et ne peut être remplacé par un objet d\'un type différent.', // new
61
+ 'errReplace' : 'Impossible de remplacer "$1".', // added 11.08.1013
62
+ 'errSave' : 'Impossible de sauvegarder "$1".',
63
+ 'errCopy' : 'Impossible de copier "$1".',
64
+ 'errMove' : 'Impossible de déplacer "$1".',
65
+ 'errCopyInItself' : 'Impossible de copier "$1" sur lui-même.',
66
+ 'errRm' : 'Impossible de supprimer "$1".',
67
+ 'errRmSrc' : 'Unable remove source file(s).',
68
+ 'errExtract' : 'Imbossible d\'extraire les fichiers à partir de "$1".', // added 11.08.2012
69
+ 'errArchive' : 'Impossible de créer l\'archive.',
70
+ 'errArcType' : 'Type d\'archive non supporté.',
71
+ 'errNoArchive' : 'Le fichier n\'est pas une archive, ou c\'est un type d\'archive non supporté.',
72
+ 'errCmdNoSupport' : 'Le Backend ne prend pas en charge cette commande.',
73
+ 'errReplByChild' : 'Le dossier “$1” ne peut pas être remplacé par un élément qu\'il contient.',
74
+ 'errArcSymlinks' : 'Par mesure de sécurité, il est défendu d\'extraire une archive contenant des liens symboliques.',
75
+ 'errArcMaxSize' : 'Les fichiers de l\'archive excèdent la taille maximale autorisée.',
76
+ 'errResize' : 'Impossible de redimensionner "$1".',
77
+ 'errResizeDegree' : 'Degré de rotation invalide.', // added 11.8.2013
78
+ 'errResizeRotate' : 'L\'image ne peut pas être tournée.', // added 11.8.2013
79
+ 'errResizeSize' : 'Dimension de l\'image non-valide.', // added 11.8.2013
80
+ 'errResizeNoChange' : 'L\'image n\'est pas redimensionnable.', // added 11.8.2013
81
+ 'errUsupportType' : 'Type de fichier non supporté.',
82
+ 'errNotUTF8Content' : 'Le fichier "$1" n\'est pas en UTF-8, il ne peut être édité.', // added 9.11.2011
83
+ 'errNetMount' : 'Impossible de monter "$1".', // added 17.04.2012
84
+ 'errNetMountNoDriver' : 'Protocol non supporté.', // added 17.04.2012
85
+ 'errNetMountFailed' : 'Echec du montage.', // added 17.04.2012
86
+ 'errNetMountHostReq' : 'Hôte requis.', // added 18.04.2012
87
+ 'errSessionExpires' : 'Votre session a expiré en raison de son inactivité',
88
+ 'errCreatingTempDir' : 'Impossible de créer le répertoire temporaire : "$1"',
89
+ 'errFtpDownloadFile' : 'Impossible de télécharger le file depuis l\'accès FTP : "$1"',
90
+ 'errFtpUploadFile' : 'Impossible d\'envoyer le fichier vers l\'accès FTP : "$1"',
91
+ 'errFtpMkdir' : 'Impossible de créer un répertoire distant sur l\'accès FTP :"$1"',
92
+ 'errArchiveExec' : 'Erreur lors de l\'archivage des fichiers : "$1"',
93
+ 'errExtractExec' : 'Erreur lors de l\'extraction des fichiers : "$1"',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'Créer une archive',
97
+ 'cmdback' : 'Précédent',
98
+ 'cmdcopy' : 'Copier',
99
+ 'cmdcut' : 'Couper',
100
+ 'cmddownload' : 'Télécharger',
101
+ 'cmdduplicate' : 'Dupliquer',
102
+ 'cmdedit' : 'Éditer le fichier',
103
+ 'cmdextract' : 'Extraire les fichiers de l\'archive',
104
+ 'cmdforward' : 'Suivant',
105
+ 'cmdgetfile' : 'Sélectionner les fichiers',
106
+ 'cmdhelp' : 'À propos de ce logiciel',
107
+ 'cmdhome' : 'Accueil',
108
+ 'cmdinfo' : 'Informations',
109
+ 'cmdmkdir' : 'Nouveau dossier',
110
+ 'cmdmkfile' : 'Nouveau fichier texte',
111
+ 'cmdopen' : 'Ouvrir',
112
+ 'cmdpaste' : 'Coller',
113
+ 'cmdquicklook' : 'Prévisualiser',
114
+ 'cmdreload' : 'Actualiser',
115
+ 'cmdrename' : 'Renommer',
116
+ 'cmdrm' : 'Supprimer',
117
+ 'cmdsearch' : 'Trouver les fichiers',
118
+ 'cmdup' : 'Remonter au dossier parent',
119
+ 'cmdupload' : 'Envoyer les fichiers',
120
+ 'cmdview' : 'Vue',
121
+ 'cmdresize' : 'Redimensionner l\'image',
122
+ 'cmdsort' : 'Trier',
123
+ 'cmdnetmount' : 'Monter un volume réseau',
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'Fermer',
127
+ 'btnSave' : 'Sauvegarder',
128
+ 'btnRm' : 'Supprimer',
129
+ 'btnApply' : 'Apply',
130
+ 'btnCancel' : 'Annuler',
131
+ 'btnNo' : 'Non',
132
+ 'btnYes' : 'Oui',
133
+ 'btnMount' : 'Monter', // added 18.04.2012
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'Ouvrir le dossier',
137
+ 'ntffile' : 'Ouvrir le fichier',
138
+ 'ntfreload' : 'Actualiser le contenu du dossier',
139
+ 'ntfmkdir' : 'Création du dossier',
140
+ 'ntfmkfile' : 'Création des fichiers',
141
+ 'ntfrm' : 'Supprimer les fichiers',
142
+ 'ntfcopy' : 'Copier les fichiers',
143
+ 'ntfmove' : 'Déplacer les fichiers',
144
+ 'ntfprepare' : 'Préparation de la copie des fichiers',
145
+ 'ntfrename' : 'Renommer les fichier',
146
+ 'ntfupload' : 'Envoyer les fichiers',
147
+ 'ntfdownload' : 'Télécharger les fichiers',
148
+ 'ntfsave' : 'Sauvegarde des fichiers',
149
+ 'ntfarchive' : 'Création de l\'archive',
150
+ 'ntfextract' : 'Extraction des fichiers de l\'archive',
151
+ 'ntfsearch' : 'Recherche des fichiers',
152
+ 'ntfresize' : 'Resizing images',
153
+ 'ntfsmth' : 'Fait quelque chose',
154
+ 'ntfloadimg' : 'Chargement de l\' image',
155
+ 'ntfnetmount' : 'Monte le volume réseau', // added 18.04.2012
156
+ 'ntfdim' : 'Calcule la dimension de l\'image', // added 11.08.2013
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'Inconnue',
160
+ 'Today' : 'Aujourd\'hui',
161
+ 'Yesterday' : 'Hier',
162
+ 'msJan' : 'Jan',
163
+ 'msFeb' : 'Fév',
164
+ 'msMar' : 'Mar',
165
+ 'msApr' : 'Avr',
166
+ 'msMay' : 'Mai',
167
+ 'msJun' : 'Jun',
168
+ 'msJul' : 'Jul',
169
+ 'msAug' : 'Aoû',
170
+ 'msSep' : 'Sep',
171
+ 'msOct' : 'Oct',
172
+ 'msNov' : 'Nov',
173
+ 'msDec' : 'Déc',
174
+ 'January' : 'January',
175
+ 'February' : 'February',
176
+ 'March' : 'March',
177
+ 'April' : 'April',
178
+ 'May' : 'May',
179
+ 'June' : 'June',
180
+ 'July' : 'July',
181
+ 'August' : 'August',
182
+ 'September' : 'September',
183
+ 'October' : 'October',
184
+ 'November' : 'November',
185
+ 'December' : 'December',
186
+ 'Sunday' : 'Sunday',
187
+ 'Monday' : 'Monday',
188
+ 'Tuesday' : 'Tuesday',
189
+ 'Wednesday' : 'Wednesday',
190
+ 'Thursday' : 'Thursday',
191
+ 'Friday' : 'Friday',
192
+ 'Saturday' : 'Saturday',
193
+ 'Sun' : 'Sun',
194
+ 'Mon' : 'Mon',
195
+ 'Tue' : 'Tue',
196
+ 'Wed' : 'Wed',
197
+ 'Thu' : 'Thu',
198
+ 'Fri' : 'Fri',
199
+ 'Sat' : 'Sat',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'par nom',
203
+ 'sortkind' : 'par type',
204
+ 'sortsize' : 'par taille',
205
+ 'sortdate' : 'par date',
206
+ 'sortFoldersFirst' : 'Dossiers en premier',
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'Confirmation requise',
210
+ 'confirmRm' : 'Êtes-vous certain de vouloir supprimer les fichiers?<br/>Cela ne peut être annulé!',
211
+ 'confirmRepl' : 'Supprimer l\'ancien fichier par le nouveau?',
212
+ 'apllyAll' : 'Appliquer à tous',
213
+ 'name' : 'Nom',
214
+ 'size' : 'Taille',
215
+ 'perms' : 'Permissions',
216
+ 'modify' : 'Modifié',
217
+ 'kind' : 'Type',
218
+ 'read' : 'Lecture',
219
+ 'write' : 'Écriture',
220
+ 'noaccess' : 'Pas d\'accès',
221
+ 'and' : 'et',
222
+ 'unknown' : 'inconnu',
223
+ 'selectall' : 'Sélectionner tous les fichiers',
224
+ 'selectfiles' : 'Sélectionner le(s) fichier(s)',
225
+ 'selectffile' : 'Sélectionner le premier fichier',
226
+ 'selectlfile' : 'Sélectionner le dernier fichier',
227
+ 'viewlist' : 'Vue listing',
228
+ 'viewicons' : 'Vue icônes',
229
+ 'places' : 'Places',
230
+ 'calc' : 'Calculer',
231
+ 'path' : 'Chemin',
232
+ 'aliasfor' : 'Raccourcis pour',
233
+ 'locked' : 'Verrouiller',
234
+ 'dim' : 'Dimensions',
235
+ 'files' : 'Fichiers',
236
+ 'folders' : 'Dossiers',
237
+ 'items' : 'Éléments',
238
+ 'yes' : 'oui',
239
+ 'no' : 'non',
240
+ 'link' : 'Lien',
241
+ 'searcresult' : 'Résultat de la recherche',
242
+ 'selected' : 'Éléments sélectionnés',
243
+ 'about' : 'À propos',
244
+ 'shortcuts' : 'Raccourcis',
245
+ 'help' : 'Aide',
246
+ 'webfm' : 'Gestionnaire de fichier Web',
247
+ 'ver' : 'Version',
248
+ 'protocolver' : 'Version du protocole',
249
+ 'homepage' : 'Page du projet',
250
+ 'docs' : 'Documentation',
251
+ 'github' : 'Forker-nous sur Github',
252
+ 'twitter' : 'Suivez nous sur twitter',
253
+ 'facebook' : 'Joignez-nous facebook',
254
+ 'team' : 'Équipe',
255
+ 'chiefdev' : 'Développeur en chef',
256
+ 'developer' : 'Développeur',
257
+ 'contributor' : 'Contributeur',
258
+ 'maintainer' : 'Mainteneur',
259
+ 'translator' : 'Traducteur',
260
+ 'icons' : 'Icônes',
261
+ 'dontforget' : 'et n\'oubliez pas votre serviette',
262
+ 'shortcutsof' : 'Raccourcis désactivés',
263
+ 'dropFiles' : 'Déposez les fichiers ici',
264
+ 'or' : 'ou',
265
+ 'selectForUpload' : 'Sélectionner les fichiers à envoyer',
266
+ 'moveFiles' : 'Déplacer les fichiers',
267
+ 'copyFiles' : 'Copier les fichiers',
268
+ 'rmFromPlaces' : 'Remove from places',
269
+ 'aspectRatio' : 'Aspect ratio',
270
+ 'scale' : 'Mise à l\'échelle',
271
+ 'width' : 'Largeur',
272
+ 'height' : 'Hauteur',
273
+ 'resize' : 'Redimensionner',
274
+ 'crop' : 'Recadrer',
275
+ 'rotate' : 'Rotation',
276
+ 'rotate-cw' : 'Rotation de 90 degrés horaire',
277
+ 'rotate-ccw' : 'Rotation de 90 degrés antihoraire',
278
+ 'degree' : '°',
279
+ 'netMountDialogTitle' : 'Monter un volume réseau', // added 18.04.2012
280
+ 'protocol' : 'Protocole', // added 18.04.2012
281
+ 'host' : 'Hôte', // added 18.04.2012
282
+ 'port' : 'Port', // added 18.04.2012
283
+ 'user' : 'Utilisateur', // added 18.04.2012
284
+ 'pass' : 'Mot de passe', // added 18.04.2012
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'Inconnu',
288
+ 'kindFolder' : 'Dossier',
289
+ 'kindAlias' : 'Raccourci',
290
+ 'kindAliasBroken' : 'Raccourci cassé',
291
+ // applications
292
+ 'kindApp' : 'Application',
293
+ 'kindPostscript' : 'Document Postscript',
294
+ 'kindMsOffice' : 'Document Microsoft Office',
295
+ 'kindMsWord' : 'Document Microsoft Word',
296
+ 'kindMsExcel' : 'Document Microsoft Excel',
297
+ 'kindMsPP' : 'Présentation Microsoft PowerPoint',
298
+ 'kindOO' : 'Document OpenOffice',
299
+ 'kindAppFlash' : 'Application Flash',
300
+ 'kindPDF' : 'Portable Document Format (PDF)',
301
+ 'kindTorrent' : 'Fichier BitTorrent',
302
+ 'kind7z' : 'Archive 7z',
303
+ 'kindTAR' : 'Archive TAR',
304
+ 'kindGZIP' : 'Archive GZIP',
305
+ 'kindBZIP' : 'Archive BZIP',
306
+ 'kindXZ' : 'Archive XZ',
307
+ 'kindZIP' : 'Archive ZIP',
308
+ 'kindRAR' : 'Archive RAR',
309
+ 'kindJAR' : 'Fichier Java JAR',
310
+ 'kindTTF' : 'Police True Type',
311
+ 'kindOTF' : 'Police Open Type',
312
+ 'kindRPM' : 'Package RPM',
313
+ // texts
314
+ 'kindText' : 'Document Text',
315
+ 'kindTextPlain' : 'Texte non formaté',
316
+ 'kindPHP' : 'Source PHP',
317
+ 'kindCSS' : 'Feuille de style en cascade',
318
+ 'kindHTML' : 'Document HTML',
319
+ 'kindJS' : 'Source JavaScript',
320
+ 'kindRTF' : 'Format de texte enrichi (Rich Text Format)',
321
+ 'kindC' : 'Source C',
322
+ 'kindCHeader' : 'Source header C',
323
+ 'kindCPP' : 'Source C++',
324
+ 'kindCPPHeader' : 'Source header C++',
325
+ 'kindShell' : 'Shell script Unix',
326
+ 'kindPython' : 'Source Python',
327
+ 'kindJava' : 'Source Java',
328
+ 'kindRuby' : 'Source Ruby',
329
+ 'kindPerl' : 'Script Perl',
330
+ 'kindSQL' : 'Source SQL',
331
+ 'kindXML' : 'Document XML',
332
+ 'kindAWK' : 'Source AWK',
333
+ 'kindCSV' : 'CSV',
334
+ 'kindDOCBOOK' : 'Document Docbook XML',
335
+ // images
336
+ 'kindImage' : 'Image',
337
+ 'kindBMP' : 'Image BMP',
338
+ 'kindJPEG' : 'Image JPEG',
339
+ 'kindGIF' : 'Image GIF',
340
+ 'kindPNG' : 'Image PNG',
341
+ 'kindTIFF' : 'Image TIFF',
342
+ 'kindTGA' : 'Image TGA',
343
+ 'kindPSD' : 'Image Adobe Photoshop',
344
+ 'kindXBITMAP' : 'Image X bitmap',
345
+ 'kindPXM' : 'Image Pixelmator',
346
+ // media
347
+ 'kindAudio' : 'Son',
348
+ 'kindAudioMPEG' : 'Son MPEG',
349
+ 'kindAudioMPEG4' : 'Son MPEG-4',
350
+ 'kindAudioMIDI' : 'Son MIDI',
351
+ 'kindAudioOGG' : 'Son Ogg Vorbis',
352
+ 'kindAudioWAV' : 'Son WAV',
353
+ 'AudioPlaylist' : 'Liste de lecture audio',
354
+ 'kindVideo' : 'Vidéo',
355
+ 'kindVideoDV' : 'Vidéo DV',
356
+ 'kindVideoMPEG' : 'Vidéo MPEG',
357
+ 'kindVideoMPEG4' : 'Vidéo MPEG-4',
358
+ 'kindVideoAVI' : 'Vidéo AVI',
359
+ 'kindVideoMOV' : 'Vidéo Quick Time',
360
+ 'kindVideoWM' : 'Vidéo Windows Media',
361
+ 'kindVideoFlash' : 'Vidéo Flash',
362
+ 'kindVideoMKV' : 'Vidéo Matroska',
363
+ 'kindVideoOGG' : 'Vidéo Ogg'
364
+ }
365
+ };
366
+ }
elFinder/js/i18n/elfinder.he.js ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * עברית translation
3
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
4
+ * @version 2015-11-02
5
+ */
6
+ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
7
+ elFinder.prototype.i18.he = {
8
+ translator : 'Yaron Shahrabani <sh.yaron@gmail.com>',
9
+ language : 'עברית',
10
+ direction : 'rtl',
11
+ dateFormat : 'd.m.Y H:i', // Mar 13, 2012 05:27 PM
12
+ fancyDateFormat : '$1 H:i', // will produce smth like: Today 12:25 PM
13
+ messages : {
14
+
15
+ /********************************** errors **********************************/
16
+ 'error' : 'שגיאה',
17
+ 'errUnknown' : 'שגיאה בלתי מוכרת.',
18
+ 'errUnknownCmd' : 'פקודה בלתי מוכרת.',
19
+ 'errJqui' : 'תצורת ה־jQuery UI שגויה. יש לכלול רכיבים הניתנים לבחירה, גרירה והשלכה.',
20
+ 'errNode' : 'elFinder דורש יצירה של רכיב DOM.',
21
+ 'errURL' : 'התצורה של elFinder שגויה! אפשרות הכתובת (URL) לא הוגדרה.',
22
+ 'errAccess' : 'הגישה נדחית.',
23
+ 'errConnect' : 'לא ניתן להתחבר למנגנון.',
24
+ 'errAbort' : 'החיבור בוטל.',
25
+ 'errTimeout' : 'זמן החיבור פג.',
26
+ 'errNotFound' : 'לא נמצא מנגנון.',
27
+ 'errResponse' : 'תגובת המנגנון שגויה.',
28
+ 'errConf' : 'תצורת המנגנון שגויה.',
29
+ 'errJSON' : 'המודול PHP JSON לא מותקן.',
30
+ 'errNoVolumes' : 'אין כוננים זמינים לקריאה.',
31
+ 'errCmdParams' : 'פרמטרים שגויים לפקודה „$1“.',
32
+ 'errDataNotJSON' : 'הנתונים אינם JSON.',
33
+ 'errDataEmpty' : 'הנתונים ריקים.',
34
+ 'errCmdReq' : 'בקשה למנגנון דורשת שם פקודה.',
35
+ 'errOpen' : 'לא ניתן לפתוח את „$1“.',
36
+ 'errNotFolder' : 'הפריט אינו תיקייה.',
37
+ 'errNotFile' : 'הפריט אינו קובץ.',
38
+ 'errRead' : 'לא ניתן לקרוא את „$1“.',
39
+ 'errWrite' : 'לא ניתן לכתוב אל „$1“.',
40
+ 'errPerm' : 'ההרשאה נדחתה.',
41
+ 'errLocked' : '„$1“ נעול ואין אפשרות לשנות את שמו, להעבירו או להסירו.',
42
+ 'errExists' : 'קובץ בשם „$1“ כבר קיים.',
43
+ 'errInvName' : 'שם הקובץ שגוי.',
44
+ 'errFolderNotFound' : 'התיקייה לא נמצאה.',
45
+ 'errFileNotFound' : 'הקובץ לא נמצא.',
46
+ 'errTrgFolderNotFound' : 'תיקיית היעד „$1“ לא נמצאה.',
47
+ 'errPopup' : 'הדפדפן מנע פתיחת חלון קובץ. כדי לפתוח קובץ יש לאפשר זאת בהגדרות הדפדפן.',
48
+ 'errMkdir' : 'לא ניתן ליצור את התיקייה „$1“.',
49
+ 'errMkfile' : 'לא ניתן ליצור את הקובץ „$1“.',
50
+ 'errRename' : 'לא ניתן לשנות את השם של „$1“.',
51
+ 'errCopyFrom' : 'העתקת קבצים מהכונן „$1“ אינה מאופשרת.',
52
+ 'errCopyTo' : 'העתקת קבצים אל הכונן „$1“ אינה מאופשרת.',
53
+ 'errUpload' : 'שגיאת העלאה.', // old name - errUploadCommon
54
+ 'errUploadFile' : 'לא ניתן להעלות את „$1“.', // old name - errUpload
55
+ 'errUploadNoFiles' : 'לא נמצאו קבצים להעלאה.',
56
+ 'errUploadTotalSize' : 'הנתונים חורגים מהגודל המרבי המותר.', // old name - errMaxSize
57
+ 'errUploadFileSize' : 'הקובץ חורג מהגודל המרבי המותר.', // old name - errFileMaxSize
58
+ 'errUploadMime' : 'סוג הקובץ אינו מורשה.',
59
+ 'errUploadTransfer' : 'שגיאת העברה „$1“.',
60
+ 'errNotReplace' : 'הפריט „$1“ כבר קיים במיקום זה ואי אפשר להחליפו בפריט מסוג אחר.', // new
61
+ 'errReplace' : 'לא ניתן להחליף את „$1“.',
62
+ 'errSave' : 'לא ניתן לשמור את „$1“.',
63
+ 'errCopy' : 'לא ניתן להעתיק את „$1“.',
64
+ 'errMove' : 'לא ניתן להעביר את „$1“.',
65
+ 'errCopyInItself' : 'לא ניתן להעתיק את „$1“ לתוך עצמו.',
66
+ 'errRm' : 'לא ניתן להסיר את „$1“.',
67
+ 'errRmSrc' : 'לא ניתן להסיר את קובצי המקור.',
68
+ 'errExtract' : 'לא ניתן לחלץ קבצים מהארכיון „$1“.',
69
+ 'errArchive' : 'לא ניתן ליצור ארכיון.',
70
+ 'errArcType' : 'סוג הארכיון אינו נתמך.',
71
+ 'errNoArchive' : 'הקובץ אינו ארכיון או שסוג הקובץ שלו אינו נתמך.',
72
+ 'errCmdNoSupport' : 'המנגנון אינו תומך בפקודה זו.',
73
+ 'errReplByChild' : 'לא ניתן להחליף את התיקייה „$1“ בפריט מתוכה.',
74
+ 'errArcSymlinks' : 'מטעמי אבטחה לא ניתן לחלץ ארכיונים שמכילים קישורים סימבוליים או קבצים עם שמות בלתי מורשים.', // edited 24.06.2012
75
+ 'errArcMaxSize' : 'הארכיון חורג מהגודל המרבי המותר.',
76
+ 'errResize' : 'לא ניתן לשנות את הגודל של „$1“.',
77
+ 'errResizeDegree' : 'מעלות ההיפוך שגויות.', // added 7.3.2013
78
+ 'errResizeRotate' : 'לא ניתן להפוך את התמונה.', // added 7.3.2013
79
+ 'errResizeSize' : 'גודל התמונה שגוי.', // added 7.3.2013
80
+ 'errResizeNoChange' : 'גודל התמונה לא השתנה.', // added 7.3.2013
81
+ 'errUsupportType' : 'סוג הקובץ אינו נתמך.',
82
+ 'errNotUTF8Content' : 'הקובץ „$1“ הוא לא בתסדיר UTF-8 ולא ניתן לערוך אותו.', // added 9.11.2011
83
+ 'errNetMount' : 'לא ניתן לעגן את „$1“.', // added 17.04.2012
84
+ 'errNetMountNoDriver' : 'פרוטוקול בלתי נתמך.', // added 17.04.2012
85
+ 'errNetMountFailed' : 'העיגון נכשל.', // added 17.04.2012
86
+ 'errNetMountHostReq' : 'נדרש מארח.', // added 18.04.2012
87
+ 'errSessionExpires' : 'ההפעלה שלך פגה עקב חוסר פעילות.',
88
+ 'errCreatingTempDir' : 'לא ניתן ליצור תיקייה זמנית: „$1“',
89
+ 'errFtpDownloadFile' : 'לא ניתן להוריד קובץ מ־ FTP: „$1“',
90
+ 'errFtpUploadFile' : 'לא ניתן להעלות קובץ ל־FTP: „$1“',
91
+ 'errFtpMkdir' : 'לא ניתן ליצור תיקייה מרוחקת ב־FTP: „$1“',
92
+ 'errArchiveExec' : 'שמירת הקבצים בארכיון נכשלה: „$1“',
93
+ 'errExtractExec' : 'חילוץ קבצים נכשל: „$1“',
94
+
95
+ /******************************* commands names ********************************/
96
+ 'cmdarchive' : 'יצירת ארכיון',
97
+ 'cmdback' : 'חזרה',
98
+ 'cmdcopy' : 'העתקה',
99
+ 'cmdcut' : 'גזירה',
100
+ 'cmddownload' : 'הורדה',
101
+ 'cmdduplicate' : 'שכפול',
102
+ 'cmdedit' : 'עריכת קובץ',
103
+ 'cmdextract' : 'חילוץ קבצים מארכיון',
104
+ 'cmdforward' : 'העברה',
105
+ 'cmdgetfile' : 'בחירת קבצים',
106
+ 'cmdhelp' : 'פרטים על התכנית הזו',
107
+ 'cmdhome' : 'בית',
108
+ 'cmdinfo' : 'קבלת מידע',
109
+ 'cmdmkdir' : 'תיקייה חדשה',
110
+ 'cmdmkfile' : 'קובץ טקסט חדש',
111
+ 'cmdopen' : 'פתיחה',
112
+ 'cmdpaste' : 'הדבקה',
113
+ 'cmdquicklook' : 'תצוגה מקדימה',
114
+ 'cmdreload' : 'רענון',
115
+ 'cmdrename' : 'שינוי שם',
116
+ 'cmdrm' : 'מחיקה',
117
+ 'cmdsearch' : 'חיפוש קבצים',
118
+ 'cmdup' : 'מעבר לתיקיית ההורה',
119
+ 'cmdupload' : 'העלאת קבצים',
120
+ 'cmdview' : 'תצוגה',
121
+ 'cmdresize' : 'שינוי גודל והיפוך',
122
+ 'cmdsort' : 'מיון',
123
+ 'cmdnetmount' : 'עיגון כונן רשת', // added 18.04.2012
124
+
125
+ /*********************************** buttons ***********************************/
126
+ 'btnClose' : 'סגירה',
127
+ 'btnSave' : 'שמירה',
128
+ 'btnRm' : 'הסרה',
129
+ 'btnApply' : 'החלה',
130
+ 'btnCancel' : 'ביטול',
131
+ 'btnNo' : 'לא',
132
+ 'btnYes' : 'כן',
133
+ 'btnMount' : 'עיגון', // added 18.04.2012
134
+
135
+ /******************************** notifications ********************************/
136
+ 'ntfopen' : 'פתיחת תיקייה',
137
+ 'ntffile' : 'פתיחת קובץ',
138
+ 'ntfreload' : 'רענון תוכן התיקייה',
139
+ 'ntfmkdir' : 'תיקייה נוצרת',
140
+ 'ntfmkfile' : 'קבצים נוצרים',
141
+ 'ntfrm' : 'קבצים נמחקים',
142
+ 'ntfcopy' : 'קבצים מועתקים',
143
+ 'ntfmove' : 'קבצים מועברים',
144
+ 'ntfprepare' : 'העתקת קבצים בהכנה',
145
+ 'ntfrename' : 'שמות קבצים משתנים',
146
+ 'ntfupload' : 'קבצים נשלחים',
147
+ 'ntfdownload' : 'קבצים מתקבלים',
148
+ 'ntfsave' : 'שמירת קבצים',
149
+ 'ntfarchive' : 'ארכיון נוצר',
150
+ 'ntfextract' : 'מחולצים קבצים מארכיון',
151
+ 'ntfsearch' : 'קבצים בחיפוש',
152
+ 'ntfresize' : 'גודל קבצים משתנה',
153
+ 'ntfsmth' : 'מתבצעת פעולה',
154
+ 'ntfloadimg' : 'נטענת תמונה',
155
+ 'ntfnetmount' : 'כונן רשת מעוגן', // added 18.04.2012
156
+ 'ntfdim' : 'ממדי תמונה מתקבלים', // added 20.05.2013
157
+
158
+ /************************************ dates **********************************/
159
+ 'dateUnknown' : 'לא ידוע',
160
+ 'Today' : 'היום',
161
+ 'Yesterday' : 'מחר',
162
+ 'msJan' : 'ינו׳',
163
+ 'msFeb' : 'פבר׳',
164
+ 'msMar' : 'מרץ',
165
+ 'msApr' : 'אפר׳',
166
+ 'msMay' : 'מאי',
167
+ 'msJun' : 'יונ׳',
168
+ 'msJul' : 'יול׳',
169
+ 'msAug' : 'אוג׳',
170
+ 'msSep' : 'ספט׳',
171
+ 'msOct' : 'אוק׳',
172
+ 'msNov' : 'נוב׳',
173
+ 'msDec' : 'דצמ׳',
174
+ 'January' : 'ינואר',
175
+ 'February' : 'פברואר',
176
+ 'March' : 'מרץ',
177
+ 'April' : 'אפריל',
178
+ 'May' : 'מאי',
179
+ 'June' : 'יוני',
180
+ 'July' : 'יולי',
181
+ 'August' : 'אוגוסט',
182
+ 'September' : 'ספטמבר',
183
+ 'October' : 'אוקטובר',
184
+ 'November' : 'נובמבר',
185
+ 'December' : 'דצמבר',
186
+ 'Sunday' : 'יום ראשון',
187
+ 'Monday' : 'יום שני',
188
+ 'Tuesday' : 'יום שלישי',
189
+ 'Wednesday' : 'יום רביעי',
190
+ 'Thursday' : 'יום חמישי',
191
+ 'Friday' : 'יום שישי',
192
+ 'Saturday' : 'שבת',
193
+ 'Sun' : 'א׳',
194
+ 'Mon' : 'ב׳',
195
+ 'Tue' : 'ג׳',
196
+ 'Wed' : 'ד׳',
197
+ 'Thu' : 'ה',
198
+ 'Fri' : 'ו׳',
199
+ 'Sat' : 'ש׳',
200
+
201
+ /******************************** sort variants ********************************/
202
+ 'sortname' : 'לפי שם',
203
+ 'sortkind' : 'לפי סוג',
204
+ 'sortsize' : 'לפי גודל',
205
+ 'sortdate' : 'לפי תאריך',
206
+ 'sortFoldersFirst' : 'תיקיות תחילה',
207
+
208
+ /********************************** messages **********************************/
209
+ 'confirmReq' : 'נדרש אישור',
210
+ 'confirmRm' : 'להסיר את הקבצים?<br/>פעולה זו בלתי הפיכה!',
211
+ 'confirmRepl' : 'להחליף קובץ ישן בקובץ חדש?',
212
+ 'apllyAll' : 'להחיל על הכול',
213
+ 'name' : 'שם',
214
+ 'size' : 'גודל',
215
+ 'perms' : 'הרשאות',
216
+ 'modify' : 'שינוי',
217
+ 'kind' : 'סוג',
218
+ 'read' : 'קריאה',
219
+ 'write' : 'כתיבה',
220
+ 'noaccess' : 'אין גישה',
221
+ 'and' : 'וגם',
222
+ 'unknown' : 'לא ידוע',
223
+ 'selectall' : 'בחירת כל הקבצים',
224
+ 'selectfiles' : 'בחירת קובץ אחד ומעלה',
225
+ 'selectffile' : 'בחירת הקובץ הראשון',
226
+ 'selectlfile' : 'בחירת הקובץ האחרון',
227
+ 'viewlist' : 'תצוגת רשימה',
228
+ 'viewicons' : 'תצוגת סמלים',
229
+ 'places' : 'מיקומים',
230
+ 'calc' : 'חישוב',
231
+ 'path' : 'נתיב',
232
+ 'aliasfor' : 'כינוי עבור',
233
+ 'locked' : 'נעול',
234
+ 'dim' : 'ממדים',
235
+ 'files' : 'קבצים',
236
+ 'folders' : 'תיקיות',
237
+ 'items' : 'פריטים',
238
+ 'yes' : 'כן',
239
+ 'no' : 'לא',
240
+ 'link' : 'קישור',
241
+ 'searcresult' : 'תוצאות חיפוש',
242
+ 'selected' : 'קבצים נבחרים',
243
+ 'about' : 'על אודות',
244
+ 'shortcuts' : 'קיצורי דרך',
245
+ 'help' : 'עזרה',
246
+ 'webfm' : 'מנהל קבצים בדפדפן',
247
+ 'ver' : 'גרסה',
248
+ 'protocolver' : 'גרסת פרוטוקול',
249
+ 'homepage' : 'דף הבית של המיזם',
250
+ 'docs' : 'תיעוד',
251
+ 'github' : 'פילוג עותק ב־Github',
252
+ 'twitter' : 'לעקוב אחרינו בטוויטר',
253
+ 'facebook' : 'להצטרף אלינו בפייסבוק',
254
+ 'team' : 'צוות',
255
+ 'chiefdev' : 'מפתח ראשי',
256
+ 'developer' : 'מתכנת',
257
+ 'contributor' : 'תורם',
258
+ 'maintainer' : 'מתחזק',
259
+ 'translator' : 'מתרגם',
260
+ 'icons' : 'סמלים',
261
+ 'dontforget' : 'לא לשכוח לקחת את המגבת שלך',
262
+ 'shortcutsof' : 'קיצורי הדרך מנוטרלים',
263
+ 'dropFiles' : 'ניתן להשליך את הקבצים לכאן',
264
+ 'or' : 'או',
265
+ 'selectForUpload' : 'לבחור קבצים להעלאה',
266
+ 'moveFiles' : 'העברת קבצים',
267
+ 'copyFiles' : 'העתקת קבצים',
268
+ 'rmFromPlaces' : 'הסרה ממיקומים',
269
+ 'aspectRatio' : 'יחס תצוגה',
270
+ 'scale' : 'מתיחה',
271
+ 'width' : 'רוחב',
272
+ 'height' : 'גובה',
273
+ 'resize' : 'שינוי הגודל',
274
+ 'crop' : 'חיתוך',
275
+ 'rotate' : 'היפוך',
276
+ 'rotate-cw' : 'היפוך ב־90 מעלות נגד השעון',
277
+ 'rotate-ccw' : 'היפוך ב־90 מעלות עם השעון CCW',
278
+ 'degree' : '°',
279
+ 'netMountDialogTitle' : 'עיגון כונן רשת', // added 18.04.2012
280
+ 'protocol' : 'פרוטוקול', // added 18.04.2012
281
+ 'host' : 'מארח', // added 18.04.2012
282
+ 'port' : 'פתחה', // added 18.04.2012
283
+ 'user' : 'משתמש', // added 18.04.2012
284
+ 'pass' : 'ססמה', // added 18.04.2012
285
+
286
+ /********************************** mimetypes **********************************/
287
+ 'kindUnknown' : 'בלתי ידוע',
288
+ 'kindFolder' : 'תיקייה',
289
+ 'kindAlias' : 'כינוי',
290
+ 'kindAliasBroken' : 'כינוי שבור',
291
+ // applications
292
+ 'kindApp' : 'יישום',
293
+ 'kindPostscript' : 'מסמך Postscript',
294
+ 'kindMsOffice' : 'מסמך Microsoft Office',
295
+ 'kindMsWord' : 'מסמך Microsoft Word',
296
+ 'kindMsExcel' : 'מסמך Microsoft Excel',
297
+ 'kindMsPP' : 'מצגת Microsoft Powerpoint',
298
+ 'kindOO' : 'מסמך Open Office',
299
+ 'kindAppFlash' : 'יישום Flash',
300
+ 'kindPDF' : 'Portable Document Format (PDF)',
301
+ 'kindTorrent' : 'קובץ Bittorrent',
302
+ 'kind7z' : 'ארכיון 7z',
303
+ 'kindTAR' : 'ארכיון TAR',
304
+ 'kindGZIP' : 'ארכיון GZIP',
305
+ 'kindBZIP' : 'ארכיון BZIP',
306
+ 'kindXZ' : 'ארכיון XZ',
307
+ 'kindZIP' : 'ארכיון ZIP',
308
+ 'kindRAR' : 'ארכיון RAR',
309
+ 'kindJAR' : 'קובץ JAR של Java',
310
+ 'kindTTF' : 'גופן True Type',
311
+ 'kindOTF' : 'גופן Open Type',
312
+ 'kindRPM' : 'חבילת RPM',
313
+ // texts
314
+ 'kindText' : 'מסמך טקסט',
315
+ 'kindTextPlain' : 'טקסט פשוט',
316
+ 'kindPHP' : 'מקור PHP',
317
+ 'kindCSS' : 'גיליון סגנון מדורג',
318
+ 'kindHTML' : 'מסמך HTML',
319
+ 'kindJS' : 'מקור Javascript',
320
+ 'kindRTF' : 'תבנית טקסט עשיר',
321
+ 'kindC' : 'מקור C',
322
+ 'kindCHeader' : 'מקור כותרת C',
323
+ 'kindCPP' : 'מקור C++',
324
+ 'kindCPPHeader' : 'מקור כותרת C++',
325
+ 'kindShell' : 'תסריט מעטפת יוניקס',
326
+ 'kindPython' : 'מקור Python',
327
+ 'kindJava' : 'מקור Java',
328
+ 'kindRuby' : 'מקור Ruby',
329
+ 'kindPerl' : 'תסריט Perl',
330
+ 'kindSQL' : 'מקור SQL',
331
+ 'kindXML' : 'מקור XML',
332
+ 'kindAWK' : 'מקור AWK',
333
+ 'kindCSV' : 'ערכים מופרדים בפסיקים',
334
+ 'kindDOCBOOK' : 'מסמךDocbook XML',
335
+ // images
336
+ 'kindImage' : 'תמונה',
337
+ 'kindBMP' : 'תמונת BMP',
338
+ 'kindJPEG' : 'תמונת JPEG',
339
+ 'kindGIF' : 'תמונת GIF',
340
+ 'kindPNG' : 'תמונת PNG',
341
+ 'kindTIFF' : 'תמונת TIFF',
342
+ 'kindTGA' : 'תמונת TGA',
343
+ 'kindPSD' : 'תמונת Adobe Photoshop',
344
+ 'kindXBITMAP' : 'תמונת מפת סיביות X',
345
+ 'kindPXM' : 'תמונת Pixelmator',
346
+ // media
347
+ 'kindAudio' : 'מדיה מסוג שמע',
348
+ 'kindAudioMPEG' : 'שמע MPEG',
349
+ 'kindAudioMPEG4' : 'שמע MPEG-4',
350
+ 'kindAudioMIDI' : 'שמע MIDI',
351
+ 'kindAudioOGG' : 'שמע Ogg Vorbis',
352
+ 'kindAudioWAV' : 'שמע WAV',
353
+ 'AudioPlaylist' : 'רשימת נגינה MP3',
354
+ 'kindVideo' : 'מדיה מסוג וידאו',
355
+ 'kindVideoDV' : 'סרטון DV',
356
+ 'kindVideoMPEG' : 'סרטון MPEG',
357
+ 'kindVideoMPEG4' : 'סרטון MPEG-4',
358
+ 'kindVideoAVI' : 'סרטון AVI',
359
+ 'kindVideoMOV' : 'סרטון Quick Time',
360
+ 'kindVideoWM' : 'סרטון Windows Medi