ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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('./libs/bower/bower_components/jquery-migrate/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 "./libs/bower/bower_components/jquery/dist/jquery" . self::$min . ".js";
63  }
64 
65 
69  public static function getLocaljQueryUIPath()
70  {
71  return "./libs/bower/bower_components/jquery-ui/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 "./libs/bower/bower_components/maphilight/jquery.maphilight.min.js";
97  }
98 }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static getLocaljQueryUIPath()
jQuery utilities
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 initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
$DIC
Definition: xapitoken.php:46
static getLocalMaphilightPath()
Get local path of maphilight file.
static getLocaljQueryPath()