http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/f3d58bd0/cn/v-0.10/advanced/extend-to-android.html
----------------------------------------------------------------------
diff --git a/cn/v-0.10/advanced/extend-to-android.html 
b/cn/v-0.10/advanced/extend-to-android.html
deleted file mode 100644
index d877239..0000000
--- a/cn/v-0.10/advanced/extend-to-android.html
+++ /dev/null
@@ -1,429 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  
-  <title>Android 扩展 | Weex</title>
-  <meta name="viewport" content="width=device-width, initial-scale=1, 
maximum-scale=1">
-  <meta name="description" content="Android 扩展Weex 
提供了扩展机制,可以æ 
¹æ®è‡ªå·±çš„业务进行定制自己的功能。主要分为两类扩展:    
Module 扩展 非 UI 的特定功能。例如 sendHttp、openURL 等。 
Component 扩展 实现特别功能的 Native 
控件。例如:RichTextview,RefreshListview 等。 Adapter 扩展 Weex 
对一些基础功能实现了统一的接口,可实现">
-<meta property="og:type" content="website">
-<meta property="og:title" content="Android 扩展">
-<meta property="og:url" 
content="https://weex-project.io/cn/v-0.10/advanced/extend-to-android.html";>
-<meta property="og:site_name" content="Weex">
-<meta property="og:description" content="Android 扩展Weex 
提供了扩展机制,可以æ 
¹æ®è‡ªå·±çš„业务进行定制自己的功能。主要分为两类扩展:    
Module 扩展 非 UI 的特定功能。例如 sendHttp、openURL 等。 
Component 扩展 实现特别功能的 Native 
控件。例如:RichTextview,RefreshListview 等。 Adapter 扩展 Weex 
对一些基础功能实现了统一的接口,可实现">
-<meta property="og:updated_time" content="2017-04-28T02:36:21.000Z">
-<meta name="twitter:card" content="summary">
-<meta name="twitter:title" content="Android 扩展">
-<meta name="twitter:description" content="Android 扩展Weex 
提供了扩展机制,可以æ 
¹æ®è‡ªå·±çš„业务进行定制自己的功能。主要分为两类扩展:    
Module 扩展 非 UI 的特定功能。例如 sendHttp、openURL 等。 
Component 扩展 实现特别功能的 Native 
控件。例如:RichTextview,RefreshListview 等。 Adapter 扩展 Weex 
对一些基础功能实现了统一的接口,可实现">
-  
-    <link rel="alternate" href="/atom.xml" title="Weex" 
type="application/atom+xml">
-  
-  
-    <link rel="icon" 
href="//gw.alicdn.com/tps/TB1XNqxPXXXXXcSXVXXXXXXXXXX-64-63.png">
-  
-  
-    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" 
rel="stylesheet" type="text/css">
-  
-  <link rel="stylesheet" href="/css/style.css">
-  <link rel="stylesheet" href="/css/swiper.min.css">
-</head>
-
-<body id="advanced" class="lang-cn">
-  
-  <script>
-    window.PAGE_TYPE = "advanced";
-    window.ROOT = "/"
-  </script>
-  <header id="header">
-  <div class="navbar">
-    <a id="logo" href="/cn/">
-      <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" />
-    </a>
-    <div class="main-nav">
-      <ul class="links">
-        <li><a href="/cn/guide">教程</a></li>
-        <li><a href="/cn/references">手册</a></li>
-        <li class="dropdown">
-          <a href="javascript:;">参考</a>
-          <ul class="dropdown-menu subnav">
-            <li>
-              <a href="/cn/faq.html">FAQ</a>
-            </li>
-            <li>
-              <a href="/cn/releasenote.html">版本说明</a>
-            </li>
-          </ul>
-        </li>
-        <li class="dropdown">
-            <a href="javascript:;">工具和服务</a>
-            <ul class="dropdown-menu subnav">
-              <li>
-                <a href="/cn/playground.html">Playground</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/toolkit.html">Weex-toolkit</a>
-              </li>
-              <li>
-                <a href="http://dotwe.org"; target="_blank">Code Snippets</a>
-              </li>
-              <li>
-                <a href="https://market.dotwe.org"; target="_blank">Market</a>
-              </li>
-            </ul>
-        </li>
-      </ul>
-      <ul class="info">
-        <li><a href="https://github.com/apache/incubator-weex/"; 
target="_blank"><span class="btn-github iconfont icon-github"></span></a></li>
-      </ul>
-      <ul class="tools">
-        <li>
-          <div class="search">
-  <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <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="/v-0.10/advanced/extend-to-android.html" 
data-lang="en">English</a>
-              </li>
-              <li>
-                <a href="/cn/v-0.10/advanced/extend-to-android.html" 
data-lang="zh-cn">中文</a>
-              </li>
-            </ul>
-          </div>
-        </li>
-        <!--<li></li>-->
-      </ul>
-    </div>
-  </div>
-  <div id="mobile-nav">
-    <a id="logo" href="/cn/">
-      <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" />
-    </a>
-    <a class="btn-menu"><span class="iconfont icon-nav"></span></a>
-  </div>
-</header>
-
-  <div id="sidebar" class="">
-  <div class="sidebar-menu">
-    
-      <ul class="main-nav">
-        <li>
-          <div class="search">
-  <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <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">
-  </div>
-</div>
-        </li>
-        <li>
-          <a class="" href="/cn/guide">
-            教程
-          </a>
-        </li>
-        <li>
-          <a class="" href="/cn/references">
-            手册
-          </a>
-        </li>
-        <li>
-          <a href="/cn/faq.html">
-            FAQ
-          </a>
-        </li>
-        <li>
-            <p>工具和服务</p>
-            <ul class="subnav">
-              <li>
-                <a href="/cn/playground.html">Playground</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/devtools.html">Devtools</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/weexpack.html">Weexpack</a>
-              </li>
-              <li>
-                <a href="http://dotwe.org"; target="_blank">Snippets</a>
-              </li>
-              <li>
-                <a href="https://market.dotwe.org"; target="_blank">Market</a>
-              </li>
-            </ul>
-        </li>
-        <li>
-          <a href="https://github.com/apache/incubator-weex/"; target="_blank">
-            GitHub
-          </a>
-        </li>
-      </ul>
-    
-    <a class="btn-close-sidebar iconfont  icon-close"></a>
-  </div>
-</div>
-
-  <div class="article-wrapper page-layout">
-  <div class="doc-nav">
-    
-
-
-<div class="summary">
-  <h2 class="part-title">
-    
-      高阶知识
-    
-  </h2>
-  <ul class="doc-summary">
-    
-    
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-   
-    
-      <li>
-        <h3 class="chapter-title"><a href="/cn/v-0.10/advanced/index.html" 
class="sidebar-link  ">Weex 工作原理</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/how-data-binding-works.html" class="sidebar-link  
">数据绑定原理</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/create-a-weex-project.html" class="sidebar-link  
">如何创建一个 Weex 项目</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-android.html" class="sidebar-link  
">集成到 Android</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-ios.html" class="sidebar-link  
">集成到 iOS</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-html5.html" class="sidebar-link  
">集成到 web</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/customize-a-native-component.html" 
class="sidebar-link  ">自定义 native 组件</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/cuszomize-native-apis.html" class="sidebar-link  
">自定义 native API</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-android.html" class="sidebar-link current 
">Android 扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-ios.html" class="sidebar-link  ">iOS 
扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-html5.html" class="sidebar-link  
">weex-html5 扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-devtools-to-android.html" 
class="sidebar-link  ">集成 Devtools 到 Android</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-devtools-to-ios.html" class="sidebar-link  
">集成 Devtools 到 iOS</a></h3>
-        
-      </li>
-    
-    
-    
-  </ul>
-</div>
-  </div>
-  
-
-<article class="article article-type-advanced">
-  <div class="article-entry" itemprop="articleBody">
-    <header class="article-header">
-  
-    
-      <h1 class="article-title" itemprop="name">
-        Android 扩展
-      </h1>
-    
-  
-  <time class="article-date" datetime="2017-04-28T02:36:21.000Z">Updated time: 
28/04/2017</time>
-</header>
-    <h1 id="Android-扩展"><a href="#Android-扩展" class="headerlink" 
title="Android 扩展"></a>Android 扩展</h1><p>Weex 
提供了扩展机制,可以æ 
¹æ®è‡ªå·±çš„业务进行定制自己的功能。<br>主要分为两类扩展:
  </p>
-<ul>
-<li>Module 扩展 非 UI 的特定功能。例如 sendHttp、openURL 
等。</li>
-<li>Component 扩展 实现特别功能的 Native 
控件。例如:RichTextview,RefreshListview 等。</li>
-<li>Adapter 扩展 Weex 
对一些基础功能实现了统一的接口,可实现这些接口来定制自己的业务。例如:图片下载等。</li>
-</ul>
-<h2 id="Module-扩展"><a href="#Module-扩展" class="headerlink" 
title="Module 扩展"></a>Module 扩展</h2><ol>
-<li>Module 扩展必须继承 WXModule 类。</li>
-<li>扩展方法必须加上 @WXModuleAnno 注解。Weex 会æ 
¹æ®æ³¨è§£æ¥åˆ¤æ–­å½“前方法是否要运行在 UI 
线程,和当前方法是否是扩展方法。</li>
-<li>Weex是根据反射来进行调用 Module 
扩展方法,所以Module中的扩展方法必须是 public 类型。</li>
-<li>同样因为是通过反射调用,Module 
不能被混淆。请在混淆文件中添加代码:<code>-keep public class 
* extends com.taobao.weex.common.WXModule{*;}</code></li>
-<li>Module 扩展的方法可以使用 int, double, float, String, Map, List 
类型的参数</li>
-<li>完成 Module 后一定要在初始化时注册 
<code>WXSDKEngine.registerModule(&quot;myModule&quot;, MyModule.class);</code> 
否则会报类似错误:<code>ReportException :undefined:9: TypeError: 
Object #&lt;Object&gt; has no method &#39;printLog&#39;</code></li>
-</ol>
-<p>示例如下:</p>
-<figure class="highlight java"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">public</span> <span class="class"><span 
class="keyword">class</span> <span class="title">MyModule</span> <span 
class="keyword">extends</span> <span class="title">WXModule</span> 
</span>&#123;</div><div class="line"></div><div class="line">  <span 
class="meta">@WXModuleAnno</span>(runOnUIThread = <span 
class="keyword">true</span>)</div><div class="line">  <span 
class="function"><span class="keyword">public</span> <span 
class="keyword">void</span> <span class="title">printLog</span><span 
class="params">(String msg)</span> </span>&#123;</div><div class="line">    
Toast.makeText(mWXSDKInstance.getContext(),msg,Toast.LENGTH_SHORT).show();</div><div
 class="line">  &#125;</div><div 
