File: helpers.php

package info (click to toggle)
node-nouislider 15.8.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,936 kB
  • sloc: javascript: 5,234; php: 474; sh: 32; python: 28; makefile: 11
file content (42 lines) | stat: -rw-r--r-- 864 bytes parent folder | download | duplicates (3)
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
38
39
40
41
42
<?php

function fgc($name)
{
    return file_get_contents('./' . $GLOBALS['page'] . '/' . $name);
}

function code($name, $encode = false)
{
    $c = fgc($name . '.js');

    if ($encode) {
        $c = htmlentities($c);
    }

    echo "\r\n" . '<pre><code>' . $c . '</code></pre>';
}

function run($name)
{
    echo "\r\n" . '<script>' . "\r\n" . fgc($name . '.js') . '</script>';
}

function loadShowCSS($name)
{
    $content = fgc($name . '.css');

    echo "\r\n" . '<style>' . $content . '</style>' .
        '<pre class="language-css"><code>' . $content . '</code></pre>';
}

function showCSS($name)
{
    $content = fgc($name . '.css');

    echo "\r\n" . '<pre class="language-css"><code>' . $content . '</code></pre>';
}

function sect($title)
{
    echo '<a href="#section-' . $title . '" id="section-' . $title . '" class="section-link">&sect;</a>';
}