weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sospar...@apache.org
Subject [09/39] incubator-weex-site git commit: * update site
Date Thu, 02 Mar 2017 03:54:01 GMT
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/22906b6f/content/references/modules/storage.html
----------------------------------------------------------------------
diff --git a/content/references/modules/storage.html b/content/references/modules/storage.html
index b595a7b..7816d10 100644
--- a/content/references/modules/storage.html
+++ b/content/references/modules/storage.html
@@ -5,49 +5,6 @@
   
   <title>storage | Weex</title>
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-  <script>
-  ;(function(){
-    var currentOrigin = location.origin,
-        currentPathname = location.pathname,
-        currentLang = navigator.language,
-        selectedLang = '';
-
-    if (!currentLang) {
-      currentLang = navigator.browserLanguage;
-    }
-
-    if (window.sessionStorage) {
-      selectedLang = window.sessionStorage.getItem('lang')
-    }
-
-    if (!selectedLang) {
-      if (currentLang.indexOf('zh') >= 0 && currentPathname.indexOf('/cn/') != 0) {
-        location.href = getUrl('cn', currentOrigin, currentPathname);
-      } else if (currentLang.indexOf('en') >= 0 && currentPathname.indexOf('/cn/') == 0) {
-        location.href = getUrl('en', currentOrigin, currentPathname);
-      }
-    }
-
-    function getUrl (lang, origin, path) {
-      if (lang == 'en') {
-        if (path.indexOf('/cn/') == 0) {
-          return origin + path.substr(3)
-        } else {
-          return origin + path
-        }
-      } else {
-        var langPath = '/' + lang + '/'
-        var pathStart = path.indexOf(langPath)
-
-        if (pathStart == 0) {
-          return origin + path
-        } else {
-          return origin + langPath + path.substr(1)
-        }
-      }
-    }
-  })();
-  </script>
   <meta name="description" content="storagev0.7+
 Summarystorage is a series of apis, allowing you to for example add, modify or delete stored data items.
 APIsetItem(key, value, callback)When passed a key name and value, will add that ke">
@@ -58,7 +15,7 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
 <meta property="og:description" content="storagev0.7+
 Summarystorage is a series of apis, allowing you to for example add, modify or delete stored data items.
 APIsetItem(key, value, callback)When passed a key name and value, will add that ke">
-<meta property="og:updated_time" content="2017-02-26T06:06:13.000Z">
+<meta property="og:updated_time" content="2017-03-02T03:29:33.000Z">
 <meta name="twitter:card" content="summary">
 <meta name="twitter:title" content="storage">
 <meta name="twitter:description" content="storagev0.7+
@@ -121,13 +78,29 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
         <li>
           <div class="search">
   <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <input type="text" id="search-input-header" name="q" results="0" placeholder="search..." class="form-control search-input" autocomplete="off" autocorrect="off"/>
+    <input type="text" id="search-input-header" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/>
     <span class="iconfont icon-search"></span>
   </form>
   <div class="results-panel">
   </div>
 </div>
         </li>
+        <li>
+          <div class="dropdown select-lang">
+            <a href="javascript:;" class="dropdown-toggle">
+              Language
+              <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu pick-lang">
+              <li>
+                <a href="/references/modules/storage.html" data-lang="en">English</a>
+              </li>
+              <li>
+                <a href="/cn/references/modules/storage.html" data-lang="zh-cn">中文</a>
+              </li>
+            </ul>
+          </div>
+        </li>
         <!--<li></li>-->
       </ul>
     </div>
@@ -144,7 +117,7 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
     
       <div class="search">
   <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <input type="text" id="search-input-sidebar" name="q" results="0" placeholder="search..." class="form-control search-input" autocomplete="off" autocorrect="off"/>
+    <input type="text" id="search-input-sidebar" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/>
     <span class="iconfont icon-search"></span>
   </form>
   <div class="results-panel">
@@ -583,11 +556,11 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
               </li>
             
               <li>
-                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
+                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
               </li>
             
               <li>
-                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
+                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
               </li>
             
               <li>
@@ -703,12 +676,12 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
       </li>
     
       <li>
-        <h3 class="chapter-title"><a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a></h3>
+        <h3 class="chapter-title"><a href="/references/migration/index.html" class="sidebar-link  ">Migration</a></h3>
         
           <ul class="chapter">
             
               <li>
-                <a href="/references/migration/index.html" class="sidebar-link  ">Migration</a>
+                <a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a>
               </li>
             
               <li>
@@ -726,7 +699,7 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
     
     
       <li>
-        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Legacy</a></h3>
+        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Old Syntax Doc</a></h3>
       </li>
     
   </ul>
@@ -1170,11 +1143,11 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
               </li>
             
               <li>
-                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
+                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
               </li>
             
               <li>
-                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
+                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
               </li>
             
               <li>
@@ -1290,12 +1263,12 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
       </li>
     
       <li>
-        <h3 class="chapter-title"><a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a></h3>
+        <h3 class="chapter-title"><a href="/references/migration/index.html" class="sidebar-link  ">Migration</a></h3>
         
           <ul class="chapter">
             
               <li>
-                <a href="/references/migration/index.html" class="sidebar-link  ">Migration</a>
+                <a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a>
               </li>
             
               <li>
@@ -1313,7 +1286,7 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
     
     
       <li>
-        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Legacy</a></h3>
+        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Old Syntax Doc</a></h3>
       </li>
     
   </ul>
@@ -1331,7 +1304,7 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
       </h1>
     
   
-  <time class="article-date" datetime="2017-02-26T06:06:13.000Z">Updated time: 26/02/2017</time>
+  <time class="article-date" datetime="2017-03-02T03:29:33.000Z">Updated time: 02/03/2017</time>
 </header>
     <h1 id="storage"><a href="#storage" class="headerlink" title="storage"></a>storage</h1><p><span class="weex-version">v0.7+</span></p>
 <h2 id="Summary"><a href="#Summary" class="headerlink" title="Summary"></a>Summary</h2><p><code>storage</code> is a series of apis, allowing you to for example add, modify or delete stored data items.</p>
