From bd55b9263744884a522862eb074ad7cdd59fd4c0 Mon Sep 17 00:00:00 2001 From: "Arjay Q. Angeles" Date: Fri, 13 Nov 2020 18:18:08 +0800 Subject: [PATCH] Add missing upload field options as per doc. https://editor.datatables.net/reference/field/upload#Options --- src/Html/Editor/Fields/File.php | 88 +++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/Html/Editor/Fields/File.php b/src/Html/Editor/Fields/File.php index ea3761d..265d9fe 100644 --- a/src/Html/Editor/Fields/File.php +++ b/src/Html/Editor/Fields/File.php @@ -31,6 +31,94 @@ public static function make($name, $label = '') return $field->displayFile()->clearText()->noImageText(); } + /** + * @param string $value + * @return $this + */ + public function ajax($value) + { + $this->attributes['ajax'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function ajaxData($value) + { + $this->attributes['ajaxData'] = $value; + + return $this; + } + + /** + * @param bool $value + * @return $this + */ + public function dragDrop($value = true) + { + $this->attributes['dragDrop'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function dragDropText($value) + { + $this->attributes['dragDropText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function fileReadText($value) + { + $this->attributes['fileReadText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function noFileText($value) + { + $this->attributes['noFileText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function processingText($value) + { + $this->attributes['processingText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function uploadText($value) + { + $this->attributes['uploadText'] = $value; + + return $this; + } + /** * Set editor instance for file upload. *