MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Dokumentation
Wechseln zu:Navigation, Suche
(Der Seiteninhalt wurde durch einen anderen Text ersetzt: „→‎cache-bust: 2026-05-19-001: $.fn.extend({ treed: function (o) { var openedClass = 'fa-minus-circle'; var closed…“)
Markierung: Ersetzt
(Der Seiteninhalt wurde durch einen anderen Text ersetzt: „ // Blockieren Rechtsklick Videos $(document).ready(function () { $('video').on('contextmenu', function (e) { return false;…“)
Markierung: Ersetzt
Zeile 1: Zeile 1:
−
/* cache-bust: 2026-05-19-001 */
 
−
$.fn.extend({
 
−
    treed: function (o) {
 
−
      var openedClass = 'fa-minus-circle';
 
−
      var closedClass = 'fa-plus-circle';
 
−
      if (typeof o != 'undefined'){
 
−
        if (typeof o.openedClass != 'undefined'){
 
−
        openedClass = o.openedClass;
 
−
        }
 
−
        if (typeof o.closedClass != 'undefined'){
 
−
        closedClass = o.closedClass;
 
−
        }
 
−
      };
 
−
        var tree = $(this);
 
−
        tree.addClass("tree");
 
−
        tree.find('li').has("ul").each(function () {
 
−
            var branch = $(this);
 
−
            branch.prepend("");
 
−
            branch.addClass('branch');
 
−
            branch.on('click', function (e) {
 
−
                if (this == e.target) {
 
−
                    var icon = $(this).children('i:first');
 
−
                    icon.toggleClass(openedClass + " " + closedClass);
 
−
                    $(this).children().children().toggle();
 
−
                }
 
−
            })
 
−
            branch.children().children().toggle();
 
−
        });
 
−
      tree.find('.branch .indicator').each(function(){
 
−
        $(this).on('click', function () {
 
−
            $(this).closest('li').click();
 
−
        });
 
−
      });
 
−
        tree.find('.branch>a').each(function () {
 
−
            $(this).on('click', function (e) {
 
−
                $(this).closest('li').click();
 
−
                e.preventDefault();
 
−
            });
 
−
        });
 
−
        tree.find('.branch>button').each(function () {
 
−
            $(this).on('click', function (e) {
 
−
                $(this).closest('li').click();
 
−
                e.preventDefault();
 
−
            });
 
−
        });
 
−
    }
 
−
});
 
−
 
−
$('#tree1').treed();
 
−
$('#tree2').treed({openedClass:'fa-folder-open', closedClass:'fa-folder'});
 
−
 
−
$('#tree').treeview({
 
−
    data: tree,
 
−
    levels: 5,
 
−
    backColor: 'white',
 
−
    expandIcon: "glyphicon glyphicon-triangle-right",
 
−
    collapseIcon: "glyphicon glyphicon-triangle-bottom",
 
−
    showBorder: false,
 
−
    enableLinks: true
 
−
});
 
−
 
−
var tree = [
 
−
    {
 
−
        text: "Assets",
 
−
        href: "http://localhost:63690/asset/index",
 
−
        nodes: [
 
−
        {
 
−
            text: "Barcode"
 
−
        },
 
−
        {
 
−
            text: "Importation"
 
−
        }
 
−
        ]
 
−
    },
 
−
];
 
  
 
// Blockieren Rechtsklick Videos
 
// Blockieren Rechtsklick Videos

Version vom 1. September 2026, 16:48 Uhr

// Blockieren Rechtsklick Videos
$(document).ready(function () {
  $('video').on('contextmenu', function (e) {
    return false;
  });
});