@@ -1361,7 +1334,7 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
 <li><code>callback</code><em>(object)</em>: the callback function after executing this action.  </li>
 </ul>
 <h2 id="Example-1"><a href="#Example-1" class="headerlink" title="Example"></a>Example</h2><figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">template</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"list"</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"group center"</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel"</span>&gt;</span><span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"text"</span>&gt;</span>&#123;&#123;state&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&g
 t;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"group"</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel"</span>&gt;</span><span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"text"</span> @<span class="attr">click</span>=<span class="string">"setItem"</span>&gt;</span>set<span class="tag">&lt;/<span class="name">text</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel"</span>&gt;</span><span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<sp
 an class="string">"text"</span> @<span class="attr">click</span>=<span class="string">"getItem"</span>&gt;</span>get<span class="tag">&lt;/<span class="name">text</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel"</span>&gt;</span><span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"text"</span> @<span class="attr">click</span>=<span class="string">"removeItem"</span>&gt;</span>remove<span class="tag">&lt;/<span class="name">text</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel"</span>&gt;</span><span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class=
 "string">"text"</span> @<span class="attr">click</span>=<span class="string">"getAll"</span>&gt;</span>all<span class="tag">&lt;/<span class="name">text</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">template</span>&gt;</span></div><div class="line"></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">const</span> storage = weex.requireModule(<span class="string">'storage'</span>)</div><div class="line">  <span class="keyword">const</span> modal = weex.requireModule(<span class="string">'modal'</span>)</div><div class="line"></div><div class="line">  <span class="keyword">export</span> <span cla
 ss="keyword">default</span> &#123;</div><div class="line">    data () &#123;</div><div class="line">      <span class="keyword">return</span> &#123;</div><div class="line">        <span class="attr">keys</span>: <span class="string">'[]'</span>,</div><div class="line">        <span class="attr">length</span>: <span class="number">0</span>,</div><div class="line">        <span class="attr">state</span>: <span class="string">'----'</span></div><div class="line">      &#125;</div><div class="line">    &#125;,</div><div class="line">    <span class="attr">methods</span>: &#123;</div><div class="line">      setItem () &#123;</div><div class="line">        storage.setItem(<span class="string">'name'</span>, <span class="string">'Hanks'</span>, event =&gt; &#123;</div><div class="line">          <span class="keyword">this</span>.state = <span class="string">'set success'</span></div><div class="line">          <span class="built_in">console</span>.log(<span class="string">'set success'</sp
 an>)</div><div class="line">        &#125;)</div><div class="line">      &#125;,</div><div class="line">      getItem () &#123;</div><div class="line">        storage.getItem(<span class="string">'name'</span>, event =&gt; &#123;</div><div class="line">          <span class="built_in">console</span>.log(<span class="string">'get value:'</span>, event.data)</div><div class="line">          <span class="keyword">this</span>.state = <span class="string">'value: '</span> + event.data</div><div class="line">        &#125;)</div><div class="line">      &#125;,</div><div class="line">      removeItem () &#123;</div><div class="line">        storage.removeItem(<span class="string">'name'</span>, event =&gt; &#123;</div><div class="line">          <span class="built_in">console</span>.log(<span class="string">'delete value:'</span>, event.data)</div><div class="line">          <span class="keyword">this</span>.state = <span class="string">'deleted'</span></div><div class="line">        &#125
 ;)</div><div class="line">      &#125;,</div><div class="line">      getAll () &#123;</div><div class="line">        storage.getAllKeys(<span class="function"><span class="params">event</span> =&gt;</span> &#123;</div><div class="line">          <span class="comment">// modal.toast(&#123; message: event.result &#125;)</span></div><div class="line">          <span class="keyword">if</span> (event.result === <span class="string">'success'</span>) &#123;</div><div class="line">            modal.toast(&#123;</div><div class="line">              <span class="attr">message</span>: <span class="string">'props: '</span> + event.data.join(<span class="string">', '</span>)</div><div class="line">            &#125;)</div><div class="line">          &#125;</div><div class="line">        &#125;)</div><div class="line">      &#125;</div><div class="line">    &#125;</div><div class="line">  &#125;</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div c
 lass="line"></div><div class="line"><span class="tag">&lt;<span class="name">style</span> <span class="attr">scoped</span>&gt;</span><span class="css"></span></div><div class="line">  <span class="selector-class">.panel</span> &#123;</div><div class="line">    <span class="attribute">height</span>: <span class="number">100px</span>;</div><div class="line">    <span class="attribute">flex-direction</span>: column;</div><div class="line">    <span class="attribute">justify-content</span>: center;</div><div class="line">    <span class="attribute">border-width</span>: <span class="number">2px</span>;</div><div class="line">    <span class="attribute">border-style</span>: solid;</div><div class="line">    <span class="attribute">border-color</span>: <span class="built_in">rgb</span>(162, 217, 192);</div><div class="line">    <span class="attribute">background-color</span>: <span class="built_in">rgba</span>(162, 217, 192, 0.2);</div><div class="line">  &#125;</div><div class="line">  <s
 pan class="selector-class">.group</span> &#123;</div><div class="line">    <span class="attribute">flex-direction</span>: row;</div><div class="line">    <span class="attribute">justify-content</span>: space-between;</div><div class="line">    <span class="attribute">width</span>: <span class="number">650px</span>;</div><div class="line">    <span class="attribute">margin-left</span>: <span class="number">50px</span>;</div><div class="line">    <span class="attribute">margin-top</span>: <span class="number">50px</span>;</div><div class="line">    <span class="attribute">margin-bottom</span>: <span class="number">50px</span>;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.center</span> &#123;</div><div class="line">    <span class="attribute">justify-content</span>: center;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.text</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>
 : <span class="number">50px</span>;</div><div class="line">    <span class="attribute">text-align</span>: center;</div><div class="line">    <span class="attribute">padding-left</span>: <span class="number">25px</span>;</div><div class="line">    <span class="attribute">padding-right</span>: <span class="number">25px</span>;</div><div class="line">    <span class="attribute">color</span>: <span class="number">#41B883</span>;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.small</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>: <span class="number">32px</span>;</div><div class="line">    <span class="attribute">padding-left</span>: <span class="number">35px</span>;</div><div class="line">    <span class="attribute">padding-right</span>: <span class="number">35px</span>;</div><div class="line">    <span class="attribute">color</span>: <span class="number">#41B883</span>;</div><div class="line">  &#125;</div><div c
 lass="line"><span class="tag">&lt;/<span class="name">style</span>&gt;</span></div></pre></td></tr></table></figure>
