This repository was archived by the owner on Feb 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
380 lines (302 loc) · 24.1 KB
/
index.html
File metadata and controls
380 lines (302 loc) · 24.1 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cloudinary JavaScript Library Index</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.paper.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html"><img class="branding-logo" src="http://res-1.cloudinary.com/cloudinary/image/upload/c_scale,fl_attachment,h_30/v1/logo/for_blue_bg/cloudinary_icon_for_blue_bg.png"
alt="logo"/>Cloudinary JavaScript Library</a>
</div>
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="ClientHintsMetaTag.html">ClientHintsMetaTag</a></li><li><a href="Cloudinary.html">Cloudinary</a></li><li><a href="CloudinaryJQuery.html">CloudinaryJQuery</a></li><li><a href="Condition.html">Condition</a></li><li><a href="Configuration.html">Configuration</a></li><li><a href="Expression.html">Expression</a></li><li><a href="FetchLayer.html">FetchLayer</a></li><li><a href="HtmlTag.html">HtmlTag</a></li><li><a href="ImageTag.html">ImageTag</a></li><li><a href="jQuery.html">jQuery</a></li><li><a href="Layer.html">Layer</a></li><li><a href="SubtitlesLayer.html">SubtitlesLayer</a></li><li><a href="TextLayer.html">TextLayer</a></li><li><a href="Transformation.html">Transformation</a></li><li><a href="TransformationBase.html">TransformationBase</a></li><li><a href="Util.html">Util</a></li><li><a href="VideoTag.html">VideoTag</a></li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="global.html#slice">slice</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-8">
<div id="main">
<!-- #0 -->
<!-- #1 -->
<section class="readme-section">
<article><p><a href="https://travis-ci.org/cloudinary/cloudinary_js"><img src="https://travis-ci.org/cloudinary/cloudinary_js.svg" alt="Build Status"></a> <a href=""><img src="https://img.shields.io/npm/v/cloudinary_js.svg?maxAge=2592000" alt="npm"></a> <a href=""><img src="https://img.shields.io/bower/v/cloudinary_js.svg?maxAge=2592000" alt="Bower"></a> <a href=""><img src="https://img.shields.io/github/license/cloudinary/cloudinary_js.svg?maxAge=2592000" alt="license"></a></p>
<h1>Cloudinary Client Side JavaScript Library</h1><p>Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline.</p>
<p>Easily upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software. Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your website’s graphics requirements. Images are seamlessly delivered through a fast CDN, and much much more.</p>
<p>Cloudinary offers comprehensive APIs and administration capabilities and is easy to integrate with any web application, existing or new.</p>
<p>Cloudinary provides URL and HTTP based APIs that can be easily integrated with any Web development framework.</p>
<h2>Getting started guide</h2><p><img src="http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png" alt=""> <strong>Take a look at our <a href="http://cloudinary.com/documentation/jquery_integration#getting_started_guide">Getting started guide for jQuery</a></strong>.</p>
<h2>New API!</h2><p>The version 2.0.0 release refactors the Cloudinary JavaScript library, and the biggest news is that the newly introduced Core Library is jQuery-independent. The source code has been converted into CoffeeScript and rearranged into classes, and a new build script based on Grunt has been added. The build process produces 3 artifacts:</p>
<table>
<thead>
<tr>
<th>Github Repository</th>
<th>Package name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/cloudinary/pkg-cloudinary-core">pkg-cloudinary-core</a></td>
<td><code>cloudinary-core</code></td>
<td>Core Cloudinary Library.<br/>Use this if you do not intend to use jQuery.</td>
</tr>
<tr>
<td><a href="https://github.com/cloudinary/pkg-cloudinary-jquery">pkg-cloudinary-jquery</a></td>
<td><code>cloudinary-jquery</code></td>
<td>Core Library + jQuery plugin</td>
</tr>
<tr>
<td><a href="https://github.com/cloudinary/pkg-cloudinary-jquery-file-upload">pkg-cloudinary-jquery-file-upload</a></td>
<td><code>cloudinary-jquery-file-upload</code></td>
<td>Core Library + jQuery plugin <br/>+ Blueimp File Upload adapter</td>
</tr>
</tbody>
</table>
<p>The same package names are used in both bower and NPM.</p>
<h3>Backward compatibility</h3><p>The cloudinary-jquery-file-upload library is fully backwards compatible with the cloudinary_js library <code>v1.0.25</code>.
The relevant Blueimp files can still be found in the <code>js</code> folder for backward compatibility. If you rely on the Blueimp
files located in the repository’s <code>js</code> folder, make sure to update your links to <code>load-image.all.min.js</code> which replaces <code>load-image.min.js</code> from previous versions.
However, we encourage developers to use a dependency manager such as bower or NPM to install the 3rd party libraries, and not to rely on the files in the <code>js</code> folder.</p>
<h2>Installation</h2><p>The following instructions detail the installation of the <strong>Cloudinary jQuery File Upload library</strong>.
For installation instructions of the core library which is not dependent on jQuery follow this <a href="https://github.com/cloudinary/pkg-cloudinary-core#installation">link</a></p>
<h3>bower</h3><ol>
<li><p>Install the files using the following command. Use the optional <code>--save</code> parameter if you wish to save the dependency in your <code>bower.json</code> file.</p>
<pre class="prettyprint source lang-shell"><code>bower install cloudinary-jquery-file-upload</code></pre></li>
<li><p>Include the javascript file in your HTML. For Example:</p>
<pre class="prettyprint source lang-html"><code><script src="bower_components/jquery/dist/jquery.js" type="text/javascript"></script>
<script src="bower_components/blueimp-file-upload/js/vendor/jquery.ui.widget.js" type="text/javascript"></script>
<script src="bower_components/blueimp-file-upload/js/jquery.iframe-transport.js" type="text/javascript"></script>
<script src="bower_components/blueimp-file-upload/js/jquery.fileupload.js" type="text/javascript"></script>
<script src="bower_components/cloudinary-jquery-file-upload/cloudinary-jquery-file-upload.js" type="text/javascript"></script></code></pre></li>
</ol>
<h3>NPM</h3><p>The following instructions describe the installation of the <strong>client-side libraries</strong>. For the server side NodeJS library, see https://github.com/cloudinary/cloudinary_npm</p>
<ol>
<li><p>Install the files using the following commands. Use the optional <code>--save</code> parameter if you wish to save the dependency in your <code>package.json</code> file.</p>
<pre class="prettyprint source lang-shell"><code>npm install cloudinary-jquery-file-upload</code></pre></li>
<li><p>Include the javascript file in your HTML. For Example:</p>
<pre class="prettyprint source lang-html"><code><script src="node_modules/jquery/dist/jquery.js" type="text/javascript"></script>
<script src="node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js" type="text/javascript"></script>
<script src="node_modules/blueimp-file-upload/js/jquery.iframe-transport.js" type="text/javascript"></script>
<script src="node_modules/blueimp-file-upload/js/jquery.fileupload.js" type="text/javascript"></script>
<script src="node_modules/cloudinary-jquery-file-upload/cloudinary-jquery-file-upload.js" type="text/javascript"></script></code></pre></li>
</ol>
<h2>Setup</h2><p>In order to properly use this library you have to provide it with a few configuration parameters:</p>
<p>Required:</p>
<ul>
<li><code>cloud_name</code> - The cloudinary cloud name associated with your Cloudinary account.</li>
</ul>
<p>Optional:</p>
<ul>
<li><code>private_cdn</code>, <code>secure_distribution</code>, <code>cname</code>, <code>cdn_subdomain</code> - Please refer to <a href="http://cloudinary.com/documentation/rails_additional_topics#configuration_options">Cloudinary Documentation</a> for information on these parameters.</li>
</ul>
<p>To set these configuration parameters use the <code>Cloudinary::config</code> function (see below).</p>
<p>Note:</p>
<p>When loading the jQuery Cloudinary library directly (using a <code>script</code> tag), the library automatically converts the relevant fileupload tags to utilize the upload functionality. If jquery.cloudinary is loaded as an <a href="https://github.com/amdjs/amdjs-api/blob/master/AMD.md">AMD</a> however, you need to initialize the Cloudinary fileupload fields e.g., by calling <code>$("input.cloudinary-fileupload[type=file]").cloudinary_fileupload();</code></p>
<h2>Usage</h2><p>The following blog post details the process of setting up a jQuery based file upload.
http://cloudinary.com/blog/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery</p>
<p>The Cloudinary Documentation can be found at:
http://cloudinary.com/documentation</p>
<h3>JavaScript Cloudinary objects library</h3><p>The Cloudinary JavaScript library API reference can be found at: <a href="https://cloudinary.github.io/pkg-cloudinary-jquery-file-upload">https://cloudinary.github.io/pkg-cloudinary-jquery-file-upload</a></p>
<p>The Cloudinary JavaScript library provides several classes, defined under the "<code>cloudinary</code>" domain.</p>
<h4>Configuration</h4><p>Start by instantiating a new Cloudinary class:</p>
<h5>Explicitly</h5><pre class="prettyprint source lang-javascript"><code>var cl = cloudinary.Cloudinary.new( { cloud_name: "demo"});</code></pre><h5>Using the config function</h5><pre class="prettyprint source lang-javascript"><code>// Using the config function
var cl = cloudinary.Cloudinary.new();
cl.config( "cloud_name", "demo");</code></pre><h5>From meta tags in the current HTML document</h5><p>When using the library in a browser environment, you can use meta tags to define the configuration options.</p>
<p>The <code>init()</code> function is a convenience function that invokes both <code>fromDocument()</code> and <code>fromEnvironment()</code>.</p>
<p>For example, add the following to the header tag:</p>
<pre class="prettyprint source lang-html"><code><meta name="cloudinary_cloud_name" content="demo"></code></pre><p>In your JavaScript source, invoke <code>fromDocument()</code>:</p>
<pre class="prettyprint source lang-javascript"><code>var cl = cloudinary.Cloudinary.new();
cl.fromDocument();
// or
cl.init();</code></pre><h5>From environment variables</h5><p>When using the library in a backend environment such as NodeJS, you can use an environment variable to define the configuration options.</p>
<p>Set the environment variable, for example:</p>
<pre class="prettyprint source lang-shell"><code>export CLOUDINARY_URL=cloudinary://demo</code></pre><p>In your JavaScript source, invoke <code>fromEnvironment()</code>:</p>
<pre class="prettyprint source lang-javascript"><code>var cl = cloudinary.Cloudinary.new();
cl.fromEnvironment();
// or
cl.init();</code></pre><h4>URL generation</h4><pre class="prettyprint source lang-javascript"><code>cl.url("sample")
// "http://res.cloudinary.com/demo/image/upload/sample"
cl.url( "sample", { width: 100, crop: "fit"})
// "http://res.cloudinary.com/demo/image/upload/c_fit,w_100/sample"</code></pre><h4>HTML tag generation</h4><p>You can generate HTML tags in several ways:</p>
<p><code>Cloudinary::image()</code> generates a DOM tag, and prepares it for responsive functionality. This is the same functionality as <code>$.cloudinary.image()</code>. (When using the Cloudinary jQuery plugin, the <code>src-cache</code> data attribute is stored using jQuery's <code>data()</code> method and so is not visible.)</p>
<pre class="prettyprint source lang-javascript"><code>cl.image("sample")</code></pre><p>produces:</p>
<pre class="prettyprint source lang-html"><code><img src="http://res.cloudinary.com/demo/image/upload/sample" data-src-cache="http://res.cloudinary.com/demo/image/upload/sample"></code></pre><p>You can generate an image Tag using the <code>imageTag</code> function:</p>
<pre class="prettyprint source lang-javascript"><code>var tag = cl.imageTag("sample");
tag.toHtml();</code></pre><p>which produces:</p>
<pre class="prettyprint source lang-html"><code><img src="http://res.cloudinary.com/demo/image/upload/sample"></code></pre><p>and:</p>
<pre class="prettyprint source lang-javascript"><code>tag.transformation().crop("fit").width(100).toHtml();</code></pre><p>which produces:</p>
<pre class="prettyprint source lang-html"><code><img src="http://res.cloudinary.com/demo/image/upload/c_fit,w_100/sample"></code></pre><p>You can also use <code>ImageTag</code> independently:</p>
<pre class="prettyprint source lang-javascript"><code>var tag = cloudinary.ImageTag.new( "sample", { cloud_name: "some_other_cloud" });
tag.toHtml();</code></pre><p>which produces:</p>
<pre class="prettyprint source lang-html"><code><img src="http://res.cloudinary.com/some_other_cloud/image/upload/sample"></code></pre><h4>Transformation</h4><p>In addition to using a plain object to define transformations or using the builder methods (both described above), you can define transformations by using the Transformation class:</p>
<pre class="prettyprint source lang-javascript"><code>var tr = cloudinary.Transformation.new();
tr.crop("fit").width(100);
tr.serialize()
// "c_fit,w_100"</code></pre><p>You can also chain transformations together:</p>
<pre class="prettyprint source lang-javascript"><code>var tr = cloudinary.Transformation.new();
tr.width(10).crop('fit').chain().angle(15).serialize()
// "c_fit,w_10/a_15"</code></pre><h3>jQuery plugin</h3><p>The Cloudinary jQuery plugin is fully backward compatible with the previous cloudinary_js version.
Under the hood, the new JavaScript library instantiates a <code>CloudinaryJQuery</code> object and attaches it to jQuery.</p>
<ul>
<li><code>$.cloudinary.config(parameter_name, parameter_value)</code> - Sets parameter_name's value to parameter_value.</li>
<li><code>$.cloudinary.url(public_id, options)</code> - Returns a cloudinary URL based on your configuration and the given options.</li>
<li><code>$.cloudinary.image(public_id, options)</code> - Returns an HTML image tag for the photo specified by public_id</li>
<li><p><code>$.cloudinary.facebook_profile_image</code>, <code>$.cloudinary.twitter_profile_image</code>, <code>$.cloudinary.twitter_name_profile_image</code>, <code>$.cloudinary.gravatar_image</code> , <code>$.cloudinary.fetch_image</code> - Same as <code>image</code> but returns a specific type of image.</p>
</li>
<li><p><code>$(jquery_selector).cloudinary(options)</code> - Goes over the elements specified by the jQuery selector and changes all the images to be fetched using Cloudinary's CDN. Using the <code>options</code> parameter, you can also specify transformations to the images which use similar syntax across all cloudinary frameworks. Please refer to <a href="http://cloudinary.com/documentation/jquery_image_manipulation">jQuery image manipulation</a> for a more complete reference regarding the options.</p>
</li>
</ul>
<p><img src="http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png" alt=""> <strong>See <a href="http://cloudinary.com/documentation/jquery_image_manipulation">our documentation</a> for more information about displaying and transforming images using jQuery</strong>. </p>
<h3>Direct file upload with backend support</h3><p>The javascript library implements helpers to be used in conjunction with the backend cloudinary frameworks (Rails, PHP, django). These frameworks can be used to embed a file upload field in the HTML (<code>cl_image_upload_tag</code>). When used, the script finds these fields and extends them as follows:</p>
<ul>
<li>Upon a successful image upload, the script will trigger a jQuery event (<code>cloudinarydone</code>) on the input field and provide a fileupload data object (along with the <code>result</code> key containing received data from the cloudinary upload API) as the only argument.</li>
<li>If a <code>cloudinary-field-name</code> has been provided with the upload field, the script will find an input field in the form with the given name and update it post-upload with the image metadata: <code><image-path>#<public-id></code>.</li>
<li>If no such field exists a new hidden field will be created.</li>
</ul>
<p><img src="http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png" alt=""> <strong>See <a href="http://cloudinary.com/documentation/jquery_image_upload">our documentation</a> with plenty more options for uploading to the cloud directly from the browser</strong>.</p>
<h2>Client side image resizing before upload</h2><p>See the File Processing Options in https://github.com/blueimp/jQuery-File-Upload/wiki/Options.
Modify your script tags based on the the following example (order is important!):</p>
<pre class="prettyprint source"><code><script src="bower_components/jquery/dist/jquery.js" type="text/javascript"></script>
<script src="bower_components/jquery.ui/ui/widget.js" type="text/javascript"></script>
<script src="bower_components/blueimp-load-image/js/load-image.all.min.js"></script>
<script src="bower_components/blueimp-canvas-to-blob/js/canvas-to-blob.min.js"></script>
<script src="bower_components/blueimp-file-upload/js/jquery.iframe-transport.js" type="text/javascript"></script>
<script src="bower_components/blueimp-file-upload/js/jquery.fileupload.js" type="text/javascript"></script>
<script src="bower_components/blueimp-file-upload/js/jquery.fileupload-process.js"></script>
<script src="bower_components/blueimp-file-upload/js/jquery.fileupload-image.js" type="text/javascript"></script>
<script src="bower_components/blueimp-file-upload/js/jquery.fileupload-validate.js"></script>
<script src="bower_components/cloudinary-jquery-file-upload/cloudinary-jquery-file-upload.js" type="text/javascript"></script></code></pre><p>Also, add the following javascript:</p>
<pre class="prettyprint source lang-javascript"><code>$(document).ready(function() {
$('.cloudinary-fileupload').cloudinary_fileupload({
disableImageResize: false,
imageMaxWidth: 800, // 800 is an example value
imageMaxHeight: 600, // 600 is an example value
maxFileSize: 20000000, // 20MB is an example value
loadImageMaxFileSize: 20000000, // default is 10MB
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|bmp|ico)$/i
});
});</code></pre><h2>Angular Directives</h2><p>Joshua Chaitin-Pollak contributed AngularJS directives for Cloudinary:
Display and manipulate images and perform uploads from your Angular application.</p>
<p>The Angular module is currently maintained as a separate GitHub project:</p>
<p>https://github.com/cloudinary/cloudinary_angular</p>
<h2>Additional resources</h2><p>Additional resources are available at:</p>
<ul>
<li><a href="http://cloudinary.com">Website</a></li>
<li><a href="http://cloudinary.com/documentation">Documentation</a></li>
<li><a href="http://support.cloudinary.com/forums">Knowledge Base</a></li>
<li><a href="http://cloudinary.com/documentation/jquery_integration">Documentation for jQuery integration</a></li>
<li><a href="http://cloudinary.com/documentation/jquery_image_upload">jQuery image upload documentation</a></li>
<li><a href="http://cloudinary.com/documentation/jquery_image_manipulation">jQuery image manipulation documentation</a></li>
<li><a href="http://cloudinary.com/documentation/image_transformations">Image transformations documentation</a></li>
</ul>
<h2>Support</h2><p>You can <a href="https://github.com/cloudinary/cloudinary_js/issues">open an issue through GitHub</a>.</p>
<p>Contact us at <a href="http://cloudinary.com/contact">http://cloudinary.com/contact</a>.</p>
<p>Stay tuned for updates, tips and tutorials: <a href="http://cloudinary.com/blog">Blog</a>, <a href="https://twitter.com/cloudinary">Twitter</a>, <a href="http://www.facebook.com/Cloudinary">Facebook</a>.</p>
<h2>License</h2><p>Released under the MIT license.</p>
<p>The direct image upload feature of the plugin is based on https://github.com/blueimp/jQuery-File-Upload</p></article>
</section>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-3">
<div id="toc" class="col-md-3"></div>
</div>
</div>
</div>
<footer>
<span class="copyright">
DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects.
</span>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc </a> using the
<a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
<!--<script src="scripts/sunlight.js"></script>-->
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
var id = $( heading ).attr( "id" );
return id && id.replace(/\~/g, '-inner-').replace(/\./g, '-static-') || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : "100px"
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
// $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" );
$( ".tutorial-section pre, .readme-section pre" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
lang = "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
navbarOffset: 10,
smoothScrolling: true
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
// $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
</body>
</html>