BibliographyBackbone: Difference between revisions

From Illustrations in German Translations of Mark Twain's Works

No edit summary
Tag: Manual revert
No edit summary
Line 1: Line 1:
{{Seitenkopf|Bibliography Generator}}
{{Seitenkopf|Bibliography Generator}}
<html>
<html>
<button id="testBtn" style="
 
 
<button id="copyBtn" onclick="window.CopyBibliographyData.copy()" style="
   background-color: #008CBA;
   background-color: #008CBA;
   color: white;
   color: white;
Line 10: Line 12:
   cursor: pointer;
   cursor: pointer;
   margin-bottom: 1rem;
   margin-bottom: 1rem;
">Test Years</button>
">Copy Raw Data</button>


<textarea id="bibOutput" style="
<textarea id="bibOutput" style="
Line 24: Line 26:
   overflow: auto;
   overflow: auto;
"></textarea>
"></textarea>
<script>
async function testYears() {
  console.log('testYears aufgerufen');
  const output = document.getElementById('bibOutput');
  if (!output) {
    console.error('bibOutput nicht gefunden');
    return;
  }
  output.value = 'Lade Daten...\n';
  try {
    const response = await fetch('https://illus.twainframe.org/BibliographyData?action=raw');
    console.log('Response status:', response.status);
   
    if (!response.ok) throw new Error(`HTTP ${response.status}`);
   
    const entries = await response.json();
    console.log('JSON geparst, Anzahl Einträge:', entries.length);
    let result = '';
    entries.forEach((entry, index) => {
      const year = entry.year && entry.year.trim() ? entry.year : 'unknown';
      result += `${index + 1}. ${year}\n`;
    });
    output.value = result;
    console.log('Fertig');
  } catch (error) {
    output.value = `ERROR: ${error.message}`;
    console.error('Fehler:', error);
  }
}
document.addEventListener('DOMContentLoaded', function() {
  const btn = document.getElementById('testBtn');
  if (btn) {
    btn.addEventListener('click', testYears);
    console.log('Button bereit');
  }
});
</script>
</html>
</html>

Revision as of 00:44, 12 May 2026

Bibliography Generator