-<p><a href="../../examples/storage.html">try it</a></p>
+<p><a href="http://dotwe.org/vue/3fdd3e2d1646ca41199d80c7be799858" target="_blank" rel="external">try it</a></p>
 
   </div>
   
@@ -1383,7 +1356,7 @@ APIsetItem(key, value, callback)When passed a key name and value, will add that
           <a href="/references/modules/storage.html" data-lang="en">English</a>
         </li>
         <li>
-          <a href="/cn/references/modules/storage.html" data-lang="cn">中文</a>
+          <a href="/cn/references/modules/storage.html" data-lang="zh-cn">中文</a>
         </li>
       </ul>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/22906b6f/content/references/modules/stream.html
----------------------------------------------------------------------
diff --git a/content/references/modules/stream.html b/content/references/modules/stream.html
index 50d5b15..103c6db 100644
--- a/content/references/modules/stream.html
+++ b/content/references/modules/stream.html
@@ -5,49 +5,6 @@
   
   <title>stream | Weex</title>
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-  <script>
-  ;(function(){
-    var currentOrigin = location.origin,
-        currentPathname = location.pathname,
-        currentLang = navigator.language,
-        selectedLang = '';
-
-    if (!currentLang) {
-      currentLang = navigator.browserLanguage;
-    }
-
-    if (window.sessionStorage) {
-      selectedLang = window.sessionStorage.getItem('lang')
-    }
-
-    if (!selectedLang) {
-      if (currentLang.indexOf('zh') >= 0 && currentPathname.indexOf('/cn/') != 0) {
-        location.href = getUrl('cn', currentOrigin, currentPathname);
-      } else if (currentLang.indexOf('en') >= 0 && currentPathname.indexOf('/cn/') == 0) {
-        location.href = getUrl('en', currentOrigin, currentPathname);
-      }
-    }
-
-    function getUrl (lang, origin, path) {
-      if (lang == 'en') {
-        if (path.indexOf('/cn/') == 0) {
-          return origin + path.substr(3)
-        } else {
-          return origin + path
-        }
-      } else {
-        var langPath = '/' + lang + '/'
-        var pathStart = path.indexOf(langPath)
-
-        if (pathStart == 0) {
-          return origin + path
-        } else {
-          return origin + langPath + path.substr(1)
-        }
-      }
-    }
-  })();
-  </script>
   <meta name="description" content="streamA series of stream api. It provides a network request.
 APIfetch(options, callback,progressCallback)Start a network request, use two callbacks to receive server’s response data.
 Arguments
@@ -62,7 +19,7 @@ APIfetch(options, callback,progressCallback)Start a network request, use two cal
 Arguments
 
 option">
-<meta property="og:updated_time" content="2017-02-17T02:09:41.000Z">
+<meta property="og:updated_time" content="2017-03-02T03:29:33.000Z">
 <meta name="twitter:card" content="summary">
 <meta name="twitter:title" content="stream">
 <meta name="twitter:description" content="streamA series of stream api. It provides a network request.
@@ -127,13 +84,29 @@ option">
         <li>
           <div class="search">
   <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <input type="text" id="search-input-header" name="q" results="0" placeholder="search..." class="form-control search-input" autocomplete="off" autocorrect="off"/>
+    <input type="text" id="search-input-header" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/>
     <span class="iconfont icon-search"></span>
   </form>
   <div class="results-panel">
   </div>
 </div>
         </li>
+        <li>
+          <div class="dropdown select-lang">
+            <a href="javascript:;" class="dropdown-toggle">
+              Language
+              <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu pick-lang">
+              <li>
+                <a href="/references/modules/stream.html" data-lang="en">English</a>
+              </li>
+              <li>
+                <a href="/cn/references/modules/stream.html" data-lang="zh-cn">中文</a>
+              </li>
+            </ul>
+          </div>
+        </li>
         <!--<li></li>-->
       </ul>
     </div>
@@ -150,7 +123,7 @@ option">
     
       <div class="search">
   <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <input type="text" id="search-input-sidebar" name="q" results="0" placeholder="search..." class="form-control search-input" autocomplete="off" autocorrect="off"/>
+    <input type="text" id="search-input-sidebar" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/>
     <span class="iconfont icon-search"></span>
   </form>
   <div class="results-panel">
@@ -589,11 +562,11 @@ option">
               </li>
             
               <li>
-                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
+                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
               </li>
             
               <li>
-                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
+                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
               </li>
             
               <li>
@@ -709,12 +682,12 @@ option">
       </li>
     
       <li>
-        <h3 class="chapter-title"><a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a></h3>
+        <h3 class="chapter-title"><a href="/references/migration/index.html" class="sidebar-link  ">Migration</a></h3>
         
           <ul class="chapter">
             
               <li>
-                <a href="/references/migration/index.html" class="sidebar-link  ">Migration</a>
+                <a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a>
               </li>
             
               <li>
@@ -732,7 +705,7 @@ option">
     
     
       <li>
