File: r.html

package info (click to toggle)
requirejs 2.3.6%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,212 kB
  • sloc: javascript: 80,855; sh: 64; makefile: 10
file content (46 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (7)
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
43
44
45
46
<!DOCTYPE html>
<html>
<head>
    <style>
        textarea {
            width: 100%;
            height: 20em;
        }
    </style>
    <script src="../../r.js"></script>
    <script>
    document.addEventListener('DOMContentLoaded', function (evt) {
        document.getElementById('build').addEventListener('click', function (evt) {
            requirejs.optimize({
                baseUrl: '.',
                paths: {
                    'd': 'sub/d'
                },
                include: ['a'],
                out: function (text) {
                    document.getElementById('output').value = text;
                }
            }, function (buildText) {
                document.getElementById('buildMessages').value = buildText;
            });
        }, false);
    }, false);
    </script>
</head>
<body>
    <h1>r.js in the browser</h1>


    <p>A test of running r.js in the browser.</p>

    <p>
        <button id="build">Build it</button>
    </p>

    <h2>Build Messages</h2>
    <textarea id="buildMessages"></textarea>

    <h2>Output</h2>
    <textarea id="output"></textarea>
</body>
</html>