Hier der vollständige Code. Geändert ist nur resolveItemUrl(), dazu kommt die neue Hilfsfunktion languagePrefix(). Die Sprache wird aus dem URL-Präfix der Druckseite übernommen, z. B. /es/. html
(function () { function textOf(el) { return (el && el.textContent || "").replace(/\s+/g, " ").trim(); } // Sprachpräfix der aktuellen Seite ermitteln, z. B. "/es" bei /es/druckseite?item=123 // Standardsprache (ohne Präfix) liefert "". function languagePrefix() { var m = window.location.pathname.match(/^\/([a-z]{2})(?=\/|$)/i); return m ? "/" + m[1].toLowerCase() : ""; } function resolveItemUrl() { var match = window.location.search.match(/[?&]item=(\d+)/); if (!match) { return null; } return window.location.origin + languagePrefix() + "/a-" + match[1] + "/"; } function loadAccordion() { var url = resolveItemUrl(); if (!url) { return Promise.resolve(null); } return new Promise(function (resolve, reject) { var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.onload = function () { if (xhr.status < 200 || xhr.status >= 400) { reject(new Error("item page " + xhr.status)); return; } var doc = new DOMParser().parseFromString(xhr.responseText, "text/html"); resolve(doc.querySelector(".phywe-item-accordion")); }; xhr.onerror = function () { reject(new Error("item page network error")); }; xhr.send(); }); } function parseItemBlocks(scope, withQuantity) { if (!scope) { return []; } var rows = scope.querySelectorAll(".itemslist .row.itemblocks"); var items = []; for (var i = 0; i < rows.length; i++) { var cols = rows[i].children; if (!cols.length) { continue; } var nameLink = cols[0].querySelector("a"); var numberLink = cols[1] ? cols[1].querySelector("a") : null; var item = { name: textOf(nameLink || cols[0]), mappedTo: textOf(numberLink) }; if (withQuantity && cols[2]) { var qty = parseInt(textOf(cols[2]).replace(/[^\d]/g, ""), 10); item.quantity = isNaN(qty) ? textOf(cols[2]) : String(qty); } if (item.name) { items.push(item); } } return items; } function fillTable(tableId, items, withQuantity) { var table = document.getElementById(tableId); if (!table || !items.length) { return; } var tbody = table.querySelector("tbody"); for (var i = 0; i < items.length; i++) { var tr = document.createElement("tr"); var nameTd = document.createElement("td"); nameTd.style.width = "80%"; nameTd.textContent = items[i].name; tr.appendChild(nameTd); var numberTd = document.createElement("td"); numberTd.textContent = items[i].mappedTo; tr.appendChild(numberTd); if (withQuantity) { var qtyTd = document.createElement("td"); qtyTd.textContent = items[i].quantity || ""; tr.appendChild(qtyTd); } tbody.appendChild(tr); } var wrapper = table.parentElement; while (wrapper && wrapper.className.indexOf("printtablediv") === -1) { wrapper = wrapper.parentElement; } if (wrapper) { wrapper.style.display = ""; } } function stepTitle(stepEl) { if (!stepEl) { return ""; } var titleEl = stepEl.querySelector(".card-header button div") || stepEl.querySelector(".card-header button"); return textOf(titleEl); } function setHeadline(tableId, title) { var headline = document.querySelector("#" + tableId + " .printtableheadline"); if (headline && title) { headline.textContent = title; } } function parseMedia(scope) { if (!scope) { return []; } var rows = scope.querySelectorAll(".itemslist .row.itemblocks"); var items = []; for (var i = 0; i < rows.length; i++) { var cols = rows[i].children; if (!cols.length) { continue; } var nameLink = cols[0].querySelector("a"); var fileLink = cols[1] ? cols[1].querySelector("a") : null; var item = { name: textOf(nameLink || cols[0]), mappedTo: textOf(fileLink || cols[1]), quantity: cols[2] ? textOf(cols[2]) : "" }; if (item.name) { items.push(item); } } return items; } function fillFromAccordion(accordion) { if (!accordion) { return; } var versucheStep = accordion.querySelector('[data-step="versuche"]'); var versuche = parseItemBlocks(versucheStep, false); setHeadline("print-versuche", stepTitle(versucheStep)); fillTable("print-versuche", versuche, false); var lieferumfangStep = accordion.querySelector('[data-step="lieferumfang"]'); var lieferumfang = parseItemBlocks(lieferumfangStep, true); fillTable("print-lieferumfang", lieferumfang, true); var zubehoer = accordion.querySelector('[data-step="zubehoer"]'); var sections = zubehoer ? zubehoer.querySelectorAll(".card-body") : []; var notwendig = []; var empfohlen = []; for (var i = 0; i < sections.length; i++) { var items = parseItemBlocks(sections[i], false); if (sections[i].querySelector(".text-red, .icon-warning-black")) { notwendig = items; } else if (sections[i].querySelector(".text-green, .icon-Mehrwert_black")) { empfohlen = items; } } fillTable("print-zubehoer-notwendig", notwendig, false); fillTable("print-zubehoer-empfohlen", empfohlen, false); var mediaStep = accordion.querySelector('[data-step="media"]'); var media = parseMedia(mediaStep); setHeadline("print-media", stepTitle(mediaStep)); fillTable("print-media", media, true); } function start() { var itemUrl = resolveItemUrl(); if (!itemUrl) { setTimeout(function () { window.print(); }, 2000); return; } loadAccordion() .then(function (accordion) { fillFromAccordion(accordion); }) .catch(function (err) { if (window.console && console.warn) { console.warn("Accordion konnte nicht geladen werden:", itemUrl, err); } }) .then(function () { setTimeout(function () { window.print(); }, 500); }); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", start); } else { start(); } })();
 

Datos técnicos


Nº de artículo LIE-2900

Funciones y uso

2900 Phanerogamae, conjunto complementario. - Complementario del set nº 2800. - 50 Preparaciones microscópicas - 1. Ápice del tallo y tejido meristemático, Asparagus l.s. 2. Granos de aleurona, t.s. del endospermo de Ricinus 3. Grasa en sec. a través del endospermo de Corylus 4. Glándulas oleosas lisígenas, c.t. de Citrus 5. Cristales de inulina, c.t. del tubérculo de Dahlia 6. Cristales de oxalato de calcio, en c.s. de cáscara seca de cebolla 7. Células de madera, maceradas 8. Vasos lactíferos, c.s. de tallo de Euphorbia (tártago) 9. Cloroplastos en hoja de Elodea w.m. 10. Pelos foliares ramificados, aislados de Verbascum (gordolobo) 11. Celulosa de reserva, c.t. de la semilla de Phoenix (dátil) 12. Rheum, ruibarbo, raíz con cristales c.t. 13. Dendrobium, orquídea, raíz aérea con velamen c.t. 14. Pinus, pino, raíz leñosa más antigua c.t. 15. Smilax, raíz con endodermis engrosada c.t. 16. Lupinus, altramuz, nódulos de la raíz con bacterias fijadoras de nitrógeno c.t. 17. Quercus, roble, raíz leñosa más antigua c.t. 18. Daucus, zanahoria, raíz de almacenamiento c.t. 19. 19. Pinus, pino, tallo leñoso viejo c.t. 20. Zea mays, maíz, tallo con haces c.t. 21. Elodea, alga acuática, tallo acuático con manojos primitivos c.t. Juncus, enea, tallo con células estrelladas c.t. 23. Pelargonium, geranio, tallo joven de una planta anual c.t. 24. 24. Tilia, tilo, tallo leñoso viejo c.t. y c.l. Acorus calamus, cálamo dulce, rizoma c.t. 26. 26. Pinus, pino, tres secciones de madera Fagus, haya, tres secciones de madera 28. 28. Bryonia, tallo con placas cribosas c.t. 29. Ribes, grosella, tallo con placas cribosas c.t. 29. Ribes, grosella, tallo con felógeno c.t. 30. Helianthus, girasol, tallo típico de dicotiledónea c.t. Salvia, salvia, tallo cuadrado con colénquima c.t. 32. Nymphaea, lirio de agua, hoja flotante c.t. 33. Dionaea, Venus atrapamoscas, hoja con glándulas digestivas c.t. 34. Fagus, haya, hojas de sol y de sombra en una diapositiva c.t. 35. 35. Pinguicula, hierba de la mantequilla, hoja con pelos glandulares c.t. Nerium, adelfa, hoja xeromorfa con estomas hundidos t.s. 37. Drosera, drosera, hoja con pelos glandulares c.t. 38. Urtica, ortiga, hoja con pelos urticantes 39. Utricularia, hierba de la vejiga, con pelos en la vejiga 40. 40. Pinus, pino, cono masculino con polen l.s. 41. Pinus, cono femenino joven con óvulos l.s. Pinus, óvulo con arquegonios c.s. 43. Pinus, embrión maduro con endospermo c.t. 44. Pinus, granos de polen con alas c.t. 45. Lilium, lirio, anteras jóvenes mostrando la meiosis de las células madre del polen 46. 46. Tulipa, tulipán, ovario c.t. mostrando la disposición de los óvulos 47. Taraxacum, diente de león, flor compuesta l.s. Papaver, amapola, flor c.t. mostrando el diagrama floral 49. 49. Phaseolus, judía, vaina con pericarpio y semilla c.t. Lycopersicum, tomate, fruto

joven c.t

Las micro-láminas se suministran en una caja de láminas.

PHYWE Systeme GmbH & Co. KG
Robert-Bosch-Breite 10 – 37079 Göttingen – Deutschland
www.phywe.com
Contact