-        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Legacy</a></h3>
+        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Old Syntax Doc</a></h3>
       </li>
     
   </ul>
@@ -1176,11 +1149,11 @@ option">
               </li>
             
               <li>
-                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
+                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
               </li>
             
               <li>
-                <a href="/references/modules/websocket.html" class="sidebar-link  ">WebSocket</a>
+                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
               </li>
             
               <li>
@@ -1296,12 +1269,12 @@ option">
       </li>
     
       <li>
-        <h3 class="chapter-title"><a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a></h3>
+        <h3 class="chapter-title"><a href="/references/migration/index.html" class="sidebar-link  ">Migration</a></h3>
         
           <ul class="chapter">
             
               <li>
-                <a href="/references/migration/index.html" class="sidebar-link  ">Migration</a>
+                <a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a>
               </li>
             
               <li>
@@ -1319,7 +1292,7 @@ option">
     
     
       <li>
-        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Legacy</a></h3>
+        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Old Syntax Doc</a></h3>
       </li>
     
   </ul>
@@ -1337,7 +1310,7 @@ option">
       </h1>
     
   
-  <time class="article-date" datetime="2017-02-17T02:09:41.000Z">Updated time: 17/02/2017</time>
+  <time class="article-date" datetime="2017-03-02T03:29:33.000Z">Updated time: 02/03/2017</time>
 </header>
     <h1 id="stream"><a href="#stream" class="headerlink" title="stream"></a>stream</h1><p>A series of stream api. It provides a network request.</p>
 <h2 id="API"><a href="#API" class="headerlink" title="API"></a>API</h2><h3 id="fetch-options-callback-progressCallback"><a href="#fetch-options-callback-progressCallback" class="headerlink" title="fetch(options, callback,progressCallback)"></a>fetch(options, callback,progressCallback)</h3><p>Start a network request, use two callbacks to receive server’s response data.</p>
