ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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($a_tpl = null)
27  {
28  global $DIC;
29 
30  $tpl = $DIC["tpl"];
31 
32  // self::$min = DEVMODE ? "" : ".min";
33  self::$min = "";
34  if ($a_tpl == null) {
35  $a_tpl = $tpl;
36  }
37 
38  $a_tpl->addJavaScript(self::getLocaljQueryPath(), true, 1);
39  $a_tpl->addJavaScript('./libs/bower/bower_components/jquery-migrate/jquery-migrate.min.js', true, 1);
40  }
41 
42 
47  public static function initjQueryUI($a_tpl = null)
48  {
49  global $DIC;
50 
51  $tpl = $DIC["tpl"];
52 
53  if ($a_tpl == null) {
54  $a_tpl = $tpl;
55  }
56 
57  $a_tpl->addJavaScript(self::getLocaljQueryUIPath(), true, 1);
58  }
59 
60 
64  public static function getLocaljQueryPath()
65  {
66  return "./libs/bower/bower_components/jquery/dist/jquery" . self::$min . ".js";
67  }
68 
69 
73  public static function getLocaljQueryUIPath()
74  {
75  return "./libs/bower/bower_components/jquery-ui/jquery-ui" . self::$min . ".js";
76  }
77 
78  //
79  // Maphilight plugin
80  //
81 
85  public static function initMaphilight()
86  {
87  global $DIC;
88 
89  $tpl = $DIC["tpl"];
90 
91  $tpl->addJavaScript(self::getLocalMaphilightPath(), true, 1);
92  }
93 
94 
98  public static function getLocalMaphilightPath()
99  {
100  return "./libs/bower/bower_components/maphilight/jquery.maphilight.min.js";
101  }
102 }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static getLocaljQueryUIPath()
static initMaphilight()
Inits and add maphilight to the general template.
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static getLocalMaphilightPath()
Get local path of maphilight file.
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static getLocaljQueryPath()