Widget:Autorenbox: Unterschied zwischen den Versionen

Aus ZUM-Unterrichten
KKeine Bearbeitungszusammenfassung
Markierung: 2017-Quelltext-Bearbeitung
KKeine Bearbeitungszusammenfassung
Markierung: 2017-Quelltext-Bearbeitung
Zeile 40: Zeile 40:
     };
     };
     const response = jQuery.Deferred();
     const response = jQuery.Deferred();
     function continueQueryOrResolve(response, query, pages, lastContinue){
     function continueQueryOrResolve(result, query, pages, lastContinue){
       api.get({...query, ...lastContinue})
       api.get({...query, ...lastContinue})
         .then((response) => {
         .then((response) => {
           const newResult = Object.values(response.query.pages).reduce((pages, page) => {
           const newPages = Object.values(response.query.pages).reduce((pages, page) => {
             pages[page.pageid] = {...pages[page.pageid], ...page};
             pages[page.pageid] = {...pages[page.pageid], ...page};
             return pages;
             return pages;
           }, pages);
           }, pages);
           if (response.continue !== undefined) {
           if (response.continue !== undefined) {
             continueQueryOrResolve(response, query, newResult, response.continue);
             continueQueryOrResolve(result, query, newPages, response.continue);
           } else if (response.batchcomplete !== undefined) {
           } else if (response.batchcomplete !== undefined) {
             response.resolve(newResult);
             result.resolve(newResult);
           }
           }
         });
         });

Version vom 14. November 2021, 19:33 Uhr