OSDN Git Service

BugTrack/2436 ESLint - Linting utility for JavaScript
[pukiwiki/pukiwiki.git] / plugin / size.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: size.inc.php,v 1.10 2005/06/16 15:04:08 henoheno Exp $
4 //
5 // Text-size changing via CSS plugin
6
7 define('PLUGIN_SIZE_MAX', 60); // px
8 define('PLUGIN_SIZE_MIN',  8); // px
9
10 // ----
11 define('PLUGIN_SIZE_USAGE', '&size(px){Text you want to change};');
12
13 function plugin_size_inline()
14 {
15         if (func_num_args() != 2) return PLUGIN_SIZE_USAGE;
16
17         list($size, $body) = func_get_args();
18
19         // strip_autolink() is not needed for size plugin
20         //$body = strip_htmltag($body);
21         
22         if ($size == '' || $body == '' || ! preg_match('/^\d+$/', $size))
23                 return PLUGIN_SIZE_USAGE;
24
25         $size = max(PLUGIN_SIZE_MIN, min(PLUGIN_SIZE_MAX, $size));
26         return '<span style="font-size:' . $size .
27                 'px;display:inline-block;line-height:130%;text-indent:0px">' .
28                 $body . '</span>';
29 }
30 ?>