|
|
| (7 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| | | {{Seitenkopf|Bibliography Backbone}} |
| | |
| {{#dpl: | |
| |category = Media Pages | |
| |include = {MediaInfo}:publication:year:illustrator:chapter:illustration:title:tags:[[%TITLE%]]
| |
| |table = class="wikitable datatable hover" id="DPL"
| |
| data-layout='{"top1Start":"searchBuilder"}'
| |
| data-language='<nowiki>{"searchPlaceholder":" Quick Search", "search":"", "searchBuilder":{"add":"Add Search Condition"}}</nowiki>'
| |
| data-page-length="50",-,Publication, Year, Illustrator, Chapter, Illustration, Title, Tags,ID
| |
| |tablerow=style="width:5%;"¦%%, %%, style="width:5%;"¦%%, %%, style="width:5%;"¦%%, style="width:5%;"¦%%, class="type" style="width:5%;"¦%%,
| |
| style="width:5%;"¦%%, style="width:5%;"¦%%
| |
| |ordermethod = title
| |
| |order=ascending
| |
| }} | |
| <html> | | <html> |
| <button id="generateCatalogHTML"> | | <p> |
| Generate static catalog HTML
| | <button id="generateCatalogHTML">Create Raw HTML</button> |
| </button> | | </p> |
| | |
| <pre id="catalogOutput" style="margin-top:1em; white-space:pre-wrap;"></pre>
| |
| | |
| <script>
| |
| mw.hook('wikipage.content').add(function () {
| |
| | |
| document.addEventListener('click', function (e) {
| |
| if (e.target.id !== 'generateCatalogHTML') return;
| |
| | |
| const table = document.getElementById('DPL');
| |
| if (!table) {
| |
| alert('DPL table not found');
| |
| return;
| |
| }
| |
| | |
| const rows = table.querySelectorAll('tbody tr');
| |
| let out = [];
| |
| | |
| rows.forEach((row, i) => {
| |
| if (i === 0) return;
| |
| | |
| const td = row.querySelectorAll('td');
| |
| if (td.length < 8) return;
| |
| | |
| const link = td[7].querySelector('a');
| |
| if (!link) return;
| |
| | |
| const file = decodeURIComponent(
| |
| (link.href.match(/title=([^&]+)/i) || [])[1] || ''
| |
| );
| |
| | |
| if (!file) return;
| |
| | |
| out.push(`
| |
| <tr>
| |
| <td align="left"><font face="Liberation Serif">${td[0].innerText.trim()}</font></td>
| |
| <td align="right" sdval="${td[1].innerText.trim()}"><font face="Liberation Serif">${td[1].innerText.trim()}</font></td>
| |
| <td align="left"><font face="Liberation Serif">${td[2].innerText.trim()}</font></td>
| |
| <td align="center">${td[3].innerText.trim()}</td>
| |
| <td align="center">${td[3].innerText.trim()}</td>
| |
| <td align="center">${td[4].innerText.trim()}</td>
| |
| <td align="left"><font face="Liberation Serif">${td[5].innerText.trim()}</font></td>
| |
| <td align="left"><font face="Liberation Serif">-${td[6].innerText.trim().replace(/,\s*/g,' -')}</font></td>
| |
| <td align="left">
| |
| <a href="/index.php/Special:Redirect/file/${file}">${file.replace(/\.jpg$/i,'')}</a>
| |
| </td>
| |
| </tr>`.trim());
| |
| });
| |
| | |
| const html = `
| |
| <table id="catalog" class="wikitable" style="width:100%">
| |
| <thead>
| |
| <tr>
| |
| <th>Book</th>
| |
| <th>Year</th>
| |
| <th>Illustrator</th>
| |
| <th>Og.Chpt.</th>
| |
| <th>Chpt.</th>
| |
| <th>Ill. in Chpt.</th>
| |
| <th>Illustration Title</th>
| |
| <th>Tags</th>
| |
| <th>ID</th>
| |
| </tr>
| |
| </thead>
| |
| <tbody>
| |
| ${out.join('\n')}
| |
| </tbody>
| |
| </table>`.trim();
| |
| | |
| document.getElementById('catalogOutput').textContent = html;
| |
| });
| |
| | |
| });
| |
| </script>
| |
| | |
|
| |
|
| | <textarea id="outputHTML" style="width:100%; height:600px; font-family:monospace;"></textarea> |
|
| |
|
| | <div id="status" style="margin-top:10px;"></div> |
| </html> | | </html> |