From 7072d4c343cc22cd823d890608768e204ef429d3 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 7 May 2018 00:43:52 -0600 Subject: [PATCH] Add server file picker to TinyMCE (close #20) --- lib/filepicker.php | 112 ++++++++++++++++++++++++++++++++++++++ pages.php | 3 +- pages/editor.php | 19 +++++++ static/css/filepicker.css | 10 ++++ static/js/editor.js | 19 ++++--- static/js/editorparent.js | 30 ++++++++++ 6 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 lib/filepicker.php create mode 100644 static/css/filepicker.css diff --git a/lib/filepicker.php b/lib/filepicker.php new file mode 100644 index 0000000..5377058 --- /dev/null +++ b/lib/filepicker.php @@ -0,0 +1,112 @@ + + +
+ +
+
+ /other icons + $mimefirst = explode("/", $mimetype, 2)[0]; + if (array_key_exists($mimefirst . "/other", $MIMEICONS)) { + $icon = $MIMEICONS[$mimetype]; + } + } + } + ?> +
" + data-path="" + data-file=""> + +
+ +
+

+ +

+

+ +

+
+ +
\ No newline at end of file diff --git a/pages.php b/pages.php index c8ff144..8b8e136 100644 --- a/pages.php +++ b/pages.php @@ -40,7 +40,8 @@ define("PAGES", [ "title" => "editor", "styles" => [ "static/css/editorparent.css", - "static/css/iconselector.css" + "static/css/iconselector.css", + "static/css/filepicker.css", ], "scripts" => [ "static/js/editorparent.js", diff --git a/pages/editor.php b/pages/editor.php index be9eb66..16149ea 100644 --- a/pages/editor.php +++ b/pages/editor.php @@ -68,6 +68,25 @@ if (!is_empty($VARS['siteid'])) { } ?> + +