ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.iljQueryUtil.php
Go to the documentation of this file.
1<?php
2
25{
29 private static $min = ".min";
30
31
37 public static function initjQuery(?ilGlobalTemplateInterface $a_tpl = null): void
38 {
39 global $DIC;
40
41 self::$min = "";
42 if ($a_tpl === null) {
43 $a_tpl = $DIC["tpl"];
44 }
45
46 $a_tpl->addJavaScript(self::getLocaljQueryPath(), true, 0);
47 $a_tpl->addJavaScript('assets/js/jquery-migrate.min.js', true, 0);
48 }
49
50
55 public static function initjQueryUI(?ilGlobalTemplateInterface $a_tpl = null): void
56 {
57 global $DIC;
58
59 if ($a_tpl === null) {
60 $a_tpl = $DIC["tpl"];
61 }
62
63 // Important: jQueryUI has to be included before(!) the bootstrap JS file
64 $a_tpl->addJavaScript(self::getLocaljQueryUIPath(), true, 0);
65 }
66
67
71 public static function getLocaljQueryPath(): string
72 {
73 return "assets/js/jquery" . self::$min . ".js";
74 }
75
76
80 public static function getLocaljQueryUIPath(): string
81 {
82 return "./assets/js/jquery-ui" . self::$min . ".js";
83 }
84
85 //
86 // Maphilight plugin
87 //
88
92 public static function initMaphilight(): void
93 {
94 global $DIC;
95
96 $tpl = $DIC["tpl"];
97
98 $tpl->addJavaScript(self::getLocalMaphilightPath(), true, 1);
99 }
100
101
105 public static function getLocalMaphilightPath(): string
106 {
107 return "./assets/js/jquery.maphilight.min.js";
108 }
109}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLocaljQueryUIPath()
static getLocaljQueryPath()
static initMaphilight()
Inits and add maphilight to the general template.
static getLocalMaphilightPath()
Get local path of maphilight file.
static initjQueryUI(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
global $DIC
Definition: shib_login.php:26