1<?php
2/*
3 * Copyright (c) 2012-2016 Mark C. Prins <mprins@users.sf.net>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 *
17 * @author  Mark C. Prins <mprins@users.sf.net>
18 */
19
20/**
21 * DokuWiki Plugin snow (Action Component).
22 */
23class action_plugin_snow extends DokuWiki_Action_Plugin {
24
25    public function register(Doku_Event_Handler $controller): void {
26        $controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'addJsinfoInformation');
27    }
28
29    public function addJsinfoInformation(&$event, $param): void {
30        global $JSINFO;
31
32        $JSINFO['plugin']['snow']['enabled'] = $this->getConf('enabled');
33        $JSINFO['plugin']['snow']['zindex'] = $this->getConf('zindex');
34        $JSINFO['plugin']['snow']['color'] = $this->getConf('color');
35        $JSINFO['plugin']['snow']['excludemobile'] = $this->getConf('excludemobile');
36        $JSINFO['plugin']['snow']['flakesmax'] = $this->getConf('flakesmax');
37        $JSINFO['plugin']['snow']['flakesmaxactive'] = $this->getConf('flakesmaxactive');
38        $JSINFO['plugin']['snow']['animationinterval'] = $this->getConf('animationinterval');
39        $JSINFO['plugin']['snow']['usegpu'] = $this->getConf('usegpu');
40        $JSINFO['plugin']['snow']['followmouse'] = $this->getConf('followmouse');
41        $JSINFO['plugin']['snow']['snowstick'] = $this->getConf('snowstick');
42        $JSINFO['plugin']['snow']['usemelteffect'] = $this->getConf('usemelteffect');
43        $JSINFO['plugin']['snow']['usetwinkleeffect'] = $this->getConf('usetwinkleeffect');
44        $JSINFO['plugin']['snow']['freezeonblur'] = $this->getConf('freezeonblur');
45    }
46}
47