You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/08/11 09:37:35 UTC
[01/13] incubator-weex git commit: + [doc] update doc of devtools
android
Repository: incubator-weex
Updated Branches:
refs/heads/0.16-dev 42285f337 -> 51ed22dcb
+ [doc] update doc of devtools android
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9db8054d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9db8054d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9db8054d
Branch: refs/heads/0.16-dev
Commit: 9db8054d405ae99ef25be3c4639a3ec12fe72289
Parents: 3b9b5a5
Author: misakuo <mi...@apache.org>
Authored: Fri Jul 21 15:29:34 2017 +0800
Committer: misakuo <mi...@apache.org>
Committed: Fri Jul 21 15:29:34 2017 +0800
----------------------------------------------------------------------
.../advanced/integrate-devtool-to-android.md | 86 +++++++++++++++++++-
1 file changed, 84 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9db8054d/doc/source/cn/references/advanced/integrate-devtool-to-android.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/advanced/integrate-devtool-to-android.md b/doc/source/cn/references/advanced/integrate-devtool-to-android.md
index 05a7f18..c26c814 100644
--- a/doc/source/cn/references/advanced/integrate-devtool-to-android.md
+++ b/doc/source/cn/references/advanced/integrate-devtool-to-android.md
@@ -19,7 +19,7 @@ Weex Devtools 能够方便调试 Weex 页面,但此功能离不开 Native 的
```gradle
dependencies {
- compile 'com.taobao.android:weex_inspector:0.8.0.0'
+ compile 'com.taobao.android:weex_inspector:${version}'
}
```
@@ -29,7 +29,7 @@ Weex Devtools 能够方便调试 Weex 页面,但此功能离不开 Native 的
<dependency>
<groupId>com.taobao.android</groupId>
<artifactId>weex_inspector</artifactId>
- <version>0.8.0.0</version>
+ <version>${version}</version>
<type>pom</type>
</dependency>
```
@@ -82,6 +82,7 @@ Weex Devtools 能够方便调试 Weex 页面,但此功能离不开 Native 的
| weex sdk | weex inspector | Debugger Server |
|----------|----------------|-----------------|
+| 0.13+ | 0.12+ | 0.2.39+ |
| 0.8.0.1+ | 0.0.8.1+ | 0.2.39+ |
| 0.7.0+ | 0.0.7.13 | 0.2.38 |
| 0.6.0+ | 0.0.2.2 | - |
@@ -269,3 +270,84 @@ Devtools 扩展了 [Chrome Debugging Protocol](https://developer.chrome.com/devt
已知的原因如下:
* 多线程操作网络连接引起,在频繁的即断即连时容易触发。在 0.0.7.1 版本已修复。
+
+## 注入自定义WebSocket Client
+目前Inspector以反射的方式动态调用了okhttp-ws库中的相关代码,可以兼容的okhttp与okhttp-ws版本为:
+- okhttp, okhttp-ws 2.7.5版本以下
+- okhttp3, okhttp3-ws 3.5版本以下
+
+如果客户端中集成的版本与上述版本不匹配,则可以使用`WeexInspector.overrideWebSocketClient`方法来注入自定义的WebSocket实现,示例:
+```java
+
+ public class CustomWebSocketClient implements IWebSocketClient {
+
+ private WebSocket ws;
+
+ @Override
+ public boolean isOpen() {
+ return ws != null;
+ }
+
+ @Override
+ public void connect(String wsAddress, final WSListener listener) {
+ OkHttpClient okHttpClient = new OkHttpClient();
+ okHttpClient.setConnectTimeout(5, TimeUnit.SECONDS);
+ okHttpClient.setReadTimeout(5, TimeUnit.SECONDS);
+ okHttpClient.setWriteTimeout(5, TimeUnit.SECONDS);
+
+ Request request = new Request.Builder().url(wsAddress).build();
+ WebSocketCall webSocketCall = WebSocketCall.create(okHttpClient, request);
+ webSocketCall.enqueue(new WebSocketListener() {
+ @Override
+ public void onOpen(WebSocket webSocket, Request request, Response response) throws IOException {
+ ws = webSocket;
+ listener.onOpen();
+ }
+
+ @Override
+ public void onMessage(BufferedSource payload, WebSocket.PayloadType type) throws IOException {
+ if (WebSocket.PayloadType.TEXT == type) {
+ listener.onMessage(payload.readUtf8());
+ }
+ }
+
+ @Override
+ public void onPong(Buffer payload) {
+ //ignore
+ }
+
+ @Override
+ public void onClose(int code, String reason) {
+ listener.onClose();
+ }
+
+ @Override
+ public void onFailure(IOException e) {
+ listener.onFailure(e);
+ }
+ });
+ }
+
+ @Override
+ public void close() {
+ if (ws != null) {
+ try {
+ ws.close(CloseCodes.NORMAL_CLOSURE, "Normal closure");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ public void sendMessage(int requestId, String message) {
+ if (ws != null) {
+ try {
+ ws.sendMessage(WebSocket.PayloadType.TEXT, new Buffer().writeString(message, Charset.defaultCharset()));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+```
[11/13] incubator-weex git commit: Add 32-bit device support.
Posted by ac...@apache.org.
Add 32-bit device support.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cfe067a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cfe067a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cfe067a2
Branch: refs/heads/0.16-dev
Commit: cfe067a279049dac9c28db617b0d6686ebbdae5c
Parents: 75101d5
Author: DavidYang <ya...@ymatou.com>
Authored: Thu Aug 10 19:21:13 2017 +0800
Committer: DavidYang <ya...@ymatou.com>
Committed: Thu Aug 10 19:21:13 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cfe067a2/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index f995c3e..e0d1d72 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -379,7 +379,7 @@
[self.weexInstance.componentManager _addUITask:^{
if (isDeleteSection) {
- WXLogDebug(@"delete section:%ld", headerIndex);
+ WXLogDebug(@"delete section:%zd", headerIndex);
[_completedSections removeObjectAtIndex:headerIndex];
}
@@ -388,7 +388,7 @@
}
if (completedReloadSection) {
- WXLogDebug(@"Reload section:%ld", reloadIndex);
+ WXLogDebug(@"Reload section:%zd", reloadIndex);
_completedSections[reloadIndex] = completedReloadSection;
}
[02/13] incubator-weex git commit: *[doc] add color-name file color
block
Posted by ac...@apache.org.
*[doc] add color-name file color block
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/fbf39cd2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/fbf39cd2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/fbf39cd2
Branch: refs/heads/0.16-dev
Commit: fbf39cd2f61d8b78a285244ab69e5996ac187042
Parents: b16f36f
Author: tancy <ro...@gmail.com>
Authored: Wed Jul 19 17:15:49 2017 +0800
Committer: misakuo <mi...@apache.org>
Committed: Fri Jul 21 15:33:06 2017 +0800
----------------------------------------------------------------------
doc/themes/weex/source/js/common.js | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/fbf39cd2/doc/themes/weex/source/js/common.js
----------------------------------------------------------------------
diff --git a/doc/themes/weex/source/js/common.js b/doc/themes/weex/source/js/common.js
index 3e92ba4..c3f6631 100644
--- a/doc/themes/weex/source/js/common.js
+++ b/doc/themes/weex/source/js/common.js
@@ -105,6 +105,28 @@
initPickLang()
+ /**
+ * color name
+ */
+
+ function colorname(){
+ if(location.pathname.indexOf('references/color-names.html')>0){
+ var t = document.querySelectorAll("table");
+ Array.prototype.forEach.call(t, function (table) {
+ var d = table.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
+ Array.prototype.forEach.call(d, function (tr) {
+ var r = tr.getElementsByTagName("td")[1];
+ r.innerHTML ='<span style="background:'+ r.innerHTML +';color:'+ r.innerHTML +'"> yy </span> ' + r.innerHTML
+ });
+
+ });
+ }
+ }
+
+ colorname();
+
+
+
/**
* Search
*/
[12/13] incubator-weex git commit: Merge branch 'dev' of
https://github.com/DavidYang1121/incubator-weex into wip-us-dev
Posted by ac...@apache.org.
Merge branch 'dev' of https://github.com/DavidYang1121/incubator-weex into wip-us-dev
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/778c0f6a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/778c0f6a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/778c0f6a
Branch: refs/heads/0.16-dev
Commit: 778c0f6ad7adcfa863c0a5ac49c14b57affbc525
Parents: fcc77c9 cfe067a
Author: acton393 <zh...@gmail.com>
Authored: Fri Aug 11 17:33:01 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Aug 11 17:33:01 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[09/13] incubator-weex git commit: * [doc] fix documentation error in
extending ios
Posted by ac...@apache.org.
* [doc] fix documentation error in extending ios
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/63896cb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/63896cb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/63896cb8
Branch: refs/heads/0.16-dev
Commit: 63896cb8f13dc8443da6863738a4f77f186aa8c0
Parents: 75101d5
Author: cxfeng <cx...@apache.org>
Authored: Fri Aug 4 10:15:53 2017 +0800
Committer: cxfeng <cx...@apache.org>
Committed: Fri Aug 4 10:15:53 2017 +0800
----------------------------------------------------------------------
doc/source/cn/references/advanced/extend-to-ios.md | 4 +++-
doc/source/references/advanced/extend-to-ios.md | 5 +++--
2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/63896cb8/doc/source/cn/references/advanced/extend-to-ios.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/advanced/extend-to-ios.md b/doc/source/cn/references/advanced/extend-to-ios.md
index 5229201..bf949fd 100644
--- a/doc/source/cn/references/advanced/extend-to-ios.md
+++ b/doc/source/cn/references/advanced/extend-to-ios.md
@@ -28,8 +28,10 @@ Weex SDK 只提供渲染,而不是其他的能力,如果你需要 像网络
```object-c
@implementation WXEventModule
+
@synthesize weexInstance;
- WX_EXPORT_METHOD(@selector(openURL:callback))
+ WX_EXPORT_METHOD(@selector(openURL:callback:))
+
- (void)openURL:(NSString *)url callback:(WXModuleCallback)callback
{
NSString *newURL = url;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/63896cb8/doc/source/references/advanced/extend-to-ios.md
----------------------------------------------------------------------
diff --git a/doc/source/references/advanced/extend-to-ios.md b/doc/source/references/advanced/extend-to-ios.md
index a6646b9..9039754 100644
--- a/doc/source/references/advanced/extend-to-ios.md
+++ b/doc/source/references/advanced/extend-to-ios.md
@@ -31,8 +31,9 @@ For example: If you want to implement an address jumping function, you can achie
```objective-c
@implementation WXEventModule
+
@synthesize weexInstance;
- WX_EXPORT_METHOD(@selector(openURL:callback))
+WX_EXPORT_METHOD(@selector(openURL:callback:))
- (void)openURL:(NSString *)url callback:(WXModuleCallback)callback
{
@@ -337,4 +338,4 @@ after your registration for your own custom component, now you can call it in yo
}
}
</script>
-```
\ No newline at end of file
+```
[13/13] incubator-weex git commit: Merge branch 'dev' of
https://git-wip-us.apache.org/repos/asf/incubator-weex into wip-us-0.16-dev
Posted by ac...@apache.org.
Merge branch 'dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into wip-us-0.16-dev
# Conflicts:
# doc/source/cn/references/weex-variable.md
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/51ed22dc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/51ed22dc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/51ed22dc
Branch: refs/heads/0.16-dev
Commit: 51ed22dcbfffdee078e46dada4bcb6032b0464a4
Parents: 42285f3 778c0f6
Author: acton393 <zh...@gmail.com>
Authored: Fri Aug 11 17:37:17 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Aug 11 17:37:17 2017 +0800
----------------------------------------------------------------------
doc/source/_posts/arkit.md | 112 +++++++++++++++++++
doc/source/_posts/cn/hello.md | 6 -
doc/source/_posts/hello_world.md | 7 --
doc/source/_posts/test.md | 14 ---
doc/source/cn/blog/index.md | 4 -
.../cn/references/advanced/extend-to-ios.md | 4 +-
.../advanced/integrate-devtool-to-android.md | 86 +++++++++++++-
doc/source/cn/references/components/text.md | 4 +-
doc/source/references/advanced/extend-to-ios.md | 5 +-
doc/source/references/components/text.md | 4 +-
doc/themes/weex/layout/_partial/header.ejs | 1 +
.../weex/layout/_partial/post/summary.ejs | 1 +
doc/themes/weex/source/css/blog.scss | 3 +
doc/themes/weex/source/css/media-queries.scss | 1 +
doc/themes/weex/source/css/partial/header.scss | 6 +-
.../WeexSDK/Sources/Component/WXListComponent.m | 4 +-
16 files changed, 217 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/51ed22dc/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
[04/13] incubator-weex git commit: Merge branch 'dev' of
https://git-wip-us.apache.org/repos/asf/incubator-weex into apache-dev
Posted by ac...@apache.org.
Merge branch 'dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into apache-dev
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/beb83d2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/beb83d2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/beb83d2e
Branch: refs/heads/0.16-dev
Commit: beb83d2e3e103746178a59dbd5db8c961375b410
Parents: fbf39cd 8a5e0ee
Author: misakuo <mi...@apache.org>
Authored: Fri Jul 21 15:33:42 2017 +0800
Committer: misakuo <mi...@apache.org>
Committed: Fri Jul 21 15:33:42 2017 +0800
----------------------------------------------------------------------
----------------------------------------------------------------------
[06/13] incubator-weex git commit: *[doc] add aliyunhost tip
Posted by ac...@apache.org.
*[doc] add aliyunhost tip
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/476cc3af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/476cc3af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/476cc3af
Branch: refs/heads/0.16-dev
Commit: 476cc3af1b40ea328982e3167fd308f5eef94761
Parents: d2b5104
Author: tancy <ro...@gmail.com>
Authored: Fri Jul 28 16:24:45 2017 +0800
Committer: tancy <ro...@gmail.com>
Committed: Fri Jul 28 16:24:45 2017 +0800
----------------------------------------------------------------------
doc/themes/weex/layout/_partial/post/summary.ejs | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/476cc3af/doc/themes/weex/layout/_partial/post/summary.ejs
----------------------------------------------------------------------
diff --git a/doc/themes/weex/layout/_partial/post/summary.ejs b/doc/themes/weex/layout/_partial/post/summary.ejs
index e81308d..abf1bc7 100644
--- a/doc/themes/weex/layout/_partial/post/summary.ejs
+++ b/doc/themes/weex/layout/_partial/post/summary.ejs
@@ -51,4 +51,5 @@
<a href="https://render.alipay.com/p/s/taobaonpm_click/weex_banner_click">
<img src="https://render.alipay.com/p/s/taobaonpm_click/weex_banner" alt="" width="180px">
</a>
+ <div style="color: #7f8c8d;font-size: 12px;">阿里云赞助</div>
</div>
\ No newline at end of file
[05/13] incubator-weex git commit: +[doc] add blog
Posted by ac...@apache.org.
+[doc] add blog
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d2b5104f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d2b5104f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d2b5104f
Branch: refs/heads/0.16-dev
Commit: d2b5104f1596676b500c0c42010357bb79eae57e
Parents: beb83d2
Author: tancy <ro...@gmail.com>
Authored: Fri Jul 28 15:58:06 2017 +0800
Committer: tancy <ro...@gmail.com>
Committed: Fri Jul 28 15:58:06 2017 +0800
----------------------------------------------------------------------
doc/source/_posts/arkit.md | 112 ++++++++++++++++++++
doc/source/_posts/cn/hello.md | 6 --
doc/source/_posts/hello_world.md | 7 --
doc/source/_posts/test.md | 14 ---
doc/source/cn/blog/index.md | 4 -
doc/themes/weex/layout/_partial/header.ejs | 1 +
doc/themes/weex/source/css/blog.scss | 3 +
doc/themes/weex/source/css/media-queries.scss | 1 +
doc/themes/weex/source/css/partial/header.scss | 6 +-
9 files changed, 120 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/source/_posts/arkit.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/arkit.md b/doc/source/_posts/arkit.md
new file mode 100644
index 0000000..2b97c6e
--- /dev/null
+++ b/doc/source/_posts/arkit.md
@@ -0,0 +1,112 @@
+title: Weex ❤️ iOS 11 系列之一:ARKit初探
+type: blog
+date: 2017-06-27 14:32:10
+
+---
+
+## ARKit
+苹果在wwdc 2017公布了第一款具有AR功能的操作系统iOS11,并提供了AR的SDK,ARKit,同时宣称苹果是世界上最大的AR平台,Weex也积极拥抱AR,让Weex用户也可以方便开发AR功能
+
+AR体验就是创建和追踪用户所在的现实世界和可建立模型的空间的对应关系的能力,让用户感觉产生虚拟内容在现实世界的错觉,这就是所谓的增强现实。ARKit通过识别图像场景中的显著特征,追踪这些特征的差异位置,最后与传感器数据比较,得到设备位置和运动状态的高精度模型
+
+## 原理
+ARkit 在ARSCNView,ARSession,ARFrame的基础上实现
+
+### ARSCNView和ARSession
+
+ARKit提供了两种增强现实的视图,他们分别是ARSCNView(3D)和ARSKView(2D),这两种视图都采用ARCamera作为视图背景的,而ARSCNView等视图和相机没有直接关系,他们是通过ARSession这个桥梁和camera交互的,运行一个session,需要指定会话追踪配置的对象:ARSessionConfiguration,ARSessionConfiguration负责追踪相机在3D世界中的位置和平面探测
+
+### ARWorldTrackingSessionConfiguration与ARFrame
+
+ARWorldTrackingSessionConfiguration通过一系列的复杂计算和调用传感器来跟踪设备的方向和位置,当ARWorldTrackingSessionConfiguration计算出位置,会交给ARSession管理,ARSession就会维护一个相机的位置ARFame,用户可以通过这个frame将4x4矩阵世界坐标转换为3D系统相机坐标
+
+## weex-ar
+ARKit在wwdc上带来的震撼效果,我通过weex插件的方式将ARKit能力透传到Weex,让用户在weex上也第一时间体验到Native的AR效果
+所有的demo以及源码我已经开源,同步到[github](https://github.com/kfeagle/weex-ar),用户在自己工程依赖即可使用
+
+### 在现实世界渲染一个3D的虚拟物体
+```
+this.$refs['scene'].addNode({
+ name:'color',
+ width:0.1,
+ height:0.1,
+ length:0.1,
+ chamferRadius:0,
+ vector:{
+ x:0.1,
+ y:0.1,
+ z:-0.5
+ },
+ contents:{
+ type:'color',
+ name:'red'
+ }
+ });
+```
+Weex在compnonent中增加addNode方法,用户可以设置好节点的参数,然后就会构建一个虚拟物体
+- 效果
+ - 
+
+### 交互支持
+当native触发了点击事件,会向jsfm发送点击位置信息
+
+```
+-(void)tapped:(UITapGestureRecognizer *)recognizer
+{
+ SCNView *sceneView = (SCNView *)recognizer.view ;
+ CGPoint touchLocation = [recognizer locationInView:sceneView];
+ [self fireEvent:@"tap" params:@{@"touchLocation":@{@"x":@(touchLocation.x),@"y":@(touchLocation.y)}}];
+}
+```
+当VUE接收到相关信息,会处理位置信息,然后更新节点
+```
+tap:function (event) {
+ this.index = this.index+1;
+ if(this.index>3){
+ this.index = 0;
+ }
+ var color = 'red';
+ if(this.index == 1){
+ color = 'blue';
+ }
+ if(this.index == 2){
+ color = 'green';
+ }
+ if(this.index == 3){
+ color = 'yellow';
+ }
+ this.$refs['scene'].updateNode({
+ name:'color',
+ x:event.touchLocation.x,
+ y:event.touchLocation.y,
+ color:color
+ })
+ }
+```
+- 效果
+ - 
+
+### 碰撞游戏
+设置节点的mask,通过arkit的代理就可以检测碰撞了
+```
+node.physicsBody.categoryBitMask= [self getMask:[WXConvert NSInteger:[options objectForKey:@"categoryBitMask"]]];
+ node.physicsBody.contactTestBitMask= [self getMask:[WXConvert NSInteger:[options objectForKey:@"contactTestBitMask"]]];
+```
+当碰撞发生时候,会通过physicsWorld:(SCNPhysicsWorld *)world didBeginContact:(SCNPhysicsContact *)contact代理获取到节点的信息,weex将相关信息发送到jsfm
+vue获取先关节点可以删除节点,增减节点,从而完成碰撞的处理
+```
+contact:function (event) {
+ if(event.nodes.nodeA.mask == 0 || event.nodes.nodeB.mask == 0 ){
+
+ this.isAdd = false;
+ this.$refs['scene'].removeNode(event.nodes.nodeA.name);
+ this.$refs['scene'].removeNode(event.nodes.nodeB.name);
+
+ }
+
+ }
+```
+
+- 效果
+
+ - 
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/source/_posts/cn/hello.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/cn/hello.md b/doc/source/_posts/cn/hello.md
deleted file mode 100644
index da43361..0000000
--- a/doc/source/_posts/cn/hello.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: hello
-lang: cn
-date: 2016-12-27 15:54:28
-type: blog
----
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/source/_posts/hello_world.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/hello_world.md b/doc/source/_posts/hello_world.md
deleted file mode 100644
index 803ef70..0000000
--- a/doc/source/_posts/hello_world.md
+++ /dev/null
@@ -1,7 +0,0 @@
-title: Hello World
-type: blog
-
----
-
-# Hello world
-
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/source/_posts/test.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/test.md b/doc/source/_posts/test.md
deleted file mode 100644
index afaa8ec..0000000
--- a/doc/source/_posts/test.md
+++ /dev/null
@@ -1,14 +0,0 @@
-title: test
-type: blog
-
----
-
-
-# test
-
-asdfadfasdfasdfadfadsf
-asdfasdfadsf
-adsfadsfadsf
-
-## sdfasdfasdf
-sdfsdfsdf
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/source/cn/blog/index.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/blog/index.md b/doc/source/cn/blog/index.md
deleted file mode 100644
index ef7b31d..0000000
--- a/doc/source/cn/blog/index.md
+++ /dev/null
@@ -1,4 +0,0 @@
-type: blog
-index: true
-layout: blog
----
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/themes/weex/layout/_partial/header.ejs
----------------------------------------------------------------------
diff --git a/doc/themes/weex/layout/_partial/header.ejs b/doc/themes/weex/layout/_partial/header.ejs
index 4c7d92d..5b5701f 100644
--- a/doc/themes/weex/layout/_partial/header.ejs
+++ b/doc/themes/weex/layout/_partial/header.ejs
@@ -36,6 +36,7 @@
</li>
</ul>
</li>
+ <li><a href="/blog"><%= _p('menu.blog') %></a></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>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/themes/weex/source/css/blog.scss
----------------------------------------------------------------------
diff --git a/doc/themes/weex/source/css/blog.scss b/doc/themes/weex/source/css/blog.scss
index 7e2cd9d..4f5fb55 100644
--- a/doc/themes/weex/source/css/blog.scss
+++ b/doc/themes/weex/source/css/blog.scss
@@ -24,6 +24,9 @@
.blog-article-inner {
padding: 0 1.45em;
margin-bottom: 50px;
+ a{
+ line-height: 120%
+ }
}
.more-link {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/themes/weex/source/css/media-queries.scss
----------------------------------------------------------------------
diff --git a/doc/themes/weex/source/css/media-queries.scss b/doc/themes/weex/source/css/media-queries.scss
index f31a880..317223c 100644
--- a/doc/themes/weex/source/css/media-queries.scss
+++ b/doc/themes/weex/source/css/media-queries.scss
@@ -89,6 +89,7 @@
}
}
+
@media screen and (max-width: 700px) {
/***********************************************
* Index
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2b5104f/doc/themes/weex/source/css/partial/header.scss
----------------------------------------------------------------------
diff --git a/doc/themes/weex/source/css/partial/header.scss b/doc/themes/weex/source/css/partial/header.scss
index f109404..ac02f1a 100644
--- a/doc/themes/weex/source/css/partial/header.scss
+++ b/doc/themes/weex/source/css/partial/header.scss
@@ -3,7 +3,7 @@
#header {
width: 100%;
height: 72px;
- padding: 0 65px;
+ padding: 0 40px;
position: fixed;
background-color: rgba(255, 255, 255, .95);
box-shadow: 3px 2px 4px 0 rgba(0,0,0,0.12);
@@ -74,12 +74,12 @@
}
> li + li {
- margin-left: 40px;
+ margin-left: 30px;
}
}
.info li {
- margin-left: 40px;
+ margin-left: 30px;
}
.tools {
[10/13] incubator-weex git commit: * [doc] update text doc
Posted by ac...@apache.org.
* [doc] update text doc
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/fcc77c9e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/fcc77c9e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/fcc77c9e
Branch: refs/heads/0.16-dev
Commit: fcc77c9e6ea10f215262f0bde890a1c909f6d12b
Parents: 63896cb
Author: acton393 <zh...@gmail.com>
Authored: Thu Aug 10 17:51:01 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Aug 10 17:51:01 2017 +0800
----------------------------------------------------------------------
doc/source/cn/references/components/text.md | 4 ++--
doc/source/references/components/text.md | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/fcc77c9e/doc/source/cn/references/components/text.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/components/text.md b/doc/source/cn/references/components/text.md
index 7746378..136d409 100644
--- a/doc/source/cn/references/components/text.md
+++ b/doc/source/cn/references/components/text.md
@@ -29,7 +29,7 @@ version: 2.1
- 支持 `text-align` 样式.
- 支持 `text-decoration` 样式.
- 支持 `text-overflow` 样式.
- - 支持 `line-height`样式<sup class="wx-v">0.6.1+</sup> 。`line-height` 在 iOS 中与 H5 和 Android 中不同, 文本值将放置在框的底部。
+ - 支持 `line-height`样式<sup class="wx-v">0.6.1+</sup>
- 不支持 `flex-direction`, `justify-content`, `align-items` 这些为子节点设置的属性,并且`<text>`没有子节点。
- 通用样式:支持所有通用样式
@@ -62,7 +62,7 @@ version: 2.1
`支持版本:v0.12.0`
-支持ttf和woff字体格式的自定义字体, 可以通过调用 `dom` module 里面的 [addRule](../modules/dom.html#addRule)方法, 构建自定义的`font-family`使用
+支持ttf和woff字体格式的自定义字体, 可以通过调用 `dom` module 里面的 [addRule](../modules/dom.html#addRule)方法, 构建自定义的`font-family`使用, addRule 建议在`mounted`时候调用
```html
<template>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/fcc77c9e/doc/source/references/components/text.md
----------------------------------------------------------------------
diff --git a/doc/source/references/components/text.md b/doc/source/references/components/text.md
index 9b86016..e235fae 100644
--- a/doc/source/references/components/text.md
+++ b/doc/source/references/components/text.md
@@ -36,7 +36,7 @@ this.text = textComponent.attr.value;
* support 'text-align' style.
* support 'text-decoration' style.
* support 'text-overflow' style.
- * support 'line-height'(available from v0.6.1) style. line-height in iOS is different from h5 and Android, text value will be placed at bottom of line box.
+ * support 'line-height'(available from v0.6.1) style.
* not support 'flex-direction, 'justify-content', 'align-items' which is active for child nodes, and text has no child nodes.
### common styles
@@ -59,7 +59,7 @@ check out [common events](../common-event.html)
`support:v0.12.0`
-support `ttf` and `woff` font format to custom your text, call [addRule](../modules/dom.html#addRule) in dom module to build your own `font-family`
+support `ttf` and `woff` font format to custom your text, call [addRule](../modules/dom.html#addRule) in dom module to build your own `font-family`, we suggest that you call `addRule` in `mounted`
```html
<template>
[08/13] incubator-weex git commit: Merge branch '0.15-dev' into dev
Posted by ac...@apache.org.
Merge branch '0.15-dev' into dev
# Conflicts:
# doc/source/cn/references/weex-variable.md
# doc/source/references/weex-variable.md
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/75101d59
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/75101d59
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/75101d59
Branch: refs/heads/0.16-dev
Commit: 75101d59ff2501a48852f68ffd0c2611ac2801ab
Parents: af71702 eb48b94
Author: zshshr <zh...@gmail.com>
Authored: Tue Aug 1 10:53:53 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Aug 1 10:53:53 2017 +0800
----------------------------------------------------------------------
README.md | 51 +-
WeexSDK.podspec | 2 +-
.../weex/extend/component/WXParallax.java | 4 +-
.../java/com/taobao/weex/WXEnvironment.java | 4 +
.../java/com/taobao/weex/WXSDKInstance.java | 11 +-
.../com/taobao/weex/bridge/WXBridgeManager.java | 12 +-
.../java/com/taobao/weex/common/WXConfig.java | 1 +
.../com/taobao/weex/common/WXImageStrategy.java | 9 +-
.../main/java/com/taobao/weex/dom/WXAttr.java | 38 +-
.../java/com/taobao/weex/dom/WXDomModule.java | 1 -
.../com/taobao/weex/dom/WXImageQuality.java | 4 +-
.../taobao/weex/dom/WXRecyclerDomObject.java | 4 +
.../com/taobao/weex/dom/WXTextDomObject.java | 4 +-
.../com/taobao/weex/dom/action/Actions.java | 4 +-
.../taobao/weex/ui/component/WXComponent.java | 12 +-
.../taobao/weex/ui/component/WXScroller.java | 79 ++-
.../com/taobao/weex/ui/component/WXSlider.java | 10 +-
.../ui/component/list/BasicListComponent.java | 114 ++--
.../taobao/weex/ui/component/list/WXCell.java | 1 -
.../weex/ui/component/list/WXListComponent.java | 9 +-
.../weex/ui/view/WXHorizontalScrollView.java | 27 +
.../com/taobao/weex/ui/view/WXScrollView.java | 1 -
.../java/com/taobao/weex/dom/WXAttrTest.java | 19 +-
build/config.js | 1 +
build/karma.vue.conf.js | 16 +-
build/webpack.examples.web.config.js | 1 +
build/webpack.test.web.config.js | 1 +
doc/source/cn/references/modules/meta.md | 96 +++
doc/source/cn/references/modules/timer.md | 47 ++
doc/source/cn/references/weex-variable.md | 3 +-
doc/source/references/modules/meta.md | 97 +++
doc/source/references/modules/timer.md | 58 ++
doc/source/references/weex-variable.md | 3 +-
examples/vue/components/input.vue | 17 +
examples/vue/hello.vue | 2 +-
examples/vue/market/gcanvas.vue | 36 +-
.../vue/components/scrollable/list/index.js | 3 +-
.../vue/components/scrollable/scroller.js | 3 +-
.../vue/components/scrollable/waterfall.js | 3 +-
.../render/vue/components/slider/slideMixin.js | 17 +-
html5/render/vue/core/node.js | 172 +++--
html5/render/vue/core/style.js | 26 +-
html5/render/vue/env/global.js | 2 +
html5/render/vue/env/weex.js | 3 +
html5/render/vue/env/wx-env.js | 2 +-
html5/render/vue/mixins/base.js | 16 +-
html5/render/vue/mixins/scrollable.js | 18 +-
html5/render/vue/mixins/style.js | 58 +-
html5/render/vue/modules/websocket/websocket.js | 2 +
html5/render/vue/utils/event.js | 6 +-
html5/render/vue/utils/func.js | 136 +++-
html5/render/vue/utils/index.js | 104 ---
html5/render/vue/utils/perf.js | 3 +-
html5/render/vue/utils/style.js | 30 +-
html5/shared/console.js | 10 +-
html5/test/render/vue/core/node.js | 32 +-
html5/test/render/vue/core/scope-style-map.js | 4 +
.../render/vue/data/dotvue/event-bubble-bar.vue | 11 -
.../render/vue/data/dotvue/event-bubble.vue | 11 -
html5/test/render/vue/helper/utils.js | 10 +-
html5/test/render/vue/modules/modal.js | 225 +++++++
html5/test/render/vue/modules/websocket.js | 83 ++-
html5/test/render/vue/utils/component.js | 50 +-
html5/test/render/vue/utils/event.js | 78 +++
html5/test/render/vue/utils/func.js | 278 +++++++-
html5/test/render/vue/utils/lazyload.js | 106 +++
html5/test/render/vue/utils/perf.js | 132 ++++
html5/test/render/vue/utils/style.js | 157 ++++-
html5/test/render/vue/utils/type.js | 49 ++
html5/test/render/vue/validator/index.js | 31 +-
ios/playground/Podfile | 2 +-
.../WeexDemo.xcodeproj/project.pbxproj | 4 +
ios/playground/WeexDemo/WXDemoViewController.m | 2 +-
ios/sdk/WeexSDK-Dynamic/Info.plist | 24 +
ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 642 ++++++++++++++++++-
.../xcschemes/WeexSDK-Dynamic.xcscheme | 80 +++
.../WeexSDK/Sources/Bridge/WXBridgeContext.h | 2 +-
.../WeexSDK/Sources/Bridge/WXBridgeContext.m | 74 ++-
ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.m | 16 +-
ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 35 +-
.../Component/Recycler/WXRecyclerComponent.h | 3 +-
.../Component/Recycler/WXRecyclerComponent.m | 5 +-
.../Recycler/WXSectionDataController.h | 2 +
.../WeexSDK/Sources/Component/WXAComponent.m | 2 +-
.../Sources/Component/WXCanvasComponent.h | 2 +-
.../Sources/Component/WXCycleSliderComponent.m | 6 +
.../WeexSDK/Sources/Component/WXEditComponent.m | 4 +-
.../Sources/Component/WXFooterComponent.h | 2 +-
.../Sources/Component/WXHeaderComponent.h | 3 +-
.../Sources/Component/WXImageComponent.m | 5 +-
.../WeexSDK/Sources/Component/WXListComponent.m | 60 +-
.../Sources/Component/WXScrollerComponent.m | 1 +
.../WeexSDK/Sources/Component/WXTextComponent.m | 81 ++-
ios/sdk/WeexSDK/Sources/Component/WXTransform.m | 24 +-
.../Sources/Component/WXVideoComponent.m | 2 +-
.../WeexSDK/Sources/Component/WXWebComponent.m | 2 +-
.../Sources/Controller/WXRootViewController.m | 1 +
.../Sources/Display/WXComponent+BoxShadow.h | 4 -
ios/sdk/WeexSDK/Sources/Display/WXInnerLayer.h | 1 +
ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h | 2 +-
ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m | 10 +-
.../WeexSDK/Sources/Events/WXComponent+Events.m | 19 +-
.../Sources/Handler/WXURLRewriteDefaultImpl.m | 2 +-
.../WeexSDK/Sources/Layout/WXComponent+Layout.m | 3 +-
.../Sources/Manager/WXComponentManager.h | 3 +
.../Sources/Manager/WXComponentManager.m | 6 +-
ios/sdk/WeexSDK/Sources/Manager/WXRuleManager.m | 2 +-
.../WeexSDK/Sources/Manager/WXServiceFactory.h | 2 +-
.../WeexSDK/Sources/Manager/WXTracingManager.h | 126 ++++
.../WeexSDK/Sources/Manager/WXTracingManager.m | 384 +++++++++++
ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 5 +-
.../WeexSDK/Sources/Model/WXJSExceptionInfo.h | 1 +
.../WeexSDK/Sources/Model/WXJSExceptionInfo.m | 1 +
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 13 +-
.../WeexSDK/Sources/Module/WXAnimationModule.m | 15 +-
ios/sdk/WeexSDK/Sources/Module/WXDomModule.m | 28 +-
ios/sdk/WeexSDK/Sources/Module/WXPickerModule.m | 11 +-
ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m | 2 +-
.../WeexSDK/Sources/Module/WXWebSocketModule.h | 1 -
.../WeexSDK/Sources/Module/WXWebSocketModule.m | 1 +
.../WeexSDK/Sources/Protocol/WXBridgeProtocol.h | 5 +
.../Sources/Protocol/WXURLRewriteProtocol.h | 2 +-
ios/sdk/WeexSDK/Sources/Utility/WXDefine.h | 2 +-
ios/sdk/WeexSDK/Sources/Utility/WXLog.m | 8 +
ios/sdk/WeexSDK/Sources/Utility/WXUtility.h | 2 -
ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 16 +-
.../View/WXComponent+PseudoClassManagement.h | 4 +-
.../Sources/View/WXComponent+ViewManagement.m | 7 +-
ios/sdk/WeexSDK/Sources/WeexSDK.h | 1 +
ios/sdk/WeexSDKTests/WXAnimationModuleTests.m | 29 +
ios/sdk/buildScripts.sh | 2 +
package.json | 8 +-
packages/weex-vue-render/package.json | 8 +-
pre-build/native-bundle-main.js | 16 +-
134 files changed, 3833 insertions(+), 675 deletions(-)
----------------------------------------------------------------------
[07/13] incubator-weex git commit: *[doc]fix blog name
Posted by ac...@apache.org.
*[doc]fix blog name
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/af717020
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/af717020
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/af717020
Branch: refs/heads/0.16-dev
Commit: af717020ccb138755b28449780ed940a689caf9e
Parents: 476cc3a
Author: tancy <ro...@gmail.com>
Authored: Fri Jul 28 22:38:06 2017 +0800
Committer: tancy <ro...@gmail.com>
Committed: Fri Jul 28 22:38:06 2017 +0800
----------------------------------------------------------------------
doc/source/_posts/arkit.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/af717020/doc/source/_posts/arkit.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/arkit.md b/doc/source/_posts/arkit.md
index 2b97c6e..5da0e92 100644
--- a/doc/source/_posts/arkit.md
+++ b/doc/source/_posts/arkit.md
@@ -1,4 +1,4 @@
-title: Weex ❤️ iOS 11 系列之一:ARKit初探
+title: Weex ❤️ iOS 11 系列之二:ARKit初探
type: blog
date: 2017-06-27 14:32:10
[03/13] incubator-weex git commit: * [doc] update input components
document & bubble document
Posted by ac...@apache.org.
* [doc] update input components document & bubble document
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b16f36fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b16f36fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b16f36fc
Branch: refs/heads/0.16-dev
Commit: b16f36fca70ce60d94b9a5f276873455024cb6af
Parents: 9db8054
Author: tancy <ro...@gmail.com>
Authored: Wed Jul 19 15:12:22 2017 +0800
Committer: misakuo <mi...@apache.org>
Committed: Fri Jul 21 15:33:06 2017 +0800
----------------------------------------------------------------------
doc/source/_posts/coreml.md | 79 +++++++++++++++++++++++
doc/source/_posts/hello_world.md | 3 +-
doc/source/_posts/test.md | 14 ++++
doc/source/cn/references/bubble.md | 4 +-
doc/source/cn/references/components/input.md | 34 +++++-----
doc/source/cn/v-0.10/references/bubble.md | 6 +-
doc/source/references/bubble.md | 4 +-
doc/source/references/components/input.md | 34 +++++-----
doc/source/v-0.10/references/bubble.md | 8 +--
9 files changed, 142 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/_posts/coreml.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/coreml.md b/doc/source/_posts/coreml.md
new file mode 100644
index 0000000..c628fb3
--- /dev/null
+++ b/doc/source/_posts/coreml.md
@@ -0,0 +1,79 @@
+title: Weex ❤️ iOS 11 系列之一:Core ML 初探
+type: blog
+date: 2017-06-21 15:46:44
+
+---
+
+## 背景
+
+WWDC 2017 有一个非常明确的信号:**端上机器学习将会是未来苹果的一个重要发力点,同时开发者的使用门槛在不断降低**。
+
+Core ML 是今年 WWDC 上苹果发布的机器学习框架。它允许开发者在自己开发的 app 上使用机器学习,同时不需要收集用户数据。 有了 Core ML,你可以将自己训练得到的模型,借助苹果提供的转换工具,转化成 Core ML 类型的模型文件,你可以非常轻松地直接实现模型和 app 数据的互通。
+
+WWDC 上展示了一张简单的架构图:
+
+
+
+最底层的 Accelerate 和 MPS,其实是苹果去年推出的接口,前者可以直接调用 CPU,后者则直接调用 GPU。 Core ML 会自行决定到底使用 CPU 还是 GPU 来进行运算,可以最大程度地利用硬件资源来处理模型数据。
+
+而 Core ML 往上一层则是应用层。Vision 主要负责图像相关的人工智能处理,如人脸识别、面部追踪、文字识别等等;NLP 则提供语义分析相关 API。这部分内容在以前版本的 SDK 中也存在,这次被集成到了新框架当中。好处在于,开发者拥有了更大的自由度。在以前,开发者的 app 调用这些高级接口,对底层的实现细节的掌控力度非常小。现在,你可以通过自定义底层所使用的机器学习模型,从而实现更个性化的需求。
+
+## Weex-ML
+
+Weex 交互视觉能力小结中提到,**Weex 最大的特别之处在于其 native 的能力, 我们要最大化利用 native 的特性, 而不是去模仿它**。
+
+作为本次 iOS 11 的一个重要 native 能力,我也第一时间尝试将 Core ML 透传到了 Weex 上。所有代码和 Demo 都已开源到 [Github](https://github.com/cxfeng1/Weex-ML),后续也会将机器学习相关的Weex 模块统一放到 Weex Market 上。
+
+得益于 Core ML API 的简洁,在 Weex 上使用 Core ML 相关能力变得非常简单:
+
+```javascript
+let imageRecognition = weex.requireModule('imageRecognition')
+imageRecognition.predictWithImage(this.$refs.image.ref, (results)=>{
+ this.results = results.slice(0,5);
+})
+```
+
+通过调用透传的 module `imageRecognition` , 并传入 image 组件的 ref 作为参数,就可以实现图片识别的功能,最后提取出识别结果中 confidence 最高的 5 个结果。
+
+## Demo
+
+### imageRecognition
+
+
+
+使用 [Inceptionv3](https://github.com/fchollet/keras/blob/0bb4e0fad5b4bb3743c8a7d03c260b62a35e7045/keras/applications/inception_v3.py) 作为模型,能够高效识别, 该模型已经在 [keras](https://github.com/fchollet/keras) 中被训练好并通过苹果提供的工具转换成 **mlmodel** 文件, 只需拖拽的方式就可以集成到 iOS 开发环境中, 上述 demo 输出了对一张图片分类最大可能的5个预测结果, 对于 Weex 来说,几行代码就能搞定。
+
+
+
+### digitDetect
+
+
+
+上述 demo 首先使用 [weex-gcanvas](http://market.dotwe.org/ext/list.htm#6) 插件做了一个简单的绘制板,然后使用 MNIST model 完成了对手写数字的识别。
+
+### faceDetect
+
+
+
+这个 demo 没有加载任何 model,使用了 iOS 11 内置的 Vision Framework,顾名思义,Vision 可以让开发者运行计算机视觉相关的任务,它相当于 Core ML 的 High-Level Solution, 它可以做很多事情:
+
+- 脸部识别,会返回一个矩形数组来表示每一个脸部
+- 脸部更精细识别,比如眼睛和鼻子的具体位置、头部的形状等,上述 demo 就是拿到这些信息以后使用 gcanvas 绘制出了面部精细轮廓
+- 图片中的矩形探测
+- 图片中的文字探测
+- 二维码/条形码探测
+- 视频中跟踪移动的物体
+
+## 总结
+
+这次 Core ML 的推出,同时得益于苹果对软硬件的全面掌控,使得从系统级到第三方开发者,都具备了在端上就可以进行机器学习模型处理的能力。所有代码和 Demo 都已上传到 [Github](https://github.com/cxfeng1/Weex-ML),欢迎贡献和交流。
+
+当然在实际研究过程中,也发现了 Core ML 的一些限制:
+
+- 无法在端上进行模型的训练,所有模型必须提前训练好再转换成 Core ML 的格式
+- 无法动态下载和更新模型,对于需要经常重新训练的模型不太友好
+- 目前看只支持监督学习的模型,不支持非监督学习。
+
+Weex 未来在提供更多功能透传的同时,也会继续探索更深层次的结合。
+
+最后,本文是 Weex 和 iOS 11 结合系列的第一篇文章,后续将会有更多有意思的iOS 11 feature (如 ARKit、 drag & drop 等) 和大家一起探讨。
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/_posts/hello_world.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/hello_world.md b/doc/source/_posts/hello_world.md
index 07f4223..803ef70 100644
--- a/doc/source/_posts/hello_world.md
+++ b/doc/source/_posts/hello_world.md
@@ -1,6 +1,7 @@
title: Hello World
type: blog
-order: 1
+
---
# Hello world
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/_posts/test.md
----------------------------------------------------------------------
diff --git a/doc/source/_posts/test.md b/doc/source/_posts/test.md
new file mode 100644
index 0000000..afaa8ec
--- /dev/null
+++ b/doc/source/_posts/test.md
@@ -0,0 +1,14 @@
+title: test
+type: blog
+
+---
+
+
+# test
+
+asdfadfasdfasdfadfadsf
+asdfasdfadsf
+adsfadsfadsf
+
+## sdfasdfasdf
+sdfsdfsdf
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/cn/references/bubble.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/bubble.md b/doc/source/cn/references/bubble.md
index 4b63cad..6f8f0ed 100644
--- a/doc/source/cn/references/bubble.md
+++ b/doc/source/cn/references/bubble.md
@@ -11,7 +11,7 @@ Weex 2.0 实现了 W3C 标准的事件冒泡机制。
### 使用
-```javascript
+```html
<template>
<div class="root" @click="rootClick" bubble="true">
<text style="font-size: 40px;">{{rootText}}</text>
@@ -81,7 +81,7 @@ Weex 2.0 实现了 W3C 标准的事件冒泡机制。
在事件处理函数中,可以使用 `e.stopPropagation()` 方法,来阻止本次事件向上的传递过程。注意,`e.stopPropagation()` 与 `bubble="true"` 不同,前者只会影响当前元素以及父元素的传播,不会影响子元素的传播;后者是为了版本兼容而增加的开关机制,会全局关闭或者开启冒泡机制,两者可以共同存在使用,如下:
-```javascript
+```html
<template>
<div class="root" @click="rootClick" bubble="true">
<text style="font-size: 40px;">{{rootText}}</text>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/cn/references/components/input.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/components/input.md b/doc/source/cn/references/components/input.md
index a0aecf8..3cf83fd 100644
--- a/doc/source/cn/references/components/input.md
+++ b/doc/source/cn/references/components/input.md
@@ -135,13 +135,15 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
<text style="font-size: 40px">oninput: {{txtInput}}</text>
<text style="font-size: 40px">onchange: {{txtChange}}</text>
<text style="font-size: 40px">onreturntype: {{txtReturnType}}</text>
+ <text style="font-size: 40px">selection: {{txtSelection}}</text>
+
</div>
<scroller>
<div>
<div style="background-color: #286090">
<text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = text</text>
</div>
- <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput" @focus="onfocus" @blur="onblur"/>
+ <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput"/>
</div>
<div>
@@ -181,6 +183,13 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
<div>
<div style="background-color: #286090">
+ <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = number</text>
+ </div>
+ <input type="number" placeholder="Input number" class="input" @change="onchange" @input="oninput"/>
+ </div>
+
+ <div>
+ <div style="background-color: #286090">
<text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = date</text>
</div>
<input type="date" placeholder="Input Date" class="input" @change="onchange" @input="oninput" max="2017-12-12" min="2015-01-01"/>
@@ -248,6 +257,7 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
</div>
<div style="flex-direction: row;margin-bottom: 16px;justify-content: space-between">
<text class="button" value="setRange" type="primary" @click="setRange"></text>
+ <text class="button" value="getSelectionRange" type="primary" @click="getSelectionRange"></text>
</div>
<input type="text" ref="inputselection" placeholder="please input" value="123456789" class="input" @change="onchange" @return = "onreturn" @input="oninput"/>
</div>
@@ -280,7 +290,6 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
</style>
<script>
- const modal = weex.requireModule('modal')
module.exports = {
data: function () {
return {
@@ -320,23 +329,16 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
console.log(this.$refs["inputselection"]);
this.$refs["inputselection"].setSelectionRange(2, 6);
},
- onfocus () {
- console.log('onfocus:');
- modal.toast({
- message: 'onfocus',
- duration: 0.8
- })
- },
- onblur () {
- console.log('onblur:');
- modal.toast({
- message: 'input blur',
- duration: 0.8
- })
+ getSelectionRange: function() {
+ console.log(this.$refs["inputselection"]);
+ var self = this;
+ this.$refs["inputselection"].getSelectionRange(function(e) {
+ self.txtSelection = e.selectionStart +'-' + e.selectionEnd;
+ });
}
}
};
</script>
```
-[体验一下](http://dotwe.org/vue/dd83d941d2364f2849e45dc3c5d91ab4)
+[体验一下](http://dotwe.org/vue/3470e4d0194f3879a72d38e2ab02cc9f)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/cn/v-0.10/references/bubble.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/v-0.10/references/bubble.md b/doc/source/cn/v-0.10/references/bubble.md
index cb25e05..74b7e98 100644
--- a/doc/source/cn/v-0.10/references/bubble.md
+++ b/doc/source/cn/v-0.10/references/bubble.md
@@ -2,7 +2,7 @@
title: 事件冒泡
type: references
order: 1.3
-version: 2.1
+version: 0.10
---
# 事件冒泡 <span class="api-version">v0.13+</span>
@@ -11,7 +11,7 @@ Weex 1.0 实现了 W3C 标准的事件冒泡机制。
### 使用
-```javascript
+```html
<template>
<div class="root" onclick="rootClick" bubble="true">
<div>
@@ -83,7 +83,7 @@ Weex 1.0 实现了 W3C 标准的事件冒泡机制。
在事件处理函数中,可以使用 `e.stopPropagation()` 方法,来阻止本次事件向上的传递过程。注意,`e.stopPropagation()` 与 `bubble="true"` 不同,前者只会影响当前元素以及父元素的传播,不会影响子元素的传播;后者是为了版本兼容而增加的开关机制,会全局关闭或者开启冒泡机制,两者可以共同存在使用,如下:
-```javascript
+```html
<template>
<div class="root" onclick="rootClick" bubble="true">
<div>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/references/bubble.md
----------------------------------------------------------------------
diff --git a/doc/source/references/bubble.md b/doc/source/references/bubble.md
index c66d9b9..8d2470c 100644
--- a/doc/source/references/bubble.md
+++ b/doc/source/references/bubble.md
@@ -11,7 +11,7 @@ Weex 2.0 implements the W3C standard event bubbling mechanism.
### Usage
-```javascript
+```html
<template>
<div class="root" @click="rootClick" bubble="true">
<text style="font-size: 40px;">{{rootText}}</text>
@@ -81,7 +81,7 @@ One thing should be noticed: **For compatibility with previous versions, Weex do
In the event handler function, you can use the `e.stopPropagation()` method to prevent the event from escalating. Note that `e.stopPropagation()` differs from `bubble = "true"`, which affects only the current elements and the propagation of parent elements, without affecting the propagation of child elements; the latter is a switching mechanism that is added for compatibility, Will be a global shutdown or open the bubble mechanism, the two can co-exist, as follows:
-```javascript
+```html
<template>
<div class="root" @click="rootClick" bubble="true">
<text style="font-size: 40px;">{{rootText}}</text>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/references/components/input.md
----------------------------------------------------------------------
diff --git a/doc/source/references/components/input.md b/doc/source/references/components/input.md
index 8eea2ad..fdd4d0a 100644
--- a/doc/source/references/components/input.md
+++ b/doc/source/references/components/input.md
@@ -113,13 +113,15 @@ does not support the common-event 'click'. Please listen to the 'input' or '
<text style="font-size: 40px">oninput: {{txtInput}}</text>
<text style="font-size: 40px">onchange: {{txtChange}}</text>
<text style="font-size: 40px">onreturntype: {{txtReturnType}}</text>
+ <text style="font-size: 40px">selection: {{txtSelection}}</text>
+
</div>
<scroller>
<div>
<div style="background-color: #286090">
<text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = text</text>
</div>
- <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput" @focus="onfocus" @blur="onblur"/>
+ <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput"/>
</div>
<div>
@@ -159,6 +161,13 @@ does not support the common-event 'click'. Please listen to the 'input' or '
<div>
<div style="background-color: #286090">
+ <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = number</text>
+ </div>
+ <input type="number" placeholder="Input number" class="input" @change="onchange" @input="oninput"/>
+ </div>
+
+ <div>
+ <div style="background-color: #286090">
<text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = date</text>
</div>
<input type="date" placeholder="Input Date" class="input" @change="onchange" @input="oninput" max="2017-12-12" min="2015-01-01"/>
@@ -226,6 +235,7 @@ does not support the common-event 'click'. Please listen to the 'input' or '
</div>
<div style="flex-direction: row;margin-bottom: 16px;justify-content: space-between">
<text class="button" value="setRange" type="primary" @click="setRange"></text>
+ <text class="button" value="getSelectionRange" type="primary" @click="getSelectionRange"></text>
</div>
<input type="text" ref="inputselection" placeholder="please input" value="123456789" class="input" @change="onchange" @return = "onreturn" @input="oninput"/>
</div>
@@ -258,7 +268,6 @@ does not support the common-event 'click'. Please listen to the 'input' or '
</style>
<script>
- const modal = weex.requireModule('modal')
module.exports = {
data: function () {
return {
@@ -298,23 +307,16 @@ does not support the common-event 'click'. Please listen to the 'input' or '
console.log(this.$refs["inputselection"]);
this.$refs["inputselection"].setSelectionRange(2, 6);
},
- onfocus () {
- console.log('onfocus:');
- modal.toast({
- message: 'onfocus',
- duration: 0.8
- })
- },
- onblur () {
- console.log('onblur:');
- modal.toast({
- message: 'input blur',
- duration: 0.8
- })
+ getSelectionRange: function() {
+ console.log(this.$refs["inputselection"]);
+ var self = this;
+ this.$refs["inputselection"].getSelectionRange(function(e) {
+ self.txtSelection = e.selectionStart +'-' + e.selectionEnd;
+ });
}
}
};
</script>
```
-[try it](http://dotwe.org/vue/dd83d941d2364f2849e45dc3c5d91ab4)
+[try it](http://dotwe.org/vue/3470e4d0194f3879a72d38e2ab02cc9f)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16f36fc/doc/source/v-0.10/references/bubble.md
----------------------------------------------------------------------
diff --git a/doc/source/v-0.10/references/bubble.md b/doc/source/v-0.10/references/bubble.md
index 849ab36..ba59a90 100644
--- a/doc/source/v-0.10/references/bubble.md
+++ b/doc/source/v-0.10/references/bubble.md
@@ -2,16 +2,16 @@
title: Event Bubble
type: references
order: 1.3
-version: 2.1
+version: 0.10
---
# Event Bubble <span class="api-version">v0.13+</span>
-Weex 2.0 implements the W3C standard event bubbling mechanism.
+Weex 1.0 implements the W3C standard event bubbling mechanism.
### Usage
-```javascript
+```html
<template>
<div class="root" onclick="rootClick" bubble="true">
<div>
@@ -83,7 +83,7 @@ One thing should be noticed: **For compatibility with previous versions, Weex do
In the event handler function, you can use the `e.stopPropagation()` method to prevent the event from escalating. Note that `e.stopPropagation()` differs from `bubble = "true"`, which affects only the current elements and the propagation of parent elements, without affecting the propagation of child elements; the latter is a switching mechanism that is added for compatibility, Will be a global shutdown or open the bubble mechanism, the two can co-exist, as follows:
-```javascript
+```html
<template>
<div class="root" onclick="rootClick" bubble="true">
<div>