forked from InfotelGLPI/printercounters
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprintercounters_load_scripts.js.php
More file actions
37 lines (31 loc) · 964 Bytes
/
printercounters_load_scripts.js.php
File metadata and controls
37 lines (31 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
use Glpi\Event;
include('../../inc/includes.php');
header('Content-Type: text/javascript');
?>
var root_printercounters_doc = "<?php echo PLUGIN_PRINTERCOUNTERS_WEBDIR; ?>";
(function ($) {
$.fn.printercounters_load_scripts = function () {
init();
// Start the plugin
function init() {
// $(document).ready(function () {
// Send data
$.ajax({
url: root_printercounters_doc + '/ajax/loadscripts.php',
type: "POST",
dataType: "html",
data: 'action=load',
success: function (response, opts) {
var scripts, scriptsFinder = /<script[^>]*>([\s\S]+?)<\/script>/gi;
while (scripts = scriptsFinder.exec(response)) {
eval(scripts[1]);
}
}
});
// });
}
return this;
};
}(jQuery));
$(document).printercounters_load_scripts();