Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.javascript > #4962
| Path | csiph.com!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Jan Novak <repcom@gmail.com> |
| Newsgroups | de.comp.lang.javascript |
| Subject | Re: Anfängerproblem mit asynchroner Verarbeitung |
| Date | Wed, 30 May 2018 10:00:05 +0200 |
| Organization | albasani.net |
| Lines | 64 |
| Message-ID | <pellm5$vnr$1@news.albasani.net> (permalink) |
| References | <pe96r0$8ki$1@news.albasani.net> <pe9i4n.2io.1@stefan.msgid.phost.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.albasani.net J44MsiWIDXUC/0ZCKncEDg7a/37nULh88dZiVANY81kuCLBnu9sKRLz+22dLZyfb99KbG3HITNf2HoSayHC5AcNmn8GIhfCFdpbg1wi/IWhZqICPe0phYXzyIXwiv7rD |
| NNTP-Posting-Date | Wed, 30 May 2018 08:00:05 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="lPvuF+xp1neNOeFuTvfo3+pUwZtjj+zVuPKuTeo5YBQqhoG3uloXurvnhcX2tMqZXpl5+H8HbSWLyaQlJSrJxCH82JI82jZgHNoWbPK//9CUqMBmlYqBWX3Tl2kiX4Os"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
| In-Reply-To | <pe9i4n.2io.1@stefan.msgid.phost.de> |
| Content-Language | de-DE |
| Cancel-Lock | sha1:ilCfCqQV6tugd4ODSwcZ8lJPzYE= |
| Xref | csiph.com de.comp.lang.javascript:4962 |
Show key headers only | View raw
Hallo Stefan,
Am 25.05.18 um 17:45 schrieb Stefan Reuther:
> Asynchron heißt, dass du nicht weißt, welche Datei (Einzahl) gerade
> bearbeitet wird. Du kannst nur wissen, für welche Dateien (Mehrzahl) du
> bereits Requests abgesendet hast und welche davon schon zurückgekommen sind.
>
> Aus der Hüfte geschossen und ungetestet:
>
>> function resizing(mFiles){
>> modal.style.display = "block";
>
> var numRequests = 0, pendingFiles = {};
> function updateDisplay() {
> if (numRequests === 0) { modal.style.display = "none" }
> else {
> document.getElementById("INFO_TEXT").innerHTML = "Processing
> " + Object.keys(pendingFiles).join(', ');
> // ^^^ hier wäre noch HTML-Escaping notwendig.
> }
> }
>
>> document.getElementById("INFO_TEXT").innerHTML = "Processing ...";
>> var archiveId = $( "#ARCHIVE" ).val();
>> mFiles.forEach(function(item, index, array) {
>> var request=baseURL +
>> '/include/api/upload_process.php?action=createImg&file='+item["name"];
>
> ++numRequests;
> pendingFiles[item.name] = 1;
>
>> $.ajax({
>> url: request,
>> async: true
>> }).done(function(data) {
>> ret = JSON.parse(data);
>> console.log(ret);
> --numRequests;
> delete item.name;
> updateDisplay();
>
> /*
>> document.getElementById("INFO_TEXT").innerHTML = "Processing
>> ready: "+ item["name"];
>
> */
>
>> });
>> });
>
> /*
>
>> modal.style.display = "none";
>> console.log("done");
>
> */
Ich konnte das jetzt mal testen ... in der obigen Variante bekomme ich
im Modal Dialog nur angezeigt: "Processing ...", dann alle Dateien auf
einmal und dann schliesst sich der Dialog.
Jan
Back to de.comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Anfängerproblem mit asynchroner Verarbeitung Jan Novak <repcom@gmail.com> - 2018-05-25 16:33 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Stefan Reuther <stefan.news@arcor.de> - 2018-05-25 17:45 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Jan Novak <repcom@gmail.com> - 2018-05-28 07:23 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Jan Novak <repcom@gmail.com> - 2018-05-30 10:00 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Stefan Reuther <stefan.news@arcor.de> - 2018-05-30 20:08 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-05-30 22:49 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-05-27 12:41 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Jan Novak <repcom@gmail.com> - 2018-05-28 07:22 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-05-28 13:36 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Jan Novak <repcom@gmail.com> - 2018-05-28 15:39 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-05-28 16:25 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Jan Novak <repcom@gmail.com> - 2018-05-29 09:06 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-05-30 21:08 +0200
Re: Anfängerproblem mit asynchroner Verarbeitung Jan Novak <repcom@gmail.com> - 2018-05-31 13:07 +0200
csiph-web