MediaWiki:Common.js: Difference between revisions

From Hauck LabWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


// Real Example Tab für Protokoll-Seiten
// Real Example Tab für spezifische Protokoll-Seiten
$(document).ready(function() {
$(document).ready(function() {
     var pageName = mw.config.get('wgPageName');
     var pageName = mw.config.get('wgPageName');
      
      
     // Real Example Tab nur auf Protokoll-Seiten hinzufügen
     // Liste der Protokolle mit Real Examples
     // Anpassen Sie die Bedingung nach Ihren Protokoll-Seitennamen
     var protocolsWithExamples = [
    if (pageName.includes('Protocol') ||
        'In_vitro_Tyrosine_Kinase_Activity_Assay',
         pageName.includes('Method') ||
         'Gentamicin_Protection_Assay',
         pageName.startsWith('PCR_') ||
         'LIC_Cloning_(Ligation_independent_cloning)',
         pageName.startsWith('Western_') ||
         'Immunoprecipitation',
         // Fügen Sie hier weitere Pattern Ihrer Protokolle hinzu
         'Protein_expression_and_purification',
         pageName === 'DNA_Extraction' ||
         'Production_of_lentiviral_particles',
         pageName === 'LIC_Cloning') {
         'Bacterial_growth_curve'
       
    ];
   
    // Prüfen ob aktuelle Seite ein Protokoll mit Real Example ist
    if (protocolsWithExamples.includes(pageName)) {
         // Real Example Seite = Protokollname + "_Real_Example"
         // Real Example Seite = Protokollname + "_Real_Example"
         var realExamplePage = pageName + '_Real_Example';
         var realExamplePage = pageName + '_Real_Example';
         var realExampleTab = $('<li id="ca-realexample"><a href="/wiki/' + realExamplePage + '" title="Real Example from Lab Notebook">Real Example</a></li>');
         var realExampleTab = $('<li id="ca-realexample"><a href="/wiki/' + realExamplePage + '" title="Real Lab Notebook Example">Real Example</a></li>');
          
          
         $('#p-views ul').append(realExampleTab);
         $('#p-views ul').append(realExampleTab);
     }
     }
});
});

Revision as of 16:13, 30 May 2025

/* Any JavaScript here will be loaded for all users on every page load. */

// Real Example Tab für spezifische Protokoll-Seiten
$(document).ready(function() {
    var pageName = mw.config.get('wgPageName');
    
    // Liste der Protokolle mit Real Examples
    var protocolsWithExamples = [
        'In_vitro_Tyrosine_Kinase_Activity_Assay',
        'Gentamicin_Protection_Assay', 
        'LIC_Cloning_(Ligation_independent_cloning)',
        'Immunoprecipitation',
        'Protein_expression_and_purification',
        'Production_of_lentiviral_particles',
        'Bacterial_growth_curve'
    ];
    
    // Prüfen ob aktuelle Seite ein Protokoll mit Real Example ist
    if (protocolsWithExamples.includes(pageName)) {
        // Real Example Seite = Protokollname + "_Real_Example"
        var realExamplePage = pageName + '_Real_Example';
        var realExampleTab = $('<li id="ca-realexample"><a href="/wiki/' + realExamplePage + '" title="Real Lab Notebook Example">Real Example</a></li>');
        
        $('#p-views ul').append(realExampleTab);
    }
});