tra('Scroll'), 'documentation' => 'PluginScroll', 'description' => tra('Show animated text that scrolls up or down'), 'prefs' => ['wikiplugin_scroll'], 'body' => tra('text'), 'iconname' => 'sort-down', 'introduced' => 5, 'tags' => [ 'basic' ], 'params' => [ 'width' => [ 'required' => true, 'name' => tra('Width'), 'description' => tr('Width in pixels. Example: %0.', '600px'), 'since' => '5.0', 'accepted' => tra('Number of pixels followed by "px".'), 'filter' => 'text', 'default' => '', ], 'height' => [ 'required' => true, 'name' => tra('Height'), 'description' => tr('Height in pixels. Example: %0.', '450px'), 'since' => '5.0', 'accepted' => tra('Number of pixels followed by "px".'), 'filter' => 'text', 'default' => '', ], 'speed' => [ 'required' => false, 'name' => tra('Speed'), 'description' => tr('Scroll speed in number of seconds (default is %0)', '8'), 'since' => '5.0', 'filter' => 'digits', 'default' => 8, ], ] ]; } function wikiplugin_scroll($data, $params) { extract($params, EXTR_SKIP); //minimum parameters if (! isset($width)) { return ('missing width parameter for plugin
'); } if (! isset($height)) { return ('missing height parameter for plugin
'); } //optional parameters if (! isset($speed)) { $speed = 8; } // margin requierd for ilayer scrolling on mozilla $margin = 40; if (substr($width, -1) == "x") { $width_w = substr($width, 0, -2); $height_h = substr($height, 0, -2); } elseif (substr($width, -1) == "%") { return ("Warning the value of the height parameters must be set using px (ex: 600px ) for plugin
"); } else { return ("Warning the value of the width parameters must be set using px (ex: 600px ) for plugin
"); } $margin = 20; $i_width = $width_w - $margin; $c_width = $width_w - 10; $cx_width = $i_width . "px"; $z_width_w = $width_w + 10; $z_width = $z_width_w . "px"; $ret = "~np~
Down Up Stop Top
~/np~ $data ~np~ ~/np~"; return $ret; }