Gebruikershulpmiddelen

Site-hulpmiddelen


sasteren:boeken-nieuw

Verschillen

Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.

Link naar deze vergelijking

Beide kanten vorige revisieVorige revisie
Volgende revisie
Vorige revisie
sasteren:boeken-nieuw [2023/08/13 16:53] admin_sasterensasteren:boeken-nieuw [2026/04/20 06:12] (huidige) – oude revisie hersteld (2023/08/14 07:11) admin_sasteren
Regel 1: Regel 1:
-====== Nieuw Boek toevoegen ====== 
- 
- 
 <form> <form>
- 
 action template :templates/boek1template :sasteren:boeken:@p_get_first_heading(@@boek.author@@)@:@@boek.title@@ action template :templates/boek1template :sasteren:boeken:@p_get_first_heading(@@boek.author@@)@:@@boek.title@@
 struct_schema "boek" ! struct_schema "boek" !
Regel 13: Regel 9:
 <script> <script>
 const isbnField = document.getElementsByName("bureaucracy[0]")[0]; const isbnField = document.getElementsByName("bureaucracy[0]")[0];
-const itemTypeField = document.getElementsByName('bureaucracy[3]')[0];+const itemTypeField = document.getElementsByName('bureaucracy[2]')[0]; 
 +const titleField = document.getElementsByName('bureaucracy[3]')[0];
 const subtitleField = document.getElementsByName('bureaucracy[4]')[0]; const subtitleField = document.getElementsByName('bureaucracy[4]')[0];
 const originalTitleField = document.getElementsByName('bureaucracy[6]')[0]; const originalTitleField = document.getElementsByName('bureaucracy[6]')[0];
Regel 24: Regel 21:
 const publisherField = document.getElementsByName('bureaucracy[10]')[0]; const publisherField = document.getElementsByName('bureaucracy[10]')[0];
 const descriptionField = document.getElementsByName('bureaucracy[9]')[0]; const descriptionField = document.getElementsByName('bureaucracy[9]')[0];
 +const statusField = document.getElementsByName('bureaucracy[22]')[0]; // Status field
 +const plaatsingField = document.getElementsByName('bureaucracy[24]')[0]; // Plaatsing field
        
 isbnField.addEventListener('blur', function() { isbnField.addEventListener('blur', function() {
Regel 33: Regel 32:
                 if (googleBookData) {                 if (googleBookData) {
                     populateFieldsFromGoogle(googleBookData);                     populateFieldsFromGoogle(googleBookData);
 +                    openThumbnailImage(googleBookData);
                 } else {                 } else {
                     console.error('No book data found for ISBN:', isbn);                     console.error('No book data found for ISBN:', isbn);
Regel 42: Regel 42:
     }     }
 }); });
 +
 +function openThumbnailImage(data) {
 +    const imagelinks = data.imageLinks || {};
 +    const thumbnailUrl = imagelinks.thumbnail || '';
 +    if (thumbnailUrl) {
 +        window.open(thumbnailUrl, '_blank');
 +    }
 +}
  
 function fetchGoogleBookData(isbn) { function fetchGoogleBookData(isbn) {
Regel 61: Regel 69:
     const title = data.title || '';     const title = data.title || '';
     const subtitle = data.subtitle || '';     const subtitle = data.subtitle || '';
-    const authors = data.authors ? data.authors.map(author => ":sasteren:auteurs:" + author.replace(/ /g, "_").toLowerCase()) : [];+    const authors = data.authors || [];
     const languageCode = data.language || ''; // Language code from JSON     const languageCode = data.language || ''; // Language code from JSON
     const languages = {     const languages = {
Regel 82: Regel 90:
     if (itemTypeField.value === '') {     if (itemTypeField.value === '') {
         itemTypeField.value = 'boek';         itemTypeField.value = 'boek';
 +    }
 +
 +    if (titleField.value === '') {
 +        titleField.value = title;
     }     }
  
Regel 89: Regel 101:
  
     if (authorField.value === '') {     if (authorField.value === '') {
-        authorField.value = authors.join(', ');+        authorField.value = ("sasteren:auteurs:"+authors.join(', ')).replace(/ /g, "_").toLowerCase();;
     }     }
  
Regel 111: Regel 123:
  
     if (publisherField.value === '') {     if (publisherField.value === '') {
-        publisherField.value = publisher; +        publisherField.value = (":sasteren:uitgevers:"publisher).replace(/ /g, "_").toLowerCase();
-    } else { +
-        publisherField.value = ":sasteren:uitgevers:"publisherField.value;+
     }     }
  
     if (descriptionField.value === '') {     if (descriptionField.value === '') {
         descriptionField.value = bookDescription;         descriptionField.value = bookDescription;
 +    }
 +
 +    if (statusField.value === '') {
 +        statusField.value = 'niet gestart'; // Default value for status field
 +    }
 +
 +    if (plaatsingField.value === '') {
 +        plaatsingField.value = 'bibliotheek'; // Default value for plaatsing field
 +    }
 +    
 +    // Open thumbnail image in a new window if available
 +    const imagelinks = data.imageLinks || {};
 +    const thumbnailUrl = imagelinks.thumbnail || '';
 +    if (thumbnailUrl) {
 +        const thumbnailLink = document.createElement('a');
 +        thumbnailLink.href = thumbnailUrl;
 +        thumbnailLink.target = '_blank';
 +        thumbnailLink.textContent = 'Open Thumbnail Image';
 +        document.body.appendChild(thumbnailLink);
     }     }
 } }
/var/www/dokuwiki/data/attic/sasteren/boeken-nieuw.1691945592.txt.gz · Laatst gewijzigd: door admin_sasteren

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki