Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Service: Dropzones #586

Merged
Merged
Changes from 1 commit
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
1f96a8c
Create basic interface structure for file dropzones.
May 5, 2017
8dc546a
Create basic class structure for file dropzones.
May 5, 2017
63fc928
Add phpdoc comments and implement interface methods.
May 5, 2017
3687895
Add phpdoc comments and needed private methods.
May 5, 2017
703985a
Add dropzone.js library to templates.
May 8, 2017
3f4dbaa
Create template for standard file dropzone.
May 8, 2017
ac67831
Add description and implementation for file dropzones to the UI Factory.
May 8, 2017
294c522
Create unit test FileDropzoneRendererer render standard dropzone.
May 8, 2017
0641d23
Merge branch 'trunk' into feature/5-3/ui-service-dropzones
May 8, 2017
d80f0de
Fix type hint error.
May 8, 2017
20ea633
Fix id in expected html.
May 8, 2017
d6291df
Implement unit test FileDropzoneRenderer render standard dropzone.
May 8, 2017
3e2cfc5
Add fileDropzone method.
May 8, 2017
9b98fe7
Fix method scope problem.
May 8, 2017
6b9fed5
Add less for drop zones.
May 8, 2017
a490664
Add javascript for drop zones.
May 8, 2017
809f5e9
Import dropzone less.
May 8, 2017
9c2283e
Add FileDropzone Standard example.
May 8, 2017
713907d
Add css class .standard
May 9, 2017
7b69065
Register dropzone.js resource.
May 9, 2017
4b35cee
Create unit test FileDropzoneRenderer render wrapper dropzone.
May 9, 2017
2bb03bc
Create wrapper dropzone template.
May 9, 2017
624bd1b
Override normalizeHtml method and fix spelling error in expected html.
May 9, 2017
0891f83
Implement unit test FileDropzone Renderer render wrapper dropzone.
May 9, 2017
5140de8
Create unit test FileDropzone Renderer render standard drop zone with…
May 9, 2017
f946b6e
Implement unit test FileDropzone Renderer render standard dropzone wi…
May 9, 2017
ec85cc7
Make Wrapper Dropzone with constructor argument.
May 9, 2017
2d394fb
Fix unit test with Wrapper Dropzone constructor argument.
May 9, 2017
4820db3
Add method checkEmptyArray().
May 9, 2017
74caee5
Make the methods scope public.
May 9, 2017
7974fa1
Refactor FileDropzone Renderer.
May 9, 2017
fb69840
Make the methods scope public.
May 9, 2017
84b53d8
Add example FileDropzone Standard with default message.
May 9, 2017
90c9cab
Add example FileDropzone with alternative highlight.
May 9, 2017
f89aab2
Create basic class structure.
May 9, 2017
37fed19
Add phpdoc comments.
May 9, 2017
9973555
Create unit test JavascriptHelper enable drop design.
May 9, 2017
2b7617a
Implement unit test JavascriptHelper enable drop design.
May 9, 2017
8171102
Create unit test JavascriptHelper disable drop design.
May 9, 2017
506ad69
Implement unit test JavascriptHelper disable drop design.
May 9, 2017
162c35e
Create unit test JavascriptHelper initialize drop zone.
May 9, 2017
5c4b8f5
Implement unit test JavascriptHelper initialize dropzone.
May 9, 2017
6e806a9
Create unit test JavascriptHelper trigger signals.
May 9, 2017
688314c
Implement unit test JavascriptHelper trigger signals.
May 9, 2017
317d072
Remove php7 syntax.
May 9, 2017
363ee4c
Update expected javascript in JavascriptHelperTest.
May 9, 2017
7f65b7b
Update JavascriptHelper with js function in string.
May 9, 2017
9fd7799
Add wrappToJSEventFunction method.
May 9, 2017
72a3e47
Add javascript onload code for dropzones.
May 9, 2017
17bad8e
Add phpdoc and refactor method wrapToJSEventFunction.
May 9, 2017
2ce1aef
Add the previewsContainer options the javascript code.
May 9, 2017
e00ae5c
Add phpdoc comments.
May 9, 2017
dfaf8f3
Add jsdoc to functions.
May 9, 2017
37a67d9
Add registeredSignals variable.
May 12, 2017
3879664
Update unit tests JavascriptHelper with updated expected javascript c…
May 12, 2017
e59a2d8
Implement updated unit test for JavascriptHelper class.
May 12, 2017
c85a2bd
Remove private variable $darkendBackground.
May 12, 2017
eac34e6
Add javascript functions to enable darkened Design for a dropzone.
May 12, 2017
54e0591
Update renderer for Standard Dropzone with the new javascript code.
May 12, 2017
f84a73c
Update phpdoc for Standard Dropzone.
May 12, 2017
731fc11
Update Standard Dropzone example with darkened background option.
May 12, 2017
8befee3
Delete outdated example.
May 12, 2017
5c4edb1
Update css for Standard Dropzone.
May 12, 2017
1c0c373
Add private variable $darkedBackground.
May 12, 2017
329f345
Set $darkendBackground to true in constructor.
May 12, 2017
4e7b2e8
Change $darkendBackground to false and make its scope protected.
May 12, 2017
e0af1ed
Update javascript unload code in FileDropzone Renderer.
May 12, 2017
83508c1
Create Wrapper Dropzone example.
May 12, 2017
57144b0
Add css for wrapper drop zones.
May 12, 2017
91c389c
Add Wrapper Dropzone example with alternativeDesign.
May 12, 2017
add2640
Add css for wrapper dropzone with darkened background.
May 12, 2017
a564069
Fix spelling error.
May 12, 2017
98705a6
Add javascript doc comments.
May 12, 2017
34c1d8d
Make argument for wrapper content to array or Component.
May 15, 2017
ff45787
Rename DefaultMassage to message for methods and variables.
May 15, 2017
6513a61
Change parameter to array or Component type.
May 15, 2017
1fbfa41
Add jQuery dragster library.
May 15, 2017
61ad645
Extend JavascriptHelper class with additional Javascript code for dro…
May 15, 2017
c3f3390
Add additional javascript functions for dropzones.
May 15, 2017
2b81712
Reimplement javascript setup for wrapper dropzones.
May 15, 2017
01d0059
Update css less for drop zones.
May 15, 2017
a4be402
Make JavascriptHelper class more responsible to render javascript cod…
May 16, 2017
4ac653c
Delete unnecessary unit test for JavascriptHelper class.
May 16, 2017
c8dfae0
Extend javascript functions for the dropzone behavior.
May 16, 2017
cb255a3
Update the javascript function name.
May 16, 2017
0f72b2c
Exclude javascript code into JavascriptHelper class.
May 16, 2017
142ee90
Add variable to contain css selectors which are used.
May 16, 2017
01aacc4
Remove unnecessary div tag.
May 16, 2017
e316560
Remove dropzone.js library.
May 16, 2017
2ec6c8c
Add default design function for drop zones.
May 16, 2017
b96f4a0
Fix css classes for default design.
May 16, 2017
5e2c779
Make SimpleDropzone class able to hold the option to auto discovery t…
May 16, 2017
cf5037d
Fix spelling error in comment.
May 16, 2017
db0805e
Use setter chaining for SimpleDropzone instances.
May 16, 2017
40fb58e
Update php doc comments for wrapper and standard drop zone.
May 16, 2017
19c4ff6
Fix php7 syntax.
May 16, 2017
e231ff4
Update examples for dropzones.
May 16, 2017
cb5ca01
Rename function to withMessage.
May 16, 2017
8dd874a
Delete example for file dropzone with wrong name.
May 16, 2017
b5f60be
Add less variables for dropzone styles.
May 16, 2017
8f34eec
Add public scope to methods.
May 16, 2017
addac8c
Add full namespace to phpdoc @return stamement.
May 16, 2017
a1e0604
Update phpdoc comments of the Droppable interface.
May 18, 2017
0932310
Rename BasicFileDropzone interface to FileDropzone.
May 18, 2017
6dc0619
Rename FileDropzone to Dropzone.
May 18, 2017
602b651
Fix spelling error darkend -> darkened.
May 18, 2017
a037ee9
Rename “file dropzone” to “dropzone”.
May 18, 2017
45fa917
Update php doc comment.
May 18, 2017
46cbc86
Move jQuery dragster to the libs directory.
May 18, 2017
62b50ef
Add ComponentHelper.
May 18, 2017
69e564e
Add missing return statement.
May 18, 2017
1b26975
Rename fileDropzone() method to dropzone().
May 18, 2017
835fb78
Update dropzone description in the factory classes.
May 19, 2017
5f30b60
Fix spelling error in method call.
May 19, 2017
109cee3
Rename directory for examples from FileDropzone to Dropzone.
May 19, 2017
cfc3c55
Delete dropzone examples in wrong directory.
May 19, 2017
dfa225d
Reimplement the dropzone behavior.
May 19, 2017
270b3dd
Remove File Dropzone js.
May 22, 2017
fc4be81
Update SimpleDropzone with type attribute.
May 22, 2017
4e77cfd
Create class JSDropzoneInitializer and add basic methods.
May 22, 2017
79e26d2
Fix arg list check method call.
May 22, 2017
3378ad3
Add phpdoc comments.
May 22, 2017
be84ee6
Prevent defaults on browser drop events and update js doc.
May 22, 2017
6b55d34
Add authors email.
May 22, 2017
0b62fdc
Update dropzone init.
May 22, 2017
6c6c69c
Implement Wrapper drop zone behavior.
May 22, 2017
3ccfe26
Remove JavascriptHelper class.
May 22, 2017
41048a7
Update DropzoneRendererTest.
May 22, 2017
99aafcb
Remove old FileDropzoneRendererTest.
May 22, 2017
77dff79
Remove default from method name.
May 22, 2017
31dfa89
Create unit test cases for JSDropzoneInitializer class.
May 22, 2017
baa040d
Update jsdoc comment.
May 22, 2017
df193e8
Optimize rendering of dropzone content.
May 22, 2017
c83afcc
Fix bug when a signal is not used as string.
May 22, 2017
29ea4af
Move Dropzone to Dropzone/File.
May 22, 2017
d346111
Fix namespace errors.
May 22, 2017
4820e55
Delete old drop zone templates.
May 22, 2017
b7e65b1
Move unit tests to the File directory.
May 22, 2017
c292030
Delete old unit tests.
May 22, 2017
9066b13
Fix bug with jQuery foreach.
May 23, 2017
d1a0a9d
code-format proposal
chfsx May 30, 2017
5317d5e
code-format II
chfsx May 30, 2017
cc0ce30
Merge branch 'feature/5-3/ui-service-dropzones-codeformat' into 'feat…
May 30, 2017
c3f4938
Fix yaml parse errors.
Jun 1, 2017
a408a49
Implement upload-container.js.
Jun 13, 2017
105b8c5
Implement uploader.js component.
Jun 13, 2017
436f0ae
Extend dropzone-behavior.js with the Upload dropzone component.
Jun 13, 2017
a0fe5e4
Add additional attributes for dropzones.
Jun 13, 2017
5555236
Add additional attributes in the json options parameter.
Jun 13, 2017
1af127b
Register upload-container.js and uploader.js.
Jun 13, 2017
08bd755
Fix path to js resource.
Jun 13, 2017
dd193ee
Fix event.dataTransfer call and $.each loop.
Jun 13, 2017
2a568ae
Update type of ajax request.
Jun 13, 2017
50c8d39
Implement server side part of “proof of concept” upload dropzone and …
wanze Jun 15, 2017
f197f03
Add fineuploader library as upload dependency
wanze Jun 28, 2017
58cb103
Implement JS wrapper to upload files (WIP)
wanze Jun 28, 2017
096c4b6
Add validation for file uploads: Allowed file types, Max file size, M…
wanze Jun 29, 2017
d24eb72
Refactoring of file dropzones
wanze Jul 18, 2017
15ff641
Update factory descriptions and add a proof of concept of how one can…
wanze Jul 19, 2017
3626f8d
Merge branch 'trunk' into feature/5-3/ui-service-dropzones-2
wanze Jul 20, 2017
06a1d4f
Extend javascript wrapper of uploader with the possbility to bind upl…
wanze Jul 20, 2017
0dfe022
Update examples, update factory descriptions and fix rendering unit t…
wanze Jul 21, 2017
c10faf2
Remove some unecessary files of 3thparty dependency “FineUploader”
wanze Jul 24, 2017
a4dc212
Some updates after feedback on pull request, mainly factory descripti…
wanze Jul 31, 2017
e1d0d5b
added bower dependency description
chfsx Aug 3, 2017
32d2a83
Merge branch 'trunk' into feature/5-3/ui-service-dropzones-2
chfsx Aug 3, 2017
41eeebf
Merge branch 'proposal/5-3/bower' into feature/5-3/ui-service-dropzon…
chfsx Aug 3, 2017
fb06b73
switched to bower for JS-dependency, another PR will be opened for th…
chfsx Aug 3, 2017
b888b6a
updated KS-data
chfsx Aug 3, 2017
afa019b
corrected some naming on Droppable
chfsx Aug 3, 2017
d016585
renaming some methods in both interface and implementation based on f…
chfsx Aug 3, 2017
a2d9be1
switched jquery.dragster.js to bower
chfsx Aug 3, 2017
6add51d
withUserDefinedDescriptionEnabled and withUserDefinedFileNamesEnabled
chfsx Aug 3, 2017
52eac04
first attempt to implement #578
chfsx Aug 3, 2017
fe2fe6e
fixed two small BT tasks
chfsx Aug 3, 2017
935e3b2
Merge branch 'trunk' into feature/5-3/ui-service-dropzones-2
chfsx Aug 4, 2017
19b6994
dropzone-specific css rendered
chfsx Aug 4, 2017
fa8b081
implemented more accurate version of the standard-dropzone as discuss…
chfsx Aug 4, 2017
4209c2d
language improvements for DZ
chfsx Aug 4, 2017
eac8ccb
finalized standard dropzone and prototype of usage in standard (legac…
chfsx Aug 5, 2017
d3cacc6
finished implementation of wrapper dropzone
chfsx Aug 5, 2017
5c0a89a
missed template file in commit
chfsx Aug 5, 2017
6aad4ae
Merge branch 'trunk' into feature/5-3/ui-service-dropzones-2
chfsx Aug 8, 2017
6283e43
implemented alternative version of filelists in d&d uploads
chfsx Aug 8, 2017
2b4db82
fixed margin of closebutton within the filelist
chfsx Aug 9, 2017
479d459
again the margin...
chfsx Aug 9, 2017
a35c391
changes due to integration in legacy forms
chfsx Aug 10, 2017
7d15ba6
updated classmap
chfsx Aug 10, 2017
293911f
moved ilFileStandardDropzoneGUI
chfsx Aug 10, 2017
34546be
updated classmap
chfsx Aug 10, 2017
f7e72c5
latest changes to form-usage of dropzones
chfsx Aug 10, 2017
f3e03e1
coding conventions
chfsx Aug 10, 2017
a325c36
implemented stronger rule for wrapper-dz
chfsx Aug 10, 2017
ed34979
Updated Tests
chfsx Aug 10, 2017
e3eb8fa
added additional tests for dropzones
chfsx Aug 10, 2017
3a22fee
Merge branch 'trunk' into feature/5-3/ui-service-dropzones-2
chfsx Aug 15, 2017
3703fca
comment why the ilFileStandardDropzoneInputGUI is not a replacement f…
chfsx Aug 15, 2017
debbdbe
describing the public interface of ilFileStandardDropzoneInputGUI
chfsx Aug 15, 2017
b11be2d
moved ilFileStandardDropzoneInputGUI.js out of examples to a more app…
chfsx Aug 15, 2017
a31abe0
removed @version descriptions
chfsx Aug 15, 2017
59d3abc
renamed withIdentifier to withParameterName
chfsx Aug 15, 2017
2e08d94
comment for the drop-event
chfsx Aug 15, 2017
97e4e9c
comments in the Examples
chfsx Aug 15, 2017
bada67b
removed debugging in ilFileStandardDropzoneInputGUI.js
chfsx Aug 15, 2017
6ea9296
descriptions in Wrapper-Dropzone Examples
chfsx Aug 15, 2017
559d676
commented out log() in uploader.js
chfsx Aug 15, 2017
d9d6be6
removed logging in dropzone.js
chfsx Aug 15, 2017
d39ece7
removed another @version
chfsx Aug 16, 2017
07b2516
describing public method
chfsx Aug 16, 2017
8019727
use withAdditionalOnLoadCode() for the upload button
chfsx Aug 16, 2017
fe9a2ba
!important; no longer needed
chfsx Aug 16, 2017
0fac873
removed unused jquery.dragster
chfsx Aug 16, 2017
954a27c
push those libraries for tho moment, if #608 won't be accepted we wil…
chfsx Aug 16, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ public function render($a_mode = "") {
$dropzone = $f->dropzone()
->file()
->standard($this->getUploadUrl())
->withIdentifier($this->getPostVar())
->withParameterName($this->getPostVar())
->withMaxFiles($this->getMaxFiles())
->withMessage($this->getDropzoneMessage())
->withAllowedFileTypes($this->getSuffixes());
7 changes: 4 additions & 3 deletions src/UI/Component/Dropzone/File/File.php
Original file line number Diff line number Diff line change
@@ -116,16 +116,17 @@ public function allowsUserDefinedFileDescriptions();
* Note: If you use multiple file dropzones on the same page, you MUST use identifier in
* order to identify an uploaded file. The default identifier is 'files'.
*
* @param string $identifier
* @param string $parameter_name
*
* @return $this
*/
public function withIdentifier($identifier);
public function withParameterName($parameter_name);

/**
* Get the identifier used to retrieve and identify an uploaded file server side.
*
* @return string
*/
public function getIdentifier();
public function getParametername();

}
12 changes: 6 additions & 6 deletions src/UI/Implementation/Component/Dropzone/File/File.php
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ abstract class File implements \ILIAS\UI\Component\Dropzone\File\File {
/**
* @var string
*/
protected $identifier = 'files';
protected $parameter_name = 'files';

/**
* @param string $url
@@ -171,18 +171,18 @@ public function allowsUserDefinedFileDescriptions() {
/**
* @inheritdoc
*/
public function withIdentifier($identifier) {
$this->checkStringArg('identifier', $identifier);
public function withParameterName($parameter_name) {
$this->checkStringArg('identifier', $parameter_name);
$clone = clone $this;
$clone->identifier = $identifier;
$clone->parameter_name = $parameter_name;
return $clone;
}

/**
* @inheritdoc
*/
public function getIdentifier() {
return $this->identifier;
public function getParameterName() {
return $this->parameter_name;
}


2 changes: 1 addition & 1 deletion src/UI/Implementation/Component/Dropzone/File/Renderer.php
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ protected function registerSignals(\ILIAS\UI\Component\Dropzone\File\File $dropz
'fileSizeLimit' => $dropzone->getFileSizeLimit() ? $dropzone->getFileSizeLimit()->getSize()
* $dropzone->getFileSizeLimit()->getUnit() : 0,
'maxFiles' => $dropzone->getMaxFiles(),
'identifier' => $dropzone->getIdentifier(),
'identifier' => $dropzone->getParametername(),
]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the much improved generation of this options as json!

$reflect = new \ReflectionClass($dropzone);
$type = $reflect->getShortName();