@@ -39,10 +39,11 @@ public function admin_enqueue_scripts() {
3939 if (!$ this ->isValidPostType ()) {
4040 return false ;
4141 }
42- $ cm_settings ['php ' ]['codeEditor ' ] = wp_enqueue_code_editor (array ('type ' => 'text/html ' , 'codemirror ' => array ('autoRefresh ' => true )));
43- $ cm_settings ['html ' ]['codeEditor ' ] = wp_enqueue_code_editor (array ('type ' => 'text/html ' , 'codemirror ' => array ('autoRefresh ' => true )));
44- $ cm_settings ['css ' ]['codeEditor ' ] = wp_enqueue_code_editor (array ('type ' => 'text/css ' , 'codemirror ' => array ('autoRefresh ' => true )));
45- $ cm_settings ['js ' ]['codeEditor ' ] = wp_enqueue_code_editor (array ('type ' => 'text/javascript ' , 'codemirror ' => array ('autoRefresh ' => true )));
42+ $ cm_settings ['php ' ] = wp_enqueue_code_editor (array ('file ' => 'example.php ' , 'codemirror ' => array ('autoRefresh ' => true ), 'htmlhint ' => array ('space-tab-mixed-disabled ' => 'space ' )));
43+ $ cm_settings ['html ' ] = wp_enqueue_code_editor (array ('file ' => 'example.html ' , 'codemirror ' => array ('autoRefresh ' => true ), 'htmlhint ' => array ('space-tab-mixed-disabled ' => 'space ' )));
44+ $ cm_settings ['css ' ] = wp_enqueue_code_editor (array ('file ' => 'example.css ' , 'codemirror ' => array ('autoRefresh ' => true )));
45+ $ cm_settings ['js ' ] = wp_enqueue_code_editor (array ('file ' => 'example.js ' , 'codemirror ' => array ('autoRefresh ' => true )));
46+
4647 wp_localize_script ('jquery ' , 'cm_settings ' , $ cm_settings );
4748 wp_enqueue_script ('wp-theme-plugin-editor ' );
4849 wp_enqueue_style ('wp-codemirror ' );
@@ -100,16 +101,25 @@ function listFolderFiles($dir, $url = '') {
100101 $ file_path = str_replace (ABSPATH , '' , $ dir ) . '/ ' . $ ff ;
101102 $ file_url = site_url ('/ ' ) . $ file_path ;
102103 if (is_dir ($ dir . '/ ' . $ ff )) {
103- $ output .= '<strong> ' . $ ff . '/</strong> ' ;
104+ $ output .= '<span class="folder-name"> ' . $ ff . '/</span> ' ;
105+ /*$output .= '<div class="tree-folder">';
106+ $output .= '<div class="folder-actions">';
107+ $output .= '<label title="'.__('Upload', 'drophtml').'" class="upload-to-tree-folder" target="_blank">';
108+ $output .= '<i class="dashicons dashicons-upload"></i>';
109+ $output .= '<input type="file" name="tf[]" multiple="multiple">';
110+ $output .= '</label>';
111+ $output .= '<span title="'.__('Delete', 'drophtml').'" class="delete-tree-folder" data-folder="' . $file_path . '"><i class="dashicons dashicons-trash"></i></span>';
112+ $output .= '</div>';
113+ $output .= '</div>';*/
104114 } else {
105- $ fileSlug = sanitize_title ($ dir . $ ff );
115+ $ fileSlug = sanitize_title ($ file_path );
106116 $ output .= '<div class="tree-file"> ' . $ ff ;
107117 $ output .= '<div class="file-actions"> ' ;
108- $ output .= '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $ file_url . '" target="_blank"><span class="dashicons dashicons-visibility"></span></a> ' ;
118+ $ output .= '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $ file_url . '" title=" ' . __ ( ' Preview ' , ' drophtml ' ). ' " target="_blank"><span class="dashicons dashicons-visibility"></span></a> ' ;
109119 if ($ this ->isAllowEdit ($ dir . '/ ' . $ ff )) {
110- $ output .= '<a href="javascript:void(0)" class="edit-tree-file" data-ext=" ' .$ this ->getFileExt ($ ff ).'" data-slug=" ' .$ fileSlug .'" data-file=" ' . $ file_path . '" data-state="0"><span class="dashicons dashicons-edit"></span></a> ' ;
120+ $ output .= '<a href="javascript:void(0)" title=" ' . __ ( ' Edit ' , ' drophtml ' ). ' " class="edit-tree-file" data-ext=" ' .$ this ->getFileExt ($ ff ).'" data-slug=" ' .$ fileSlug .'" data-file=" ' . $ file_path . '" data-state="0"><span class="dashicons dashicons-edit"></span></a> ' ;
111121 }
112- $ output .= '<a href="javascript:void(0)" class="delete-tree-file" data-file=" ' . $ file_path . '"><span class="dashicons dashicons-trash"></span></a> ' ;
122+ $ output .= '<a href="javascript:void(0)" title=" ' . __ ( ' Delete ' , ' drophtml ' ). ' " class="delete-tree-file" data-file=" ' . $ file_path . '"><span class="dashicons dashicons-trash"></span></a> ' ;
113123 $ output .= '</div> ' ;
114124 if ($ this ->isAllowEdit ($ dir . '/ ' . $ ff )) {
115125 $ content = file_get_contents ($ dir . '/ ' . $ ff );
0 commit comments