Author: buildbot Date: Wed Mar 26 22:29:55 2014 New Revision: 903848 Log: Staging update by buildbot for thrift
Modified: websites/staging/thrift/trunk/content/ (props changed) websites/staging/thrift/trunk/content/tutorial/js.html Propchange: websites/staging/thrift/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Wed Mar 26 22:29:55 2014 @@ -1 +1 @@ -1582093 +1582096 Modified: websites/staging/thrift/trunk/content/tutorial/js.html ============================================================================== --- websites/staging/thrift/trunk/content/tutorial/js.html (original) +++ websites/staging/thrift/trunk/content/tutorial/js.html Wed Mar 26 22:29:55 2014 @@ -92,32 +92,29 @@ <li>This tutorial depends on an existing Thrift server. See either the <a href="/tutorial/java">Java tutorial</a> or <a href="/tutorial/cpp">C++ tutorial</a> for how to build and setup one of these servers.</li> </ul> <h3 id="client">Client</h3> -<div class="codehilite"><pre> <span class="kd">function</span> <span class="nx">calc</span><span class="p">()</span> <span class="p">{</span> - <span class="kd">var</span> <span class="nx">transport</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Thrift</span><span class="p">.</span><span class="nx">Transport</span><span class="p">(</span><span class="s2">"/thrift/service/tutorial/"</span><span class="p">);</span> - <span class="kd">var</span> <span class="nx">protocol</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Thrift</span><span class="p">.</span><span class="nx">Protocol</span><span class="p">(</span><span class="nx">transport</span><span class="p">);</span> - <span class="kd">var</span> <span class="nx">client</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CalculatorClient</span><span class="p">(</span><span class="nx">protocol</span><span class="p">);</span> - - <span class="kd">var</span> <span class="nx">work</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Work</span><span class="p">();</span> - <span class="nx">work</span><span class="p">.</span><span class="nx">num1</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#num1"</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span> - <span class="nx">work</span><span class="p">.</span><span class="nx">num2</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#num2"</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span> - <span class="nx">work</span><span class="p">.</span><span class="nx">op</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#op"</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span> +<p><pre><code class="language-js"> +function calc() { + var transport = new Thrift.Transport("/thrift/service/tutorial/"); + var protocol = new Thrift.Protocol(transport); + var client = new CalculatorClient(protocol);</p> +<div class="codehilite"><pre> <span class="n">var</span> <span class="n">work</span> <span class="p">=</span> <span class="n">new</span> <span class="n">Work</span><span class="p">()</span> + <span class="n">work</span><span class="p">.</span><span class="n">num1</span> <span class="p">=</span> $<span class="p">(</span>"#<span class="n">num1</span>"<span class="p">).</span><span class="n">val</span><span class="p">();</span> + <span class="n">work</span><span class="p">.</span><span class="n">num2</span> <span class="p">=</span> $<span class="p">(</span>"#<span class="n">num2</span>"<span class="p">).</span><span class="n">val</span><span class="p">();</span> + <span class="n">work</span><span class="p">.</span><span class="n">op</span> <span class="p">=</span> $<span class="p">(</span>"#<span class="n">op</span>"<span class="p">).</span><span class="n">val</span><span class="p">();</span> <span class="k">try</span> <span class="p">{</span> - <span class="nx">result</span> <span class="o">=</span> <span class="nx">client</span><span class="p">.</span><span class="nx">calculate</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="nx">work</span><span class="p">);</span> - <span class="nx">$</span><span class="p">(</span><span class="s1">'#result'</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="nx">result</span><span class="p">);</span> - <span class="nx">$</span><span class="p">(</span><span class="s1">'#result'</span><span class="p">).</span><span class="nx">css</span><span class="p">(</span><span class="s1">'color'</span><span class="p">,</span> <span class="s1">'black'</span><span class="p">);</span> - <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">ouch</span><span class="p">){</span> - <span class="nx">$</span><span class="p">(</span><span class="s1">'#result'</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="nx">ouch</span><span class="p">.</span><span class="nx">why</span><span class="p">);</span> - <span class="nx">$</span><span class="p">(</span><span class="s1">'#result'</span><span class="p">).</span><span class="nx">css</span><span class="p">(</span><span class="s1">'color'</span><span class="p">,</span> <span class="s1">'red'</span><span class="p">);</span> + <span class="n">result</span> <span class="p">=</span> <span class="n">client</span><span class="p">.</span><span class="n">calculate</span><span class="p">(</span>1<span class="p">,</span> <span class="n">work</span><span class="p">);</span> + $<span class="p">(</span><span class="s">'#result'</span><span class="p">).</span><span class="n">val</span><span class="p">(</span><span class="n">result</span><span class="p">);</span> + $<span class="p">(</span><span class="s">'#result'</span><span class="p">).</span><span class="n">css</span><span class="p">(</span><span class="s">'color'</span><span class="p">,</span> <span class="s">'black'</span><span class="p">);</span> + <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="n">ouch</span><span class="p">){</span> + $<span class="p">(</span><span class="s">'#result'</span><span class="p">).</span><span class="n">val</span><span class="p">(</span><span class="n">ouch</span><span class="p">.</span><span class="nb">why</span><span class="p">);</span> + $<span class="p">(</span><span class="s">'#result'</span><span class="p">).</span><span class="n">css</span><span class="p">(</span><span class="s">'color'</span><span class="p">,</span> <span class="s">'red'</span><span class="p">);</span> <span class="p">}</span> - <span class="p">}</span> </pre></div> -<p class='snippet_footer'> - This snippet was generated by Apache Thrift's <strong>source tree docs</strong>: - <a href="http://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob;f=tutorial/js/tutorial.html;hb=HEAD"</a>tutorial/js/tutorial.html</a> -</p> +<p>} +</code></pre></p> <h3 id="server">Server</h3> <p>Use either the <a href="/tutorial/java">Java tutorial</a> or <a href="/tutorial/cpp">C++ tutorial</a> server </p> <h2 id="additional-information">Additional Information</h2>