-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (64 loc) · 4.08 KB
/
index.html
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>TSIncludeJS by JonasBr68</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">TSIncludeJS</h1>
<h2 class="project-tagline">Super simple fluent TypeScript/JavaScript API to include JavaScript dependencies, instead of adding a bunch of <script... > tags, or when you want something simple instead of for instance RequireJS etc.</h2>
<a href="https://github.com/JonasBr68/TSIncludeJS" class="btn">View on GitHub</a>
<a href="sample/unittesting.html" class="btn">See QUnit Test sample page with TSIncludeJS</a>
<a href="https://github.com/JonasBr68/TSIncludeJS/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/JonasBr68/TSIncludeJS/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<h1>
<a id="tsincludejs" class="anchor" href="#tsincludejs" aria-hidden="true"><span class="octicon octicon-link"></span></a>TSIncludeJS
</h1>
<p>Super simple fluent TypeScript/JavaScript API to include JavaScript dependencies, instead of adding a bunch of <script... > tags, or when you want something simple instead of for instance RequireJS etc.</p>
<p>
Add you script with dependencies like:<br>
<code><script src="../src/include.js" type="text/javascript" data-boot="tests.js"></script></code><br>
where tests.js is your script that defines dependencies and your code.
</p>
<p>
The sample on <a href="http://jonasbr68.github.io/TSIncludeJS/sample/unittesting.html">http://jonasbr68.github.io/TSIncludeJS/sample/unittesting.html</a>
for instance uses a tests.js file like below.
With a fluent api you specify dependency/load order, and wrap your dependent code in an anonymous function.
</p>
<pre><code>
TSIncludeJS.include("https://code.jquery.com/jquery-2.1.4.js")
.include("http://code.jquery.com/qunit/qunit-1.20.0.js")
.done(function () {
QUnit.test("hello test", function (assert) {
assert.ok(1 == 1, "Works!");
});
QUnit.test("jquery test", function (assert) {
assert.ok((typeof $ === "function"), "Works!");
});
});
</code></pre>
<p>
Or you can completely separate our your code from dependecis, like this
The sample on <a href="http://jonasbr68.github.io/TSIncludeJS/sample/separate.html">http://jonasbr68.github.io/TSIncludeJS/sample/separate.html</a>
Still with a fluent api you specify dependency/load order, and lastly specify the js code you want to run.
</p>
<pre><code>
TSIncludeJS.include("https://code.jquery.com/jquery-2.1.4.js")
.include("http://code.jquery.com/qunit/qunit-1.20.0.js")
.run("only-tests.js");
</code></pre>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/JonasBr68/TSIncludeJS">TSIncludeJS</a> is maintained by <a href="https://github.com/JonasBr68">JonasBr68</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>