ILIAS  release_7 Revision v7.30-3-g800a261c036
class.iljQueryUtil.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
13{
14
18 private static $min = ".min";
19
20
26 public static function initjQuery(ilGlobalTemplateInterface $a_tpl = null)
27 {
28 global $DIC;
29
30 self::$min = "";
31 if ($a_tpl == null) {
32 $a_tpl = $DIC["tpl"];
33 }
34
35 $a_tpl->addJavaScript(self::getLocaljQueryPath(), true, 0);
36 $a_tpl->addJavaScript('./node_modules/jquery-migrate/dist/jquery-migrate.min.js', true, 0);
37 }
38
39
44 public static function initjQueryUI($a_tpl = null)
45 {
46 global $DIC;
47
48 if ($a_tpl == null) {
49 $a_tpl = $DIC["tpl"];
50 }
51
52 // Important: jQueryUI has to be included before(!) the bootstrap JS file
53 $a_tpl->addJavaScript(self::getLocaljQueryUIPath(), true, 0);
54 }
55
56
60 public static function getLocaljQueryPath()
61 {
62 return "./node_modules/jquery/dist/jquery" . self::$min . ".js";
63 }
64
65
69 public static function getLocaljQueryUIPath()
70 {
71 return "./node_modules/jquery-ui-dist/jquery-ui" . self::$min . ".js";
72 }
73
74 //
75 // Maphilight plugin
76 //
77
81 public static function initMaphilight()
82 {
83 global $DIC;
84
85 $tpl = $DIC["tpl"];
86
87 $tpl->addJavaScript(self::getLocalMaphilightPath(), true, 1);
88 }
89
90
94 public static function getLocalMaphilightPath()
95 {
96 return "./node_modules/maphilight/jquery.maphilight.min.js";
97 }
98}
An exception for terminatinating execution or to throw for unit testing.
jQuery utilities
static getLocaljQueryUIPath()
static getLocaljQueryPath()
static initMaphilight()
Inits and add maphilight to the general template.
static getLocalMaphilightPath()
Get local path of maphilight file.
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
global $DIC
Definition: goto.php:24
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41