-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjquery.php
29 lines (25 loc) · 961 Bytes
/
jquery.php
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
<?php
// Jquery 3.3.1 plugin, https://github.com/nibreh/yellow-plugin-jquery
// Copyright (c) 2018 nogginfuel, update by Juh Nibreh
// This file may be used and distributed under the terms of the public license.
class YellowJquery {
const VERSION = "0.7.7";
public $yellow; //access to API
// Handle initialisation
public function onLoad($yellow) {
$this->yellow = $yellow;
if(!$this->yellow->config->isExisting("jQuery")) {
$this->yellow->config->setDefault("jQuery", "https://code.jquery.com/jquery-3.3.1.min.js");
}
}
// Handle page extra HTML data
public function onExtra($name) {
$output = null;
if ($name == "header") {
$jquery = $this->yellow->config->get("jQuery");
$output .= "<script type=\"text/javascript\" src=\"{$jquery}\"></script>\n";
}
return $output;
}
}
$yellow->plugins->register("Jquery", "YellowJquery", YellowJquery::VERSION);