@@ -1391,7 +1364,7 @@ option">
 <li>You need to set the Content-Type header to ‘application/json’ manually if you want to post the json body.</li>
 </ul>
 <h3 id="Example"><a href="#Example" class="headerlink" title="Example"></a>Example</h3><figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">template</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"wrapper"</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"group"</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span>&gt;</span>Weex Star :<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"count"</span>&gt;</span>&#123;&#123;weexStar&#125;&#125;<span class="tag
 ">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"group"</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span>&gt;</span>Vue Star :<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"count"</span>&gt;</span>&#123;&#123;vueStar&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span
  class="tag">&lt;/<span class="name">template</span>&gt;</span></div><div class="line"></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> stream = weex.requireModule(<span class="string">'stream'</span>)</div><div class="line">  <span class="keyword">export</span> <span class="keyword">default</span> &#123;</div><div class="line">    data () &#123;</div><div class="line">      <span class="keyword">return</span> &#123;</div><div class="line">        <span class="attr">weexStar</span>: <span class="string">'unknown'</span>,</div><div class="line">        <span class="attr">vueStar</span>: <span class="string">'unknown'</span></div><div class="line">      &#125;</div><div class="line">    &#125;,</div><div class="line"></div><div class="line">    <span class="attr">methods</span>: &#123;</div><div class="line">      getStarCount (repo, callback) &#123;</div>
 <div class="line">        <span class="keyword">return</span> stream.fetch(&#123;</div><div class="line">          <span class="attr">method</span>: <span class="string">'GET'</span>,</div><div class="line">          <span class="attr">type</span>: <span class="string">'json'</span>,</div><div class="line">          <span class="attr">url</span>: <span class="string">'https://api.github.com/repos/'</span> + repo</div><div class="line">        &#125;, callback)</div><div class="line">      &#125;</div><div class="line">    &#125;,</div><div class="line">    created () &#123;</div><div class="line">      <span class="keyword">this</span>.getStarCount(<span class="string">'alibaba/weex'</span>, res =&gt; &#123;</div><div class="line">        <span class="keyword">this</span>.weexStar = res.ok ? res.data.stargazers_count : <span class="string">'(network error)'</span></div><div class="line">      &#125;)</div><div class="line">      <span class="keyword">this</span>.getStarCount(<span c
 lass="string">'vuejs/vue'</span>, res =&gt; &#123;</div><div class="line">        <span class="keyword">this</span>.vueStar = res.ok ? res.data.stargazers_count : <span class="string">'(network error)'</span></div><div class="line">      &#125;)</div><div class="line">    &#125;</div><div class="line">  &#125;</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"></div><div class="line"></div><div class="line"><span class="tag">&lt;<span class="name">style</span> <span class="attr">scoped</span>&gt;</span><span class="css"></span></div><div class="line">  <span class="selector-class">.wrapper</span> &#123;</div><div class="line">    <span class="attribute">flex-direction</span>: column;</div><div class="line">    <span class="attribute">justify-content</span>: center;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.group</span> &#123;</div><div class="line">    <span class="attribute">f
 lex-direction</span>: row;</div><div class="line">    <span class="attribute">justify-content</span>: center;</div><div class="line">    <span class="attribute">margin-bottom</span>: <span class="number">40px</span>;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.title</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>: <span class="number">45px</span>;</div><div class="line">    <span class="attribute">color</span>: <span class="number">#888888</span>;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.count</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>: <span class="number">45px</span>;</div><div class="line">    <span class="attribute">font-weight</span>: bold;</div><div class="line">    <span class="attribute">margin-left</span>: <span class="number">12px</span>;</div><div class="line">    <span class="attribute">color</span>: <span class
 ="number">#41B883</span>;</div><div class="line">  &#125;</div><div class="line"><span class="tag">&lt;/<span class="name">style</span>&gt;</span></div></pre></td></tr></table></figure>
-<p><a href="../../examples/stream.html">try it</a></p>
+<p><a href="http://dotwe.org/vue/29bbf2d49fc8a204f98240044bbe211a" target="_blank" rel="external">try it</a></p>
 
   </div>
   
@@ -1413,7 +1386,7 @@ option">
           <a href="/references/modules/stream.html" data-lang="en">English</a>
         </li>
         <li>
-          <a href="/cn/references/modules/stream.html" data-lang="cn">中文</a>
+          <a href="/cn/references/modules/stream.html" data-lang="zh-cn">中文</a>
         </li>
       </ul>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/22906b6f/content/references/modules/websocket.html
----------------------------------------------------------------------
diff --git a/content/references/modules/websocket.html b/content/references/modules/websocket.html
index 6d99642..5842dad 100644
--- a/content/references/modules/websocket.html
+++ b/content/references/modules/websocket.html
@@ -5,56 +5,13 @@
   
   <title>WebSocket | Weex</title>
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-  <script>
-  ;(function(){
-    var currentOrigin = location.origin,
-        currentPathname = location.pathname,
-        currentLang = navigator.language,
-        selectedLang = '';
-
-    if (!currentLang) {
-      currentLang = navigator.browserLanguage;
-    }
-
-    if (window.sessionStorage) {
-      selectedLang = window.sessionStorage.getItem('lang')
-    }
-
-    if (!selectedLang) {
-      if (currentLang.indexOf('zh') >= 0 && currentPathname.indexOf('/cn/') != 0) {
-        location.href = getUrl('cn', currentOrigin, currentPathname);
-      } else if (currentLang.indexOf('en') >= 0 && currentPathname.indexOf('/cn/') == 0) {
-        location.href = getUrl('en', currentOrigin, currentPathname);
-      }
-    }
-
-    function getUrl (lang, origin, path) {
-      if (lang == 'en') {
-        if (path.indexOf('/cn/') == 0) {
-          return origin + path.substr(3)
-        } else {
-          return origin + path
-        }
-      } else {
-        var langPath = '/' + lang + '/'
-        var pathStart = path.indexOf(langPath)
-
-        if (pathStart == 0) {
-          return origin + path
-        } else {
-          return origin + langPath + path.substr(1)
-        }
-      }
-    }
-  })();
-  </script>
   <meta name="description" content="WebSocketSummaryWebSockets is an advanced technology that makes it possible to open an interactive communication session between the user’s H5/iOS/android and a server. With this API, you can send mes">
 <meta property="og:type" content="website">
 <meta property="og:title" content="WebSocket">
 <meta property="og:url" content="https://weex.apache.org/references/modules/websocket.html">
 <meta property="og:site_name" content="Weex">
 <meta property="og:description" content="WebSocketSummaryWebSockets is an advanced technology that makes it possible to open an interactive communication session between the user’s H5/iOS/android and a server. With this API, you can send mes">
-<meta property="og:updated_time" content="2017-02-26T06:06:13.000Z">
+<meta property="og:updated_time" content="2017-03-02T03:29:33.000Z">
 <meta name="twitter:card" content="summary">
 <meta name="twitter:title" content="WebSocket">
 <meta name="twitter:description" content="WebSocketSummaryWebSockets is an advanced technology that makes it possible to open an interactive communication session between the user’s H5/iOS/android and a server. With this API, you can send mes">
@@ -115,13 +72,29 @@
         <li>
           <div class="search">
   <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <input type="text" id="search-input-header" name="q" results="0" placeholder="search..." class="form-control search-input" autocomplete="off" autocorrect="off"/>
+    <input type="text" id="search-input-header" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/>
     <span class="iconfont icon-search"></span>
   </form>
   <div class="results-panel">
   </div>
 </div>
         </li>
+        <li>
+          <div class="dropdown select-lang">
+            <a href="javascript:;" class="dropdown-toggle">
+              Language
+              <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu pick-lang">
+              <li>
+                <a href="/references/modules/websocket.html" data-lang="en">English</a>
+              </li>
+              <li>
+                <a href="/cn/references/modules/websocket.html" data-lang="zh-cn">中文</a>
+              </li>
+            </ul>
+          </div>
+        </li>
         <!--<li></li>-->
       </ul>
     </div>
@@ -138,7 +111,7 @@
     
       <div class="search">
   <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <input type="text" id="search-input-sidebar" name="q" results="0" placeholder="search..." class="form-control search-input" autocomplete="off" autocorrect="off"/>
+    <input type="text" id="search-input-sidebar" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/>
     <span class="iconfont icon-search"></span>
   </form>
   <div class="results-panel">
@@ -577,11 +550,11 @@
               </li>
             
               <li>
-                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
+                <a href="/references/modules/websocket.html" class="sidebar-link current ">WebSocket</a>
               </li>
             
               <li>
-                <a href="/references/modules/websocket.html" class="sidebar-link current ">WebSocket</a>
+                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
               </li>
             
               <li>
@@ -697,12 +670,12 @@
       </li>
     
       <li>
-        <h3 class="chapter-title"><a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a></h3>
+        <h3 class="chapter-title"><a href="/references/migration/index.html" class="sidebar-link  ">Migration</a></h3>
         
           <ul class="chapter">
             
               <li>
-                <a href="/references/migration/index.html" class="sidebar-link  ">Migration</a>
+                <a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a>
               </li>
             
               <li>
@@ -720,7 +693,7 @@
     
     
       <li>
-        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Legacy</a></h3>
+        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Old Syntax Doc</a></h3>
       </li>
     
   </ul>
@@ -1164,11 +1137,11 @@
               </li>
             
               <li>
-                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
+                <a href="/references/modules/websocket.html" class="sidebar-link current ">WebSocket</a>
               </li>
             
               <li>
-                <a href="/references/modules/websocket.html" class="sidebar-link current ">WebSocket</a>
+                <a href="/references/modules/picker.html" class="sidebar-link  ">picker</a>
               </li>
             
               <li>
@@ -1284,12 +1257,12 @@
       </li>
     
       <li>
-        <h3 class="chapter-title"><a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a></h3>
+        <h3 class="chapter-title"><a href="/references/migration/index.html" class="sidebar-link  ">Migration</a></h3>
         
           <ul class="chapter">
             
               <li>
-                <a href="/references/migration/index.html" class="sidebar-link  ">Migration</a>
+                <a href="/references/platfrom-difference.html" class="sidebar-link  ">Platform Differences Between Weex and Web</a>
               </li>
             
               <li>
@@ -1307,7 +1280,7 @@
     
     
       <li>
-        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Legacy</a></h3>
+        <h3 class="chapter-title"><a href="/v-0.10/references/index.html" class="sidebar-link">Old Syntax Doc</a></h3>
       </li>
     
   </ul>
@@ -1325,7 +1298,7 @@
       </h1>
     
   
-  <time class="article-date" datetime="2017-02-26T06:06:13.000Z">Updated time: 26/02/2017</time>
+  <time class="article-date" datetime="2017-03-02T03:29:33.000Z">Updated time: 02/03/2017</time>
 </header>
     <h1 id="WebSocket"><a href="#WebSocket" class="headerlink" title="WebSocket"></a>WebSocket</h1><h2 id="Summary"><a href="#Summary" class="headerlink" title="Summary"></a>Summary</h2><p>WebSockets is an advanced technology that makes it possible to open an interactive communication session between the user’s H5/iOS/android and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply</p>
 <h2 id="Notes"><a href="#Notes" class="headerlink" title="Notes:"></a><strong>Notes:</strong></h2><ul>
@@ -1378,8 +1351,8 @@
 </ul>
 </li>
 </ul>
-<h3 id="Example"><a href="#Example" class="headerlink" title="Example"></a>Example</h3><figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">template</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">scroller</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: #286090"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80px ;padding: 20px;color: white"</span>&gt;</span>websocket<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span 
 class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">input</span></span></div><div class="line">        <span class="attr">type</span>=<span class="string">"text"</span></div><div class="line">        <span class="attr">placeholder</span>=<span class="string">"please input message to send"</span></div><div class="line">        <span class="attr">class</span>=<span class="string">"input"</span></div><div class="line">        <span class="attr">autofocus</span>=<span class="string">"false"</span></div><div class="line">        <span class="attr">value</span>=<span class="string">""</span></div><div class="line">        <span class="attr">onchange</span>=<span class="string">"onchange"</span></div><div class="line">        <span class="attr">oninput</span>=<span class="string">"oninput"</span></div><div class="line">        <span class="attr">id</span> = <span class="string">"input"</span></div><div class="line">      /&gt;</div><div 
 class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"flex-direction: row; justify-content: center;"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"button"</span> <span class="attr">onclick</span>=<span class="string">"&#123;&#123;connect&#125;&#125;"</span>&gt;</span>connect<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"button"</span> <span class="attr">onclick</span>=<span class="string">"&#123;&#123;send&#125;&#125;"</span>&gt;</span>send<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"button"</span
 > <span class="attr">onclick</span>=<span class="string">"&#123;&#123;close&#125;&#125;"</span>&gt;</span>close<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: lightgray"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80px ;padding: 20px;color: black"</span>&gt;</span>method = send<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <spa
 n class="attr">style</span>=<span class="string">"color: black;height: 80px"</span>&gt;</span>&#123;&#123;sendinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line"></div><div class="line"></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: lightgray"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80px ;padding: 20px;color: black"</span>&gt;</span>method = onopen<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"co
 lor: black;height: 80px"</span>&gt;</span>&#123;&#123;onopeninfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line"></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: lightgray"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80px ;padding: 20px;color: black"</span>&gt;</span>method = onmessage<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: black;height: 400px"</span>&gt;</span>&#123;&#123;onmessage&#125;&
 #125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line"></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: lightgray"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80px ;padding: 20px;color: black"</span>&gt;</span>method = onclose<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: black;height: 80px"</span>&gt;</span>&#123;&#123;oncloseinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></d
 iv><div class="line"></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: lightgray"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80px ;padding: 20px;color: black"</span>&gt;</span>method = onerror<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: black;height: 80px"</span>&gt;</span>&#123;&#123;onerrorinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line"></div><div class="line">      <span class="tag">&lt
 ;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: lightgray"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80px ;padding: 20px;color: black"</span>&gt;</span>method = close<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: black;height: 80px"</span>&gt;</span>&#123;&#123;closeinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line"></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span cl
 ass="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">scroller</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">template</span>&gt;</span></div><div class="line"></div><div class="line"><span class="tag">&lt;<span class="name">style</span>&gt;</span><span class="css"></span></div><div class="line">  <span class="selector-class">.input</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>: <span class="number">40px</span>;</div><div class="line">    <span class="attribute">height</span>: <span class="number">80px</span>;</div><div class="line">    <span class="attribute">width</span>: <span class="number">600px</span>;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.button</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>: <span class="number">36px</span>;</div><div class="line">    <s
 pan class="attribute">width</span>: <span class="number">150px</span>;</div><div class="line">    <span class="attribute">color</span>: <span class="number">#41B883</span>;</div><div class="line">    <span class="attribute">text-align</span>: center;</div><div class="line">    <span class="attribute">padding-top</span>: <span class="number">25px</span>;</div><div class="line">    <span class="attribute">padding-bottom</span>: <span class="number">25px</span>;</div><div class="line">    <span class="attribute">border-width</span>: <span class="number">2px</span>;</div><div class="line">    <span class="attribute">border-style</span>: solid;</div><div class="line">    <span class="attribute">margin-right</span>: <span class="number">20px</span>;</div><div class="line">    <span class="attribute">border-color</span>: <span class="built_in">rgb</span>(162, 217, 192);</div><div class="line">    <span class="attribute">background-color</span>: <span class="built_in">rgba</span>(162, 217, 
 192, 0.2);</div><div class="line">  &#125;</div><div class="line"><span class="tag">&lt;/<span class="name">style</span>&gt;</span></div><div class="line"></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> websocket = <span class="built_in">require</span>(<span class="string">'@weex-module/webSocket'</span>);</div><div class="line">  <span class="built_in">module</span>.exports = &#123;</div><div class="line">    <span class="attr">data</span>: &#123;</div><div class="line">      <span class="attr">connectinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">sendinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">onopeninfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">onmessage</span>: <span class="string">''</span>,</div><div class="l
 ine">      <span class="attr">oncloseinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">onerrorinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">closeinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">txtInput</span>:<span class="string">''</span>,</div><div class="line">      <span class="attr">navBarHeight</span>: <span class="number">88</span>,</div><div class="line">      <span class="attr">title</span>: <span class="string">'Navigator'</span>,</div><div class="line">      <span class="attr">dir</span>: <span class="string">'examples'</span>,</div><div class="line">      <span class="attr">baseURL</span>: <span class="string">''</span>,</div><div class="line">    &#125;,</div><div class="line">    <span class="attr">methods</span>: &#123;</div><div class="line">      <span class="attr">connect</span>:<span class="function"><span class="keyword">function<
 /span>(<span class="params"></span>) </span>&#123;</div><div class="line">        websocket.WebSocket(<span class="string">'ws://115.29.193.48:8088'</span>,<span class="string">''</span>);</div><div class="line">        <span class="keyword">var</span> self = <span class="keyword">this</span>;</div><div class="line">        websocket.onopen = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          self.onopeninfo = <span class="built_in">JSON</span>.stringify(e);</div><div class="line">        &#125;</div><div class="line">        websocket.onmessage = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          self.onmessage = e.data;</div><div class="line">        &#125;</div><div class="line">        websocket.onerror = <span class="function"><span class="keyw
 ord">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          self.onerrorinfo = e.data;</div><div class="line">        &#125;</div><div class="line">        websocket.onclose = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          self.onerrorinfo = e.code;</div><div class="line">        &#125;</div><div class="line">      &#125;,</div><div class="line">      <span class="attr">send</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>) </span>&#123;</div><div class="line">        <span class="keyword">var</span> input = <span class="keyword">this</span>.$el(<span class="string">'input'</span>);</div><div class="line">        input.blur();</div><div class="line">        websocket.send(<span class="keyword">this</span>.txtInput);</div><div class="line">      
   <span class="keyword">this</span>.sendinfo = <span class="keyword">this</span>.txtInput;</div><div class="line"></div><div class="line">      &#125;,</div><div class="line">      <span class="attr">oninput</span>: <span class="function"><span class="keyword">function</span>(<span class="params">event</span>) </span>&#123;</div><div class="line">        <span class="keyword">this</span>.txtInput = event.value;</div><div class="line">      &#125;,</div><div class="line">      <span class="attr">close</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>) </span>&#123;</div><div class="line">        websocket.close();</div><div class="line">      &#125;,</div><div class="line">    &#125;</div><div class="line">  &#125;;</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
