MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Dokumentation
Wechseln zu:Navigation, Suche
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 
$.fn.extend({
 
$.fn.extend({
 
     treed: function (o) {
 
     treed: function (o) {
     
+
 
       var openedClass = 'glyphicon-minus-sign';
+
       var openedClass = 'fa-minus-circle';
       var closedClass = 'glyphicon-plus-sign';
+
       var closedClass = 'fa-plus-circle';
     
+
 
 
       if (typeof o != 'undefined'){
 
       if (typeof o != 'undefined'){
 
         if (typeof o.openedClass != 'undefined'){
 
         if (typeof o.openedClass != 'undefined'){
Zeile 13: Zeile 13:
 
         }
 
         }
 
       };
 
       };
     
+
 
 
         //initialize each of the top levels
 
         //initialize each of the top levels
 
         var tree = $(this);
 
         var tree = $(this);
Zeile 19: Zeile 19:
 
         tree.find('li').has("ul").each(function () {
 
         tree.find('li').has("ul").each(function () {
 
             var branch = $(this); //li with children ul
 
             var branch = $(this); //li with children ul
             branch.prepend("<i class='indicator glyphicon " + closedClass + "'></i>");
+
             branch.prepend("");
 
             branch.addClass('branch');
 
             branch.addClass('branch');
 
             branch.on('click', function (e) {
 
             branch.on('click', function (e) {
Zeile 55: Zeile 55:
 
//Initialization of treeviews
 
//Initialization of treeviews
  
$('#tree2').treed({openedClass:'glyphicon-folder-open', closedClass:'glyphicon-folder-close'});
+
$('#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
 +
$(document).ready(function () {
 +
  $('video').on('contextmenu', function (e) {
 +
    return false;
 +
  });
 +
});

Aktuelle Version vom 19. Mai 2025, 09:22 Uhr

$.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;
        }
      };

        //initialize each of the top levels
        var tree = $(this);
        tree.addClass("tree");
        tree.find('li').has("ul").each(function () {
            var branch = $(this); //li with children ul
            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();
        });
        //fire event from the dynamically added icon
      tree.find('.branch .indicator').each(function(){
        $(this).on('click', function () {
            $(this).closest('li').click();
        });
      });
        //fire event to open branch if the li contains an anchor instead of text
        tree.find('.branch>a').each(function () {
            $(this).on('click', function (e) {
                $(this).closest('li').click();
                e.preventDefault();
            });
        });
        //fire event to open branch if the li contains a button instead of text
        tree.find('.branch>button').each(function () {
            $(this).on('click', function (e) {
                $(this).closest('li').click();
                e.preventDefault();
            });
        });
    }
});

//Initialization of treeviews

$('#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
$(document).ready(function () {
  $('video').on('contextmenu', function (e) {
    return false;
  });
});