Updated 057 Drag and Drop Upload functionality in JCB (markdown)

Amigo 2019-09-21 16:06:32 +02:00
parent c457b593d2
commit 8862eccad7

@ -60,14 +60,14 @@ That means if it is not this dimension it will be cropped to the desired size.'
[00:14:43](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m43s)
Let's go and look at the code and first focus on the document area. It is necessary to look at some of its fields that are attached. Some of them are JavaScript. The Ajax area is where everything happens. Custom code placeholders are used almost everywhere since a lot of the scripts are reused everywhere under components. [00:15:15](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m15s) It is therefore adapted so that it could be used in multiple places. Here is 'uploadfile' and 'removeFile' functions. It have 'target', 'type', 'field', 'filename', 'target', 'flush' and 'type'. It has values, all these values play a role within the behavior that I eventually have to demonstrate.<<<<<<<<<<<<<<<<<<<
Let's go and look at the code and first focus on the document area. It is necessary to look at some of its fields that are attached. Some of them are JavaScript. The Ajax area is where everything happens. Custom code placeholders are used almost everywhere since a lot of the scripts are reused everywhere under components. [00:15:15](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m15s) It is therefore adapted so that it could be used in multiple places. Here is 'uploadfile' and 'removeFile' functions. It have 'target', 'type', 'field', 'filename', 'target', 'flush' and 'type'. It has values, all these values play a role within the behavior that I eventually have to demonstrate.
### VastDevMod - VDM - Generates Variables
[00:15:49](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m49s)
You will also see here I've got this setVastDevMod, which is a function that generates for us some variables. Which in this case it is called VDM. Which gets placed in a variable called VastDevMod. This formation is what is used to identify the view from which the query is made. This is a long string that is related to the cash at that stage, of the view ID and name. [00:16:33](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m33s) This is how I passed the view name and ID. So I do not pass it via the Ajax query. I have it in session memory. Only if these keys validate it does work. Sort of another layer, and another layer. There are many layers to [00:16:54](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m54s) try and make this secure. Then this adminKittwo is where I am loading all the Uikit Files. I am manually adding it to the
Admin View. The admin back-end doesn't work as the Site Views where we could select a [00:17:19](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m19s) library and it dynamically answers to the view on compilation. You have to manually add it to the view and you'll do it in the Custom Script of the document.
You will also see here I've got this `setVastDevMod`, which is a function that generates for us some variables. Which in this case it is called `VDM` which gets placed in a variable called '`VastDevMod`'. This formation is what is used to identify the view from which the query is made. This is a long string that is related to the cache at that stage of the view ID and name. [00:16:33](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m33s) This is how I passed the view name and ID, so it is not passed via the Ajax query. I have it in session memory only if these keys validate that it does work. Sort of another layer, and another layer. There are many layers to [00:16:54](https://www.youtube.com/watch?v=UvzDyVQyHDI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m54s) try and make this secure. Then this `adminKittwo` is where all the Uikit files are loaded. I am manually adding it to the
Admin View. The admin back-end does not work as the Site Views where we can select a library and then it dynamically answers to the view on compilation. You have to manually add it to the view and it is done in the Custom Script of the document. <<<<<<<<<<<<<<<<<<
### setfile Method - Image - Documents - Media