ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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('./node_modules/jquery-migrate/dist/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 "./node_modules/jquery/dist/jquery" . self::$min . ".js";
74  }
75 
76 
80  public static function getLocaljQueryUIPath(): string
81  {
82  return "./node_modules/jquery-ui-dist/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 "./node_modules/maphilight/jquery.maphilight.min.js";
108  }
109 }
static getLocaljQueryUIPath()
global $DIC
Definition: feed.php:28
static initMaphilight()
Inits and add maphilight to the general template.
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static getLocalMaphilightPath()
Get local path of maphilight file.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
static getLocaljQueryPath()