| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| javascript:plugins:fileuploader [2020-04-13 16:48] – admin | javascript:plugins:fileuploader [2023-10-26 20:08] (current) – external edit 127.0.0.1 |
|---|
| * ''f.onChange'' | * ''f.onChange'' |
| * ''**callback** n.beforeSelect(files, listEl l, parentEl p, newInputEl o, inputEl s)'' // Callback fired after selecting the files from computer but only before processing them; by returning false, you will prevent the processing of the files but they will remain in the input// | * ''**callback** n.beforeSelect(files, listEl l, parentEl p, newInputEl o, inputEl s)'' // Callback fired after selecting the files from computer but only before processing them; by returning false, you will prevent the processing of the files but they will remain in the input// |
| | * for each selected file { |
| | * ''item = f._itFl[f.files.add(file, 'choosed')]'' } |
| | * ''f.files.add'': see [[#filesAddData|below]] |
| | * creation of ''item'' |
| | * binding of ''item.remove'', ''item.editor.rotate'', ''item.editor.cropper'', ''item.editor.save'' |
| | * return ''index'' --> ''item = f._itFl[index]'' |
| | * ''status = f.files.check(item, files, i == 0)'' // ["type", "message", "do not show the warning message", "do not check the next files"] // |
| | * check ''n.limit'', ''n.maxSize'' |
| | * ''**callback** n.onFilesCheck(files, options n, listEl l, parentEl p, newInputEl o, inputEl s)'' //Callback fired on checking for warnings the chosen ("choosed") files; by returning false, you will prevent the files from adding/upload// |
| | * check ''n.extensions'', ''n.disallowedExtensions'', ''n.fileMaxSize'', //no remoteFile//, //no Folder// |
| | * ''f.thumbnails.item(item)'' |
| | * generate ''item.icon'' |
| | * ''item.html'' = ''textParse(n.thumbnails.item)'' |
| | * ''item.progressBar'' = ''item.html.find('.fileuploader-progressbar')'' |
| | * ''item.html.addClass('file-type-//format// file-ext-//extension//')'' //or ''file-type-no'' if no format; ''file-ext-no'' if no extension// |
| | * Append or Prepend ''item'' to l |
| | * add ''item.popup'' |
| | * ''f.thumbnails.renderThumbnail(item)'' (arglist: ''item, forceRender, src'') |
| | * Only create for ''['image', 'video', 'audio', 'astext']'' and ''item.appended || n.thumbnails.startImageRenderer || forceRender'' |
| | * ''f.files.read(item, function () { |
| | process(item.frame || (item.reader.node && item.reader.node.nodeName.toLowerCase() == 'img') ? item.reader.frame || item.reader.src : null, true); |
| | }, null, src, true);'' |
| | * ''item.reader = { _FileReader: reader, _callbacks: [], read: item.reader.read }'' |
| | * ''if (item.format == 'image' || hasThumb)'' |
| | * define ''reader.onload'' and ''reader.onerror'' |
| | * ''useFile == true'' --> ''reader.readAsDataURL(item.file)'' --> reader.onload() |
| | * ''reader.onload''://exif rotation// ''f._assets.getExifOrientation(item.file, function (orientation) { if (orientation) { item.reader.exifOrientation = orientation; } loadNode(); });'' |
| | * ''f._assets.getExifOrientation'': |
| | |
| | |
| ---- | ---- |
| |
| regions: [] | regions: [] |
| format: "image" | format: "image" |
| | </code> |
| | - ~~codedoc:xref:filesAddData~~ ''files.add() --> data'' |
| | * <code> |
| | data = { |
| | name: "IMG_20200301_150420 (1).jpg" |
| | title: "IMG_20200301_150420 (1)" |
| | size: 821856 |
| | size2: "803 KB" |
| | type: "image/jpeg" |
| | format: "image" |
| | extension: "jpg" |
| | data: {} |
| | file: File {name: "IMG_20200301_150420 (1).jpg", lastModified: 1586083807175, lastModifiedDate: Sun Apr 05 2020 12:50:07 GMT+0200 (Central European Summer Time), webkitRelativePath: "", size: 821856, …} |
| | reader: {read: ƒ} |
| | id: 1586790020907 |
| | input: w.fn.init [input.gallery_media] |
| | html: null |
| | choosed: true |
| | appended: false |
| | uploaded: false |
| | }; |
| </code> | </code> |
| |