class="line">&#125;</div></pre></td></tr></table></figure>
-<p>JS 调用如下:</p>
-<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>&gt;</span></div><div 
class="line">    <span class="tag">&lt;<span class="name">text</span> <span 
class="attr">onclick</span>=<span 
class="string">"click"</span>&gt;</span>点击我测试<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">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="built_in">module</span>.exports = &#123;</div><div 
class="line">    <span class="attr">methods</span>: &#123;</div><div 
class="line">      <span class="att
 r">click</span>: <span class="function"><span 
class="keyword">function</span>(<span class="params"></span>) 
</span>&#123;</div><div class="line">        <span 
class="built_in">require</span>(<span 
class="string">'@weex-module/myModule'</span>).printLog(<span 
class="string">"我是一个测试!"</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></pre></td></tr></table></figure>
-<h2 id="Component-扩展"><a href="#Component-扩展" class="headerlink" 
title="Component 扩展"></a>Component 扩展</h2><ol>
-<li>Component 扩展类必须集成 WXComponent.</li>
-<li>Component 对应的设置属性的方法必须添加注解 
@WXComponentProp(name=value(value is attr or style of dsl))</li>
-<li>Weex sdk 通过反射调用对应的方法,所以 Component 
对应的属性方法必须是 
public,并且不能被混淆。请在混淆文件中添加代码  <code>-keep 
public class * extends com.taobao.weex.ui.component.WXComponent{*;}</code></li>
-<li>Component 扩展的方法可以使用 int, double, float, String, Map, 
List 类型的参数</li>
-<li>完成 Component 后一定要在初始化时注册 
<code>WXSDKEngine.registerComponent(&quot;richtext&quot;,RichText.class);</code></li>
-</ol>
-<p>示例如下:</p>
-<figure class="highlight java"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">public</span> <span class="class"><span 
class="keyword">class</span> <span class="title">RichText</span> <span 
class="keyword">extends</span> <span class="title">WXComponent</span> 
</span>&#123;</div><div class="line"></div><div class="line">  <span 
class="function"><span class="keyword">public</span> <span 
class="title">RichText</span><span class="params">(WXSDKInstance instance, 
WXDomObject dom, WXVContainer parent, <span class="keyword">boolean</span> 
isLazy)</span> </span>&#123;</div><div class="line">    <span 
class="keyword">super</span>(instance, dom, parent, isLazy);</div><div 
class="line">  &#125;</div><div class="line"></div><div class="line">  <span 
class="meta">@Override</span></div><div class="line">  <span 
class="function"><span class="keyword">protected</span> <span 
class="keyword">void</span> <span class="title">initView</span><span 
class="params">()</span> </span>
 &#123;</div><div class="line">    mHost=<span class="keyword">new</span> 
TextView(mContext);</div><div class="line">    
((TextView)mHost).setMovementMethod(LinkMovementMethod.getInstance());</div><div
 class="line">  &#125;</div><div class="line"></div><div class="line">  <span 
class="meta">@WXComponentProp</span>(name = <span 
class="string">"tel"</span>)</div><div class="line">  <span 
class="function"><span class="keyword">public</span> <span 
class="keyword">void</span> <span class="title">setTelLink</span><span 
class="params">(String tel)</span></span>&#123;</div><div class="line">    
SpannableString spannable=<span class="keyword">new</span> 
SpannableString(tel);</div><div class="line">    spannable.setSpan(<span 
class="keyword">new</span> URLSpan(<span 
class="string">"tel:"</span>+tel),<span class="number">0</span>,tel.length(), 
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);</div><div class="line">    
((TextView)mHost).setText(spannable);</div><div class="line">  &#125;</div><div 
class="line
 ">&#125;</div></pre></td></tr></table></figure>
-<p>JS 调用如下:</p>
-<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>&gt;</span></div><div 
class="line">    <span class="tag">&lt;<span class="name">richText</span> <span 
class="attr">tel</span>=<span class="string">"12305"</span> <span 
class="attr">style</span>=<span 
class="string">"width:200;height:100"</span>&gt;</span>12305<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">template</span>&gt;</span></div></pre></td></tr></table></figure>
-<h2 id="Adapter扩展"><a href="#Adapter扩展" class="headerlink" 
title="Adapter扩展"></a>Adapter扩展</h2><p>图片下载:</p>
-<p>需要时集成接口 IWXImgLoaderAdapter,实现 setImage 方法。</p>
-<p>示例如下:</p>
-<figure class="highlight java"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">public</span> <span class="class"><span 
class="keyword">class</span> <span class="title">ImageAdapter</span> <span 
class="keyword">implements</span> <span 
class="title">IWXImgLoaderAdapter</span> </span>&#123;</div><div 
class="line"></div><div class="line">  <span class="function"><span 
class="keyword">public</span> <span class="title">ImageAdapter</span><span 
class="params">()</span> </span>&#123;</div><div class="line">  
&#125;</div><div class="line"></div><div class="line">  <span 
class="meta">@Override</span></div><div class="line">  <span 
class="function"><span class="keyword">public</span> <span 
class="keyword">void</span> <span class="title">setImage</span><span 
class="params">(<span class="keyword">final</span> String url, <span 
class="keyword">final</span> ImageView view,</span></span></div><div 
class="line">                       WXImageQuality quality, WXImageStrategy s
 trategy) &#123;</div><div class="line"></div><div class="line">    
WXSDKManager.getInstance().postOnUiThread(<span class="keyword">new</span> 
Runnable() &#123;</div><div class="line"></div><div class="line">      <span 
class="meta">@Override</span></div><div class="line">      <span 
class="function"><span class="keyword">public</span> <span 
class="keyword">void</span> <span class="title">run</span><span 
class="params">()</span> </span>&#123;</div><div class="line">        <span 
class="keyword">if</span>(view==<span 
class="keyword">null</span>||view.getLayoutParams()==<span 
class="keyword">null</span>)&#123;</div><div class="line">          <span 
class="keyword">return</span>;</div><div class="line">        &#125;</div><div 
class="line">        <span class="keyword">if</span> (TextUtils.isEmpty(url)) 
&#123;</div><div class="line">          view.setImageBitmap(<span 
class="keyword">null</span>);</div><div class="line">          <span 
class="keyword">return</span>;</div><div class="lin
 e">        &#125;</div><div class="line">        String temp = url;</div><div 
class="line">        <span class="keyword">if</span> (url.startsWith(<span 
class="string">"//"</span>)) &#123;</div><div class="line">          temp = 
<span class="string">"http:"</span> + url;</div><div class="line">        
&#125;</div><div class="line">        <span class="keyword">if</span> 
(view.getLayoutParams().width &lt;= <span class="number">0</span> || 
view.getLayoutParams().height &lt;= <span class="number">0</span>) 
&#123;</div><div class="line">          <span 
class="keyword">return</span>;</div><div class="line">        &#125;</div><div 
class="line">        Picasso.with(WXEnvironment.getApplication())</div><div 
class="line">            .load(temp)</div><div class="line">            
.into(view);</div><div class="line">      &#125;</div><div class="line">    
&#125;,<span class="number">0</span>);</div><div class="line">  
&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
-<h4 id="组件方法支持"><a href="#组件方法支持" class="headerlink" 
title="组件方法支持"></a>组件方法支持</h4><p>从WeexSDK 
0.9.5开始,你可以定义组件方法</p>
-<ul>
-<li><p>在组件中如下声明一个组件方法</p>
-<figure class="highlight java"><table><tr><td class="code"><pre><div 
class="line"><span class="meta">@JSMethod</span></div><div class="line"><span 
class="function"><span class="keyword">public</span> <span 
class="keyword">void</span> <span class="title">focus</span><span 
class="params">()</span></span>&#123;</div><div class="line"><span 
class="comment">//method implementation</span></div><div 
class="line">&#125;</div></pre></td></tr></table></figure>
-</li>
-<li><p>注册组之后,你可以在weex 文件中调用</p>
-<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">mycomponent</span> <span 
class="attr">id</span>=<span 
class="string">'mycomponent'</span>&gt;</span><span class="tag">&lt;/<span 
class="name">mycomponent</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">script</span>&gt;</span><span class="javascript"></span></div><div 
class="line">   <span class="built_in">module</span>.exports = &#123;</div><div 
class="line">     <span class="attr">created</span>: <span 
class="function"><span class="keyword">function</span>(<span 
class="params"></span>) </span>&#123;</div><div class="line">       <span 
class="keyword">this</span>.$el(<span 
class="string">'mycomponent'</span>).focus();</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>
-</li>
-</ul>
-<p>注:工程要添加依赖 <code>compile 
&#39;com.squareup.picasso:picasso:2.5.2&#39;</code></p>
-
-  </div>
-  
-</article>
-</div>
-  
-  <footer id="footer">
-  <div class="row clearfix">
-    <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="/v-0.10/advanced/extend-to-android.html" 
data-lang="en">English</a>
-        </li>
-        <li>
-          <a href="/cn/v-0.10/advanced/extend-to-android.html" 
data-lang="zh-cn">中文</a>
-        </li>
-      </ul>
-    </div>
-  </div>
-  <div class="disclaimer">
-    <div><img 
src="//gw.alicdn.com/tfs/TB1pTBZQFXXXXX9XXXXXXXXXXXX-794-280.png" width="200px" 
alt="Apache Incubator"></div>
-    <div><span class="title">Disclaimer:</span> Apache Weex is an effort 
undergoing incubation at The Apache Software Foundation (ASF), sponsored by the 
Apache Incubator. Incubation is required of all newly accepted projects until a 
further review indicates that the infrastructure, communications, and decision 
making process have stabilized in a manner consistent with other successful ASF 
projects. While incubation status is not necessarily a reflection of the 
completeness or stability of the code, it does indicate that the project has 
yet to be fully endorsed by the ASF.</div>
-    <br/>
-  </div>
-  <hr>
-  <div class="row">
-    <p> <img src="//gw.alicdn.com/tfs/TB1bg8SQFXXXXcHXXXXXXXXXXXX-85-170.png" 
height="50px" alt="Apache"><span>Copyright(c) 2017 The Apache Software 
Foundation. Licensed under the </span> <a 
href="http://www.apache.org/licenses/LICENSE-2.0";>Apache License, Version 
2.0</a></p>
-  </div>
-  <div class="row clearfix">
-    <div></div>
-  </div>
-</footer>
-  <div style="display: none;">
-  <script src="//s95.cnzz.com/z_stat.php?id=1261496509&web_id=1261496509" 
language="JavaScript"></script>
-</div>
-
-  <script src="/js/reqwest.js"></script>
-  <script src="/js/common.js"></script>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/f3d58bd0/cn/v-0.10/advanced/extend-to-html5.html
----------------------------------------------------------------------
diff --git a/cn/v-0.10/advanced/extend-to-html5.html 
b/cn/v-0.10/advanced/extend-to-html5.html
deleted file mode 100644
index 236e699..0000000
--- a/cn/v-0.10/advanced/extend-to-html5.html
+++ /dev/null
@@ -1,438 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  
-  <title>weex-html5 扩展 | Weex</title>
-  <meta name="viewport" content="width=device-width, initial-scale=1, 
maximum-scale=1">
-  <meta name="description" content="扩展 weex-html5简介Weex 
是一个高可扩展性的跨平台动态化开发方案,你
可以在现有组件基础上定制自己需要的三端组件。你可以为 
Weex API 模块添加新的方法,或者创建新的 API 模块和新的加
载器。按照以下几个步骤扩展你的组件,API 或者加载器。 
首先要明确的是,组件和 API 模块是基于 Weex 
的扩展,但是独立于 Weex,组件的定义本身是不需要依赖于 
Weex 的,这样有助">
-<meta property="og:type" content="website">
-<meta property="og:title" content="weex-html5 扩展">
-<meta property="og:url" 
content="https://weex-project.io/cn/v-0.10/advanced/extend-to-html5.html";>
-<meta property="og:site_name" content="Weex">
-<meta property="og:description" content="扩展 weex-html5简介Weex 
是一个高可扩展性的跨平台动态化开发方案,你
可以在现有组件基础上定制自己需要的三端组件。你可以为 
Weex API 模块添加新的方法,或者创建新的 API 模块和新的加
载器。按照以下几个步骤扩展你的组件,API 或者加载器。 
首先要明确的是,组件和 API 模块是基于 Weex 
的扩展,但是独立于 Weex,组件的定义本身是不需要依赖于 
Weex 的,这样有助">
-<meta property="og:updated_time" content="2017-04-28T02:36:21.000Z">
-<meta name="twitter:card" content="summary">
-<meta name="twitter:title" content="weex-html5 扩展">
-<meta name="twitter:description" content="扩展 weex-html5简介Weex 
是一个高可扩展性的跨平台动态化开发方案,你
可以在现有组件基础上定制自己需要的三端组件。你可以为 
Weex API 模块添加新的方法,或者创建新的 API 模块和新的加
载器。按照以下几个步骤扩展你的组件,API 或者加载器。 
首先要明确的是,组件和 API 模块是基于 Weex 
的扩展,但是独立于 Weex,组件的定义本身是不需要依赖于 
Weex 的,这样有助">
-  
-    <link rel="alternate" href="/atom.xml" title="Weex" 
type="application/atom+xml">
-  
-  
-    <link rel="icon" 
href="//gw.alicdn.com/tps/TB1XNqxPXXXXXcSXVXXXXXXXXXX-64-63.png">
-  
-  
-    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" 
rel="stylesheet" type="text/css">
-  
-  <link rel="stylesheet" href="/css/style.css">
-  <link rel="stylesheet" href="/css/swiper.min.css">
-</head>
-
-<body id="advanced" class="lang-cn">
-  
-  <script>
-    window.PAGE_TYPE = "advanced";
-    window.ROOT = "/"
-  </script>
-  <header id="header">
-  <div class="navbar">
-    <a id="logo" href="/cn/">
-      <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" />
-    </a>
-    <div class="main-nav">
-      <ul class="links">
-        <li><a href="/cn/guide">教程</a></li>
-        <li><a href="/cn/references">手册</a></li>
-        <li class="dropdown">
-          <a href="javascript:;">参考</a>
-          <ul class="dropdown-menu subnav">
-            <li>
-              <a href="/cn/faq.html">FAQ</a>
-            </li>
-            <li>
-              <a href="/cn/releasenote.html">版本说明</a>
-            </li>
-          </ul>
-        </li>
-        <li class="dropdown">
-            <a href="javascript:;">工具和服务</a>
-            <ul class="dropdown-menu subnav">
-              <li>
-                <a href="/cn/playground.html">Playground</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/toolkit.html">Weex-toolkit</a>
-              </li>
-              <li>
-                <a href="http://dotwe.org"; target="_blank">Code Snippets</a>
-              </li>
-              <li>
-                <a href="https://market.dotwe.org"; target="_blank">Market</a>
-              </li>
-            </ul>
-        </li>
-      </ul>
-      <ul class="info">
-        <li><a href="https://github.com/apache/incubator-weex/"; 
target="_blank"><span class="btn-github iconfont icon-github"></span></a></li>
-      </ul>
-      <ul class="tools">
-        <li>
-          <div class="search">
-  <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <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="/v-0.10/advanced/extend-to-html5.html" 
data-lang="en">English</a>
-              </li>
-              <li>
-                <a href="/cn/v-0.10/advanced/extend-to-html5.html" 
data-lang="zh-cn">中文</a>
-              </li>
-            </ul>
-          </div>
-        </li>
-        <!--<li></li>-->
-      </ul>
-    </div>
-  </div>
-  <div id="mobile-nav">
-    <a id="logo" href="/cn/">
-      <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" />
-    </a>
-    <a class="btn-menu"><span class="iconfont icon-nav"></span></a>
-  </div>
-</header>
-
-  <div id="sidebar" class="">
-  <div class="sidebar-menu">
-    
-      <ul class="main-nav">
-        <li>
-          <div class="search">
-  <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <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">
-  </div>
-</div>
-        </li>
-        <li>
-          <a class="" href="/cn/guide">
-            教程
-          </a>
-        </li>
-        <li>
-          <a class="" href="/cn/references">
-            手册
-          </a>
-        </li>
-        <li>
-          <a href="/cn/faq.html">
-            FAQ
-          </a>
-        </li>
-        <li>
-            <p>工具和服务</p>
-            <ul class="subnav">
-              <li>
-                <a href="/cn/playground.html">Playground</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/devtools.html">Devtools</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/weexpack.html">Weexpack</a>
-              </li>
-              <li>
-                <a href="http://dotwe.org"; target="_blank">Snippets</a>
-              </li>
-              <li>
-                <a href="https://market.dotwe.org"; target="_blank">Market</a>
-              </li>
-            </ul>
-        </li>
-        <li>
-          <a href="https://github.com/apache/incubator-weex/"; target="_blank">
-            GitHub
-          </a>
-        </li>
-      </ul>
-    
-    <a class="btn-close-sidebar iconfont  icon-close"></a>
-  </div>
-</div>
-
-  <div class="article-wrapper page-layout">
-  <div class="doc-nav">
-    
-
-
-<div class="summary">
-  <h2 class="part-title">
-    
-      高阶知识
-    
-  </h2>
-  <ul class="doc-summary">
-    
-    
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-   
-    
-      <li>
-        <h3 class="chapter-title"><a href="/cn/v-0.10/advanced/index.html" 
class="sidebar-link  ">Weex 工作原理</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/how-data-binding-works.html" class="sidebar-link  
">数据绑定原理</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/create-a-weex-project.html" class="sidebar-link  
">如何创建一个 Weex 项目</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-android.html" class="sidebar-link  
">集成到 Android</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-ios.html" class="sidebar-link  
">集成到 iOS</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-html5.html" class="sidebar-link  
">集成到 web</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/customize-a-native-component.html" 
class="sidebar-link  ">自定义 native 组件</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/cuszomize-native-apis.html" class="sidebar-link  
">自定义 native API</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-android.html" class="sidebar-link  
">Android 扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-ios.html" class="sidebar-link  ">iOS 
扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-html5.html" class="sidebar-link current 
">weex-html5 扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-devtools-to-android.html" 
class="sidebar-link  ">集成 Devtools 到 Android</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-devtools-to-ios.html" class="sidebar-link  
">集成 Devtools 到 iOS</a></h3>
-        
-      </li>
-    
-    
-    
-  </ul>
-</div>
-  </div>
-  
-
-<article class="article article-type-advanced">
-  <div class="article-entry" itemprop="articleBody">
-    <header class="article-header">
-  
-    
-      <h1 class="article-title" itemprop="name">
-        weex-html5 扩展
-      </h1>
-    
-  
-  <time class="article-date" datetime="2017-04-28T02:36:21.000Z">Updated time: 
28/04/2017</time>
-</header>
-    <h1 id="扩展-weex-html5"><a href="#扩展-weex-html5" class="headerlink" 
title="扩展 weex-html5"></a>扩展 weex-html5</h1><h3 id="简介"><a 
href="#简介" class="headerlink" title="简介"></a>简介</h3><p>Weex 
是一个高可扩展性的跨平台动态化开发方案,你
可以在现有组件基础上定制自己需要的三端组件。你可以为 
Weex API 模块添加新的方法,或者创建新的 API 模块和新的加
载器。按照以下几个步骤扩展你的组件,API 或者加载器。</p>
-<p>首先要明确的是,组件和 API 模块是基于 Weex 
的扩展,但是独立于 Weex,组件的定义本身是不需要依赖于 
Weex 的,这æ 
·æœ‰åŠ©äºŽç»„件的分散化管理,去除中心化依赖。</p>
-<p>其次,当你扩展一个组件,你
需要同时扩展三端的组件(android, ios 和 web 端),毕竟 Weex 
是一个重视三端一致体验的跨平台移动框架。你
可以一个端一个端的扩展,也可以召唤其他端上的开发者来å…
±åŒå®Œæˆä½ åœ¨å…¶ä»–端上的组件(你
总是可以在社区找到对某个功能有共同需求的开发者
)。这里有一些在 <a href="./extend-to-android.md">android 端</a>和 <a 
href="./extend-to-ios.md">ios 端</a>做扩展的文档可以参考。</p>
-<p>你应该将你的扩展发布到 Weex 开发者
可以方便找到和使用的渠道,比如 <code>npm</code>。我们推荐你
将你开发的组件发布到 <code>npm</code> 供其他 Weex 开发者
使用。</p>
-<p>最重要的是,你的组件的命名需要遵守 Weex 
组件命名规范:以 <code>weex-</code> 
开头作为组件的前缀,并且以 <code>-&lt;platform&gt;</code> 
做为结尾后缀,除非你发布的包是三端的实现都包含在内
的。这里有个 <a href="https://github.com/MrRaindrop/weex-hello-web"; 
target="_blank" rel="external"><code>&lt;weex-hello-web</code>&gt;</a> 
的例子作为参考,这里注册了一个简单的自定义的组件。</p>
-<h3 id="创建新组件"><a href="#创建新组件" class="headerlink" 
title="创建新组件"></a>创建新组件</h3><p>步骤:</p>
-<ol>
-<li>在你的组件实现中必须继承 <code>Weex.Component</code> 
这个类, 并选择性的重写其中的一些方法。</li>
-<li>你的组件的 exports 需要暴露一个 <code>init</code> 
方法,并在其中使用 <code>Weex.registerComponent</code> 注册你
的组件。</li>
-</ol>
-<p><strong>这里用一个例子展示如何扩展一个新的组件</strong></p>
-<p>看这个组件扩展的代码( web 端上的组件):</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">const</span> attr = &#123;</div><div 
class="line">  <span class="comment">// ...</span></div><div 
class="line">&#125;</div><div class="line"><span class="keyword">const</span> 
style = &#123;</div><div class="line">  <span class="comment">// 
...</span></div><div class="line">&#125;</div><div class="line"><span 
class="keyword">const</span> event = &#123;</div><div class="line">  <span 
class="comment">// ...</span></div><div class="line">&#125;</div><div 
class="line"><span class="comment">// 
每个扩展组件都需要实现一个init方法,Weex会通过这方法进行安è£
…和注册.</span></div><div class="line"><span class="function"><span 
class="keyword">function</span> <span class="title">init</span> (<span 
class="params">Weex</span>) </span>&#123;</div><div class="line">  <span 
class="keyword">const</span> Component = Weex.Component</div><div class="line"> 
 <span class=
 "keyword">const</span> extend = Weex.utils.extend</div><div 
class="line"></div><div class="line">  <span class="comment">// 组件的构造
函数</span></div><div class="line">  <span class="function"><span 
class="keyword">function</span> <span class="title">Hello</span> (<span 
class="params">data</span>) </span>&#123;</div><div class="line">    
Component.call(<span class="keyword">this</span>, data)</div><div class="line"> 
 &#125;</div><div class="line"></div><div class="line">  <span 
class="comment">// prototype继承</span></div><div class="line">  
Hello.prototype = <span 
class="built_in">Object</span>.create(Component.prototype)</div><div 
class="line">  extend(Hello.prototype, proto)</div><div class="line"></div><div 
class="line">  <span class="comment">// 配置属性、æ 
·å¼ä»¥åŠäº‹ä»¶</span></div><div class="line">  extend(Hello.prototype, &#123; 
attr &#125;)</div><div class="line">  extend(Hello.prototype, &#123;</div><div 
class="line">    <span class="attr">style</span>: 
 extend(<span class="built_in">Object</span>.create(Component.prototype.style), 
style)</div><div class="line">  &#125;)</div><div class="line">  
extend(Hello.prototype, &#123; event &#125;)</div><div class="line"></div><div 
class="line">  Weex.registerComponent(<span class="string">'weex-hello'</span>, 
Hello)</div><div class="line">&#125;</div><div class="line"></div><div 
class="line"><span class="comment">// 暴露init方法接口.</span></div><div 
class="line"><span class="keyword">export</span> <span 
class="keyword">default</span> &#123; init 
&#125;</div></pre></td></tr></table></figure>
-<p>上述代码摘引自 <a 
href="https://github.com/MrRaindrop/weex-hello-web/blob/master/src/index.js#L46-L65";
 target="_blank" rel="external">weex-hello-web/src/index.js</a></p>
-<p>这个demo重写了基类 
<code>Component</code>中的<code>create</code>方法。你
也可以选择重写<code>Component</code>中的一些å…
¶ä»–方法来定制组件的行为。典型的方法包括:</p>
-<ul>
-<li><code>create</code>: 
创建组件的节点,在方法体中return这个节点.</li>
-<li><code>createChildren</code> 创建子节点.</li>
-<li><code>insertBefore</code> 在某个子节点之前插å…
¥ä¸€ä¸ªæ–°çš„子节点.</li>
-<li><code>appendChild</code> 在子节点列表的最后加
上一个节点.</li>
-<li><code>removeChild</code> 移除一个子节点.</li>
-</ul>
-<p><strong>进阶</strong>:更多关于组件定制和扩展的细节和代ç 
å±•ç¤ºï¼Œå¯ä»¥å‚考 <a 
href="https://github.com/apache/incubator-weex/tree/dev/html5"; target="_blank" 
rel="external">weex 主仓库的代ç 
</a>,这里的组件基本上都是通过上述方式进行定义的。</p>
-<p>重要的一点,注册组件的关键方法是 
<code>Weex.registerComponent</code>,如示例里的 <code>weex-hello</code> 
组件的注册:</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line">Weex.registerComponent(<span class="string">'weex-hello'</span>, 
Hello)</div></pre></td></tr></table></figure>
-<p>上述代码引自 <a 
href="https://github.com/MrRaindrop/weex-hello-web/blob/master/src/index.js#L62";
 target="_blank" rel="external">weex-hello-web/src/index.js</a></p>
-<p>在某个需要使用该组件的weex项目中使用 
<code>Weex.install</code> 方法安装该组件:</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line"><span class="comment">// import the original 
weex-html5.</span></div><div class="line"><span class="keyword">import</span> 
weex <span class="keyword">from</span> <span 
class="string">'weex-html5'</span></div><div class="line"><span 
class="keyword">import</span> hello <span class="keyword">from</span> <span 
class="string">'weex-hello-web'</span></div><div class="line"><span 
class="comment">// install the component.</span></div><div 
class="line">weex.install(hello)</div></pre></td></tr></table></figure>
-<p>上述代码引自 <a 
href="https://github.com/MrRaindrop/weex_extend_demo/blob/master/src/main.js#L1-L5";
 target="_blank" rel="external">weex_extend_demo/src/main.js</a></p>
-<p>在你的 <code>.we</code> 文件中直接使用这个组件:</p>
-<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>&gt;</span></div><div 
class="line">    <span class="tag">&lt;<span class="name">weex-hello</span> 
<span class="attr">class</span>=<span class="string">"hello"</span> <span 
class="attr">style</span>=<span 
class="string">"txt-color:#fff;bg-color:green"</span></span></div><div 
class="line">      <span class="attr">value</span>=<span 
class="string">"WEEX"</span> <span class="attr">onclick</span>=<span 
class="string">"handleClick"</span>&gt;</div><div class="line">    <span 
class="tag">&lt;/<span class="name">weex-hello</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></pre></td></tr></table></figure>
-<p>上述代码引自<a 
href="https://github.com/MrRaindrop/weex_extend_demo/blob/master/demo/index.we#L10-L15";
 target="_blank" rel="external">weex_extend_demo/demo/index.we</a></p>
-<h3 id="扩展API"><a href="#扩展API" class="headerlink" 
title="扩展API"></a>扩展API</h3><p>你可以扩展新的 API 模块,或者
为某个已有的模块添加新的 API. 比如,你可以添加一个 API 
模块叫做 <code>user</code>,在里面添加
一些用户登录登出处理的 API,比如 <code>login</code>, 
<code>logout</code> 等等。你可以通过 
<code>require(&#39;@weex-module/moduleName)[methodName](arg1, arg2, ...)</code> 
(<a href="../references/api.md">Module APIs</a>) 的方式调用你的 API.</p>
-<p>步骤:</p>
-<ol>
-<li>实现你的 API module.</li>
-<li>在你的 API 安装模块里暴露一个 <code>init</code> 
方法,并在这个方法里面使用 <code>Weex.registerAPIModules</code> 
注册你的 API module.</li>
-</ol>
-<p><strong>这里用一个例子展示如何扩展一个新的 API 
模块</strong></p>
-<p>创建一个文件 <code>user.js</code>,在其中定义登录登出 
<code>login/logout</code> 方法.</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">const</span> user = &#123;</div><div 
class="line">  <span class="comment">// 
定义用户登录方法.</span></div><div class="line">  login (callbackId) 
&#123;</div><div class="line">    login.then(<span class="function"><span 
class="params">res</span> =&gt;</span> &#123;</div><div class="line">      
<span class="keyword">this</span>.sender.performCallback(callbackId, 
res)</div><div class="line">    &#125;).catch(<span class="function"><span 
class="params">err</span> =&gt;</span> &#123;</div><div class="line">      
<span class="keyword">this</span>.sender.performCallback(callbackId, 
err)</div><div class="line">    &#125;)</div><div class="line">  
&#125;,</div><div class="line"></div><div class="line">  <span 
class="comment">// 定义用户登出方法.</span></div><div class="line">  
logout (callbackId) &#123;</div><div class="line">    logout.then(<span 
class="function"><s
 pan class="params">res</span> =&gt;</span> &#123;</div><div class="line">      
<span class="keyword">this</span>.sender.performCallback(callbackId, 
res)</div><div class="line">    &#125;).catch(<span class="function"><span 
class="params">err</span> =&gt;</span> &#123;</div><div class="line">      
<span class="keyword">this</span>.sender.performCallback(callbackId, 
err)</div><div class="line">    &#125;)</div><div class="line">  
&#125;</div><div class="line">&#125;</div><div class="line"></div><div 
class="line"><span class="comment">// 定义user模块的元 (meta) 
信息.</span></div><div class="line"><span class="keyword">const</span> meta = 
&#123;</div><div class="line">  <span class="attr">user</span>: 
[&#123;</div><div class="line">    <span class="attr">name</span>: <span 
class="string">'login'</span>,</div><div class="line">    <span 
class="attr">args</span>: [<span class="string">'function'</span>]</div><div 
class="line">  &#125;, &#123;</div><div class="line">    <span class
 ="attr">name</span>: <span class="string">'logout'</span>,</div><div 
class="line">    <span class="attr">args</span>: [<span 
class="string">'function'</span>]</div><div class="line">  &#125;]</div><div 
class="line">&#125;</div><div class="line"></div><div class="line"><span 
class="keyword">export</span> <span class="keyword">default</span> 
&#123;</div><div class="line">  init (Weex) &#123;</div><div class="line">    
<span class="comment">// 注册这个模块,最后一个参数是模块的å…
ƒä¿¡æ¯.</span></div><div class="line">    Weex.registerApiModule(<span 
class="string">'user'</span>, user, meta)</div><div class="line">  
&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
-<p>这个简单的 user helper 模块就实现好了,可以发布到 npm 
上,我们可以给这个模块取个名字,比如说 
<code>weex-user-helper</code>。</p>
-<p>在你的新的 Weex 项目里安装这个模块:</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">import</span> Weex <span 
class="keyword">from</span> <span class="string">'weex-html5'</span></div><div 
class="line"><span class="keyword">import</span> user <span 
class="keyword">from</span> <span 
class="string">'weex-user-helper'</span></div><div class="line"></div><div 
class="line">Weex.install(user)</div></pre></td></tr></table></figure>
-<p>安装了这个模块,你就可以在 DSL 代ç 
é‡Œå¼•ç”¨è¿™ä¸ªæ¨¡å—干点事情了:</p>
-<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>&gt;</span></div><div 
class="line">    <span class="tag">&lt;<span class="name">div</span> <span 
class="attr">class</span>=<span class="string">"btn"</span> <span 
class="attr">onclick</span>=<span 
class="string">"handleClick"</span>&gt;</span></div><div class="line">      
<span class="tag">&lt;<span class="name">text</span>&gt;</span>LOGIN<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">scrip
 t</span>&gt;</span><span class="javascript"></span></div><div class="line">  
<span class="keyword">var</span> userHelper = <span 
class="built_in">require</span>(<span 
class="string">'@weex-module/user'</span>)</div><div class="line">  <span 
class="built_in">module</span>.exports = &#123;</div><div class="line">    
<span class="attr">methods</span>: &#123;</div><div class="line">      <span 
class="attr">handleClick</span>: <span class="function"><span 
class="keyword">function</span> (<span class="params"></span>) 
</span>&#123;</div><div class="line">        userHelper.login(<span 
class="function"><span class="keyword">function</span> (<span 
class="params"></span>) </span>&#123;</div><div class="line">          <span 
class="comment">// ... do sth. in callback.</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"><span 
class="tag">&lt;/<span class="name">script</span>&g
 t;</span></div></pre></td></tr></table></figure>
-<h3 id="定制加载器loader"><a href="#定制加载器loader" 
class="headerlink" title="定制加载器loader"></a>定制加
载器loader</h3><p><strong>Loader仅用于weex-html5 (web端)加载dsl打包
出来的bundle代码,native平台有其他的加载机制</strong></p>
-<p>已有的加载器包括 <code>xhr</code>, <code>jsonp</code> 和 
<code>source</code>. 你可以使用 <code>weex.registerLoader</code> 
注册一个新的加载器。例如,你有一个获取 Weex bundle 的服务 
<code>myServe.getWeexBundle</code> , 通过这个服务可以加载 weex 
bundle,为此你可以定义一个加载器:</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line"><span class="function"><span class="keyword">function</span> <span 
class="title">loadByMyServe</span>(<span class="params">pageId, 
callback</span>) </span>&#123;</div><div class="line">  
myServe.getWeexBundle(pageId).then(<span class="function"><span 
class="keyword">function</span> (<span class="params">bundle</span>) 
</span>&#123;</div><div class="line">    callback(bundle)</div><div 
class="line">  &#125;).catch(<span class="function"><span 
class="keyword">function</span>(<span class="params">err</span>) 
</span>&#123;</div><div class="line">    callback(err)</div><div class="line">  
&#125;)</div><div class="line">&#125;</div><div class="line"></div><div 
class="line"><span class="comment">// 暴露init方法用于Weex安装此加
载器.</span></div><div class="line"><span class="keyword">export</span> <span 
class="keyword">default</span> &#123;</div><div class="line">  init (Weex) 
&#123;</div><di
 v class="line">    Weex.registerLoader(<span class="string">'myserve'</span>, 
loadByMyServe)</div><div class="line">  &#125;</div><div 
class="line">&#125;</div></pre></td></tr></table></figure>
-<p>在你的 weex-html5 项目的启动文件里安装并使用这个加
载器:</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">import</span> Weex <span 
class="keyword">from</span> <span class="string">'weex-html5'</span></div><div 
class="line"></div><div class="line"><span class="comment">// 或者import from 
'./myserve.js',不管是import一个npm模块还是import一个文件.</span></div><div
 class="line"><span class="keyword">import</span> loader <span 
class="keyword">from</span> <span class="string">'myLoader'</span></div><div 
class="line"></div><div class="line">Weex.install(loader)</div><div 
class="line"></div><div class="line"><span class="comment">// 
在init方法里使用这个加载器加载bundle文件.</span></div><div 
class="line">(<span class="function"><span class="keyword">function</span> 
(<span class="params"></span>) </span>&#123;</div><div class="line">  <span 
class="function"><span class="keyword">function</span> <span 
class="title">getUrlParam</span> (<span class="params">key
 </span>) </span>&#123;</div><div class="line">    <span 
class="keyword">const</span> reg = <span class="keyword">new</span> <span 
class="built_in">RegExp</span>(<span class="string">'[?|&amp;]'</span> + key + 
<span class="string">'=([^&amp;]+)'</span>)</div><div class="line">    <span 
class="keyword">const</span> match = location.search.match(reg)</div><div 
class="line">    <span class="keyword">return</span> match &amp;&amp; 
match[<span class="number">1</span>]</div><div class="line">  &#125;</div><div 
class="line">  <span class="keyword">const</span> page = getUrlParam(<span 
class="string">'page'</span>) || <span 
class="string">'examples/build/index.js'</span></div><div class="line">  
Weex.init(&#123;</div><div class="line">    <span class="attr">appId</span>: 
location.href,</div><div class="line">    <span class="attr">loader</span>: 
<span class="string">'myserve'</span>,  <span class="comment">// 
使用刚才定义的loader类型</span></div><div class="line">    source: 
page,</
 div><div class="line">    <span class="attr">rootId</span>: <span 
class="string">'weex'</span></div><div class="line">  &#125;)</div><div 
class="line">&#125;)();</div></pre></td></tr></table></figure>
-<p>以上是 Weex 
带来的扩展性里比较主要的一部分,更多实现细节可以在 <a 
href="https://github.com/alibaba/weex"; target="_blank" rel="external">weex 
项目代码库</a>以及 weex 的开源社区里找到。</p>
-
-  </div>
-  
-</article>
-</div>
-  
-  <footer id="footer">
-  <div class="row clearfix">
-    <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="/v-0.10/advanced/extend-to-html5.html" 
data-lang="en">English</a>
-        </li>
-        <li>
-          <a href="/cn/v-0.10/advanced/extend-to-html5.html" 
data-lang="zh-cn">中文</a>
-        </li>
-      </ul>
-    </div>
-  </div>
-  <div class="disclaimer">
-    <div><img 
src="//gw.alicdn.com/tfs/TB1pTBZQFXXXXX9XXXXXXXXXXXX-794-280.png" width="200px" 
alt="Apache Incubator"></div>
-    <div><span class="title">Disclaimer:</span> Apache Weex is an effort 
undergoing incubation at The Apache Software Foundation (ASF), sponsored by the 
Apache Incubator. Incubation is required of all newly accepted projects until a 
further review indicates that the infrastructure, communications, and decision 
making process have stabilized in a manner consistent with other successful ASF 
projects. While incubation status is not necessarily a reflection of the 
completeness or stability of the code, it does indicate that the project has 
yet to be fully endorsed by the ASF.</div>
-    <br/>
-  </div>
-  <hr>
-  <div class="row">
-    <p> <img src="//gw.alicdn.com/tfs/TB1bg8SQFXXXXcHXXXXXXXXXXXX-85-170.png" 
height="50px" alt="Apache"><span>Copyright(c) 2017 The Apache Software 
Foundation. Licensed under the </span> <a 
href="http://www.apache.org/licenses/LICENSE-2.0";>Apache License, Version 
2.0</a></p>
-  </div>
-  <div class="row clearfix">
-    <div></div>
-  </div>
-</footer>
-  <div style="display: none;">
-  <script src="//s95.cnzz.com/z_stat.php?id=1261496509&web_id=1261496509" 
language="JavaScript"></script>
-</div>
-
-  <script src="/js/reqwest.js"></script>
-  <script src="/js/common.js"></script>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/f3d58bd0/cn/v-0.10/advanced/extend-to-ios.html
----------------------------------------------------------------------
diff --git a/cn/v-0.10/advanced/extend-to-ios.html 
b/cn/v-0.10/advanced/extend-to-ios.html
deleted file mode 100644
index 7ac541a..0000000
--- a/cn/v-0.10/advanced/extend-to-ios.html
+++ /dev/null
@@ -1,473 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  
-  <title>iOS 扩展 | Weex</title>
-  <meta name="viewport" content="width=device-width, initial-scale=1, 
maximum-scale=1">
-  <meta name="description" content="iOS 扩展Module 扩展swift 扩展 module 
 Weex SDK 只提供渲染,而不是其他的能力,如果你需要 
像网络,图片,URL跳转这些特性,需要自己动手实现他们例如,如果ä½
 æƒ³å®žçŽ°ä¸€ä¸ªurl地址跳转函数,你可以按照如下步骤实现一个 
Module  自定义module的步骤  自定义的module类 必须实现 
WXModuleProtocol 必须添加宏WX_EXPORT_METHO">
-<meta property="og:type" content="website">
-<meta property="og:title" content="iOS 扩展">
-<meta property="og:url" 
content="https://weex-project.io/cn/v-0.10/advanced/extend-to-ios.html";>
-<meta property="og:site_name" content="Weex">
-<meta property="og:description" content="iOS 扩展Module 扩展swift 扩展 
module  Weex SDK 只提供渲染,而不是其他的能力,如果你需要 
像网络,图片,URL跳转这些特性,需要自己动手实现他们例如,如果ä½
 æƒ³å®žçŽ°ä¸€ä¸ªurl地址跳转函数,你可以按照如下步骤实现一个 
Module  自定义module的步骤  自定义的module类 必须实现 
WXModuleProtocol 必须添加宏WX_EXPORT_METHO">
-<meta property="og:updated_time" content="2017-04-28T02:36:21.000Z">
-<meta name="twitter:card" content="summary">
-<meta name="twitter:title" content="iOS 扩展">
-<meta name="twitter:description" content="iOS 扩展Module 扩展swift 扩展 
module  Weex SDK 只提供渲染,而不是其他的能力,如果你需要 
像网络,图片,URL跳转这些特性,需要自己动手实现他们例如,如果ä½
 æƒ³å®žçŽ°ä¸€ä¸ªurl地址跳转函数,你可以按照如下步骤实现一个 
Module  自定义module的步骤  自定义的module类 必须实现 
WXModuleProtocol 必须添加宏WX_EXPORT_METHO">
-  
-    <link rel="alternate" href="/atom.xml" title="Weex" 
type="application/atom+xml">
-  
-  
-    <link rel="icon" 
href="//gw.alicdn.com/tps/TB1XNqxPXXXXXcSXVXXXXXXXXXX-64-63.png">
-  
-  
-    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" 
rel="stylesheet" type="text/css">
-  
-  <link rel="stylesheet" href="/css/style.css">
-  <link rel="stylesheet" href="/css/swiper.min.css">
-</head>
-
-<body id="advanced" class="lang-cn">
-  
-  <script>
-    window.PAGE_TYPE = "advanced";
-    window.ROOT = "/"
-  </script>
-  <header id="header">
-  <div class="navbar">
-    <a id="logo" href="/cn/">
-      <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" />
-    </a>
-    <div class="main-nav">
-      <ul class="links">
-        <li><a href="/cn/guide">教程</a></li>
-        <li><a href="/cn/references">手册</a></li>
-        <li class="dropdown">
-          <a href="javascript:;">参考</a>
-          <ul class="dropdown-menu subnav">
-            <li>
-              <a href="/cn/faq.html">FAQ</a>
-            </li>
-            <li>
-              <a href="/cn/releasenote.html">版本说明</a>
-            </li>
-          </ul>
-        </li>
-        <li class="dropdown">
-            <a href="javascript:;">工具和服务</a>
-            <ul class="dropdown-menu subnav">
-              <li>
-                <a href="/cn/playground.html">Playground</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/toolkit.html">Weex-toolkit</a>
-              </li>
-              <li>
-                <a href="http://dotwe.org"; target="_blank">Code Snippets</a>
-              </li>
-              <li>
-                <a href="https://market.dotwe.org"; target="_blank">Market</a>
-              </li>
-            </ul>
-        </li>
-      </ul>
-      <ul class="info">
-        <li><a href="https://github.com/apache/incubator-weex/"; 
target="_blank"><span class="btn-github iconfont icon-github"></span></a></li>
-      </ul>
-      <ul class="tools">
-        <li>
-          <div class="search">
-  <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <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="/v-0.10/advanced/extend-to-ios.html" 
data-lang="en">English</a>
-              </li>
-              <li>
-                <a href="/cn/v-0.10/advanced/extend-to-ios.html" 
data-lang="zh-cn">中文</a>
-              </li>
-            </ul>
-          </div>
-        </li>
-        <!--<li></li>-->
-      </ul>
-    </div>
-  </div>
-  <div id="mobile-nav">
-    <a id="logo" href="/cn/">
-      <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" />
-    </a>
-    <a class="btn-menu"><span class="iconfont icon-nav"></span></a>
-  </div>
-</header>
-
-  <div id="sidebar" class="">
-  <div class="sidebar-menu">
-    
-      <ul class="main-nav">
-        <li>
-          <div class="search">
-  <form id="search-form" class="search-form"> <!-- 搜索框相关 -->
-    <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">
-  </div>
-</div>
-        </li>
-        <li>
-          <a class="" href="/cn/guide">
-            教程
-          </a>
-        </li>
-        <li>
-          <a class="" href="/cn/references">
-            手册
-          </a>
-        </li>
-        <li>
-          <a href="/cn/faq.html">
-            FAQ
-          </a>
-        </li>
-        <li>
-            <p>工具和服务</p>
-            <ul class="subnav">
-              <li>
-                <a href="/cn/playground.html">Playground</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/devtools.html">Devtools</a>
-              </li>
-              <li>
-                <a href="/cn/guide/tools/weexpack.html">Weexpack</a>
-              </li>
-              <li>
-                <a href="http://dotwe.org"; target="_blank">Snippets</a>
-              </li>
-              <li>
-                <a href="https://market.dotwe.org"; target="_blank">Market</a>
-              </li>
-            </ul>
-        </li>
-        <li>
-          <a href="https://github.com/apache/incubator-weex/"; target="_blank">
-            GitHub
-          </a>
-        </li>
-      </ul>
-    
-    <a class="btn-close-sidebar iconfont  icon-close"></a>
-  </div>
-</div>
-
-  <div class="article-wrapper page-layout">
-  <div class="doc-nav">
-    
-
-
-<div class="summary">
-  <h2 class="part-title">
-    
-      高阶知识
-    
-  </h2>
-  <ul class="doc-summary">
-    
-    
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-      
-      
-        
-      
-    
-   
-    
-      <li>
-        <h3 class="chapter-title"><a href="/cn/v-0.10/advanced/index.html" 
class="sidebar-link  ">Weex 工作原理</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/how-data-binding-works.html" class="sidebar-link  
">数据绑定原理</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/create-a-weex-project.html" class="sidebar-link  
">如何创建一个 Weex 项目</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-android.html" class="sidebar-link  
">集成到 Android</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-ios.html" class="sidebar-link  
">集成到 iOS</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-to-html5.html" class="sidebar-link  
">集成到 web</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/customize-a-native-component.html" 
class="sidebar-link  ">自定义 native 组件</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/cuszomize-native-apis.html" class="sidebar-link  
">自定义 native API</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-android.html" class="sidebar-link  
">Android 扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-ios.html" class="sidebar-link current ">iOS 
扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/extend-to-html5.html" class="sidebar-link  
">weex-html5 扩展</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-devtools-to-android.html" 
class="sidebar-link  ">集成 Devtools 到 Android</a></h3>
-        
-      </li>
-    
-      <li>
-        <h3 class="chapter-title"><a 
href="/cn/v-0.10/advanced/integrate-devtools-to-ios.html" class="sidebar-link  
">集成 Devtools 到 iOS</a></h3>
-        
-      </li>
-    
-    
-    
-  </ul>
-</div>
-  </div>
-  
-
-<article class="article article-type-advanced">
-  <div class="article-entry" itemprop="articleBody">
-    <header class="article-header">
-  
-    
-      <h1 class="article-title" itemprop="name">
-        iOS 扩展
-      </h1>
-    
-  
-  <time class="article-date" datetime="2017-04-28T02:36:21.000Z">Updated time: 
28/04/2017</time>
-</header>
-    <h2 id="iOS-扩展"><a href="#iOS-扩展" class="headerlink" title="iOS 
扩展"></a>iOS 扩展</h2><h3 id="Module-扩展"><a href="#Module-扩展" 
class="headerlink" title="Module 扩展"></a>Module 扩展</h3><p><a 
href="https://github.com/weexteam/article/issues/55"; target="_blank" 
rel="external">swift</a> 扩展 module </p>
-<p>Weex SDK 只提供渲染,而不是其他的能力,如果你需要 
像网络,图片,URL跳转这些特性,需要自己动手实现他们<br>例如,如果ä½
 æƒ³å®žçŽ°ä¸€ä¸ªurl地址跳转函数,你可以按照如下步骤实现一个 
Module</p>
-<ol>
-<li><p><strong>自定义module的步骤</strong></p>
-<ol>
-<li>自定义的module类 必须实现 <code>WXModuleProtocol</code></li>
-<li>必须添加宏<code>WX_EXPORT_METHOD</code>, 
它可以被weex识别,它的参数是 JavaScript调用 
module指定方法的参数</li>
-<li>添加<code>@synthesized 
weexInstance</code>,每个moudle对象被绑定到一个指定的实例上</li>
-<li>Module 
方法会在UI线程中被调用,所以不要做太多耗时的任务在这里,如果要在å
…¶ä»–线程执行整个module 
方法,需要实现<code>WXModuleProtocol</code>中<code>- (NSThread 
*)targetExecuteThread</code>的方法,这æ 
·ï¼Œåˆ†å‘到这个module的任务会在指定的线程中运行</li>
-<li>Weex 的参数可以是 String 或者Map</li>
-<li><p>Module 支持返回值给 
JavaScript中的回调,回调的类型是<code>WXModuleCallback</code>,回调的参数可以是String或è€
…Map</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">@implementation WXEventModule</div><div class="line">@synthesize 
weexInstance;</div><div class="line">   
WX_EXPORT_METHOD(@selector(openURL:callback))</div><div class="line">- 
(void)openURL:(NSString *)url callback:(WXModuleCallback)callback</div><div 
class="line">&#123;</div><div class="line">    NSString *newURL = 
url;</div><div class="line">    if ([url hasPrefix:@&quot;//&quot;]) 
&#123;</div><div class="line">        newURL = [NSString 
stringWithFormat:@&quot;http:%@&quot;, url];</div><div class="line">    &#125; 
else if (![url hasPrefix:@&quot;http&quot;]) &#123;</div><div class="line">     
  newURL = [NSURL URLWithString:url 
relativeToURL:weexInstance.scriptURL].absoluteString;</div><div class="line">   
 &#125;</div><div class="line"></div><div class="line">    UIViewController 
*controller = [[WXDemoViewController alloc] init];</div><div class="line">    
((WXDemoViewController *)controller).url 
 = [NSURL URLWithString:newURL];</div><div class="line"></div><div 
class="line">    [[weexInstance.viewController navigationController] 
pushViewController:controller animated:YES];</div><div class="line">    
callback(@&#123;@&quot;result&quot;:@&quot;success&quot;&#125;);</div><div 
class="line">&#125;</div><div class="line"></div><div 
class="line">@end</div></pre></td></tr></table></figure>
-</li>
-</ol>
-</li>
-<li><p><strong>Register the module</strong><br>通过调用 WXSDKEngine 中的 
<code>registerModule:withClass</code>方法来注册自己的module</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">WXSDKEngine.h</div><div class="line">/**</div><div class="line">*  
@abstract Registers a module for a given name</div><div class="line">*  @param 
name The module name to register</div><div class="line">*  @param clazz  The 
module class to register</div><div class="line">**/</div><div class="line">+ 
(void)registerModule:(NSString *)name withClass:(Class)clazz;</div><div 
class="line">[WXSDKEngine registerModule:@&quot;event&quot; 
withClass:[WXEventModule class]];</div></pre></td></tr></table></figure>
-</li>
-<li><p><strong>使用自己的module</strong><br> 这里的  require 
里面的event 就是在 上一步调用<code>registerModule:</code> 
注册module 时候的name</p>
-<figure class="highlight javascript"><table><tr><td class="code"><pre><div 
class="line"><span class="keyword">var</span> eventModule = <span 
class="built_in">require</span>(<span 
class="string">'@weex-module/event'</span>); </div><div 
class="line">eventModule.openURL(<span class="string">'url'</span>,<span 
class="function"><span class="keyword">function</span>(<span 
class="params">ret</span>) </span>&#123;   </div><div class="line">    
nativeLog(ret);</div><div 
class="line">&#125;);</div></pre></td></tr></table></figure>
-</li>
-</ol>
-<p>   Weex SDK没有 图片下载,navigation 
操作的能力,请大家自己实现这些 protocol</p>
-<h3 id="handler-扩展"><a href="#handler-扩展" class="headerlink" 
title="handler 扩展"></a>handler 扩展</h3><p>   
<strong>WXImgLoaderProtocol</strong>  </p>
-<p>   weexSDK 没有提供图片下载的能力,需要实现 
WXImgLoaderProtocol,参考下面的例子</p>
-   <figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">WXImageLoaderProtocol.h</div><div class="line">@protocol 
WXImgLoaderProtocol &lt;WXModuleProtocol&gt;</div><div 
class="line">/**</div><div class="line"> * @abstract Creates a image download 
handler with a given URL</div><div class="line"> * @param imageUrl The URL of 
the image to download</div><div class="line"> * @param imageFrame  The frame of 
the image you want to set</div><div class="line"> * @param options : The 
options to be used for this download</div><div class="line"> * @param 
completedBlock : A block called once the download is completed.</div><div 
class="line">   image : the image which has been download to local.</div><div 
class="line">   error : the error which has happened in download.</div><div 
class="line">   finished : a Boolean value indicating whether download action 
has finished.</div><div class="line">*/</div><div 
class="line">-(id&lt;WXImageOperationProtocol&gt;)downloadImageW
 ithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary 
*)options completed:(void(^)(UIImage *image,  NSError *error, BOOL 
finished))completedBlock;</div><div 
class="line">@end</div></pre></td></tr></table></figure>
-<p>   实现上述协议  </p>
-   <figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">@implementation WXImgLoaderDefaultImpl</div><div 
class="line">#pragma mark -</div><div class="line">#pragma mark 
WXImgLoaderProtocol</div><div class="line"></div><div class="line">- 
(id&lt;WXImageOperationProtocol&gt;)downloadImageWithURL:(NSString *)url 
imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo 
completed:(void(^)(UIImage *image,  NSError *error, BOOL 
finished))completedBlock</div><div class="line">&#123;</div><div class="line">  
  if ([url hasPrefix:@&quot;//&quot;]) &#123;</div><div class="line">        
url = [@&quot;http:&quot; stringByAppendingString:url];</div><div class="line"> 
   &#125;</div><div class="line">    return 
(id&lt;WXImageOperationProtocol&gt;)[[SDWebImageManager sharedManager] 
downloadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger 
receivedSize, NSInteger expectedSize) &#123;     </div><div class="line">    
&#125; completed:^(UIImage *
 image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL 
*imageURL) &#123;</div><div class="line">    if (completedBlock) 
&#123;</div><div class="line">        completedBlock(image, error, 
finished);</div><div class="line">    &#125;</div><div class="line">    
&#125;];</div><div class="line">&#125;</div><div 
class="line">@end</div></pre></td></tr></table></figure>
-<ol>
-<li><p><strong>handler注册</strong> </p>
-<p>你可以通过WXSDKEngine 中的 
<code>registerHandler:withProtocol</code>注册handler</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">WXSDKEngine.h</div><div class="line">/**</div><div class="line">* 
@abstract Registers a handler for a given handler instance and specific 
protocol</div><div class="line">* @param handler The handler instance to 
register</div><div class="line">* @param protocol The protocol to 
confirm</div><div class="line">*/</div><div class="line">+ 
(void)registerHandler:(id)handler withProtocol:(Protocol *)protocol;</div><div 
class="line"></div><div class="line">[WXSDKEngine 
registerHandler:[WXImgLoaderDefaultImpl new] 
withProtocol:@protocol(WXImgLoaderProtocol)]</div></pre></td></tr></table></figure>
-</li>
-</ol>
-<h4 id="Component-扩展"><a href="#Component-扩展" class="headerlink" 
title="Component 扩展"></a>Component 扩展</h4><p>   
虽然WeexSDK中有提供内
置的一些Component,但这有可能并不能满足你
的需求。在之前你可能已经写了一些很é…
·ç‚«native的组件,想包装一下,导入到Weex中,因
此我们提供了让开发者实现自己的native Component<br>   
下面将以WeexSDK 中已经存在的 
Component:<code>image</code>为例子,介绍一下如何构建一个native 
Component.<br>   假设你已经了解IOS开发  </p>
-<ol>
-<li>注册 Component<br>注册一个component比较简单,调用 
<code>WXSDKEngine</code> 中的 
<code>registerComponent:withClass:</code>方法,传入组件的æ 
‡ç­¾åç§°ï¼Œè¿˜æœ‰å¯¹åº”çš„class<br>然后你可以创建一个 
<code>WXImageComponent</code> 表示<code>image</code>组件的实现     
在.we 文件中,只需要写 <pre><code>&lt;image&gt;&lt;/image&gt;  
-</code></pre></li>
-<li><p>添加属性<br>现在我们要做一些让image component更加
强大的事情
。既然作为一个图片的component,那它应该要有源,给他加
上一个 <code>src</code>的属性,同时给它加
上一个<code>resize</code>的属性(可以é…
ç½®çš„有<code>contain/cover/stretch</code>)</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">@interface WXImageComponent ()</div><div class="line"></div><div 
class="line">@property (nonatomic, strong) NSString *imageSrc;</div><div 
class="line">@property (nonatomic, assign) UIViewContentMode 
resizeMode;</div><div class="line"></div><div 
class="line">@end</div></pre></td></tr></table></figure>
-<p>component中所有的style,attribute,events都会被传递到 
Component的初始化方法中,所以,你
可以在初始化方法中存储你感兴趣的一些属性值</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">@implementation WXImageComponent</div><div class="line"></div><div 
class="line">- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type 
styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes 
events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance</div><div 
class="line">&#123;</div><div class="line">    if (self = [super 
initWithRef:ref type:type styles:styles attributes:attributes events:events 
weexInstance:weexInstance]) &#123;</div><div class="line">        _imageSrc = 
[WXConvert NSString:attributes[@&quot;src&quot;]];</div><div class="line">      
  _resizeMode = [WXConvert 
UIViewContentMode:attributes[@&quot;resize&quot;]];</div><div 
class="line">&#125;</div><div class="line"></div><div class="line">    return 
self;</div><div class="line">&#125;</div><div class="line"></div><div 
class="line">@end</div></pre></td></tr></table></figure>
-</li>
-</ol>
-<p>   
attribute中拿到的值的类型都是<code>id</code>,我们可以用转换方法把它转换到任何值。Weex
 SDK提供了一些基础的转换方法,可以参考 
<code>WXConvert</code>类,或者你可以添加自己的转换函数</p>
-<ol>
-<li><p>Hooking 渲染生命周期<br>   native 的component 
是由Weex管理的,weex 
创建,布局,渲染,销毁。weex的component生命周期都是可以hook的,ä½
 å¯ä»¥åœ¨è¿™äº›ç”Ÿå‘½å‘¨æœŸä¸­åŽ»åšè‡ªå·±çš„事情</p>
-<p>| 方法 | 描述 |<br>| :-: | — |<br>| initWithRef:type:… | 
用给定的属性初始化一个component. |<br>| layoutDidFinish | 
在component完成布局时候会调用. |<br>| loadView | 
创建component管理的view. |<br>| viewWillLoad | 在component的view加
载之前会调用. |<br>| viewDidLoad | 在component的view加
载完之后调用. |<br>| viewWillUnload | 
在component的view被释放之前调用. |<br>| viewDidUnload | 
在component的view被释放之后调用. |<br>| updateStyles: | 
在component的style更新时候调用. |<br>| updateAttributes: | 
在component的attribute更新时候调用. |<br>| addEvent: | 
给component添加event的时候调用. |<br>| removeEvent: | 
在event移除的时候调用. |</p>
-<p>在image component的例子里面,如果我们需要我们自己的image 
view 的话,可以复写 <code>loadView</code>这个方法.</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">- (UIView *)loadView</div><div class="line">&#123;</div><div 
class="line">    return [[WXImageView alloc] init];</div><div 
class="line">&#125;</div></pre></td></tr></table></figure>
-</li>
-</ol>
-<p>   现在我们使用 <code>WXImageView</code> 渲染 <code>image</code> 
component。  </p>
-<ol>
-<li><p>作为一个image 
component,我们需要拿到服务器图片,而且把它设置进image view 
里. 这个操作可以在 <code>viewDidLoad</code> 
方法中做,这个方法是在view已经被创建而且加载了时候weex 
SDK会调用到,而且<code>viewDidLoad</code>这个方法是你
做额外初始化工作比如改变content mode(也就是设置resize) 
的最好时间.</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">- (void)viewDidLoad</div><div class="line">&#123;</div><div 
class="line">    UIImageView *imageView = (UIImageView *)self.view;</div><div 
class="line">    imageView.contentMode = _resizeMode;</div><div class="line">   
 imageView.userInteractionEnabled = YES;</div><div class="line">    
imageView.clipsToBounds = YES;</div><div class="line">    
imageView.exclusiveTouch = YES;</div><div class="line"></div><div class="line"> 
   // Do your image fetching and updating logic</div><div 
class="line">&#125;</div></pre></td></tr></table></figure>
-</li>
-</ol>
-<ol>
-<li><p>如果可以改变image的src,也可以hook 
<code>updateAttributes:</code>方法来做属性更新操作,当<code>updateAttributes:</code>或è€
… <code>updateStyles:</code>被调用的时候, component的view 已经加
载完成</p>
-<figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">- (void)updateAttributes:(NSDictionary *)attributes</div><div 
class="line">&#123;</div><div class="line">    if 
(attributes[@&quot;src&quot;]) &#123;</div><div class="line">        _imageSrc 
= [WXConvert NSString:attributes[@&quot;src&quot;]];</div><div class="line">    
    // Do your image updating logic</div><div class="line">    &#125;</div><div 
class="line"></div><div class="line">    if (attributes[@&quot;resize&quot;]) 
&#123;</div><div class="line">        _resizeMode = [WXConvert 
UIViewContentMode:attributes[@&quot;resize&quot;]];</div><div class="line">     
   self.view.contentMode = _resizeMode;</div><div class="line">    
&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
-</li>
-</ol>
-<p>   或许你
需要考虑更多的生命周期方法去Hook,当布局完成时候,像<code>layoutDidFinish</code>,如果ä½
 æƒ³äº†è§£æ›´å¤šï¼Œå¯ä»¥å‚考一下<code>WXComponent.h</code> 
声明的方法<br>   现在你可以用在任何 .we文件里面使用 
<code>&lt;image&gt;</code>,而且可以加上 image的属性</p>
-   <figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">&lt;image style=&quot;your-custom-style&quot; 
src=&quot;image-remote-source&quot; 
resize=&quot;contain/cover/stretch&quot;&gt;&lt;/image&gt;</div></pre></td></tr></table></figure>
-<h5 id="component-方法"><a href="#component-方法" class="headerlink" 
title="component 方法"></a>component 方法</h5><p>WeexSDK 0.9.5 
之后支持了在js中直接调用component的方法,这里提供一个例子,</p>
-<ul>
-<li><p>自定义一个WXMyCompoenent 的组件</p>
-  <figure class="highlight plain"><table><tr><td class="code"><pre><div 
class="line">@implementation WXMyComponent</div><div 
class="line">WX_EXPORT_METHOD(@selector(focus)) // 
暴露该方法给js</div><div class="line">- 
(instancetype)initWithRef:(NSString *)ref type:(NSString *)type 
styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes 
events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance</div><div 
class="line">&#123;</div><div class="line">    if (self = [super 
initWithRef:ref type:type styles:styles attributes:attributes events:events 
weexInstance:weexInstance]) &#123;</div><div class="line">        // handle 
your attributes</div><div class="line">        // handle your styles</div><div 
class="line">    &#125;</div><div class="line">    </div><div class="line">    
return self;</div><div class="line">&#125;</div><div class="line"></div><div 
class="line">- (void)focus</div><div class="line">&#123;</div><div 
class="line">    NSLog(@&quot;you got it&quot;
 );</div><div class="line">&#125;</div><div 
class="line">@end</div></pre></td></tr></table></figure>
-</li>
-</ul>
-<ul>
-<li>注册组件 <code>[WXSDKEngine registerComponent:@&quot;mycomponent&quot; 
withClass:[WXMyComponent class]]</code></li>
-<li><p>在weex 文件中调用</p>
-<pre><code class="html"><span class="tag">&lt;<span 
class="name">template</span>&gt;</span>
-  <span class="tag">&lt;<span class="name">mycomponent</span> <span 
class="attr">id</span>=<span 
class="string">'mycomponent'</span>&gt;</span><span class="tag">&lt;/<span 
class="name">mycomponent</span>&gt;</span>
-<span class="tag">&lt;/<span class="name">template</span>&gt;</span>
-<span class="tag">&lt;<span class="name">script</span>&gt;</span><span 
class="javascript">
-  <span class="built_in">module</span>.exports = {
-    <span class="attr">created</span>: <span class="function"><span 
class="keyword">function</span>(<span class="params"></span>) </span>{
-      <span class="keyword">this</span>.$el(<span 
class="string">'mycomponent'</span>).focus();
-    }
-  }
-</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span>
-</code></pre>
-</li>
-</ul>
-
-  </div>
-  
-</article>
-</div>
-  
-  <footer id="footer">
-  <div class="row clearfix">
-    <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="/v-0.10/advanced/extend-to-ios.html" 
data-lang="en">English</a>
-        </li>
-        <li>
-          <a href="/cn/v-0.10/advanced/extend-to-ios.html" 
data-lang="zh-cn">中文</a>
-        </li>
-      </ul>
-    </div>
-  </div>
-  <div class="disclaimer">
-    <div><img 
src="//gw.alicdn.com/tfs/TB1pTBZQFXXXXX9XXXXXXXXXXXX-794-280.png" width="200px" 
alt="Apache Incubator"></div>
-    <div><span class="title">Disclaimer:</span> Apache Weex is an effort 
undergoing incubation at The Apache Software Foundation (ASF), sponsored by the 
Apache Incubator. Incubation is required of all newly accepted projects until a 
further review indicates that the infrastructure, communications, and decision 
making process have stabilized in a manner consistent with other successful ASF 
projects. While incubation status is not necessarily a reflection of the 
completeness or stability of the code, it does indicate that the project has 
yet to be fully endorsed by the ASF.</div>
-    <br/>
-  </div>
-  <hr>
-  <div class="row">
-    <p> <img src="//gw.alicdn.com/tfs/TB1bg8SQFXXXXcHXXXXXXXXXXXX-85-170.png" 
height="50px" alt="Apache"><span>Copyright(c) 2017 The Apache Software 
Foundation. Licensed under the </span> <a 
href="http://www.apache.org/licenses/LICENSE-2.0";>Apache License, Version 
2.0</a></p>
-  </div>
-  <div class="row clearfix">
-    <div></div>
-  </div>
-</footer>
-  <div style="display: none;">
-  <script src="//s95.cnzz.com/z_stat.php?id=1261496509&web_id=1261496509" 
language="JavaScript"></script>
-</div>
-
-  <script src="/js/reqwest.js"></script>
-  <script src="/js/common.js"></script>
-</body>
-</html>


Reply via email to