MediaWiki:Common.js: Difference between revisions

From Hauck LabWiki
Jump to navigation Jump to search
No edit summary
Replaced content with "// java"
Tag: Replaced
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
// java
 
// Real Example Tab für Vector 2022 Skin
$(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'
    ];
   
    if (protocolsWithExamples.includes(pageName)) {
        var realExamplePage = pageName + '_Real_Example';
       
        // Vector 2022 spezifischer Code
        if ($('.vector-menu-tabs').length > 0) {
            // Vector 2022
            var realExampleTab = $('<li><a href="/wiki/' + realExamplePage + '" title="Real Lab Notebook Example">Real Example</a></li>');
            $('.vector-menu-tabs ul').append(realExampleTab);
        } else {
            // Fallback für andere Skins
            var realExampleTab = $('<li id="ca-realexample"><a href="/wiki/' + realExamplePage + '" title="Real Lab Notebook Example">Real Example</a></li>');
            $('#p-views ul').append(realExampleTab);
        }
    }
});

Latest revision as of 16:28, 30 May 2025

// java