--- /dev/null
+<!DOCTYPE html>
+
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width">
+ <title>Bytom Node.js SDK Class: TransactionBuilder</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.cosmo.css">
+
+</head>
+
+<body>
+
+<div class="navbar navbar-default navbar-fixed-top ">
+<div class="container">
+ <div class="navbar-header">
+ <a class="navbar-brand" href="index.html">Bytom Node.js SDK</a>
+ <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ </div>
+ <div class="navbar-collapse collapse" id="topNavigation">
+ <ul class="nav navbar-nav">
+
+ <li class="dropdown">
+ <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a>
+ <ul class="dropdown-menu ">
+ <li><a href="module-AccessTokensApi.html">AccessTokensApi</a></li><li><a href="module-AccountsApi.html">AccountsApi</a></li><li><a href="module-AssetsApi.html">AssetsApi</a></li><li><a href="module-BalancesApi.html">BalancesApi</a></li><li><a href="module-BlockAPI.html">BlockAPI</a></li><li><a href="module-ConfigApi.html">ConfigApi</a></li><li><a href="module-KeysApi.html">KeysApi</a></li><li><a href="module-TransactionsApi.html">TransactionsApi</a></li><li><a href="module-UnspentOutputsApi.html">UnspentOutputsApi</a></li>
+ </ul>
+ </li>
+
+ <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="TransactionBuilder.html">TransactionBuilder</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">Global</a></li>
+ </ul>
+ </li>
+
+ </ul>
+
+ <div class="col-sm-3 col-md-3">
+ <form class="navbar-form" role="search">
+ <div class="input-group">
+ <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
+ <div class="input-group-btn">
+ <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
+ </div>
+ </div>
+ </form>
+ </div>
+
+ </div>
+
+</div>
+</div>
+
+
+<div class="container" id="toc-content">
+<div class="row">
+
+
+ <div class="col-md-8">
+
+ <div id="main">
+
+
+ <h1 class="page-title">Class: TransactionBuilder</h1>
+<section>
+
+<header>
+
+ <h2>
+ TransactionBuilder
+ </h2>
+
+ <div class="class-description"><p>A convenience class for building transaction template objects.</p></div>
+
+
+</header>
+
+
+<article>
+ <div class="container-overview">
+
+
+<hr>
+<dt>
+ <h4 class="name" id="TransactionBuilder"><span class="type-signature"></span>new TransactionBuilder()</h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ <p>constructor - return a new object used for constructing a transaction.</p>
+ </div>
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dd>
+
+
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3 class="subsection-title">Members</h3>
+
+ <dl>
+
+<hr>
+<dt class="name" id="baseTransaction">
+ <h4 id="baseTransaction"><span class="type-signature"></span>baseTransaction<span class="type-signature"> :Object</span></h4>
+
+
+</dt>
+<dd>
+
+ <div class="description">
+ <p>Base data for the transaction, default is null.</p>
+ </div>
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">Object</span>
+
+
+
+ </li>
+ </ul>
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+</dd>
+
+
+
+<hr>
+<dt class="name" id="ttl">
+ <h4 id="ttl"><span class="type-signature"></span>ttl<span class="type-signature"> :Integer</span></h4>
+
+
+</dt>
+<dd>
+
+ <div class="description">
+ <p>Integer of the time to live in milliseconds, it means utxo will be reserved(locked) for
+builded transaction in this time range, if the transaction will not to be submitted into block,
+it will be auto unlocked for build transaction again after this ttl time. it will be set to
+5 minutes(300 seconds) defaultly when ttl is 0.</p>
+ </div>
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">Integer</span>
+
+
+
+ </li>
+ </ul>
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+</dd>
+
+ </dl>
+
+
+
+ <h3 class="subsection-title">Methods</h3>
+
+ <dl>
+
+<hr>
+<dt>
+ <h4 class="name" id="controlWithAddress"><span class="type-signature"></span>controlWithAddress(params)</h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ <p>Add an action that controls assets with an account specified by identifier.</p>
+ </div>
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>params</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Action parameters.</p>
+ <h6 class="method-params-label method-subparams-label">Properties</h6>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>asset_alias</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset alias specifying the asset to be controlled.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>asset_id</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset ID specifying the account controlling the asset.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>address</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Account address specifying the account controlling the asset.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>amount</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Number</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Amount of the asset to be controlled.</p></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+<hr>
+<dt>
+ <h4 class="name" id="controlWithControlProgram"><span class="type-signature"></span>controlWithControlProgram(params)</h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ <p>Add an action that controls assets with a receiver.</p>
+ </div>
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>params</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Action parameters.</p>
+ <h6 class="method-params-label method-subparams-label">Properties</h6>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>control_program</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>The receiver object in which assets will be controlled.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>asset_id</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset ID specifying the asset to be controlled.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>asset_alias</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset alias specifying the asset to be controlled.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>amount</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Number</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Amount of the asset to be controlled.</p></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+<hr>
+<dt>
+ <h4 class="name" id="issue"><span class="type-signature"></span>issue(params)</h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ <p>Add an action that issues assets.</p>
+ </div>
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>params</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Action parameters.</p>
+ <h6 class="method-params-label method-subparams-label">Properties</h6>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>assetId</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset ID specifying the asset to be issued.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>assetAlias</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset alias specifying the asset to be issued.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>amount</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Amount of the asset to be issued.</p></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+<hr>
+<dt>
+ <h4 class="name" id="retire"><span class="type-signature"></span>retire(params)</h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ <p>Add an action that retires units of an asset.</p>
+ </div>
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>params</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Action parameters.</p>
+ <h6 class="method-params-label method-subparams-label">Properties</h6>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>asset_id</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset ID specifying the asset to be retired.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>asset_alias</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset alias specifying the asset to be retired.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>amount</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Number</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Amount of the asset to be retired.</p></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+<hr>
+<dt>
+ <h4 class="name" id="spendAccountUnspentOutput"><span class="type-signature"></span>spendAccountUnspentOutput(params)</h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ <p>Add an action that spends an account unspent output.</p>
+ </div>
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>params</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Action parameters.</p>
+ <h6 class="method-params-label method-subparams-label">Properties</h6>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>output_id</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>ID of the transaction output to be spent.</p></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+<hr>
+<dt>
+ <h4 class="name" id="spendFromAccount"><span class="type-signature"></span>spendFromAccount(params)</h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ <p>Add an action that spends assets from an account specified by identifier.</p>
+ </div>
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>params</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Action parameters.</p>
+ <h6 class="method-params-label method-subparams-label">Properties</h6>
+
+
+<table class="params table table-striped">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>asset_id</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset ID specifying the asset to be spent.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>asset_alias</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Asset alias specifying the asset to be spent.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>account_id</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Account ID specifying the account spending the asset.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>account_alias</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">String</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Account alias specifying the account spending the asset.
+ You must specify either an ID or an alias.</p></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>amount</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Number</span>
+
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"><p>Amount of the asset to be spent.</p></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dd>
+
+ </dl>
+
+
+
+
+
+</article>
+
+</section>
+
+
+
+
+ </div>
+ </div>
+
+ <div class="clearfix"></div>
+
+
+ <div class="col-md-3">
+ <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
+ </div>
+
+
+</div>
+</div>
+
+
+ <div class="modal fade" id="searchResults">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
+ <h4 class="modal-title">Search results</h4>
+ </div>
+ <div class="modal-body"></div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+ </div>
+
+
+<footer>
+
+
+<span class="jsdoc-message">
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
+
+ on 2018-11-26T16:28:32+08:00
+
+ using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
+</span>
+</footer>
+
+<script src="scripts/docstrap.lib.js"></script>
+<script src="scripts/toc.js"></script>
+
+ <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
+
+
+<script>
+$( function () {
+ $( "[id*='$']" ).each( function () {
+ var $this = $( this );
+
+ $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
+ } );
+
+ $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).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 {
+ var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
+ lang = langClassMatch ? langClassMatch[1] : "javascript";
+ }
+
+ if ( lang ) {
+
+ $this
+ .addClass( "sunlight-highlight-" + lang )
+ .addClass( "linenums" )
+ .html( example.html() );
+
+ }
+ } );
+
+ Sunlight.highlightAll( {
+ lineNumbers : true,
+ showMenu : true,
+ enableDoclinks : true
+ } );
+
+ $.catchAnchorLinks( {
+ navbarOffset: 10
+ } );
+ $( "#toc" ).toc( {
+ anchorName : function ( i, heading, prefix ) {
+ return $( heading ).attr( "id" ) || ( prefix + i );
+ },
+ selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
+ showAndHide : false,
+ smoothScrolling: true
+ } );
+
+ $( "#main span[id^='toc']" ).addClass( "toc-shim" );
+ $( '.dropdown-toggle' ).dropdown();
+
+ $( "table" ).each( function () {
+ var $this = $( this );
+ $this.addClass('table');
+ } );
+
+} );
+</script>
+
+
+
+<!--Navigation and Symbol Display-->
+
+
+<!--Google Analytics-->
+
+
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+ SearcherDisplay.init();
+ });
+ </script>
+
+
+</body>
+</html>
\ No newline at end of file