-<p><a href="http://dotwe.org/weex/993f33173a712fecfb61c1c4b03bcb70" target="_blank" rel="external">Have a try</a></p>
+<h3 id="Example"><a href="#Example" class="headerlink" title="Example"></a>Example</h3><figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">template</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">scroller</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: #286090"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80 ;padding: 20;color: #FFFFFF"</span>&gt;</span>websocket<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span cl
 ass="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">input</span></span></div><div class="line">              <span class="attr">type</span>=<span class="string">"text"</span></div><div class="line">              <span class="attr">placeholder</span>=<span class="string">"please input message to send"</span></div><div class="line">              <span class="attr">class</span>=<span class="string">"input"</span></div><div class="line">              <span class="attr">autofocus</span>=<span class="string">"false"</span></div><div class="line">              <span class="attr">value</span>=<span class="string">""</span></div><div class="line">              <span class="attr">onchange</span>=<span class="string">"onchange"</span></div><div class="line">              <span class="attr">oninput</span>=<span class="string">"oninput"</span></div><div class="line">              <span class="attr">id</span> = <span class="string">"input"</span>
 </div><div class="line">      /&gt;</div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"flex-direction: row; justify-content: center;"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"button"</span> <span class="attr">onclick</span>=<span class="string">"&#123;&#123;connect&#125;&#125;"</span>&gt;</span>connect<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"button"</span> <span class="attr">onclick</span>=<span class="string">"&#123;&#123;send&#125;&#125;"</span>&gt;</span>send<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">cl
 ass</span>=<span class="string">"button"</span> <span class="attr">onclick</span>=<span class="string">"&#123;&#123;close&#125;&#125;"</span>&gt;</span>close<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: #D3D3D3;margin-top: 20"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80 ;padding: 20;color: #000000"</span>&gt;</span>method = send<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<s
 pan class="name">text</span> <span class="attr">style</span>=<span class="string">"color: #000000;height: 80"</span>&gt;</span>&#123;&#123;sendinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: #D3D3D3"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80 ;padding: 20;color: #000000"</span>&gt;</span>method = onopen<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: #000000;height
 : 80"</span>&gt;</span>&#123;&#123;onopeninfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: #D3D3D3"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80 ;padding: 20;color: #000000"</span>&gt;</span>method = onmessage<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: #000000;height: 100"</span>&gt;</span>&#123;&#123;onmessage&#125;&#125;<span class="tag">&lt;/<span class="name">
 text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: #D3D3D3"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80 ;padding: 20;color: #000000"</span>&gt;</span>method = onclose<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: #000000;height: 80"</span>&gt;</span>&#123;&#123;oncloseinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</sp
 an> <span class="attr">style</span>=<span class="string">"background-color: #D3D3D3"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80 ;padding: 20;color: #000000"</span>&gt;</span>method = onerror<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: #000000;height: 80"</span>&gt;</span>&#123;&#123;onerrorinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">"background-color: #D3D3D3"</span>&gt;</spa
 n></div><div class="line">        <span class="tag">&lt;<span class="name">text</span> <span class="attr">class</span>=<span class="string">"title"</span> <span class="attr">style</span>=<span class="string">"height: 80 ;padding: 20;color: #000000"</span>&gt;</span>method = close<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">      <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">      <span class="tag">&lt;<span class="name">text</span> <span class="attr">style</span>=<span class="string">"color: #000000;height: 80"</span>&gt;</span>&#123;&#123;closeinfo&#125;&#125;<span class="tag">&lt;/<span class="name">text</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">scroller</span>&gt;</span></div>
 <div class="line"><span class="tag">&lt;/<span class="name">template</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">style</span>&gt;</span><span class="css"></span></div><div class="line">  <span class="selector-class">.input</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>: <span class="number">40</span>;</div><div class="line">    <span class="attribute">height</span>: <span class="number">80</span>;</div><div class="line">    <span class="attribute">width</span>: <span class="number">600</span>;</div><div class="line">  &#125;</div><div class="line">  <span class="selector-class">.button</span> &#123;</div><div class="line">    <span class="attribute">font-size</span>: <span class="number">36</span>;</div><div class="line">    <span class="attribute">width</span>: <span class="number">150</span>;</div><div class="line">    <span class="attribute">color</span>: <span class="number">#41B883</span>;</div><div class=
 "line">    <span class="attribute">text-align</span>: center;</div><div class="line">    <span class="attribute">padding-top</span>: <span class="number">10</span>;</div><div class="line">    <span class="attribute">padding-bottom</span>: <span class="number">10</span>;</div><div class="line">    <span class="attribute">border-width</span>: <span class="number">2</span>;</div><div class="line">    <span class="attribute">border-style</span>: solid;</div><div class="line">    <span class="attribute">margin-right</span>: <span class="number">20</span>;</div><div class="line">    <span class="attribute">border-color</span>: <span class="built_in">rgb</span>(162, 217, 192);</div><div class="line">    <span class="attribute">background-color</span>: <span class="built_in">rgba</span>(162, 217, 192, 0.2);</div><div class="line">  &#125;</div><div class="line"><span class="tag">&lt;/<span class="name">style</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">s
 cript</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> websocket = <span class="built_in">require</span>(<span class="string">'@weex-module/webSocket'</span>);</div><div class="line">  <span class="built_in">module</span>.exports = &#123;</div><div class="line">    <span class="attr">data</span>: &#123;</div><div class="line">      <span class="attr">connectinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">sendinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">onopeninfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">onmessage</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">oncloseinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">onerrorinfo</span>: <span class="string">''</span>,</div><div class="line">      <span clas
 s="attr">closeinfo</span>: <span class="string">''</span>,</div><div class="line">      <span class="attr">txtInput</span>:<span class="string">''</span>,</div><div class="line">      <span class="attr">navBarHeight</span>: <span class="number">88</span>,</div><div class="line">      <span class="attr">title</span>: <span class="string">'Navigator'</span>,</div><div class="line">      <span class="attr">dir</span>: <span class="string">'examples'</span>,</div><div class="line">      <span class="attr">baseURL</span>: <span class="string">''</span>,</div><div class="line">    &#125;,</div><div class="line">    <span class="attr">methods</span>: &#123;</div><div class="line">      <span class="attr">connect</span>:<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</div><div class="line">        websocket.WebSocket(<span class="string">'ws://echo.websocket.org'</span>,<span class="string">''</span>);</div><div class="line">        <
 span class="keyword">var</span> self = <span class="keyword">this</span>;</div><div class="line">        self.onopeninfo = <span class="string">'connecting...'</span></div><div class="line">        websocket.onopen = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          self.onopeninfo = <span class="string">'websocket open'</span>;</div><div class="line">        &#125;</div><div class="line">        websocket.onmessage = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          self.onmessage = e.data;</div><div class="line">        &#125;</div><div class="line">        websocket.onerror = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          s
 elf.onerrorinfo = e.data;</div><div class="line">        &#125;</div><div class="line">        websocket.onclose = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span></div><div class="line">        &#123;</div><div class="line">          self.onopeninfo = <span class="string">''</span>;</div><div class="line">          self.onerrorinfo = e.code;</div><div class="line">        &#125;</div><div class="line">      &#125;,</div><div class="line">      <span class="attr">send</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>) </span>&#123;</div><div class="line">        <span class="keyword">var</span> input = <span class="keyword">this</span>.$el(<span class="string">'input'</span>);</div><div class="line">        input.blur();</div><div class="line">        websocket.send(<span class="keyword">this</span>.txtInput);</div><div class="line">        <span class="keyword">this</span>.sendinfo = <
 span class="keyword">this</span>.txtInput;</div><div class="line">      &#125;,</div><div class="line">      <span class="attr">oninput</span>: <span class="function"><span class="keyword">function</span>(<span class="params">event</span>) </span>&#123;</div><div class="line">        <span class="keyword">this</span>.txtInput = event.value;</div><div class="line">      &#125;,</div><div class="line">      <span class="attr">close</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>) </span>&#123;</div><div class="line">        websocket.close();</div><div class="line">      &#125;,</div><div class="line">    &#125;</div><div class="line">  &#125;;</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
+<p><a href="http://dotwe.org/weex/0256bbfc448f0fdbe8b10ba311c947b4" target="_blank" rel="external">Have a try</a></p>
 
   </div>
   
@@ -1401,7 +1374,7 @@
           <a href="/references/modules/websocket.html" data-lang="en">English</a>
         </li>
         <li>
-          <a href="/cn/references/modules/websocket.html" data-lang="cn">中文</a>
+          <a href="/cn/references/modules/websocket.html" data-lang="zh-cn">中文</a>
         </li>
       </ul>
     </div>


Mime
View raw message