You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ta...@apache.org on 2017/05/25 02:45:43 UTC

[01/50] incubator-weex git commit: * [html5] fix scale calculating when translate a negative value.

Repository: incubator-weex
Updated Branches:
  refs/heads/0.13-dev fa1424f4c -> 7a6b69a8c


* [html5] fix scale calculating when translate a negative value.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6a4f5514
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6a4f5514
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6a4f5514

Branch: refs/heads/0.13-dev
Commit: 6a4f5514a81c3c84c720de56e4f5d8efb42a7576
Parents: 88789e0
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 3 16:00:00 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 3 16:00:00 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/style.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6a4f5514/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index db57394..535afed 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -85,7 +85,7 @@ export function normalizeString (styleKey: string, styleVal: string): string {
   if (unitsNum) { return unitsNum }
 
   // 2. test if is a translate scale. e.g. `transform: translate2d(1px, 2px);`
-  const regTranslateString = /translate[^(]*\([\d ,.pwx]+\)/i // unit support: wx, px.
+  const regTranslateString = /translate[^(]*\([+-\d ,.pwx]+\)/i // unit support: wx, px.
   if (styleKey.match(/transform/i) && regTranslateString.test(styleVal)) {
     const val = styleVal.replace(regTranslateString, function (translate) {
       const reg = /([+-]?\d+(?:\.\d+)?)([p,w]x)?(?![dD])/g


[18/50] incubator-weex git commit: * [html5] fix click bubble tests.

Posted by ta...@apache.org.
* [html5] fix click bubble tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/37231969
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/37231969
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/37231969

Branch: refs/heads/0.13-dev
Commit: 372319692e26ef0a5275976d1ebcb0f643e2c73f
Parents: 0414737
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 19:45:04 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 19:45:04 2017 +0800

----------------------------------------------------------------------
 html5/test/render/vue/core/node.js                 |  4 ++--
 .../render/vue/data/dotvue/event-bubble-bar.vue    | 13 ++++++++++++-
 html5/test/render/vue/data/dotvue/event-bubble.vue | 17 ++++++++++++++---
 3 files changed, 28 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/37231969/html5/test/render/vue/core/node.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/core/node.js b/html5/test/render/vue/core/node.js
index 910e390..8076e4c 100644
--- a/html5/test/render/vue/core/node.js
+++ b/html5/test/render/vue/core/node.js
@@ -31,7 +31,7 @@ init('core node', (Vue, helper) => {
        * child vnode -> parent vnode.
        *  e.g.  div -> foo (whoes root element is the div.)
        */
-      const evt = new Event('click', { bubbles: true })
+      const evt = new Event('tap', { bubbles: true })
       el.dispatchEvent(evt)
 
       helper.registerDone(id, (tracker) => {
@@ -49,7 +49,7 @@ init('core node', (Vue, helper) => {
        * click inner div. should just trigget the inner handler and
        * shouldn't bubbe to outter div.
        */
-      const evt = new Event('click', { bubbles: true })
+      const evt = new Event('tap', { bubbles: true })
       inner.dispatchEvent(evt)
 
       helper.registerDone(id, (tracker) => {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/37231969/html5/test/render/vue/data/dotvue/event-bubble-bar.vue
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/data/dotvue/event-bubble-bar.vue b/html5/test/render/vue/data/dotvue/event-bubble-bar.vue
index bcf547a..02f289d 100644
--- a/html5/test/render/vue/data/dotvue/event-bubble-bar.vue
+++ b/html5/test/render/vue/data/dotvue/event-bubble-bar.vue
@@ -17,4 +17,15 @@
       }
     }
   }
-</script>
\ No newline at end of file
+</script>
+
+<style scoped>
+.event-bubble-outter {
+  height: 400px;
+  background-color: #f7f7f7;
+}
+.event-bubble-inner {
+  height: 200px;
+  background-color: #ccc;
+}
+</style>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/37231969/html5/test/render/vue/data/dotvue/event-bubble.vue
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/data/dotvue/event-bubble.vue b/html5/test/render/vue/data/dotvue/event-bubble.vue
index 71b77a4..3ee3be4 100644
--- a/html5/test/render/vue/data/dotvue/event-bubble.vue
+++ b/html5/test/render/vue/data/dotvue/event-bubble.vue
@@ -1,7 +1,7 @@
 <template>
-  <div>
+  <div class="ct">
     <bar @click="click"></bar>
-    <text>{{tracker}}</text>
+    <text class="txt">{{tracker}}</text>
   </div>
 </template>
 
@@ -22,4 +22,15 @@
       bar: require('./event-bubble-bar.vue')
     }
   }
-</script>
\ No newline at end of file
+</script>
+
+<style scoped>
+.ct {
+  height: 600px;
+  background-color: #fff;
+}
+.txt {
+  font-size: 32px;
+  padding: 20px;
+}
+</style>


[36/50] incubator-weex git commit: * [html5] release vue-render 0.11.32

Posted by ta...@apache.org.
* [html5] release vue-render 0.11.32


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/75287e4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/75287e4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/75287e4b

Branch: refs/heads/0.13-dev
Commit: 75287e4b1b09017f7d694f502acb721ffce57eea
Parents: 6ef1d96
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 16 00:30:57 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 16 00:30:57 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/75287e4b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5713f10..3717df9 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.31",
+    "vue-render": "0.11.32",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/75287e4b/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 6035b26..4520f28 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.31",
+  "version": "0.11.32",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[50/50] incubator-weex git commit: * [html5] add licence head.

Posted by ta...@apache.org.
* [html5] add licence head.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7a6b69a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7a6b69a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7a6b69a8

Branch: refs/heads/0.13-dev
Commit: 7a6b69a8cbb388a6d45755c174f8d162e70c4b81
Parents: 23df1a6
Author: MrRaindrop <te...@gmail.com>
Authored: Thu May 25 10:32:44 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu May 25 10:32:44 2017 +0800

----------------------------------------------------------------------
 .../vue/components/slider/slider-neighbor.js     | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7a6b69a8/html5/render/vue/components/slider/slider-neighbor.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slider-neighbor.js b/html5/render/vue/components/slider/slider-neighbor.js
index b6a49e4..c576ea7 100644
--- a/html5/render/vue/components/slider/slider-neighbor.js
+++ b/html5/render/vue/components/slider/slider-neighbor.js
@@ -1,4 +1,21 @@
-// import { validateStyles } from '../../validator'
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 import './slider-neighbor.css'
 import { extractComponentStyle, createEventMap } from '../../core'
 import { throttle, bind, extend, fireLazyload } from '../../utils'


[03/50] incubator-weex git commit: * [html5] fix updating and processing children's style.

Posted by ta...@apache.org.
* [html5] fix updating and processing children's style.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8d3e29e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8d3e29e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8d3e29e0

Branch: refs/heads/0.13-dev
Commit: 8d3e29e0c2a0acba5b12d398d05cfea81e43888e
Parents: 00a4db8
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 3 22:34:41 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 3 22:34:41 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/base.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8d3e29e0/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 734f667..4360fc1 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -88,12 +88,28 @@ export default {
     if (process.env.NODE_ENV === 'development') {
       tagUpdated()
     }
+
+    /**
+     * During updating process, updateChildren will not process the render function of the
+     * children's components. Therefore it is necessary to process children's static styles in
+     * this hook func.
+     */
     const children = this.$children
     if (children) {
       children.forEach((childVm) => {
+        /**
+         * Has to delete the previousVnode's staticStyle. Otherwise some style props may not
+         * be attached on the dom, since the previous staticStyle val is equal with the new
+         * updated style val.
+         */
+        let i
+        if ((i = childVm._vnode) && (i = childVm._vnode.data)) {
+          delete i.staticStyle
+        }
         childVm._watcher.run()
       })
     }
+
     watchAppear(this)
   },
 


[15/50] incubator-weex git commit: * [html5] fix limit scale to 1px.

Posted by ta...@apache.org.
* [html5] fix limit scale to 1px.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3bdc8629
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3bdc8629
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3bdc8629

Branch: refs/heads/0.13-dev
Commit: 3bdc86291ccab46d2e250dc11973d9d699cc80b8
Parents: 173c482
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 17:40:27 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 17:40:27 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/style.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3bdc8629/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index 0bcfaf1..3287535 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -74,10 +74,14 @@ function getUnitScaleMap () {
   }
 }
 
+function limitScale (val, limit) {
+  limit = limit || 1
+  return Math.abs(val) > limit ? val : Math.sign(val) * limit
+}
+
 function parseScale (val: number, unit: string): string {
   const unitScaleMap = getUnitScaleMap()
-  const res = val * unitScaleMap[unit]
-  return (res === 0 ? 0 : res > 1 ? res : 1) + 'px'
+  return limitScale(val * unitScaleMap[unit]) + 'px'
 }
 
 export function normalizeString (styleKey: string, styleVal: string): string {
@@ -105,7 +109,7 @@ export function normalizeString (styleKey: string, styleVal: string): string {
     const unitScaleMap = getUnitScaleMap()
     const val = styleVal.replace(numReg, function (m, $0, $1) {
       const res = parseFloat($0) * unitScaleMap[$1]
-      return (res === 0 ? 0 : res > 1 ? res : 1) + 'px'
+      return limitScale(res) + 'px'
     })
     return val
   }


[21/50] incubator-weex git commit: * [html5] firelazyload before animte dom.

Posted by ta...@apache.org.
* [html5] firelazyload before animte dom.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1b72c9e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1b72c9e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1b72c9e3

Branch: refs/heads/0.13-dev
Commit: 1b72c9e3ce5d4ec16f1550aacd39f1740a979659
Parents: 3c66ca5
Author: MrRaindrop <te...@gmail.com>
Authored: Thu May 11 16:45:31 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu May 11 16:45:31 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/animation.js | 3 +++
 html5/render/vue/utils/lazyload.js    | 3 ++-
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b72c9e3/html5/render/vue/modules/animation.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/animation.js b/html5/render/vue/modules/animation.js
index 07542bb..d7e0b32 100644
--- a/html5/render/vue/modules/animation.js
+++ b/html5/render/vue/modules/animation.js
@@ -41,6 +41,9 @@ function transitionOnce (vnode, config, callback) {
   const transitionValue = `all ${duration}ms ${timing} ${delay}ms`
 
   const dom = vnode.$el
+  // trigger image lazyloading by force.
+  dom && weex.utils.fireLazyload(dom, true)
+
   const transitionEndHandler = function (event) {
     event.stopPropagation()
     dom.removeEventListener('webkitTransitionEnd', transitionEndHandler)

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b72c9e3/html5/render/vue/utils/lazyload.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/lazyload.js b/html5/render/vue/utils/lazyload.js
index 667d6b6..c8bd369 100644
--- a/html5/render/vue/utils/lazyload.js
+++ b/html5/render/vue/utils/lazyload.js
@@ -84,7 +84,8 @@ export function fireLazyload (el: Array<any> | any | null, ignoreVisibility: ?bo
   }
   el = el || document.body
   if (!el) { return }
-  const imgs: NodeList = (el || document.body).querySelectorAll('[img-src]')
+  let imgs: NodeList | Array<any> = (el || document.body).querySelectorAll('[img-src]')
+  if (el.getAttribute('img-src')) { imgs = [el] }
   for (let i: number = 0; i < imgs.length; i++) {
     const img = imgs[i]
     if (typeof ignoreVisibility === 'boolean' && ignoreVisibility) {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b72c9e3/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2acf46a..1f55aed 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.23",
+    "vue-render": "0.11.24",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b72c9e3/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 85fb66b..fb41117 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.23",
+  "version": "0.11.24",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[41/50] incubator-weex git commit: * [html5] fix scrollToElement bug for not stopping step function.

Posted by ta...@apache.org.
* [html5] fix scrollToElement bug for not stopping step function.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/90efb9a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/90efb9a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/90efb9a1

Branch: refs/heads/0.13-dev
Commit: 90efb9a13b1dfbee67bab841fa279132ee8ea8b3
Parents: d43f5cb
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 17 16:48:04 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 17 16:48:04 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/dom.js       | 7 ++++++-
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/90efb9a1/html5/render/vue/modules/dom.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/dom.js b/html5/render/vue/modules/dom.js
index 6d1e4dc..2efccfc 100644
--- a/html5/render/vue/modules/dom.js
+++ b/html5/render/vue/modules/dom.js
@@ -64,7 +64,12 @@ function step (context) {
   context.method.call(context.scrollable, context.dSuffix, currentPosition)
 
   // return when end points have been reached
-  if (currentPosition === context.position) {
+  /**
+   * NOTE: should use ~~ to parse position number into integer. Otherwise
+   * this two float numbers maybe have a slicely little difference, which
+   * will cause this function never to stop.
+   */
+  if (~~currentPosition === ~~context.position) {
     window.cancelAnimationFrame(context.frame)
     return
   }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/90efb9a1/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 26df24a..2e3a41d 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.33",
+    "vue-render": "0.11.34",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/90efb9a1/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index d5469b3..81f2a7e 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.33",
+  "version": "0.11.34",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[42/50] incubator-weex git commit: * [html5] release v0.11.35

Posted by ta...@apache.org.
* [html5] release v0.11.35


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/21ceac3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/21ceac3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/21ceac3b

Branch: refs/heads/0.13-dev
Commit: 21ceac3b0ab023cbf9c83bba011e5cb90bb6e464
Parents: 90efb9a
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 17 22:55:44 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 17 22:55:44 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/21ceac3b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2e3a41d..ccca173 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.34",
+    "vue-render": "0.11.35",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/21ceac3b/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 81f2a7e..60960d7 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.34",
+  "version": "0.11.35",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[07/50] incubator-weex git commit: * [html5] fix slider & indicator.

Posted by ta...@apache.org.
* [html5] fix slider & indicator.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/88c199d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/88c199d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/88c199d3

Branch: refs/heads/0.13-dev
Commit: 88c199d31c7ad35d4bae6dcfaa90f189d2e69b6d
Parents: b7c194b
Author: MrRaindrop <te...@gmail.com>
Authored: Fri May 5 12:09:47 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri May 5 12:09:47 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/index.js     | 8 ++++++++
 html5/render/vue/components/slider/indicator.js | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/88c199d3/html5/render/vue/components/slider/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/index.js b/html5/render/vue/components/slider/index.js
index 72c2653..72d7bd1 100644
--- a/html5/render/vue/components/slider/index.js
+++ b/html5/render/vue/components/slider/index.js
@@ -133,6 +133,14 @@ export default {
   },
 
   updated () {
+    const children = this.$children
+    const len = children && children.length
+    if (children && len > 0) {
+      const indicator = children[len - 1]
+      if (indicator.$options._componentTag === 'indicator') {
+        indicator._watcher.get()
+      }
+    }
     fireLazyload(this.$el, true)
   },
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/88c199d3/html5/render/vue/components/slider/indicator.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/indicator.js b/html5/render/vue/components/slider/indicator.js
index 4a6032f..060c21d 100644
--- a/html5/render/vue/components/slider/indicator.js
+++ b/html5/render/vue/components/slider/indicator.js
@@ -156,7 +156,7 @@ function _reLayout (context, virtualRect, ltbr) {
   }]
   Object.keys(axisMap).forEach(key => {
     const { dir, scale } = axisMap[key]
-    el.style[dir] = ltbr[dir] + virtualRect[scale] / 2 - rect[scale] / 2 + 'px'
+    el.style[dir] = (ltbr[dir] || 0) + virtualRect[scale] / 2 - rect[scale] / 2 + 'px'
   })
 }
 


[17/50] incubator-weex git commit: * [html5] use tap for click event since click has 300ms latency in ios.

Posted by ta...@apache.org.
* [html5] use tap for click event since click has 300ms latency in 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/04147374
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/04147374
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/04147374

Branch: refs/heads/0.13-dev
Commit: 04147374ae00838c9e8d7ac7f58dbedb2bac14d1
Parents: 910546e
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 17:52:43 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 17:52:43 2017 +0800

----------------------------------------------------------------------
 .../render/vue/components/slider/slideMixin.js  |  6 +-
 html5/render/vue/core/node.js                   | 62 ++++++++++++--------
 html5/render/vue/mixins/scrollable.js           |  6 +-
 3 files changed, 43 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/04147374/html5/render/vue/components/slider/slideMixin.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js
index 3aef972..314a377 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -179,7 +179,7 @@ export default {
     },
 
     handleTouchStart (event) {
-      event.stopPropagation()
+      // event.stopPropagation()
       const touch = event.changedTouches[0]
       this._touchParams = {
         originalTransform: this.$refs.inner.style.webkitTransform || this.$refs.inner.style.transform,
@@ -191,7 +191,7 @@ export default {
     },
 
     handleTouchMove (event) {
-      event.stopPropagation()
+      // event.stopPropagation()
       const tp = this._touchParams
       if (!tp) { return }
       const { startX, startY } = this._touchParams
@@ -225,7 +225,7 @@ export default {
     },
 
     handleTouchEnd (event) {
-      event.stopPropagation()
+      // event.stopPropagation()
       const tp = this._touchParams
       if (!tp) { return }
       const isV = tp.isVertical

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/04147374/html5/render/vue/core/node.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/node.js b/html5/render/vue/core/node.js
index e9a28df..746f3c6 100644
--- a/html5/render/vue/core/node.js
+++ b/html5/render/vue/core/node.js
@@ -17,6 +17,8 @@
  * under the License.
  */
 
+import { extend } from '../utils'
+
 /**
  * remove text nodes in the nodes array.
  * @param  {Array} nodes
@@ -52,7 +54,7 @@ function getListeners (vnode, evt) {
 }
 
 const supportedEvents = [
-  'click', 'longpress', 'appear', 'disappear',
+  'longpress', 'appear', 'disappear',
   // 'touchstart', 'touchmove', 'touchend',
   'panstart', 'panmove', 'panend', 'swipe', 'longpress'
 ]
@@ -63,34 +65,44 @@ const supportedEvents = [
  */
 export function createEventMap (context, extras = []) {
   const eventMap = {}
-  supportedEvents.concat(extras).forEach(name => {
-    eventMap[name] = function (e) {
-      // no original bubbling.
-      e.stopPropagation()
-      // but should trigger the closest parent which has bound the
-      // event handler.
-      let vm = context
-      while (vm) {
-        const ons = getListeners(vm.$vnode, name)
-        const len = ons.length
-        let idx = 0
-        while (idx < len) {
-          let on = ons[idx]
-          if (on && on.fn) {
-            on = on.fn
+  /**
+   * bind name with evt event. e.g. bind 'click' with 'tap' event.
+   */
+  const bindFunc = (evt) => {
+    return name => {
+      const evtType = evt || name
+      eventMap[evtType] = function (e) {
+        // no original bubbling.
+        e.stopPropagation()
+        // but should trigger the closest parent which has bound the
+        // event handler.
+        let vm = context
+        while (vm) {
+          const ons = getListeners(vm.$vnode, name)
+          const len = ons.length
+          let idx = 0
+          while (idx < len) {
+            let on = ons[idx]
+            if (on && on.fn) {
+              on = on.fn
+            }
+            on && on.call(vm,
+              evtType === name ? e : extend({}, e, { type: name })
+            )
+            idx++
           }
-          on && on.call(vm, e)
-          idx++
-        }
 
-        // once a parent node (or self node) has triggered the handler,
-        // then it stops bubble immediately.
-        if (len > 0) {
-          return
+          // once a parent node (or self node) has triggered the handler,
+          // then it stops bubble immediately.
+          if (len > 0) {
+            return
+          }
+          vm = vm.$parent
         }
-        vm = vm.$parent
       }
     }
-  })
+  }
+  supportedEvents.concat(extras).forEach(bindFunc())
+  bindFunc('tap')('click')
   return eventMap
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/04147374/html5/render/vue/mixins/scrollable.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/scrollable.js b/html5/render/vue/mixins/scrollable.js
index 45a9853..b0a84de 100644
--- a/html5/render/vue/mixins/scrollable.js
+++ b/html5/render/vue/mixins/scrollable.js
@@ -110,7 +110,7 @@ export default {
 
     handleTouchStart (event) {
       // event.preventDefault()
-      event.stopPropagation()
+      // event.stopPropagation()
       if (this._loading || this._refresh) {
         const touch = event.changedTouches[0]
         this._touchParams = {
@@ -126,7 +126,7 @@ export default {
 
     handleTouchMove (event) {
       // event.preventDefault()
-      event.stopPropagation()
+      // event.stopPropagation()
       if (this._touchParams) {
         const inner = this.$refs.inner
         const { startY, reachTop, reachBottom } = this._touchParams
@@ -146,7 +146,7 @@ export default {
 
     handleTouchEnd (event) {
       // event.preventDefault()
-      event.stopPropagation()
+      // event.stopPropagation()
       if (this._touchParams) {
         const inner = this.$refs.inner
         const { reachTop, reachBottom } = this._touchParams


[05/50] incubator-weex git commit: * [html5] use to preprocess vnode's style data, which will be directly used in updateChildren patch ignoring the render function processing.

Posted by ta...@apache.org.
* [html5] use  to preprocess vnode's style data, which will be directly used in updateChildren patch ignoring the render function processing.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6ed07bd5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6ed07bd5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6ed07bd5

Branch: refs/heads/0.13-dev
Commit: 6ed07bd5c521d8c77cce5dbcdc994f9aad3939ed
Parents: c853cb9
Author: MrRaindrop <te...@gmail.com>
Authored: Thu May 4 18:25:23 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu May 4 18:25:23 2017 +0800

----------------------------------------------------------------------
 build/webpack.examples.web.config.js  | 29 +++++++++++------------
 build/webpack.test.web.config.js      | 21 ++++++++---------
 html5/render/vue/core/style.js        | 15 ++++++++----
 html5/render/vue/mixins/base.js       | 38 +++++++++++++-----------------
 html5/render/vue/mixins/style.js      | 14 ++++++-----
 package.json                          |  2 +-
 packages/weex-vue-render/package.json |  2 +-
 7 files changed, 60 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed07bd5/build/webpack.examples.web.config.js
----------------------------------------------------------------------
diff --git a/build/webpack.examples.web.config.js b/build/webpack.examples.web.config.js
index 5f329ed..4b81cc5 100644
--- a/build/webpack.examples.web.config.js
+++ b/build/webpack.examples.web.config.js
@@ -80,20 +80,19 @@ module.exports = {
       }
     ]
   },
-  // vue: {
-  //   /**
-  //    * important! should use postTransformNode to add $processStyle for
-  //    * inline style prefixing.
-  //    */
-  //   compilerModules: [
-  //     {
-  //       postTransformNode: el => {
-  //         el.staticStyle = `$processStyle(${el.staticStyle})`
-  //         el.styleBinding = `$processStyle(${el.styleBinding})`
-  //       }
-  //     }
-  //   ],
-  //   postcss: [require('autoprefixer')()]
-  // },
+  vue: {
+    /**
+     * important! should use postTransformNode to add $processStyle for
+     * inline style prefixing.
+     */
+    compilerModules: [
+      {
+        postTransformNode: el => {
+          el.staticStyle = `$processStyle(${el.staticStyle})`
+          el.styleBinding = `$processStyle(${el.styleBinding})`
+        }
+      }
+    ],
+  },
   plugins: [bannerPlugin]
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed07bd5/build/webpack.test.web.config.js
----------------------------------------------------------------------
diff --git a/build/webpack.test.web.config.js b/build/webpack.test.web.config.js
index 64e0009..3135852 100644
--- a/build/webpack.test.web.config.js
+++ b/build/webpack.test.web.config.js
@@ -80,20 +80,19 @@ module.exports = {
       }
     ]
   },
-  // vue: {
+  vue: {
     /**
      * important! should use postTransformNode to add $processStyle for
      * inline style prefixing.
      */
-    // compilerModules: [
-    //   {
-    //     postTransformNode: el => {
-    //       el.staticStyle = `$processStyle(${el.staticStyle})`
-    //       el.styleBinding = `$processStyle(${el.styleBinding})`
-    //     }
-    //   }
-    // ],
-    // postcss: [require('autoprefixer')()]
-  // }
+    compilerModules: [
+      {
+        postTransformNode: el => {
+          el.staticStyle = `$processStyle(${el.staticStyle})`
+          el.styleBinding = `$processStyle(${el.styleBinding})`
+        }
+      }
+    ]
+  }
   // plugins: [bannerPlugin]
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed07bd5/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index 4f6aa78..2d6ec6f 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -158,7 +158,7 @@ export function getScopeStyle (vnode, classNames) {
     map && extendTruthy(style, map)
     clsNmsIdx++
   }
-  return style
+  return camelizeKeys(style)
 }
 
 function getStyle (vnode, extract) {
@@ -166,20 +166,25 @@ function getStyle (vnode, extract) {
   const staticClassNames = (typeof data.staticClass === 'string') ? data.staticClass.split(' ') : (data.staticClass || [])
   const classNames = (typeof data.class === 'string') ? data.class.split(' ') : (data.class || [])
   const clsNms = staticClassNames.concat(classNames)
-  const style = getScopeStyle(vnode, clsNms)
+  const style = normalizeStyle(getScopeStyle(vnode, clsNms))
+  /**
+   * cache static style and bind style.
+   * cached staticStyle (including style and staticStyle) has already been normalized
+   * in $processStyle. So there's no need to normalize it again.
+   */
   if (!data.cached) {
     // cache staticStyle once in the beginning.
     data.cached = extendTruthy({}, data.staticStyle)
   }
   // cache binding style every time since the binding style is variable.
   extendTruthy(data.cached, data.style)
-  extend(style, data.cached)
+  extend(style, camelizeKeys(data.cached))
   data.staticStyle = style
   if (extract) {
     delete data.staticStyle
     delete data.style
   }
-  return camelizeKeys(style)
+  return style
 }
 
 /**
@@ -199,7 +204,7 @@ export function getComponentStyle (context, extract) {
     extend(style, getStyle(vnode, extract))
     vnode = vnode.parent
   }
-  style = addPrefix(normalizeStyle(style))
+  style = addPrefix(style)
   /**
    * when prefixed value is a array, it should be applied to element
    * during the next tick.

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed07bd5/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 0b49566..e1476b0 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -52,6 +52,17 @@ function watchLazyload () {
   })
 }
 
+let warned = false
+const notePage = 'https://gist.github.com/MrRaindrop/5a805a067146609e5cfd4d64d775d693#file-weex-vue-render-config-for-vue-loader-js'
+function warnProcessStyle () {
+  if (!warned) {
+    warned = true
+    const page = window._process_style_note_page || notePage
+    console.warn(`[vue-render]: you should add vue-loader config with $processStyle to enable inline styles's `
+      + `normalization. see ${page} If you already did this, please ignore this message.`)
+  }
+}
+
 export default {
   beforeCreate () {
     if (!lazyloadWatched) {
@@ -77,6 +88,11 @@ export default {
       weex._root.classList.add('weex-root')
     }
 
+    // give warning for not using $processStyle in vue-loader config.
+    if (!warned && !window._style_processing_added) {
+      warnProcessStyle()
+    }
+
     // bind attrs to $el.
     let i, j
     if (this.$el && (i = j = this.$vnode) && (i = i.data) && (j = j.componentOptions)) {
@@ -96,28 +112,6 @@ export default {
     if (process.env.NODE_ENV === 'development') {
       tagUpdated()
     }
-
-    /**
-     * During updating process, updateChildren will not process the render function of the
-     * children's components. Therefore it is necessary to process children's static styles in
-     * this hook func.
-     */
-    const children = this.$children
-    if (children) {
-      children.forEach((childVm) => {
-        /**
-         * Has to delete the previousVnode's staticStyle. Otherwise some style props may not
-         * be attached on the dom, since the previous staticStyle val is equal with the new
-         * updated style val.
-         */
-        let i
-        if ((i = childVm._vnode) && (i = childVm._vnode.data)) {
-          delete i.staticStyle
-        }
-        childVm._watcher.run()
-      })
-    }
-
     watchAppear(this)
   },
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed07bd5/html5/render/vue/mixins/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/style.js b/html5/render/vue/mixins/style.js
index 8625537..69b7dc2 100644
--- a/html5/render/vue/mixins/style.js
+++ b/html5/render/vue/mixins/style.js
@@ -22,8 +22,10 @@ import {
   extractComponentStyle
 } from '../core'
 
-let warned = false
-const warnInfo = `[vue-render] after v0.11.3 there's no need to add $processStyle in vue-loader config anymore.`
+import {
+  normalizeStyle,
+  camelizeKeys
+} from '../utils'
 
 export default {
   beforeCreate () {
@@ -35,11 +37,11 @@ export default {
 
   methods: {
     $processStyle (style) {
-      if (!warned) {
-        warned = true
-        console.warn(warnInfo)
+      window._style_processing_added = true
+      if (!style) {
+        return
       }
-      return style
+      return normalizeStyle(camelizeKeys(style))
     },
 
     _extractComponentStyle () {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed07bd5/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 4637764..5d0530f 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.17",
+    "vue-render": "0.11.18",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed07bd5/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 5d95837..d7ec02d 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.17",
+  "version": "0.11.18",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[31/50] incubator-weex git commit: * [html5] test performance's existance.

Posted by ta...@apache.org.
* [html5] test performance's existance.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/18f25501
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/18f25501
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/18f25501

Branch: refs/heads/0.13-dev
Commit: 18f255011049643d42e9ac383ac7f06250564710
Parents: a0eda53
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 17:55:44 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 17:55:44 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/perf.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/18f25501/html5/render/vue/utils/perf.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/perf.js b/html5/render/vue/utils/perf.js
index 37b3512..a5c4ee8 100644
--- a/html5/render/vue/utils/perf.js
+++ b/html5/render/vue/utils/perf.js
@@ -114,7 +114,7 @@ function collectStat (): void {
   })
 
   // get templateUrl && JSTemplateSize
-  const entries = performance.getEntries && performance.getEntries()
+  const entries = performance && performance.getEntries && performance.getEntries()
   if (entries) {
     const params = window.lib.httpurl(location.href).params
     const bundle = params.page || params._wx_tpl
@@ -145,11 +145,11 @@ export function collectStatPerf (name: string, val: string | number): void {
 }
 
 function getNow (): number {
-  return performance.now ? performance.now() : new Date().getTime()
+  return performance && performance.now ? performance.now() : new Date().getTime()
 }
 
 function getEntries (): Array<any> {
-  return performance.getEntries
+  return performance && performance.getEntries
     ? performance.getEntries()
     : [{ responseEnd: getNow() - IMG_REC_INDENT }]
 }


[23/50] incubator-weex git commit: * [html5] fix flex 1 in old devices.

Posted by ta...@apache.org.
* [html5] fix flex 1 in old devices.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d0057518
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d0057518
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d0057518

Branch: refs/heads/0.13-dev
Commit: d00575182d715e063d00807c09b0a6b9b49c6163
Parents: e2dd9bf
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 10:17:42 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 10:17:42 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/core/style.js  | 6 +++---
 html5/render/vue/utils/style.js | 8 +++++++-
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d0057518/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index 0003ad7..74b4c9b 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -22,11 +22,11 @@ import {
   extend,
   extendTruthy,
   trimComment,
-  normalizeStyle
+  normalizeStyle,
+  autoPrefix
 } from '../utils'
 import { tagBegin, tagEnd } from '../utils/perf'
 /* istanbul ignore next */
-import addPrefix from 'inline-style-prefixer/static'
 
 /**
  * get scoped class style map from stylesheets in <head>.
@@ -204,7 +204,7 @@ export function getComponentStyle (context, extract) {
     extend(style, getStyle(vnode, extract))
     vnode = vnode.parent
   }
-  style = addPrefix(style)
+  style = autoPrefix(style)
   /**
    * when prefixed value is a array, it should be applied to element
    * during the next tick.

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d0057518/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index 3287535..65e94f2 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -119,7 +119,13 @@ export function normalizeString (styleKey: string, styleVal: string): string {
 }
 
 export function autoPrefix (style: {}): {} {
-  return addPrefix(style)
+  const prefixed = addPrefix(style)
+  // flex only added WebkitFlex. Should add WebkitBoxFlex also.
+  const flex = prefixed.flex
+  if (flex) {
+    prefixed.WebkitBoxFlex = flex
+  }
+  return prefixed
 }
 
 export function normalizeNumber (styleKey: string, styleVal: number): string {


[16/50] incubator-weex git commit: * [html5] release vue-render 0.11.22

Posted by ta...@apache.org.
* [html5] release vue-render 0.11.22


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/910546e9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/910546e9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/910546e9

Branch: refs/heads/0.13-dev
Commit: 910546e94b01923add1e136beb973bfd0d71ffe9
Parents: 3bdc862
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 17:42:15 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 17:42:15 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/910546e9/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index f859c1c..f82cce0 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.21",
+    "vue-render": "0.11.22",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/910546e9/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index e7ba5fa..2ac5c25 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.21",
+  "version": "0.11.22",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[11/50] incubator-weex git commit: * [html5] fix style regexp.

Posted by ta...@apache.org.
* [html5] fix style regexp.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e30b1a54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e30b1a54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e30b1a54

Branch: refs/heads/0.13-dev
Commit: e30b1a543f5a6a896e763f1135eecb6bb3dd8c68
Parents: f8b7759
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 11:45:34 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 11:45:34 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/env/weex.js    |  8 +++++-
 html5/render/vue/utils/style.js | 51 ++++++++++++++++++------------------
 2 files changed, 33 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e30b1a54/html5/render/vue/env/weex.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/weex.js b/html5/render/vue/env/weex.js
index dba6d3d..e5ae94b 100644
--- a/html5/render/vue/env/weex.js
+++ b/html5/render/vue/env/weex.js
@@ -33,7 +33,9 @@ const weex = {
     bundleUrl: location.href
   },
 
-  document: { body: {} },
+  document: {
+    body: {}
+  },
 
   requireModule (moduleName) {
     return weexModules[moduleName]
@@ -43,6 +45,10 @@ const weex = {
     return this.registerApiModule(...args)
   },
 
+  /**
+   * Register a new vue instance in this weex instance. Put its root element into weex.document.body.children, so
+   * that user can use weex.document.body to walk through all dom structures in all vue instances in the page.
+   */
   registerVueInstance (instance) {
     if (!instance instanceof Vue) {
       if (process.env.NODE_ENV === 'development') {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e30b1a54/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index 535afed..aca1fc7 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -66,13 +66,18 @@ export function normalizeUnitsNum (val: string): string {
   return parseScale(parseFloat(match[1]), unit)
 }
 
-function parseScale (val: number, unit: string): string {
+function getUnitScaleMap () {
   const { scale, dpr } = getViewportInfo()
-  const unitScaleMap = {
+  return {
     px: scale,
     wx: scale * dpr
   }
-  return val * unitScaleMap[unit] + 'px'
+}
+
+function parseScale (val: number, unit: string): string {
+  const unitScaleMap = getUnitScaleMap()
+  const res = val  * unitScaleMap[unit]
+  return (res === 0 ? 0 : res > 1 ? res : 1) + 'px'
 }
 
 export function normalizeString (styleKey: string, styleVal: string): string {
@@ -80,31 +85,27 @@ export function normalizeString (styleKey: string, styleVal: string): string {
     return styleVal
   }
 
-  // 1. test if is a regular scale css. e.g. `width: 100px;`
+  /**
+   * 1. test if is a regular scale css. e.g. `width: 100px;`
+   *  this should be a standalone number value with or without unit, otherwise
+   *  it shouldn't be changed.
+   */
   const unitsNum = normalizeUnitsNum(styleVal)
   if (unitsNum) { return unitsNum }
 
-  // 2. test if is a translate scale. e.g. `transform: translate2d(1px, 2px);`
-  const regTranslateString = /translate[^(]*\([+-\d ,.pwx]+\)/i // unit support: wx, px.
-  if (styleKey.match(/transform/i) && regTranslateString.test(styleVal)) {
-    const val = styleVal.replace(regTranslateString, function (translate) {
-      const reg = /([+-]?\d+(?:\.\d+)?)([p,w]x)?(?![dD])/g
-      return translate.replace(reg, function (m, $1, $2) {
-        const unit = $2 || 'px'
-        return parseScale($1, unit)
-      })
-    })
-    return val
-  }
-
-  // 3. test if is a border style. e.g. `border: 1px solid red;`
-  const regBorderKey = /^border(?:-(?:top|bottom|left|right))?$/
-  const regBorderVal = /^([+-]?\d+(?:\.\d+)?)([p ,w]x)?\s+/
-  if (regBorderKey.test(styleKey) && regBorderVal.test(styleVal)) {
-    const reg = /^([+-]?\d+(?:\.\d+)?)([p,w]x)?/
-    const val = styleVal.replace(reg, function (m, $1, $2) {
-      const unit = $2 || 'px'
-      return parseScale($1, unit)
+  /**
+   * 2. if a string contains multiple px values, than they should be all normalized.
+   *  values should have wx or px units, otherwise they should be left unchanged.
+   *  e.g.
+   *    transform: translate(10px, 6px, 0)
+   *    border: 2px solid red
+   */
+  const numReg = /([+-]?[\d.]+)([p,w]x)/ig
+  if (numReg.test(styleVal)) {
+    const unitScaleMap = getUnitScaleMap()
+    const val = styleVal.replace(numReg, function (m, $0, $1) {
+      const res = parseFloat($0) * unitScaleMap[$1]
+      return (res === 0 ? 0 : res > 1 ? res : 1) + 'px'
     })
     return val
   }


[47/50] incubator-weex git commit: * [html5] rm img-src immediately after apply src to bg.

Posted by ta...@apache.org.
* [html5] rm img-src immediately after apply src to bg.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/98a4f458
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/98a4f458
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/98a4f458

Branch: refs/heads/0.13-dev
Commit: 98a4f4585a903384498ae0e8144c92966ef39e5e
Parents: 0268618
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 24 15:34:02 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 24 15:34:02 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/lazyload.js    | 4 +---
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/98a4f458/html5/render/vue/utils/lazyload.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/lazyload.js b/html5/render/vue/utils/lazyload.js
index 0fab86d..16fdc1e 100644
--- a/html5/render/vue/utils/lazyload.js
+++ b/html5/render/vue/utils/lazyload.js
@@ -39,7 +39,6 @@ function preLoadImg (src: string,
 export function applySrc (item: any, src: ?string, placeholderSrc: ?string): void {
   if (!src) { return }
   function finallCb () {
-    item.removeAttribute('img-src')
     delete item._src_loading
     if (doRecord) {
       if (window._weex_perf.renderTime.length < SCREEN_REC_LIMIT) {
@@ -50,13 +49,12 @@ export function applySrc (item: any, src: ?string, placeholderSrc: ?string): voi
       }
     }
   }
-
   /**
    * 1. apply src immediately in case javscript blocks the image loading
    *  before next tick.
    */
   item.style.backgroundImage = `url(${src || ''})`
-
+  item.removeAttribute('img-src')
   /**
    * 2. then load the img src with Image constructor (but would not post
    *  a request again), just to trigger the load event.

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/98a4f458/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index fb6e1e0..4036fab 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.39",
+    "vue-render": "0.11.40",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/98a4f458/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 2a8e3e5..7f868d3 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.39",
+  "version": "0.11.40",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[44/50] incubator-weex git commit: * [html5] release 0.11.37

Posted by ta...@apache.org.
* [html5] release 0.11.37


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d15f5f45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d15f5f45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d15f5f45

Branch: refs/heads/0.13-dev
Commit: d15f5f450df2a95e59d828c4fb42bf3cbb0e1771
Parents: 108a582
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 22 22:18:00 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 22 22:18:00 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/index.js     | 13 -----------
 .../render/vue/components/slider/slideMixin.js  | 24 ++++++++++++++++++++
 .../vue/components/slider/slider-neighbor.css   |  2 --
 .../vue/components/slider/slider-neighbor.js    | 19 ++++++++++------
 package.json                                    |  2 +-
 packages/weex-vue-render/package.json           |  2 +-
 6 files changed, 38 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d15f5f45/html5/render/vue/components/slider/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/index.js b/html5/render/vue/components/slider/index.js
index ce74db0..740a8ee 100644
--- a/html5/render/vue/components/slider/index.js
+++ b/html5/render/vue/components/slider/index.js
@@ -35,7 +35,6 @@ const _css = `
 }
 
 .weex-slider-cell {
-  display: block;
   position: absolute;
   top: 0;
   left: 0;
@@ -140,18 +139,6 @@ export default {
     this.reorder()
   },
 
-  updated () {
-    const children = this.$children
-    const len = children && children.length
-    if (children && len > 0) {
-      const indicator = children[len - 1]
-      if (indicator.$options._componentTag === 'indicator') {
-        indicator._watcher.get()
-      }
-    }
-    fireLazyload(this.$el, true)
-  },
-
   mounted () {
     if (this.autoPlay && this.autoPlay !== 'false') {
       const interval = Number(this.interval)

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d15f5f45/html5/render/vue/components/slider/slideMixin.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js
index efceb04..6595ff7 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -26,6 +26,19 @@ const MAIN_SLIDE_OPACITY = 1
 // const scrollDam = 16
 
 export default {
+  updated () {
+    const children = this.$children
+    const len = children && children.length
+    if (children && len > 0) {
+      const indicator = children[len - 1]
+      if (indicator.$options._componentTag === 'indicator'
+        || indicator.$vnode.data.ref === 'indicator') {
+        indicator._watcher.get()
+      }
+    }
+    fireLazyload(this.$el, true)
+  },
+
   methods: {
     // get standard index
     normalizeIndex (index) {
@@ -99,6 +112,8 @@ export default {
           opacity = MAIN_SLIDE_OPACITY
         }
 
+        elm.style.visibility = 'visible'
+
         const origin = dir === 'prev' ? '100% 0' : '0 0'
         elm.style.webkitTransformOrigin = origin
         elm.style.transformOrigin = origin
@@ -153,6 +168,9 @@ export default {
 
         // put current slide on the top.
         setPosition(currentElm, 'current')
+        currentElm.style.webkitBoxAlign = 'center'
+        currentElm.style.webkitAlignItems = 'center'
+        currentElm.style.AlignItems = 'center'
 
         // clone prevCell if there are only tow slides.
         if (this._cells.length === 2) {
@@ -168,7 +186,13 @@ export default {
         }
 
         setPosition(prevElm, 'prev')
+        prevElm.style.webkitBoxAlign = 'end'
+        prevElm.style.webkitAlignItems = 'flex-end'
+        prevElm.style.AlignItems = 'flex-end'
         setPosition(nextElm, 'next')
+        nextElm.style.webkitBoxAlign = 'start'
+        nextElm.style.webkitAlignItems = 'flex-start'
+        nextElm.style.AlignItems = 'flex-start'
         this.currentIndex = newIndex
       })
     },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d15f5f45/html5/render/vue/components/slider/slider-neighbor.css
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slider-neighbor.css b/html5/render/vue/components/slider/slider-neighbor.css
index 4bd34bf..9bbdb36 100644
--- a/html5/render/vue/components/slider/slider-neighbor.css
+++ b/html5/render/vue/components/slider/slider-neighbor.css
@@ -10,8 +10,6 @@
 
 .weex-neighbor-item {
   position: absolute !important;
-  top: 50% !important;
-  left: 50% !important;
   -webkit-box-align: center;
   -webkit-align-items: center;
   align-items: center;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d15f5f45/html5/render/vue/components/slider/slider-neighbor.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slider-neighbor.js b/html5/render/vue/components/slider/slider-neighbor.js
index a8a813c..9cd50dd 100644
--- a/html5/render/vue/components/slider/slider-neighbor.js
+++ b/html5/render/vue/components/slider/slider-neighbor.js
@@ -14,6 +14,10 @@ let id = 0
 export default {
   mixins: [slideMixin],
   props: {
+    index: {
+      type: [String, Number],
+      default: 0
+    },
     autoPlay: {
       type: [String, Boolean],
       default: false
@@ -60,9 +64,15 @@ export default {
     }
   },
 
+  watch: {
+    index () {
+      this.currentIndex = this.normalizeIndex(this.index)
+    }
+  },
+
   data () {
     return {
-      currentIndex: 0,
+      currentIndex: this.index,
       frameCount: 0
     }
   },
@@ -98,7 +108,7 @@ export default {
       }).map(vnode => {
         return createElement('li', {
           ref: 'cells',
-          staticClass: 'weex-slider-cell'
+          staticClass: 'weex-slider-cell weex-ct weex-neighbor-item'
         }, [vnode])
       })
       if (indicatorVnode) {
@@ -117,7 +127,6 @@ export default {
 
   created () {
     this.weexType = 'slider-neighbor'
-    this.currentIndex = 0
     this.innerOffset = 0
     this._indicator = null
     this.id = id++
@@ -131,10 +140,6 @@ export default {
     this.reorder()
   },
 
-  updated () {
-    fireLazyload(this.$el, true)
-  },
-
   mounted () {
     if (this.autoPlay && this.autoPlay !== 'false') {
       const interval = Number(this.interval)

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d15f5f45/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 686e7cf..80489af 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.36",
+    "vue-render": "0.11.37",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d15f5f45/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 77872b6..b331f08 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.36",
+  "version": "0.11.37",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[49/50] incubator-weex git commit: Merge branch '0.13-dev' into 0.12-dev-web

Posted by ta...@apache.org.
Merge branch '0.13-dev' into 0.12-dev-web


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/23df1a6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/23df1a6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/23df1a6d

Branch: refs/heads/0.13-dev
Commit: 23df1a6d86683c9f5aa993f2e9e0eea4d63bd0bf
Parents: 4cdfbb8 fa1424f
Author: MrRaindrop <te...@gmail.com>
Authored: Thu May 25 10:02:32 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu May 25 10:02:32 2017 +0800

----------------------------------------------------------------------
 .travis.yml                                     |  13 +-
 Dangerfile-ios                                  |   1 +
 WeexSDK.podspec                                 |   4 +-
 android/.gitignore                              |   4 +-
 android/README.md                               |   6 +
 android/build.gradle                            |  44 +++
 android/codeStyleSettings.xml                   | 393 +++++++++++++++++++
 android/commons/build.gradle                    |  38 +-
 android/gradle.properties                       |  16 +
 android/gradle/wrapper/gradle-wrapper.jar       | Bin 0 -> 52266 bytes
 .../gradle/wrapper/gradle-wrapper.properties    |   6 +
 android/gradlew                                 | 164 ++++++++
 android/gradlew.bat                             |  90 +++++
 android/license/LICENSE                         |  16 +
 android/playground/LICENSE                      | 202 ----------
 android/playground/NOTICE                       |   7 -
 android/playground/README.md                    |   5 -
 android/playground/app/build.gradle             |  27 +-
 .../java/com/alibaba/weex/WXPageActivity.java   |   3 +-
 .../weex/extend/module/WXEventModule.java       |  23 +-
 android/playground/build.gradle                 |  22 --
 android/playground/codeStyleSettings.xml        | 393 -------------------
 android/playground/gradle.properties            |  16 -
 .../gradle/wrapper/gradle-wrapper.jar           | Bin 51018 -> 0 bytes
 .../gradle/wrapper/gradle-wrapper.properties    |   8 -
 android/playground/gradlew                      | 164 --------
 android/playground/gradlew.bat                  |  90 -----
 android/playground/settings.gradle              |  10 -
 android/run-ci.sh                               |   9 +-
 android/sdk/.gitignore                          |   3 +-
 android/sdk/NOTICE                              |  13 -
 android/sdk/assets/main.js                      |   8 -
 android/sdk/build.gradle                        |  57 +--
 android/sdk/gradle/wrapper/gradle-wrapper.jar   | Bin 53637 -> 0 bytes
 .../gradle/wrapper/gradle-wrapper.properties    |   7 -
 android/sdk/gradlew                             | 160 --------
 android/sdk/gradlew.bat                         |  90 -----
 android/sdk/libs/armeabi/libweexjsc.so          | Bin 7815820 -> 7652256 bytes
 android/sdk/license/LICENSE                     |  16 -
 .../license/license-gradle-plugin-0.12.1.jar    | Bin 329739 -> 0 bytes
 .../license/maven-license-plugin-1.10.b1.jar    | Bin 57954 -> 0 bytes
 android/sdk/license/plexus-utils-3.0.24.jar     | Bin 247351 -> 0 bytes
 .../com/taobao/weex/LayoutFinishListener.java   |   8 +
 .../java/com/taobao/weex/WXSDKInstance.java     |  51 +++
 .../taobao/weex/adapter/IDrawableLoader.java    |   3 +-
 .../weex/adapter/IWXUserTrackAdapter.java       |   2 +-
 .../com/taobao/weex/bridge/WXModuleManager.java |  44 ++-
 .../taobao/weex/dom/DOMActionContextImpl.java   |  15 +-
 .../com/taobao/weex/dom/TextDecorationSpan.java |  55 +++
 .../java/com/taobao/weex/dom/WXDomHandler.java  |   4 +
 .../java/com/taobao/weex/dom/WXDomManager.java  |  19 +
 .../java/com/taobao/weex/dom/WXDomObject.java   |  51 +--
 .../taobao/weex/dom/WXRecyclerDomObject.java    |   8 +-
 .../main/java/com/taobao/weex/dom/WXStyle.java  | 193 ++++++++-
 .../com/taobao/weex/dom/WXSwitchDomObject.java  |  29 +-
 .../com/taobao/weex/dom/WXTextDomObject.java    |  11 +-
 .../com/taobao/weex/dom/action/Actions.java     |  12 +
 .../taobao/weex/dom/action/AnimationAction.java |   3 +
 .../weex/dom/action/CreateFinishAction.java     |  20 +
 .../weex/dom/action/ExecutableRenderAction.java |  30 ++
 .../weex/dom/action/GetComponentRectAction.java |  29 +-
 .../weex/dom/action/ModuleInvocationAction.java |  50 +++
 .../ui/animation/DimensionUpdateListener.java   |  14 +
 .../weex/ui/animation/WXAnimationBean.java      |   1 +
 .../taobao/weex/ui/component/WXComponent.java   |  37 ++
 .../taobao/weex/ui/component/WXScroller.java    |  16 +-
 .../weex/ui/component/WXTextDecoration.java     |   1 +
 .../ui/component/list/BasicListComponent.java   |   8 +-
 .../ui/component/list/StickyHeaderHelper.java   |   2 +-
 .../taobao/weex/ui/module/WXTimerModule.java    |  42 +-
 .../com/taobao/weex/ui/view/WXImageView.java    |  31 +-
 .../weex/ui/view/border/BorderDrawable.java     |   3 +-
 .../java/com/taobao/weex/utils/WXUtils.java     |  60 ++-
 .../java/com/taobao/weex/utils/WXViewUtils.java |  37 +-
 .../java/com/taobao/weex/utils/WXUtilsTest.java |  16 +-
 android/sdk/unittest.sh                         |   3 -
 android/settings.gradle                         |   9 +
 android/weex_debug/build.gradle                 |  35 +-
 .../gradle/wrapper/gradle-wrapper.jar           | Bin 51018 -> 0 bytes
 .../gradle/wrapper/gradle-wrapper.properties    |   6 -
 android/weex_debug/gradlew                      | 164 --------
 android/weex_debug/gradlew.bat                  |  90 -----
 dangerfile.js                                   | 166 +++++++-
 doc/source/cn/references/bubble.md              | 146 +++++++
 doc/source/cn/references/downgrade.md           |  11 +
 doc/source/cn/references/index.md               |   4 +-
 doc/source/cn/v-0.10/references/bubble.md       | 150 +++++++
 doc/source/references/bubble.md                 | 146 +++++++
 doc/source/references/downgrade.md              |  11 +
 doc/source/references/index.md                  |   2 +
 doc/source/v-0.10/references/bubble.md          | 150 +++++++
 examples/iconfont.we                            |  63 ++-
 examples/index.we                               |   1 +
 examples/vue/iconfont.vue                       |  80 ++--
 examples/vue/index.vue                          |   3 +-
 examples/vue/market/gcanvas.vue                 |   2 +-
 html5/render/native/index.js                    |  33 +-
 html5/render/native/setup.js                    |  58 +++
 html5/runtime/vdom/document.js                  |   4 +-
 html5/runtime/vdom/element.js                   |  25 +-
 html5/test/unit/default/vm/vm.js                |   2 +-
 .../WeexDemo.xcodeproj/project.pbxproj          |   6 +
 ios/playground/WeexDemo/AppDelegate.m           |   4 +
 .../WeexDemo/Scanner/WXScannerHistoryVC.m       |  25 +-
 .../WeexDemo/WXConfigCenterDefaultImpl.h        |  25 ++
 .../WeexDemo/WXConfigCenterDefaultImpl.m        |  45 +++
 ios/playground/WeexDemo/WXDemoViewController.m  |  16 +-
 .../WeexDemo/extend/module/WXEventModule.m      |  16 +
 ios/sdk/WeexSDK.xcodeproj/project.pbxproj       |  32 +-
 ios/sdk/WeexSDK/Resources/main.js               |   8 -
 .../WeexSDK/Sources/Bridge/WXBridgeContext.m    |   5 +
 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m |  85 +++-
 ios/sdk/WeexSDK/Sources/Bridge/WXModuleMethod.m |  13 +-
 .../WeexSDK/Sources/Component/WXAComponent.m    |  13 +-
 .../Sources/Component/WXComponent_internal.h    |   2 -
 .../Sources/Component/WXCycleSliderComponent.m  |  11 +-
 .../Sources/Component/WXEmbedComponent.m        |   2 +-
 .../Sources/Component/WXImageComponent.m        |  27 +-
 .../Sources/Component/WXIndicatorComponent.m    |   3 +
 .../WeexSDK/Sources/Component/WXListComponent.m |  31 ++
 .../Sources/Component/WXScrollerComponent.m     |  30 ++
 .../Component/WXSliderNeighborComponent.m       |   9 +-
 .../WeexSDK/Sources/Component/WXTextComponent.m |  33 +-
 .../Sources/Component/WXVideoComponent.m        |  12 +-
 .../WeexSDK/Sources/Component/WXWebComponent.m  |  10 +-
 .../Sources/Controller/WXBaseViewController.m   |  19 +-
 ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m    |  13 +-
 ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h     |   1 +
 .../WeexSDK/Sources/Events/WXComponent+Events.m |  26 +-
 .../WeexSDK/Sources/Layout/WXComponent+Layout.m |  24 +-
 .../WeexSDK/Sources/Loader/WXResourceLoader.m   |   2 +
 .../WeexSDK/Sources/Manager/WXBridgeManager.h   |   2 +
 .../Sources/Manager/WXComponentManager.h        |   2 +-
 .../Sources/Manager/WXComponentManager.m        |  32 +-
 ios/sdk/WeexSDK/Sources/Manager/WXRuleManager.m |   8 +-
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m     |  19 +-
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h   |   5 +
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m   |  36 +-
 .../WeexSDK/Sources/Module/WXAnimationLayout.h  |  49 +++
 .../WeexSDK/Sources/Module/WXAnimationLayout.m  | 115 ++++++
 .../WeexSDK/Sources/Module/WXAnimationModule.m  |  30 +-
 .../WeexSDK/Sources/Module/WXModalUIModule.m    |   1 +
 .../WeexSDK/Sources/Module/WXPrerenderManager.h |  89 +++++
 .../WeexSDK/Sources/Module/WXPrerenderManager.m | 314 +++++++++++++++
 ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m |   6 +-
 .../Sources/Network/WXResourceRequestHandler.h  |   2 +
 .../WXResourceRequestHandlerDefaultImpl.m       |   5 +-
 .../Sources/Protocol/WXConfigCenterProtocol.h   |  20 +
 .../Sources/Protocol/WXScrollerProtocol.h       |   7 +
 .../Sources/Protocol/WXURLRewriteProtocol.h     |   5 +-
 ios/sdk/WeexSDK/Sources/Utility/WXConvert.m     |   6 +-
 ios/sdk/WeexSDK/Sources/Utility/WXDefine.h      |   4 +-
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m     |  82 ++--
 .../View/WXComponent+PseudoClassManagement.m    |   4 +-
 .../Sources/View/WXComponent+ViewManagement.m   |  96 ++++-
 ios/sdk/WeexSDK/Sources/View/WXView.m           |   1 +
 ios/sdk/WeexSDK/Sources/WeexSDK.h               |   3 +
 package.json                                    |  25 +-
 pre-build/native-bundle-main.js                 |   8 +
 test/.gitignore                                 |   3 +-
 test/pages/attributes/compositing.vue           |  89 +++++
 test/pages/components/hyperlink.vue             |  31 ++
 test/pages/components/hyperlink_target.vue      |  22 ++
 test/pages/css/border.vue                       | 370 +++++++++++++++++
 test/pages/modules/globalEvent.vue              |  48 +++
 test/pages/modules/vue_timer.vue                |  75 ++++
 test/pages/modules/we_timer.we                  |  73 ++++
 test/run.sh                                     |   2 +-
 test/screenshot/border-android.png              | Bin 0 -> 196752 bytes
 test/screenshot/border-ios.png                  | Bin 0 -> 161202 bytes
 test/screenshot/compositing-ios.png             | Bin 0 -> 228306 bytes
 test/scripts/attributes/compositing.test.js     |  63 +++
 test/scripts/components/hyperlink.test.js       |  44 +++
 test/scripts/components/recycler.test.js        |   6 +-
 test/scripts/components/scroll-event.test.js    |  29 +-
 test/scripts/components/scroller-fixed.test.js  |   5 +-
 test/scripts/components/text.test.js            |  26 +-
 .../components/textarea-maxlength.test.js       |   2 +-
 test/scripts/css/border.test.js                 |  60 +++
 test/scripts/modules/globalEvent.test.js        |  60 +++
 test/scripts/modules/timer.test.js              | 100 +++++
 test/scripts/util.js                            |  61 ++-
 182 files changed, 5026 insertions(+), 2064 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/23df1a6d/package.json
----------------------------------------------------------------------
diff --cc package.json
index fd66a25,fdee5a6..16779e1
--- a/package.json
+++ b/package.json
@@@ -1,10 -1,10 +1,10 @@@
  {
    "name": "weex",
-   "version": "0.4.0",
+   "version": "0.12.0",
    "subversion": {
      "browser": "0.5.0",
-     "framework": "0.20.5",
+     "framework": "0.20.6",
 -    "vue-render": "0.11.10",
 +    "vue-render": "0.11.41",
      "transformer": ">=0.1.5 <0.5"
    },
    "description": "A framework for building Mobile cross-platform UI",


[34/50] incubator-weex git commit: * [html5] fix bubble event in a component.

Posted by ta...@apache.org.
* [html5] fix bubble event in a component.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9c7da7cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9c7da7cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9c7da7cf

Branch: refs/heads/0.13-dev
Commit: 9c7da7cfd0b06e81ae67f613a9843fd2f3efbd26
Parents: 174af84
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 16 00:27:33 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 16 00:27:33 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/a.js |  18 ++
 html5/render/vue/core/node.js    |  19 +-
 html5/render/vue/env/index.js    |   3 +-
 html5/render/vue/lib/gesture.js  | 512 ++++++++++++++++++++++++++++++++++
 4 files changed, 546 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9c7da7cf/html5/render/vue/components/a.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/a.js b/html5/render/vue/components/a.js
index b624163..b4b3ef0 100644
--- a/html5/render/vue/components/a.js
+++ b/html5/render/vue/components/a.js
@@ -24,21 +24,39 @@ const _css = `
   text-decoration: none;
 }
 `
+let cnt = 0
 
 export default {
   name: 'weex-a',
   props: {
     href: String
   },
+  mounted () {
+    const $el = this.$el
+    const id = $el.id
+
+    /**
+     * if there is a child component already triggered a click handler, then
+     * this link jumping should be prevented.
+     */
+    $el.addEventListener('click', (e) => {
+      const el = e._triggered && e._triggered.el
+      if (el && (el !== $el) && !el.querySelector(`#${id}`)) {
+        e.preventDefault()
+      }
+    })
+  },
   render (createElement) {
     /* istanbul ignore next */
     // if (process.env.NODE_ENV === 'development') {
     //   validateStyles('a', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
     this._renderHook()
+    const id = cnt++
     return createElement('html:a', {
       attrs: {
         'weex-type': 'a',
+        'id': `weex-a-${id}`,
         href: this.href
       },
       on: createEventMap(this),

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9c7da7cf/html5/render/vue/core/node.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/node.js b/html5/render/vue/core/node.js
index 746f3c6..87981d8 100644
--- a/html5/render/vue/core/node.js
+++ b/html5/render/vue/core/node.js
@@ -54,7 +54,7 @@ function getListeners (vnode, evt) {
 }
 
 const supportedEvents = [
-  'longpress', 'appear', 'disappear',
+  'tap', 'click', 'longpress', 'appear', 'disappear',
   // 'touchstart', 'touchmove', 'touchend',
   'panstart', 'panmove', 'panend', 'swipe', 'longpress'
 ]
@@ -72,8 +72,13 @@ export function createEventMap (context, extras = []) {
     return name => {
       const evtType = evt || name
       eventMap[evtType] = function (e) {
-        // no original bubbling.
-        e.stopPropagation()
+        /**
+         * allow original bubbling.
+         * use '_triggered' to control actural bubbling.
+         */
+        if (e._triggered) {
+          return
+        }
         // but should trigger the closest parent which has bound the
         // event handler.
         let vm = context
@@ -93,8 +98,11 @@ export function createEventMap (context, extras = []) {
           }
 
           // once a parent node (or self node) has triggered the handler,
-          // then it stops bubble immediately.
+          // then it stops bubble immediately, and a '_triggered' object is set.
           if (len > 0) {
+            e._triggered = {
+              el: vm.$el
+            }
             return
           }
           vm = vm.$parent
@@ -103,6 +111,7 @@ export function createEventMap (context, extras = []) {
     }
   }
   supportedEvents.concat(extras).forEach(bindFunc())
-  bindFunc('tap')('click')
+  // bindFunc('tap')('click')
+
   return eventMap
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9c7da7cf/html5/render/vue/env/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/index.js b/html5/render/vue/env/index.js
index 0cf07a9..bc2836a 100644
--- a/html5/render/vue/env/index.js
+++ b/html5/render/vue/env/index.js
@@ -19,7 +19,8 @@
 import '../styles/reset.css'
 import '../styles/base.css'
 
-import '../../browser/render/gesture'
+// import '../../browser/render/gesture'
+import '../lib/gesture'
 
 import '../../../shared/arrayFrom'
 import '../../../shared/objectAssign'

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9c7da7cf/html5/render/vue/lib/gesture.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/lib/gesture.js b/html5/render/vue/lib/gesture.js
new file mode 100644
index 0000000..7ed0592
--- /dev/null
+++ b/html5/render/vue/lib/gesture.js
@@ -0,0 +1,512 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/* eslint-disable */
+
+'use strict'
+
+var isInitialized = false
+
+// major events supported:
+//   panstart
+//   panmove
+//   panend
+//   swipe
+//   longpress
+// extra events supported:
+//   dualtouchstart
+//   dualtouch
+//   dualtouchend
+//   tap
+//   doubletap
+//   pressend
+
+var doc = window.document
+var docEl = doc.documentElement
+var slice = Array.prototype.slice
+var gestures = {}
+var lastTap = null
+
+/**
+ * find the closest common ancestor
+ * if there's no one, return null
+ *
+ * @param  {Element} el1 first element
+ * @param  {Element} el2 second element
+ * @return {Element}     common ancestor
+ */
+function getCommonAncestor(el1, el2) {
+  var el = el1
+  while (el) {
+    if (el.contains(el2) || el == el2) {
+      return el
+    }
+    el = el.parentNode
+  }
+  return null
+}
+
+/**
+ * fire a HTMLEvent
+ *
+ * @param  {Element} element which element to fire a event on
+ * @param  {string}  type    type of event
+ * @param  {object}  extra   extra data for the event object
+ */
+function fireEvent(element, type, extra) {
+  var event = doc.createEvent('HTMLEvents')
+  event.initEvent(type, false, true)
+
+  if (typeof extra === 'object') {
+    for (var p in extra) {
+      event[p] = extra[p]
+    }
+  }
+
+  element.dispatchEvent(event)
+}
+
+/**
+ * calc the transform
+ * assume 4 points ABCD on the coordinate system
+ * > rotate:angle rotating from AB to CD
+ * > scale:scale ratio from AB to CD
+ * > translate:translate shift from A to C
+ *
+ * @param  {number} x1 abscissa of A
+ * @param  {number} y1 ordinate of A
+ * @param  {number} x2 abscissa of B
+ * @param  {number} y2 ordinate of B
+ * @param  {number} x3 abscissa of C
+ * @param  {number} y3 ordinate of C
+ * @param  {number} x4 abscissa of D
+ * @param  {number} y4 ordinate of D
+ * @return {object}    transform object like
+ *   {rotate, scale, translate[2], matrix[3][3]}
+ */
+function calc(x1, y1, x2, y2, x3, y3, x4, y4) {
+  var rotate = Math.atan2(y4 - y3, x4 - x3) - Math.atan2(y2 - y1, x2 - x1)
+  var scale = Math.sqrt((Math.pow(y4 - y3, 2)
+    + Math.pow(x4 - x3, 2)) / (Math.pow(y2 - y1, 2)
+    + Math.pow(x2 - x1, 2)))
+  var translate = [
+    x3
+    - scale * x1 * Math.cos(rotate)
+    + scale * y1 * Math.sin(rotate),
+    y3
+    - scale * y1 * Math.cos(rotate)
+    - scale * x1 * Math.sin(rotate)]
+
+  return {
+    rotate: rotate,
+    scale: scale,
+    translate: translate,
+    matrix: [
+      [scale * Math.cos(rotate), -scale * Math.sin(rotate), translate[0]],
+      [scale * Math.sin(rotate), scale * Math.cos(rotate), translate[1]],
+      [0, 0, 1]
+    ]
+  }
+}
+
+/**
+ * take over the touchstart events. Add new touches to the gestures.
+ * If there is no previous records, then bind touchmove, tochend
+ * and touchcancel events.
+ * new touches initialized with state 'tapping', and within 500 milliseconds
+ * if the state is still tapping, then trigger gesture 'press'.
+ * If there are two touche points, then the 'dualtouchstart' is triggerd. The
+ * node of the touch gesture is their cloest common ancestor.
+ *
+ * @event
+ * @param  {event} event
+ */
+function touchstartHandler(event) {
+
+  if (Object.keys(gestures).length === 0) {
+    docEl.addEventListener('touchmove', touchmoveHandler, false)
+    docEl.addEventListener('touchend', touchendHandler, false)
+    docEl.addEventListener('touchcancel', touchcancelHandler, false)
+  }
+
+  // record every touch
+  for (var i = 0; i < event.changedTouches.length; i++) {
+    var touch = event.changedTouches[i]
+    var touchRecord = {}
+
+    for (var p in touch) {
+      touchRecord[p] = touch[p]
+    }
+
+    var gesture = {
+      startTouch: touchRecord,
+      startTime: Date.now(),
+      status: 'tapping',
+      element: event.srcElement || event.target,
+      pressingHandler: setTimeout(function (element, touch) {
+        return function () {
+          if (gesture.status === 'tapping') {
+            gesture.status = 'pressing'
+
+            fireEvent(element, 'longpress', {
+              // add touch data for weex
+              touch: touch,
+              touches: event.touches,
+              changedTouches: event.changedTouches,
+              touchEvent: event
+            })
+          }
+
+          clearTimeout(gesture.pressingHandler)
+          gesture.pressingHandler = null
+        }
+      }(event.srcElement || event.target, event.changedTouches[i]), 500)
+    }
+    gestures[touch.identifier] = gesture
+  }
+
+  if (Object.keys(gestures).length == 2) {
+    var elements = []
+
+    for (var p in gestures) {
+      elements.push(gestures[p].element)
+    }
+
+    fireEvent(getCommonAncestor(elements[0], elements[1]), 'dualtouchstart', {
+      touches: slice.call(event.touches),
+      touchEvent: event
+    })
+  }
+}
+
+/**
+ * take over touchmove events, and handle pan and dual related gestures.
+ *
+ * 1. traverse every touch point:
+ * > if 'tapping' and the shift is over 10 pixles, then it's a 'panning'.
+ * 2. if there are two touch points, then calc the tranform and trigger
+ *   'dualtouch'.
+ *
+ * @event
+ * @param  {event} event
+ */
+function touchmoveHandler(event) {
+  for (var i = 0; i < event.changedTouches.length; i++) {
+    var touch = event.changedTouches[i]
+    var gesture = gestures[touch.identifier]
+
+    if (!gesture) {
+      return
+    }
+
+    if (!gesture.lastTouch) {
+      gesture.lastTouch = gesture.startTouch
+    }
+    if (!gesture.lastTime) {
+      gesture.lastTime = gesture.startTime
+    }
+    if (!gesture.velocityX) {
+      gesture.velocityX = 0
+    }
+    if (!gesture.velocityY) {
+      gesture.velocityY = 0
+    }
+    if (!gesture.duration) {
+      gesture.duration = 0
+    }
+
+    var time =  Date.now() - gesture.lastTime
+    var vx = (touch.clientX - gesture.lastTouch.clientX) / time
+    var vy = (touch.clientY - gesture.lastTouch.clientY) / time
+
+    var RECORD_DURATION = 70
+    if (time > RECORD_DURATION) {
+      time = RECORD_DURATION
+    }
+    if (gesture.duration + time > RECORD_DURATION) {
+      gesture.duration = RECORD_DURATION - time
+    }
+
+    gesture.velocityX = (gesture.velocityX * gesture.duration + vx * time)
+      / (gesture.duration + time)
+    gesture.velocityY = (gesture.velocityY * gesture.duration + vy * time)
+      / (gesture.duration + time)
+    gesture.duration += time
+
+    gesture.lastTouch = {}
+
+    for (var p in touch) {
+      gesture.lastTouch[p] = touch[p]
+    }
+    gesture.lastTime = Date.now()
+
+    var displacementX = touch.clientX - gesture.startTouch.clientX
+    var displacementY = touch.clientY - gesture.startTouch.clientY
+    var distance = Math.sqrt(Math.pow(displacementX, 2)
+      + Math.pow(displacementY, 2))
+    var isVertical = !(Math.abs(displacementX) > Math.abs(displacementY))
+    var direction = isVertical
+      ? displacementY >= 0 ? 'down' : 'up'
+      : displacementX >= 0 ? 'right' : 'left'
+
+    // magic number 10: moving 10px means pan, not tap
+    if ((gesture.status === 'tapping' || gesture.status === 'pressing')
+        && distance > 10) {
+      gesture.status = 'panning'
+      gesture.isVertical = isVertical
+      gesture.direction = direction
+
+      fireEvent(gesture.element, 'panstart', {
+        touch: touch,
+        touches: event.touches,
+        changedTouches: event.changedTouches,
+        touchEvent: event,
+        isVertical: gesture.isVertical,
+        direction: direction
+      })
+    }
+
+    if (gesture.status === 'panning') {
+      gesture.panTime = Date.now()
+
+      fireEvent(gesture.element, 'panmove', {
+        displacementX: displacementX,
+        displacementY: displacementY,
+        touch: touch,
+        touches: event.touches,
+        changedTouches: event.changedTouches,
+        touchEvent: event,
+        isVertical: gesture.isVertical,
+        direction: direction
+      })
+    }
+  }
+
+  if (Object.keys(gestures).length == 2) {
+    var position = []
+    var current = []
+    var elements = []
+    var transform
+
+    for (var i = 0; i < event.touches.length; i++) {
+      var touch = event.touches[i]
+      var gesture = gestures[touch.identifier]
+      position.push([gesture.startTouch.clientX, gesture.startTouch.clientY])
+      current.push([touch.clientX, touch.clientY])
+    }
+
+    for (var p in gestures) {
+      elements.push(gestures[p].element)
+    }
+
+    transform = calc(
+      position[0][0],
+      position[0][1],
+      position[1][0],
+      position[1][1],
+      current[0][0],
+      current[0][1],
+      current[1][0],
+      current[1][1]
+    )
+    fireEvent(getCommonAncestor(elements[0], elements[1]), 'dualtouch', {
+      transform: transform,
+      touches: event.touches,
+      touchEvent: event
+    })
+  }
+}
+
+/**
+ * handle touchend event
+ *
+ * 1. if there are tow touch points, then trigger 'dualtouchend'如
+ *
+ * 2. traverse every touch piont:
+ * > if tapping, then trigger 'tap'.
+ * If there is a tap 300 milliseconds before, then it's a 'doubletap'.
+ * > if padding, then decide to trigger 'panend' or 'swipe'
+ * > if pressing, then trigger 'pressend'.
+ *
+ * 3. remove listeners.
+ *
+ * @event
+ * @param  {event} event
+ */
+function touchendHandler(event) {
+
+  if (Object.keys(gestures).length == 2) {
+    var elements = []
+    for (var p in gestures) {
+      elements.push(gestures[p].element)
+    }
+    fireEvent(getCommonAncestor(elements[0], elements[1]), 'dualtouchend', {
+      touches: slice.call(event.touches),
+      touchEvent: event
+    })
+  }
+
+  for (var i = 0; i < event.changedTouches.length; i++) {
+    var touch = event.changedTouches[i]
+    var id = touch.identifier
+    var gesture = gestures[id]
+
+    if (!gesture) {
+      continue
+    }
+
+    if (gesture.pressingHandler) {
+      clearTimeout(gesture.pressingHandler)
+      gesture.pressingHandler = null
+    }
+
+    if (gesture.status === 'tapping') {
+      gesture.timestamp = Date.now()
+      // fire click, not tap.
+      fireEvent(gesture.element, 'tap', {
+        touch: touch,
+        touchEvent: event
+      })
+
+      if (lastTap && gesture.timestamp - lastTap.timestamp < 300) {
+        fireEvent(gesture.element, 'doubletap', {
+          touch: touch,
+          touchEvent: event
+        })
+      }
+
+      lastTap = gesture
+    }
+
+    if (gesture.status === 'panning') {
+      var now = Date.now()
+      var duration = now - gesture.startTime
+      var displacementX = touch.clientX - gesture.startTouch.clientX
+      var displacementY = touch.clientY - gesture.startTouch.clientY
+
+      var velocity = Math.sqrt(gesture.velocityY * gesture.velocityY
+        + gesture.velocityX * gesture.velocityX)
+      var isSwipe = velocity > 0.5 && (now - gesture.lastTime) < 100
+      var extra = {
+        duration: duration,
+        isSwipe: isSwipe,
+        velocityX: gesture.velocityX,
+        velocityY: gesture.velocityY,
+        displacementX: displacementX,
+        displacementY: displacementY,
+        touch: touch,
+        touches: event.touches,
+        changedTouches: event.changedTouches,
+        touchEvent: event,
+        isVertical: gesture.isVertical,
+        direction: gesture.direction
+      }
+
+      fireEvent(gesture.element, 'panend', extra)
+      if (isSwipe) {
+        fireEvent(gesture.element, 'swipe', extra)
+      }
+    }
+
+    if (gesture.status === 'pressing') {
+      fireEvent(gesture.element, 'pressend', {
+        touch: touch,
+        touchEvent: event
+      })
+    }
+
+    delete gestures[id]
+  }
+
+  if (Object.keys(gestures).length === 0) {
+    docEl.removeEventListener('touchmove', touchmoveHandler, false)
+    docEl.removeEventListener('touchend', touchendHandler, false)
+    docEl.removeEventListener('touchcancel', touchcancelHandler, false)
+  }
+}
+
+/**
+ * handle touchcancel
+ *
+ * 1. if there are two touch points, then trigger 'dualtouchend'
+ *
+ * 2. traverse everty touch point:
+ * > if pannnig, then trigger 'panend'
+ * > if pressing, then trigger 'pressend'
+ *
+ * 3. remove listeners
+ *
+ * @event
+ * @param  {event} event
+ */
+function touchcancelHandler(event) {
+
+  if (Object.keys(gestures).length == 2) {
+    var elements = []
+    for (var p in gestures) {
+      elements.push(gestures[p].element)
+    }
+    fireEvent(getCommonAncestor(elements[0], elements[1]), 'dualtouchend', {
+      touches: slice.call(event.touches),
+      touchEvent: event
+    })
+  }
+
+  for (var i = 0; i < event.changedTouches.length; i++) {
+    var touch = event.changedTouches[i]
+    var id = touch.identifier
+    var gesture = gestures[id]
+
+    if (!gesture) {
+      continue
+    }
+
+    if (gesture.pressingHandler) {
+      clearTimeout(gesture.pressingHandler)
+      gesture.pressingHandler = null
+    }
+
+    if (gesture.status === 'panning') {
+      fireEvent(gesture.element, 'panend', {
+        touch: touch,
+        touches: event.touches,
+        changedTouches: event.changedTouches,
+        touchEvent: event
+      })
+    }
+    if (gesture.status === 'pressing') {
+      fireEvent(gesture.element, 'pressend', {
+        touch: touch,
+        touchEvent: event
+      })
+    }
+    delete gestures[id]
+  }
+
+  if (Object.keys(gestures).length === 0) {
+    docEl.removeEventListener('touchmove', touchmoveHandler, false)
+    docEl.removeEventListener('touchend', touchendHandler, false)
+    docEl.removeEventListener('touchcancel', touchcancelHandler, false)
+  }
+}
+
+if (!isInitialized) {
+  docEl.addEventListener('touchstart', touchstartHandler, false)
+  isInitialized = true
+}
+


[13/50] incubator-weex git commit: * [html5] fix scrollToElement.

Posted by ta...@apache.org.
* [html5] fix scrollToElement.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b9bbe00b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b9bbe00b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b9bbe00b

Branch: refs/heads/0.13-dev
Commit: b9bbe00b82451a62c15cef25573de3a9ffd26875
Parents: 177bfa1
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 17:16:26 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 17:16:26 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/dom.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b9bbe00b/html5/render/vue/modules/dom.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/dom.js b/html5/render/vue/modules/dom.js
index 3d16c7b..f82604f 100644
--- a/html5/render/vue/modules/dom.js
+++ b/html5/render/vue/modules/dom.js
@@ -114,7 +114,7 @@ export default {
       const elRect = el.getBoundingClientRect()
 
       const dir = dSuffix.toLowerCase()
-      let offset = el[`scroll${dSuffix}`] + elRect[dir] - ctRect[dir]
+      let offset = ct[`scroll${dSuffix}`] + elRect[dir] - ctRect[dir]
       // let offset = el[`offset${dSuffix}`]
 
       if (options) {


[27/50] incubator-weex git commit: * [html5] rm Math.sign since it's not compatilble with some android devices.

Posted by ta...@apache.org.
* [html5] rm Math.sign since it's not compatilble with some android devices.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6b620c61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6b620c61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6b620c61

Branch: refs/heads/0.13-dev
Commit: 6b620c617b0d762c4481afe74223bd30eab42718
Parents: 65df9b6
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 11:45:11 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 11:45:11 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/slideMixin.js | 3 ++-
 html5/render/vue/utils/style.js                  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6b620c61/html5/render/vue/components/slider/slideMixin.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js
index 314a377..154ed45 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -45,7 +45,8 @@ export default {
       const newIndex = this.normalizeIndex(index)
       const inner = this.$refs.inner
       const step = this._cells.length <= 1 ? 0 : this.currentIndex - index
-      this.innerOffset += Math.sign(step) * this.wrapperWidth
+      const sign = step === 0 ? 0 : step > 0 ? 1 : -1
+      this.innerOffset += sign * this.wrapperWidth
       if (inner) {
         // const match = (inner.style.transform || inner.style.webkitTransform).match(/(\d+)px/)
         // const currentOffset = parseFloat(match[1])

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6b620c61/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index 65e94f2..c4f7d18 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -76,7 +76,8 @@ function getUnitScaleMap () {
 
 function limitScale (val, limit) {
   limit = limit || 1
-  return Math.abs(val) > limit ? val : Math.sign(val) * limit
+  const sign = val === 0 ? 0 : val > 0 ? 1 : -1
+  return Math.abs(val) > limit ? val : sign * limit
 }
 
 function parseScale (val: number, unit: string): string {


[09/50] incubator-weex git commit: * [html5] add roots to weex.document.body

Posted by ta...@apache.org.
* [html5] add roots to weex.document.body


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c2d2ccff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c2d2ccff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c2d2ccff

Branch: refs/heads/0.13-dev
Commit: c2d2ccff0e991b7fab31e1d3ba8ad9a6d81fb4a9
Parents: 46dc29b
Author: MrRaindrop <te...@gmail.com>
Authored: Fri May 5 13:20:36 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri May 5 13:20:36 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/env/weex.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c2d2ccff/html5/render/vue/env/weex.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/weex.js b/html5/render/vue/env/weex.js
index 091969a..dba6d3d 100644
--- a/html5/render/vue/env/weex.js
+++ b/html5/render/vue/env/weex.js
@@ -33,7 +33,7 @@ const weex = {
     bundleUrl: location.href
   },
 
-  document: {},
+  document: { body: {} },
 
   requireModule (moduleName) {
     return weexModules[moduleName]
@@ -57,7 +57,7 @@ const weex = {
       }
       return
     }
-    this.document.children.push(root.$el)
+    this.document.body.children.push(root.$el)
   },
 
   // @deprecated
@@ -112,7 +112,7 @@ const weex = {
   }
 }
 
-Object.defineProperty(weex.document, 'children', {
+Object.defineProperty(weex.document.body, 'children', {
   get () { return _roots }
 })
 


[02/50] incubator-weex git commit: * [html5] rm flag of lazyload loaded.

Posted by ta...@apache.org.
* [html5] rm flag of lazyload loaded.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/00a4db82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/00a4db82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/00a4db82

Branch: refs/heads/0.13-dev
Commit: 00a4db822bdc5bb13bc0ee87dfa9f63ffd75373a
Parents: 6a4f551
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 3 22:33:15 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 3 22:33:15 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/lazyload.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/00a4db82/html5/render/vue/utils/lazyload.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/lazyload.js b/html5/render/vue/utils/lazyload.js
index 04ff7c6..667d6b6 100644
--- a/html5/render/vue/utils/lazyload.js
+++ b/html5/render/vue/utils/lazyload.js
@@ -41,7 +41,6 @@ export function applySrc (item: any, src: ?string, placeholderSrc: ?string): voi
   function finallCb () {
     item.removeAttribute('img-src')
     delete item._src_loading
-    item._src_loaded = true
     if (doRecord) {
       if (window._weex_perf.renderTime.length < SCREEN_REC_LIMIT) {
         tagImg() // tag lastest img onload time.
@@ -51,7 +50,7 @@ export function applySrc (item: any, src: ?string, placeholderSrc: ?string): voi
       }
     }
   }
-  if (item._src_loading || item._src_loaded) {
+  if (item._src_loading) {
     return
   }
   item._src_loading = true


[35/50] incubator-weex git commit: * [html5] fix scrollToElement in body.

Posted by ta...@apache.org.
* [html5] fix scrollToElement in body.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6ef1d962
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6ef1d962
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6ef1d962

Branch: refs/heads/0.13-dev
Commit: 6ef1d96269cd53742c805cd7f32429e71a1a7ed0
Parents: 9c7da7c
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 16 00:28:54 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 16 00:28:54 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/dom.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ef1d962/html5/render/vue/modules/dom.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/dom.js b/html5/render/vue/modules/dom.js
index f82604f..6d1e4dc 100644
--- a/html5/render/vue/modules/dom.js
+++ b/html5/render/vue/modules/dom.js
@@ -114,7 +114,7 @@ export default {
       const elRect = el.getBoundingClientRect()
 
       const dir = dSuffix.toLowerCase()
-      let offset = ct[`scroll${dSuffix}`] + elRect[dir] - ctRect[dir]
+      let offset = (isWindow ? 0 : ct[`scroll${dSuffix}`]) + elRect[dir] - ctRect[dir]
       // let offset = el[`offset${dSuffix}`]
 
       if (options) {


[10/50] incubator-weex git commit: * [html5] release 0.11.19

Posted by ta...@apache.org.
* [html5] release 0.11.19


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f8b7759e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f8b7759e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f8b7759e

Branch: refs/heads/0.13-dev
Commit: f8b7759eb54598f65dfbf82c406c6cda2bc0f0a1
Parents: c2d2ccf
Author: MrRaindrop <te...@gmail.com>
Authored: Fri May 5 13:21:23 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri May 5 13:21:23 2017 +0800

----------------------------------------------------------------------
 .gitignore                            | 1 +
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f8b7759e/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index c5a3be7..3012e55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,7 @@ html5/test/e2e/logs
 
 # render test
 html5/test/render/vue/data/build
+examples/vue/test/
 
 # Created by Weex Web Packer
 html5/browser/extend/packer.js

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f8b7759e/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5d0530f..83a190b 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.18",
+    "vue-render": "0.11.19",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f8b7759e/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index d7ec02d..43ae33f 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.18",
+  "version": "0.11.19",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[45/50] incubator-weex git commit: * [html5] release 0.11.38 & fix neighbor-space.

Posted by ta...@apache.org.
* [html5] release 0.11.38 & fix neighbor-space.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3aaba518
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3aaba518
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3aaba518

Branch: refs/heads/0.13-dev
Commit: 3aaba518ea3ee24dbcdb8374ab92d55da3504ffd
Parents: d15f5f4
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 23 11:41:21 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 23 11:41:21 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/slideMixin.js      | 9 ++++++++-
 html5/render/vue/components/slider/slider-neighbor.js | 2 +-
 package.json                                          | 2 +-
 packages/weex-vue-render/package.json                 | 2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3aaba518/html5/render/vue/components/slider/slideMixin.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js
index 6595ff7..d85cf9b 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -127,7 +127,10 @@ export default {
             offsetX += this.wrapperWidth * (1 - neighborScale) / 2
           }
           else {
-            offsetX = offsetX - sign * this.neighborSpace * scale
+            // offsetX = offsetX - sign * this.neighborSpace * scale
+            offsetX = offsetX - sign * (
+              (this.wrapperWidth - this._origItemWidth * this.currentItemScale) / 2
+              - this.neighborSpace * scale)
           }
         }
 
@@ -166,6 +169,10 @@ export default {
         const nextElm = this._cells[nextIndex].elm
         const currentElm = this._cells[newIndex].elm
 
+        if (!this._origItemWidth) {
+          this._origItemWidth = currentElm.firstElementChild.getBoundingClientRect().width
+        }
+
         // put current slide on the top.
         setPosition(currentElm, 'current')
         currentElm.style.webkitBoxAlign = 'center'

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3aaba518/html5/render/vue/components/slider/slider-neighbor.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slider-neighbor.js b/html5/render/vue/components/slider/slider-neighbor.js
index 9cd50dd..b6a49e4 100644
--- a/html5/render/vue/components/slider/slider-neighbor.js
+++ b/html5/render/vue/components/slider/slider-neighbor.js
@@ -5,7 +5,7 @@ import { throttle, bind, extend, fireLazyload } from '../../utils'
 import indicator from './indicator'
 import slideMixin from './slideMixin'
 
-const DEFAULT_NEIGHBOR_SPACE = 20
+const DEFAULT_NEIGHBOR_SPACE = 25
 const DEFAULT_NEIGHBOR_ALPHA = 0.6
 const DEFAULT_NEIGHBOR_SCALE = 0.8
 const DEFAULT_CURRENT_ITEM_SCALE = 0.9

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3aaba518/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 80489af..bc73a69 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.37",
+    "vue-render": "0.11.38",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3aaba518/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index b331f08..bb90cac 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.37",
+  "version": "0.11.38",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[22/50] incubator-weex git commit: * [html5] release vue-render 0.11.25

Posted by ta...@apache.org.
* [html5] release vue-render 0.11.25


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e2dd9bf7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e2dd9bf7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e2dd9bf7

Branch: refs/heads/0.13-dev
Commit: e2dd9bf7c3a47830ecf668c596a2b341c315a311
Parents: 1b72c9e
Author: MrRaindrop <te...@gmail.com>
Authored: Thu May 11 18:02:56 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu May 11 18:02:56 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/style.js      | 8 ++++++--
 html5/render/vue/utils/perf.js        | 2 +-
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e2dd9bf7/html5/render/vue/mixins/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/style.js b/html5/render/vue/mixins/style.js
index 69b7dc2..6fe9bb2 100644
--- a/html5/render/vue/mixins/style.js
+++ b/html5/render/vue/mixins/style.js
@@ -29,8 +29,12 @@ import {
 
 export default {
   beforeCreate () {
-    // get static class style map from document's styleSheets.
-    if (!weex.styleMap) {
+    /**
+     * get static class style map from document's styleSheets.
+     * Weex.on will create a Vue instance. In this case we'll ignore it, since
+     * it's not sure whether the scoped style has already attached to head or not.
+     */
+    if (!weex.styleMap && this.$options && this.$options._scopeId) {
       weex.styleMap = getHeadStyleMap()
     }
   },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e2dd9bf7/html5/render/vue/utils/perf.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/perf.js b/html5/render/vue/utils/perf.js
index af0ce78..37b3512 100644
--- a/html5/render/vue/utils/perf.js
+++ b/html5/render/vue/utils/perf.js
@@ -128,7 +128,7 @@ function collectStat (): void {
           const res: any = extend({}, entry)
           extend(perf.stat, {
             templateUrl: res.name,
-            JSTemplateSize: parseInt(res.transferSize / 1024),
+            JSTemplateSize: (res.transferSize / 1024).toFixed(2),
             networkTime: parseInt(res.duration)
           })
           break

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e2dd9bf7/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1f55aed..28ffb09 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.24",
+    "vue-render": "0.11.25",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e2dd9bf7/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index fb41117..0c85fab 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.24",
+  "version": "0.11.25",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[33/50] incubator-weex git commit: * [html5] fix null performance error in safari of ip5.

Posted by ta...@apache.org.
* [html5] fix null performance error in safari of ip5.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/174af84f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/174af84f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/174af84f

Branch: refs/heads/0.13-dev
Commit: 174af84ffbb6b005f624efeb02e2807947a36d16
Parents: 3b241b2
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 18:17:54 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 18:17:54 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/index.js             | 2 +-
 html5/render/vue/utils/perf.js        | 4 +++-
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/174af84f/html5/render/vue/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/index.js b/html5/render/vue/index.js
index 6373a09..d821b54 100644
--- a/html5/render/vue/index.js
+++ b/html5/render/vue/index.js
@@ -68,7 +68,7 @@ if (typeof window !== 'undefined' && window.Vue) {
 window._component_count = 0
 
 // perf stat for JSLibInitTime.
-window._jslib_init_end = performance && performance.now() || +new Date()
+window._jslib_init_end = window.performance && window.performance.now() || +new Date()
 window._weex_perf.stat.JSLibInitTime = parseInt(window._jslib_init_end - window._jslib_init_start)
 delete window._jslib_init_end
 delete window._jslib_init_start

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/174af84f/html5/render/vue/utils/perf.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/perf.js b/html5/render/vue/utils/perf.js
index a5c4ee8..9542a53 100644
--- a/html5/render/vue/utils/perf.js
+++ b/html5/render/vue/utils/perf.js
@@ -112,7 +112,7 @@ function collectStat (): void {
     bizType: 'weex',
     JSLibVersion: version
   })
-
+  const performance = window.performance
   // get templateUrl && JSTemplateSize
   const entries = performance && performance.getEntries && performance.getEntries()
   if (entries) {
@@ -145,10 +145,12 @@ export function collectStatPerf (name: string, val: string | number): void {
 }
 
 function getNow (): number {
+  const performance = window.performance
   return performance && performance.now ? performance.now() : new Date().getTime()
 }
 
 function getEntries (): Array<any> {
+  const performance = window.performance
   return performance && performance.getEntries
     ? performance.getEntries()
     : [{ responseEnd: getNow() - IMG_REC_INDENT }]

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/174af84f/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 66fc5ce..5713f10 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.30",
+    "vue-render": "0.11.31",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/174af84f/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index e1c8462..6035b26 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.30",
+  "version": "0.11.31",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[30/50] incubator-weex git commit: * [html5] set opacity of toast to 0.7

Posted by ta...@apache.org.
* [html5] set opacity of toast to 0.7


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/a0eda538
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/a0eda538
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/a0eda538

Branch: refs/heads/0.13-dev
Commit: a0eda538662abdd121e405216f0a29eb395c794e
Parents: 0eb4060
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 17:55:08 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 17:55:08 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/modal/style.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a0eda538/html5/render/vue/modules/modal/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/modal/style.js b/html5/render/vue/modules/modal/style.js
index d6bb4fa..510bb6c 100644
--- a/html5/render/vue/modules/modal/style.js
+++ b/html5/render/vue/modules/modal/style.js
@@ -30,7 +30,7 @@ export default `
   background-color: #000;
   color: #fff;
   text-align: center;
-  opacity: 0.6;
+  opacity: 0.7;
   -webkit-transition: all 0.4s ease-in-out;
           transition: all 0.4s ease-in-out;
   border-radius: 0.066667rem;


[14/50] incubator-weex git commit: * [html5] release vue-render 0.11.21

Posted by ta...@apache.org.
* [html5] release vue-render 0.11.21


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/173c482e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/173c482e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/173c482e

Branch: refs/heads/0.13-dev
Commit: 173c482ed77111bbf599f71c656faf77e8fc895f
Parents: b9bbe00
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 17:17:55 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 17:17:55 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/style.js       | 2 +-
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/173c482e/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index aca1fc7..0bcfaf1 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -76,7 +76,7 @@ function getUnitScaleMap () {
 
 function parseScale (val: number, unit: string): string {
   const unitScaleMap = getUnitScaleMap()
-  const res = val  * unitScaleMap[unit]
+  const res = val * unitScaleMap[unit]
   return (res === 0 ? 0 : res > 1 ? res : 1) + 'px'
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/173c482e/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index ecd2c7a..f859c1c 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.20",
+    "vue-render": "0.11.21",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/173c482e/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 540ebd9..e7ba5fa 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.20",
+  "version": "0.11.21",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[19/50] incubator-weex git commit: * [html5] release vue-render 0.11.23

Posted by ta...@apache.org.
* [html5] release vue-render 0.11.23


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5c02c7d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5c02c7d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5c02c7d3

Branch: refs/heads/0.13-dev
Commit: 5c02c7d375182ff56135243b5428a634be933411
Parents: 3723196
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 19:47:15 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 19:47:15 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5c02c7d3/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index f82cce0..2acf46a 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.22",
+    "vue-render": "0.11.23",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5c02c7d3/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 2ac5c25..85fb66b 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.22",
+  "version": "0.11.23",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[37/50] incubator-weex git commit: * [html5] fix performance test error in old safari on ip5.

Posted by ta...@apache.org.
* [html5] fix performance test error in old safari on ip5.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/be1a2f6f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/be1a2f6f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/be1a2f6f

Branch: refs/heads/0.13-dev
Commit: be1a2f6f1c3127e5fb39d11cbffae86223d91995
Parents: 75287e4
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 16 00:41:57 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 16 00:41:57 2017 +0800

----------------------------------------------------------------------
 build/config.js                       | 2 +-
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/be1a2f6f/build/config.js
----------------------------------------------------------------------
diff --git a/build/config.js b/build/config.js
index aab8ab6..ad178cd 100644
--- a/build/config.js
+++ b/build/config.js
@@ -85,7 +85,7 @@ const configs = {
     dest: absolute('packages/weex-vue-render/dist/index.js'),
     banner:`
 console.log('START WEEX VUE RENDER: ${subversion['vue-render']}, Build ${now()}.');
-window._jslib_init_start = performance && performance.now && performance.now() || +new Date();\n\n`,
+window._jslib_init_start = window.performance && window.performance.now && window.performance.now() || +new Date();\n\n`,
     format: 'umd',
     plugins: [
       postcss(),

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/be1a2f6f/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3717df9..26df24a 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.32",
+    "vue-render": "0.11.33",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/be1a2f6f/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 4520f28..d5469b3 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.32",
+  "version": "0.11.33",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[25/50] incubator-weex git commit: * [html5] refactor env. rm envd dependency.

Posted by ta...@apache.org.
* [html5] refactor env. rm envd dependency.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1c501c36
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1c501c36
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1c501c36

Branch: refs/heads/0.13-dev
Commit: 1c501c36142aa86e420e18036074deb1bbed7e22
Parents: 9a09be4
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 10:32:49 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 10:32:49 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/env/index.js        |   1 -
 html5/render/vue/env/wx-env.js       |   8 +-
 html5/render/vue/lib/envd/index.js   | 179 ++++++++++++++++++++++++++++++
 html5/render/vue/lib/envd/params.js  |  17 +++
 html5/render/vue/lib/envd/version.js | 152 +++++++++++++++++++++++++
 5 files changed, 353 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1c501c36/html5/render/vue/env/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/index.js b/html5/render/vue/env/index.js
index c00b251..0cf07a9 100644
--- a/html5/render/vue/env/index.js
+++ b/html5/render/vue/env/index.js
@@ -19,7 +19,6 @@
 import '../styles/reset.css'
 import '../styles/base.css'
 
-// import 'lazyimg'
 import '../../browser/render/gesture'
 
 import '../../../shared/arrayFrom'

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1c501c36/html5/render/vue/env/wx-env.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/wx-env.js b/html5/render/vue/env/wx-env.js
index 47d1706..21ea582 100644
--- a/html5/render/vue/env/wx-env.js
+++ b/html5/render/vue/env/wx-env.js
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import 'envd'
+import '../lib/envd'
 
 import { init as initViewport } from './viewport'
 import { extend } from '../utils'
@@ -27,12 +27,14 @@ import { extend } from '../utils'
  * @param  {object} envInfo: info parsed from lib.env.
  */
 export function initEnv (viewportInfo, envInfo) {
+  const browserName = envInfo.browser ? envInfo.browser.name : navigator.appName
+  const browserVersion = envInfo.browser ? envInfo.browser.version.val : null
   const env = {
     platform: 'Web',
     weexVersion: 'process.env.WEEX_VERSION',
     userAgent: navigator.userAgent,
-    appName: envInfo.aliapp ? envInfo.aliapp.appname : navigator.appName,
-    appVersion: envInfo.aliapp ? envInfo.aliapp.version.val : null,
+    appName: navigator.appName,
+    appVersion: navigator.appVersion,
     osName: envInfo.browser ? envInfo.browser.name : null,
     osVersion: envInfo.browser ? envInfo.browser.version.val : null,
     deviceModel: envInfo.os.name || null

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1c501c36/html5/render/vue/lib/envd/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/lib/envd/index.js b/html5/render/vue/lib/envd/index.js
new file mode 100644
index 0000000..99b6fd6
--- /dev/null
+++ b/html5/render/vue/lib/envd/index.js
@@ -0,0 +1,179 @@
+import './version'
+import './params'
+
+const lib = window.lib || (window.lib = {})
+const env = lib.env || (lib.env = {})
+
+const ua = window.navigator.userAgent
+let match
+
+/**
+ * os
+ */
+
+match = ua.match(/Windows\sPhone\s(?:OS\s)?([\d.]+)/)
+if (match) {
+  /**
+   * @type {Object}
+   * @memberof lib.env
+   * @property {String} name - os name, e.g. Android/AndroidPad/iPhone/iPod/iPad/Windows Phone/unknown, etc.
+   * @property {lib.env~Version} version - os version.
+   * @property {Boolean} isWindowsPhone
+   * @property {Boolean} isIPhone - is iPhone/iTouch
+   * @property {Boolean} isIPad
+   * @property {Boolean} isIOS
+   * @property {Boolean} isAndroid
+   * @property {Boolean} isAndroidPad
+   */
+  env.os = {
+    name: 'Windows Phone',
+    isWindowsPhone: true,
+    version: match[1]
+  }
+}
+else if (!!ua.match(/Safari/) && (match = ua.match(/Android[\s/]([\d.]+)/))) {
+  env.os = {
+    version: match[1]
+  }
+
+  if ((ua.match(/Mobile\s+Safari/))) {
+    env.os.name = 'Android'
+    env.os.isAndroid = true
+  }
+  else {
+    env.os.name = 'AndroidPad'
+    env.os.isAndroidPad = true
+  }
+}
+else if ((match = ua.match(/(iPhone|iPad|iPod)/))) {
+  const name = match[1]
+
+  match = ua.match(/OS ([\d_.]+) like Mac OS X/)
+
+  env.os = {
+    name: name,
+    isIPhone: (name === 'iPhone' || name === 'iPod'),
+    isIPad: name === 'iPad',
+    isIOS: true,
+    version: match[1].split('_').join('.')
+  }
+}
+else {
+  env.os = {
+    name: 'unknown',
+    version: '0.0.0'
+  }
+}
+
+if (lib.version) {
+  env.os.version = lib.version(env.os.version)
+}
+
+/**
+ * browser
+ */
+
+match = ua.match(/(?:UCWEB|UCBrowser\/)([\d.]+)/)
+
+if (match) {
+  /**
+   * @type {Object}
+   * @memberof env
+   * @property {String} name - browser name,e.g. UC/QQ/Firefox/Chrome/Android/Safari/iOS Webview/Chrome Webview/IE/IEMobile/unknown, etc.
+   * @property {env~Version} version - browser version.
+   * @property {Boolean} isUC
+   * @property {Boolean} isQQ
+   * @property {Boolean} isIE
+   * @property {Boolean} isIEMobile
+   * @property {Boolean} isIELikeWebkit
+   * @property {Boolean} isChrome
+   * @property {Boolean} isAndroid
+   * @property {Boolean} isSafari
+   * @property {Boolean} isWebview
+   */
+  env.browser = {
+    name: 'UC',
+    isUC: true,
+    version: match[1]
+  }
+}
+else if ((match = ua.match(/MQQBrowser\/([\d.]+)/))) {
+  env.browser = {
+    name: 'QQ',
+    isQQ: true,
+    version: match[1]
+  }
+}
+else if ((match = ua.match(/Firefox\/([\d.]+)/))) {
+  env.browser = {
+    name: 'Firefox',
+    isFirefox: true,
+    version: match[1]
+  }
+}
+else if ((match = ua.match(/MSIE\s([\d.]+)/))
+  || (match = ua.match(/IEMobile\/([\d.]+)/))) {
+  env.browser = {
+    version: match[1]
+  }
+
+  if (ua.match(/IEMobile/)) {
+    env.browser.name = 'IEMobile'
+    env.browser.isIEMobile = true
+  }
+  else {
+    env.browser.name = 'IE'
+    env.browser.isIE = true
+  }
+
+  if (ua.match(/Android|iPhone/)) {
+    env.browser.isIELikeWebkit = true
+  }
+}
+else if ((match = ua.match(/(?:Chrome|CriOS)\/([\d.]+)/))) {
+  env.browser = {
+    name: 'Chrome',
+    isChrome: true,
+    version: match[1]
+  }
+
+  if (ua.match(/Version\/[\d+.]+\s*Chrome/)) {
+    env.browser.name = 'Chrome Webview'
+    env.browser.isWebview = true
+  }
+}
+else if (!!ua.match(/Safari/) && (match = ua.match(/Android[\s/]([\d.]+)/))) {
+  env.browser = {
+    name: 'Android',
+    isAndroid: true,
+    version: match[1]
+  }
+}
+else if (ua.match(/iPhone|iPad|iPod/)) {
+  if (ua.match(/Safari/)) {
+    match = ua.match(/Version\/([\d.]+)/)
+    env.browser = {
+      name: 'Safari',
+      isSafari: true,
+      version: match[1]
+    }
+  }
+  else {
+    match = ua.match(/OS ([\d_.]+) like Mac OS X/)
+    env.browser = {
+      name: 'iOS Webview',
+      isWebview: true,
+      version: match[1].replace(/_/g, '.')
+    }
+  }
+}
+else {
+  env.browser = {
+    name: 'unknown',
+    version: '0.0.0'
+  }
+}
+
+if (lib.version) {
+  env.browser.version = lib.version(env.browser.version)
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1c501c36/html5/render/vue/lib/envd/params.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/lib/envd/params.js b/html5/render/vue/lib/envd/params.js
new file mode 100644
index 0000000..71569df
--- /dev/null
+++ b/html5/render/vue/lib/envd/params.js
@@ -0,0 +1,17 @@
+const lib = window.lib || (window.lib = {})
+const env = lib.env || (lib.env = {})
+
+const search = window.location.search.replace(/^\?/, '')
+env.params = {}
+if (search) {
+  const params = search.split('&')
+  for (let i = 0; i < params.length; i++) {
+    params[i] = params[i].split('=')
+    try {
+      env.params[params[i][0]] = decodeURIComponent(params[i][1])
+    }
+    catch (e) {
+      env.params[params[i][0]] = params[i][1]
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1c501c36/html5/render/vue/lib/envd/version.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/lib/envd/version.js b/html5/render/vue/lib/envd/version.js
new file mode 100644
index 0000000..d51839a
--- /dev/null
+++ b/html5/render/vue/lib/envd/version.js
@@ -0,0 +1,152 @@
+const lib = window.lib || (window.lib = {})
+
+/**
+ * Version class.
+ * @class lib.env~Version
+ * @param {String} v - version number.
+ */
+export default function Version (v) {
+  Object.defineProperty(this, 'val', {
+    value: v.toString(),
+    enumerable: true
+  })
+
+  /**
+   * larger than
+   * @method gt
+   * @param {String} v - version
+   * @return {Boolean} result
+   * @instance
+   * @memberof Version
+   */
+  this.gt = function (v) {
+    return Version.compare(this, v) > 0
+  }
+
+  /**
+   * larger than or equal to.
+   * @method gte
+   * @param {String} v - version
+   * @return {Boolean} result
+   * @instance
+   * @memberof Version
+   */
+  this.gte = function (v) {
+    return Version.compare(this, v) >= 0
+  }
+
+  /**
+   * less than.
+   * @method lt
+   * @param {String} v - version
+   * @return {Boolean} result
+   * @instance
+   * @memberof Version
+   */
+  this.lt = function (v) {
+    return Version.compare(this, v) < 0
+  }
+
+  /**
+   * less than or equal to.
+   * @method lte
+   * @param {String} v - version
+   * @return {Boolean} result
+   * @instance
+   * @memberof Version
+   */
+  this.lte = function (v) {
+    return Version.compare(this, v) <= 0
+  }
+
+  /**
+   * equal to.
+   * @method eq
+   * @param {String} v - version
+   * @return {Boolean} equal to
+   * @instance
+   * @memberof Version
+   */
+  this.eq = function (v) {
+    return Version.compare(this, v) === 0
+  }
+}
+
+/**
+ * version number string.
+ * @method toString
+ * @return {String} current version number string.
+ * @instance
+ * @memberof Version
+ */
+Version.prototype.toString = function () {
+  return this.val
+}
+
+/**
+ * return current version number.
+ * @method valueOf
+ * @return {Boolean} version number
+ * @instance
+ * @memberof Version
+ */
+Version.prototype.valueOf = function () {
+  const v = this.val.split('.')
+  const r = []
+  for (let i = 0; i < v.length; i++) {
+    let n = parseInt(v[i], 10)
+    if (isNaN(n)) {
+      n = 0
+    }
+    let s = n.toString()
+    if (s.length < 5) {
+      s = Array(6 - s.length).join('0') + s
+    }
+    r.push(s)
+    if (r.length === 1) {
+      r.push('.')
+    }
+  }
+  return parseFloat(r.join(''))
+}
+
+/**
+ * compare two versions.
+ * @method compare
+ * @param {String} v1 - version1
+ * @param {String} v2 - version2
+ * @return {Number} 0 for equality,-1 for less than,1 for larger than.
+ * @memberof Version
+ */
+Version.compare = function (v1, v2) {
+  v1 = v1.toString().split('.')
+  v2 = v2.toString().split('.')
+  for (let i = 0; i < v1.length || i < v2.length; i++) {
+    let n1 = parseInt(v1[i], 10)
+    let n2 = parseInt(v2[i], 10)
+    if (window.isNaN(n1)) {
+      n1 = 0
+    }
+    if (window.isNaN(n2)) {
+      n2 = 0
+    }
+    if (n1 < n2) {
+      return -1
+    }
+    else if (n1 > n2) {
+      return 1
+    }
+  }
+  return 0
+}
+
+/**
+ * 解析和操作版本号
+ * @method version
+ * @param {string} v - 需要解析的版本号
+ * @return {lib.env~Version} Verson实例
+ * @memberof lib
+ */
+lib.version = function (v) {
+  return new Version(v)
+}


[06/50] incubator-weex git commit: * [html5] no need to camelize agian.

Posted by ta...@apache.org.
* [html5] no need to camelize agian.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b7c194b7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b7c194b7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b7c194b7

Branch: refs/heads/0.13-dev
Commit: b7c194b77e28dc267ccf9d97f92d0293330cce71
Parents: 6ed07bd
Author: MrRaindrop <te...@gmail.com>
Authored: Thu May 4 18:28:39 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu May 4 18:28:39 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/core/style.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b7c194b7/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index 2d6ec6f..0003ad7 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -178,7 +178,7 @@ function getStyle (vnode, extract) {
   }
   // cache binding style every time since the binding style is variable.
   extendTruthy(data.cached, data.style)
-  extend(style, camelizeKeys(data.cached))
+  extend(style, data.cached)
   data.staticStyle = style
   if (extract) {
     delete data.staticStyle


[24/50] incubator-weex git commit: * [html5] release 0.11.27.

Posted by ta...@apache.org.
* [html5] release 0.11.27.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9a09be40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9a09be40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9a09be40

Branch: refs/heads/0.13-dev
Commit: 9a09be40459ecabd8eaa84610aa55953a4b8f344
Parents: d005751
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 10:18:20 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 10:18:20 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9a09be40/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 28ffb09..793f466 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.25",
+    "vue-render": "0.11.27",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9a09be40/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 0c85fab..57057f7 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.25",
+  "version": "0.11.27",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[29/50] incubator-weex git commit: * [html5] release v0.11.29 & fix slider index.

Posted by ta...@apache.org.
* [html5] release v0.11.29 & fix slider index.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0eb40607
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0eb40607
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0eb40607

Branch: refs/heads/0.13-dev
Commit: 0eb406074383bd5c77a37bad00051085cbd6bfb9
Parents: 56b455a
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 16:43:27 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 16:43:27 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/index.js      | 14 +++++++++++---
 html5/render/vue/components/slider/slideMixin.js | 15 +++++++++------
 package.json                                     |  2 +-
 packages/weex-vue-render/package.json            |  2 +-
 4 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0eb40607/html5/render/vue/components/slider/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/index.js b/html5/render/vue/components/slider/index.js
index 3c3360f..ce74db0 100644
--- a/html5/render/vue/components/slider/index.js
+++ b/html5/render/vue/components/slider/index.js
@@ -51,6 +51,10 @@ const _css = `
 export default {
   mixins: [slideMixin],
   props: {
+    index: {
+      type: [String, Number],
+      default: 0
+    },
     'auto-play': {
       type: [String, Boolean],
       default: false
@@ -63,13 +67,18 @@ export default {
       type: [String, Boolean],
       default: true
     }
+  },
 
+  watch: {
+    index () {
+      this.currentIndex = this.normalizeIndex(this.index)
+    }
   },
 
   data () {
     return {
-      currentIndex: 0,
-      frameCount: 0
+      frameCount: 0,
+      currentIndex: this.index
     }
   },
 
@@ -119,7 +128,6 @@ export default {
 
   created () {
     this.weexType = 'slider'
-    this.currentIndex = 0
     this.innerOffset = 0
     this._indicator = null
     this.$nextTick(() => {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0eb40607/html5/render/vue/components/slider/slideMixin.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js
index 154ed45..a11a519 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -64,13 +64,12 @@ export default {
       // nextFrame()
 
       if (newIndex !== this.currentIndex) {
-        this.currentIndex = newIndex
         // replace $el with { attr, style } is a legacy usage. Is it necessary to
         // do this ? Or just tell devers to use inline functions to access attrs ?
         this.$emit('change', createEvent(this.$el, 'change', {
           index: this.currentIndex
         }))
-        setTimeout(() => { this.reorder() }, TRANSITION_TIME)
+        setTimeout(() => { this.reorder(newIndex) }, TRANSITION_TIME)
       }
     },
     order () {
@@ -84,7 +83,10 @@ export default {
         // this.reorder()
       })
     },
-    reorder () {
+    reorder (newIndex) {
+      if (!newIndex && newIndex !== 0) {
+        newIndex = this.currentIndex
+      }
       // dir: 'current' | 'prev' | 'next'
       const setPosition = (elm, dir) => {
         const scale = window.weex.config.env.scale
@@ -144,11 +146,11 @@ export default {
           return
         }
         const lastPrev = this._prevElm
-        const prevIndex = this.normalizeIndex(this.currentIndex - 1)
-        const nextIndex = this.normalizeIndex(this.currentIndex + 1)
+        const prevIndex = this.normalizeIndex(newIndex - 1)
+        const nextIndex = this.normalizeIndex(newIndex + 1)
         let prevElm = this._prevElm = this._cells[prevIndex].elm
         const nextElm = this._cells[nextIndex].elm
-        const currentElm = this._cells[this.currentIndex].elm
+        const currentElm = this._cells[newIndex].elm
 
         // put current slide on the top.
         setPosition(currentElm, 'current')
@@ -168,6 +170,7 @@ export default {
 
         setPosition(prevElm, 'prev')
         setPosition(nextElm, 'next')
+        this.currentIndex = newIndex
       })
     },
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0eb40607/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 8132ed9..c5db963 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.28",
+    "vue-render": "0.11.29",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0eb40607/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 85520a3..2c9d17b 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.28",
+  "version": "0.11.29",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[28/50] incubator-weex git commit: * [html5] release 0.11.28

Posted by ta...@apache.org.
* [html5] release 0.11.28


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/56b455aa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/56b455aa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/56b455aa

Branch: refs/heads/0.13-dev
Commit: 56b455aaf3e2c3e5f60b42b518c3b1052a6fb438
Parents: 6b620c6
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 11:46:35 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 11:46:35 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/56b455aa/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 793f466..8132ed9 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.27",
+    "vue-render": "0.11.28",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/56b455aa/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 57057f7..85520a3 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.27",
+  "version": "0.11.28",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[46/50] incubator-weex git commit: * [html5] release v0.11.39 & load img asynchronously.

Posted by ta...@apache.org.
* [html5] release v0.11.39 & load img asynchronously.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0268618b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0268618b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0268618b

Branch: refs/heads/0.13-dev
Commit: 0268618ba7ed8db01568429a7bc31026e993d12c
Parents: 3aaba51
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 24 13:21:55 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 24 13:21:55 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/base.js       |  4 ++--
 html5/render/vue/utils/lazyload.js    | 11 +++++++++++
 html5/render/vue/utils/perf.js        | 11 +++++++++++
 package.json                          |  2 +-
 packages/weex-vue-render/package.json |  2 +-
 5 files changed, 26 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0268618b/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 6c9c38b..9393685 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -75,11 +75,11 @@ export default {
 
   mounted () {
     if (this.$options._componentTag === 'image') {
-      global._has_image_in_first_screen = true
+      window._has_image_in_first_screen = true
     }
     if (this === this.$root) {
       tagRootMounted()
-      if (!global._has_image_in_first_screen) {
+      if (!window._has_image_in_first_screen) {
         tagFirstScreen()
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0268618b/html5/render/vue/utils/lazyload.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/lazyload.js b/html5/render/vue/utils/lazyload.js
index c8bd369..0fab86d 100644
--- a/html5/render/vue/utils/lazyload.js
+++ b/html5/render/vue/utils/lazyload.js
@@ -50,6 +50,17 @@ export function applySrc (item: any, src: ?string, placeholderSrc: ?string): voi
       }
     }
   }
+
+  /**
+   * 1. apply src immediately in case javscript blocks the image loading
+   *  before next tick.
+   */
+  item.style.backgroundImage = `url(${src || ''})`
+
+  /**
+   * 2. then load the img src with Image constructor (but would not post
+   *  a request again), just to trigger the load event.
+   */
   if (item._src_loading) {
     return
   }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0268618b/html5/render/vue/utils/perf.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/perf.js b/html5/render/vue/utils/perf.js
index 9542a53..b7ccbcf 100644
--- a/html5/render/vue/utils/perf.js
+++ b/html5/render/vue/utils/perf.js
@@ -92,6 +92,7 @@ const perf: {
 const tmp = {}
 
 const IMG_REC_INDENT: number = 500  // record loading events after 500ms towards last recording.
+const REGEXP_IMG_TYPE = /(.png|.jpg|.webp|.gif)$/  // image file type regexp.
 
 let earliestBeforeUpdateTime: number = 0
 let earliestBeforeCreateTime: number = 0
@@ -153,6 +154,9 @@ function getEntries (): Array<any> {
   const performance = window.performance
   return performance && performance.getEntries
     ? performance.getEntries()
+      .filter(function (entry) {
+        return entry.initiatorType === 'img' || REGEXP_IMG_TYPE.test(entry.name)
+      })
     : [{ responseEnd: getNow() - IMG_REC_INDENT }]
 }
 
@@ -209,6 +213,13 @@ export function tagFirstScreen (time?: number): void {
 const debouncedTagImg = debounce(function () {
   const entries = getEntries()
   const len = entries.length
+  if (!len) {
+    /**
+     * no image loaded. This probably happened because of the disabling of images' loading
+     * events. So just tag now as the first screen time.
+     */
+    return tagFirstScreen()
+  }
   let i = 0
   let end = 0
   while (i < len) {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0268618b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index bc73a69..fb6e1e0 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.38",
+    "vue-render": "0.11.39",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0268618b/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index bb90cac..2a8e3e5 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.38",
+  "version": "0.11.39",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[26/50] incubator-weex git commit: * [html5] update

Posted by ta...@apache.org.
* [html5] update


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/65df9b61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/65df9b61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/65df9b61

Branch: refs/heads/0.13-dev
Commit: 65df9b616cc0afb9fbae2e42ec48d3f6c9f7aa58
Parents: 1c501c3
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 11:14:37 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 11:14:37 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/env/wx-env.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/65df9b61/html5/render/vue/env/wx-env.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/wx-env.js b/html5/render/vue/env/wx-env.js
index 21ea582..13d8a4f 100644
--- a/html5/render/vue/env/wx-env.js
+++ b/html5/render/vue/env/wx-env.js
@@ -33,8 +33,8 @@ export function initEnv (viewportInfo, envInfo) {
     platform: 'Web',
     weexVersion: 'process.env.WEEX_VERSION',
     userAgent: navigator.userAgent,
-    appName: navigator.appName,
-    appVersion: navigator.appVersion,
+    appName: browserName,
+    appVersion: browserVersion,
     osName: envInfo.browser ? envInfo.browser.name : null,
     osVersion: envInfo.browser ? envInfo.browser.version.val : null,
     deviceModel: envInfo.os.name || null


[08/50] incubator-weex git commit: * [html5] fix reduplicated appearing during mounted.

Posted by ta...@apache.org.
* [html5] fix reduplicated appearing during mounted.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/46dc29b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/46dc29b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/46dc29b2

Branch: refs/heads/0.13-dev
Commit: 46dc29b22a4c9427ad0587faaa462a9c89a8dda9
Parents: 88c199d
Author: MrRaindrop <te...@gmail.com>
Authored: Fri May 5 12:10:43 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri May 5 12:10:43 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/component.js | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/46dc29b2/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index 989499e..c810e8d 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -101,15 +101,17 @@ export function watchAppear (context) {
           isWindow = true
         }
         const visible = isElementVisible(el, isWindow ? document.body : container)
-        context._visible = visible
-        // if the component hasn't appeared for once yet, then it shouldn't trigger
-        // a disappear event at all.
-        if (context._appearedOnce) {
-          triggerEvent(el, on, visible, null)
-        }
-        else if (visible) {
-          context._appearedOnce = true
-          triggerEvent(el, on, true, null)
+        if (context._visible !== visible) {
+          context._visible = visible
+          // if the component hasn't appeared for once yet, then it shouldn't trigger
+          // a disappear event at all.
+          if (context._appearedOnce) {
+            triggerEvent(el, on, visible, null)
+          }
+          else if (visible) {
+            context._appearedOnce = true
+            triggerEvent(el, on, true, null)
+          }
         }
 
         let lastScrollTop = container.scrollTop || window.pageYOffset


[04/50] incubator-weex git commit: * [html5] add attrs to for consistency in renders.

Posted by ta...@apache.org.
* [html5] add attrs to  for consistency in renders.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c853cb92
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c853cb92
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c853cb92

Branch: refs/heads/0.13-dev
Commit: c853cb925a71f19b7c37fde84104dbda5b53308e
Parents: 8d3e29e
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 3 23:29:32 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 3 23:29:32 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/env/weex.js          | 25 +++++++++++++++++++++++++
 html5/render/vue/mixins/base.js       | 10 +++++++++-
 package.json                          |  2 +-
 packages/weex-vue-render/package.json |  2 +-
 4 files changed, 36 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c853cb92/html5/render/vue/env/weex.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/weex.js b/html5/render/vue/env/weex.js
index 82e4e44..091969a 100644
--- a/html5/render/vue/env/weex.js
+++ b/html5/render/vue/env/weex.js
@@ -16,11 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+/* global Vue */
 
 import './wx-env'
 import * as utils from '../utils'
 
 const weexModules = {}
+const _roots = []
 
 const weex = {
   __vue__: null,
@@ -31,6 +33,8 @@ const weex = {
     bundleUrl: location.href
   },
 
+  document: {},
+
   requireModule (moduleName) {
     return weexModules[moduleName]
   },
@@ -39,6 +43,23 @@ const weex = {
     return this.registerApiModule(...args)
   },
 
+  registerVueInstance (instance) {
+    if (!instance instanceof Vue) {
+      if (process.env.NODE_ENV === 'development') {
+        console.error(`[vue-render] registerVueInstance: invalid instance, not a vue instance.`)
+      }
+      return
+    }
+    const root = instance.$root
+    if (!root || !root.$el) {
+      if (process.env.NODE_ENV === 'development') {
+        console.error(`[vue-render] registerVueInstance: instance has no root.`)
+      }
+      return
+    }
+    this.document.children.push(root.$el)
+  },
+
   // @deprecated
   require (...args) {
     console.log(`[Vue Render] "weex.require" is deprecated, please use "weex.requireModule" instead.`)
@@ -91,6 +112,10 @@ const weex = {
   }
 }
 
+Object.defineProperty(weex.document, 'children', {
+  get () { return _roots }
+})
+
 ; ['on', 'once', 'off', 'emit'].forEach(function (method) {
   weex[method] = function (...args) {
     if (!this._vue) {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c853cb92/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 4360fc1..0b49566 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -18,7 +18,8 @@
  */
 import {
   getThrottleLazyload,
-  watchAppear
+  watchAppear,
+  extend
 } from '../utils'
 
 import {
@@ -75,6 +76,13 @@ export default {
       weex._root = this.$root.$el
       weex._root.classList.add('weex-root')
     }
+
+    // bind attrs to $el.
+    let i, j
+    if (this.$el && (i = j = this.$vnode) && (i = i.data) && (j = j.componentOptions)) {
+      this.$el.attrs = extend({}, i.attrs, j.propsData)
+    }
+
     watchAppear(this)
   },
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c853cb92/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index c9ae0dd..4637764 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.16",
+    "vue-render": "0.11.17",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c853cb92/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 696cfe0..5d95837 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.16",
+  "version": "0.11.17",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[38/50] incubator-weex git commit: * [html5] in case the styleMap not exists.

Posted by ta...@apache.org.
* [html5] in case the styleMap not exists.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d4378c0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d4378c0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d4378c0c

Branch: refs/heads/0.13-dev
Commit: d4378c0c3398988f5aeed11b5454952f4c2b96c9
Parents: be1a2f6
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 16 20:19:27 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 16 20:19:27 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/core/style.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d4378c0c/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index 74b4c9b..5ea83a1 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -149,7 +149,7 @@ export function getScopeId (vnode) {
 export function getScopeStyle (vnode, classNames) {
   const scopeId = getScopeId(vnode)
   const style = {}
-  const styleMap = weex.styleMap
+  const styleMap = weex.styleMap || {}
   let clsNmsIdx = 0
   const clsNmsLen = classNames.length
   while (clsNmsIdx < clsNmsLen) {


[43/50] incubator-weex git commit: * [html5] release v0.11.36

Posted by ta...@apache.org.
* [html5] release v0.11.36


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/108a582b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/108a582b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/108a582b

Branch: refs/heads/0.13-dev
Commit: 108a582b86b0ec4a36a95fb6fbd8fa1913f89292
Parents: 21ceac3
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 22 21:24:46 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 22 21:24:46 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/slideMixin.js      | 3 +--
 html5/render/vue/components/slider/slider-neighbor.js | 9 +++++++++
 package.json                                          | 2 +-
 packages/weex-vue-render/package.json                 | 2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/108a582b/html5/render/vue/components/slider/slideMixin.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js
index a11a519..efceb04 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -20,7 +20,6 @@ import { createEvent/*, nextFrame*/, fireLazyload, addTransform } from '../../ut
 
 const TRANSITION_TIME = 200
 
-const MAIN_SLIDE_SCALE = 0.9
 const MAIN_SLIDE_OPACITY = 1
 
 // trigger scroll event frequency.
@@ -96,7 +95,7 @@ export default {
         let offsetY = 0
         if (dir === 'current') {
           elm.style.zIndex = 1
-          neighborScale = MAIN_SLIDE_SCALE
+          neighborScale = this.currentItemScale
           opacity = MAIN_SLIDE_OPACITY
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/108a582b/html5/render/vue/components/slider/slider-neighbor.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slider-neighbor.js b/html5/render/vue/components/slider/slider-neighbor.js
index 907b931..a8a813c 100644
--- a/html5/render/vue/components/slider/slider-neighbor.js
+++ b/html5/render/vue/components/slider/slider-neighbor.js
@@ -8,6 +8,7 @@ import slideMixin from './slideMixin'
 const DEFAULT_NEIGHBOR_SPACE = 20
 const DEFAULT_NEIGHBOR_ALPHA = 0.6
 const DEFAULT_NEIGHBOR_SCALE = 0.8
+const DEFAULT_CURRENT_ITEM_SCALE = 0.9
 
 let id = 0
 export default {
@@ -48,6 +49,14 @@ export default {
         return !isNaN(val) && val >= 0 && val <= 1
       },
       default: DEFAULT_NEIGHBOR_SCALE
+    },
+    currentItemScale: {
+      type: [String, Number],
+      validator: function (val) {
+        val = parseFloat(val)
+        return !isNaN(val) && val >= 0 && val <= 1
+      },
+      default: DEFAULT_CURRENT_ITEM_SCALE
     }
   },
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/108a582b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index ccca173..686e7cf 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.35",
+    "vue-render": "0.11.36",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/108a582b/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 60960d7..77872b6 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.35",
+  "version": "0.11.36",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[20/50] incubator-weex git commit: * [html5] add perf stat.

Posted by ta...@apache.org.
* [html5] add perf stat.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3c66ca55
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3c66ca55
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3c66ca55

Branch: refs/heads/0.13-dev
Commit: 3c66ca55f1b0b3abb73979248224c86f0841a897
Parents: 5c02c7d
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 10 15:50:18 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 10 15:50:18 2017 +0800

----------------------------------------------------------------------
 build/config.js                                 |   4 +-
 html5/render/vue/components/a.js                |   1 +
 html5/render/vue/components/div.js              |   1 +
 html5/render/vue/components/image.js            |   1 +
 html5/render/vue/components/input.js            |   1 +
 .../render/vue/components/scrollable/header.js  |   1 +
 .../vue/components/scrollable/list/cell.js      |   1 +
 .../vue/components/scrollable/list/index.js     |   1 +
 .../components/scrollable/loading-indicator.js  |   1 +
 .../render/vue/components/scrollable/loading.js |   1 +
 .../render/vue/components/scrollable/refresh.js |   1 +
 .../vue/components/scrollable/scroller.js       |   1 +
 html5/render/vue/components/slider/index.js     |   1 +
 html5/render/vue/components/slider/indicator.js |   1 +
 .../vue/components/slider/slider-neighbor.js    |   1 +
 html5/render/vue/components/switch.js           |   1 +
 html5/render/vue/components/text.js             |   1 +
 html5/render/vue/components/textarea.js         |   1 +
 html5/render/vue/components/video.js            |   1 +
 html5/render/vue/components/web.js              |   1 +
 html5/render/vue/index.js                       |   9 ++
 html5/render/vue/mixins/base.js                 |   6 ++
 html5/render/vue/utils/perf.js                  | 106 +++++++++++++++++--
 23 files changed, 135 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/build/config.js
----------------------------------------------------------------------
diff --git a/build/config.js b/build/config.js
index 092df5d..aab8ab6 100644
--- a/build/config.js
+++ b/build/config.js
@@ -83,7 +83,9 @@ const configs = {
     moduleName: 'WeexVueRender',
     entry: absolute('html5/render/vue/index.js'),
     dest: absolute('packages/weex-vue-render/dist/index.js'),
-    banner: `console.log('START WEEX VUE RENDER: ${subversion['vue-render']}, Build ${now()}.');\n\n`,
+    banner:`
+console.log('START WEEX VUE RENDER: ${subversion['vue-render']}, Build ${now()}.');
+window._jslib_init_start = performance && performance.now && performance.now() || +new Date();\n\n`,
     format: 'umd',
     plugins: [
       postcss(),

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/a.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/a.js b/html5/render/vue/components/a.js
index bf12d21..b624163 100644
--- a/html5/render/vue/components/a.js
+++ b/html5/render/vue/components/a.js
@@ -35,6 +35,7 @@ export default {
     // if (process.env.NODE_ENV === 'development') {
     //   validateStyles('a', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
+    this._renderHook()
     return createElement('html:a', {
       attrs: {
         'weex-type': 'a',

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/div.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/div.js b/html5/render/vue/components/div.js
index 9811332..63cdbc1 100644
--- a/html5/render/vue/components/div.js
+++ b/html5/render/vue/components/div.js
@@ -32,6 +32,7 @@ export default {
     // if (process.env.NODE_ENV === 'development') {
     //   validateStyles('div', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
+    this._renderHook()
     return createElement('html:div', {
       attrs: { 'weex-type': 'div' },
       on: createEventMap(this),

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/image.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/image.js b/html5/render/vue/components/image.js
index 39caa55..ba44d2a 100644
--- a/html5/render/vue/components/image.js
+++ b/html5/render/vue/components/image.js
@@ -79,6 +79,7 @@ export default {
     // const style = this._normalizeInlineStyles(this.$vnode.data)
     const resizeStyle = getResizeStyle(this)
     const style = extractComponentStyle(this)
+    this._renderHook()
     return createElement('figure', {
       attrs: {
         'weex-type': 'image',

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/input.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/input.js b/html5/render/vue/components/input.js
index fc1ac99..cc8059e 100644
--- a/html5/render/vue/components/input.js
+++ b/html5/render/vue/components/input.js
@@ -70,6 +70,7 @@ export default {
     //   validateStyles('input', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
     const events = extend(createEventMap(this), mapFormEvents(this))
+    this._renderHook()
     return createElement('html:input', {
       attrs: {
         'weex-type': 'input',

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/scrollable/header.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/header.js b/html5/render/vue/components/scrollable/header.js
index 9753209..3644177 100644
--- a/html5/render/vue/components/scrollable/header.js
+++ b/html5/render/vue/components/scrollable/header.js
@@ -64,6 +64,7 @@ export default {
     // if (process.env.NODE_ENV === 'development') {
     //   validateStyles('header', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
+    this._renderHook()
     return createElement('html:header', {
       attrs: { 'weex-type': 'header' },
       on: createEventMap(this),

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/scrollable/list/cell.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/list/cell.js b/html5/render/vue/components/scrollable/list/cell.js
index 2f37f4a..d7ddbf7 100644
--- a/html5/render/vue/components/scrollable/list/cell.js
+++ b/html5/render/vue/components/scrollable/list/cell.js
@@ -25,6 +25,7 @@ export default {
     // if (process.env.NODE_ENV === 'development') {
     //   validateStyles('cell', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
+    this._renderHook()
     return createElement('section', {
       attrs: { 'weex-type': 'cell' },
       on: createEventMap(this),

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/scrollable/list/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/list/index.js b/html5/render/vue/components/scrollable/list/index.js
index a5fceff..682d6ef 100644
--- a/html5/render/vue/components/scrollable/list/index.js
+++ b/html5/render/vue/components/scrollable/list/index.js
@@ -71,6 +71,7 @@ export default {
       this.updateLayout()
     })
 
+    this._renderHook()
     return createElement('main', {
       ref: 'wrapper',
       attrs: { 'weex-type': 'list' },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/scrollable/loading-indicator.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/loading-indicator.js b/html5/render/vue/components/scrollable/loading-indicator.js
index 356236d..1d71226 100644
--- a/html5/render/vue/components/scrollable/loading-indicator.js
+++ b/html5/render/vue/components/scrollable/loading-indicator.js
@@ -56,6 +56,7 @@ const _css = `
 export default {
   render (createElement) {
     this.weexType = 'loading-indicator'
+    this._renderHook()
     return createElement('mark', {
       attrs: { 'weex-type': 'loading-indicator' },
       staticClass: 'weex-loading-indicator weex-ct',

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/scrollable/loading.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/loading.js b/html5/render/vue/components/scrollable/loading.js
index e8bef52..40fe8ed 100644
--- a/html5/render/vue/components/scrollable/loading.js
+++ b/html5/render/vue/components/scrollable/loading.js
@@ -91,6 +91,7 @@ export default {
   },
   render (createElement) {
     this.$parent._loading = this
+    this._renderHook()
     return createElement('aside', {
       ref: 'loading',
       attrs: { 'weex-type': 'loading' },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/scrollable/refresh.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/refresh.js b/html5/render/vue/components/scrollable/refresh.js
index a770095..40653b7 100644
--- a/html5/render/vue/components/scrollable/refresh.js
+++ b/html5/render/vue/components/scrollable/refresh.js
@@ -99,6 +99,7 @@ export default {
   },
   render (createElement) {
     this.$parent._refresh = this
+    this._renderHook()
     return createElement('aside', {
       ref: 'refresh',
       attrs: { 'weex-type': 'refresh' },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/scrollable/scroller.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/scroller.js b/html5/render/vue/components/scrollable/scroller.js
index 96ebc10..954af1b 100644
--- a/html5/render/vue/components/scrollable/scroller.js
+++ b/html5/render/vue/components/scrollable/scroller.js
@@ -91,6 +91,7 @@ export default {
       this.updateLayout()
     })
 
+    this._renderHook()
     return createElement('main', {
       ref: 'wrapper',
       attrs: { 'weex-type': 'scroller' },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/slider/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/index.js b/html5/render/vue/components/slider/index.js
index 72d7bd1..3c3360f 100644
--- a/html5/render/vue/components/slider/index.js
+++ b/html5/render/vue/components/slider/index.js
@@ -174,6 +174,7 @@ export default {
     this._cells = this.formatChildren(createElement)
     this.frameCount = this._cells.length
 
+    this._renderHook()
     return createElement(
       'nav',
       {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/slider/indicator.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/indicator.js b/html5/render/vue/components/slider/indicator.js
index 060c21d..09189bb 100644
--- a/html5/render/vue/components/slider/indicator.js
+++ b/html5/render/vue/components/slider/indicator.js
@@ -181,6 +181,7 @@ export default {
     const { count, active } = this.$vnode.data.attrs || {}
     this.count = count
     this.active = active
+    this._renderHook()
     return _render(this, createElement)
   },
   _css

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/slider/slider-neighbor.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slider-neighbor.js b/html5/render/vue/components/slider/slider-neighbor.js
index ec118e9..907b931 100644
--- a/html5/render/vue/components/slider/slider-neighbor.js
+++ b/html5/render/vue/components/slider/slider-neighbor.js
@@ -157,6 +157,7 @@ export default {
     this._cells = this.formatChildren(createElement)
     this.frameCount = this._cells.length
 
+    this._renderHook()
     return createElement(
       'nav',
       {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/switch.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/switch.js b/html5/render/vue/components/switch.js
index 426beb5..6780da9 100644
--- a/html5/render/vue/components/switch.js
+++ b/html5/render/vue/components/switch.js
@@ -116,6 +116,7 @@ export default {
     // if (process.env.NODE_ENV === 'development') {
     //   validateStyles('switch', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
+    this._renderHook()
     return createElement('span', {
       attrs: { 'weex-type': 'switch' },
       on: {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/text.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/text.js b/html5/render/vue/components/text.js
index b93540b..e0f14ee 100644
--- a/html5/render/vue/components/text.js
+++ b/html5/render/vue/components/text.js
@@ -68,6 +68,7 @@ export default {
     // }
     const style = extractComponentStyle(this)
     const textSpecStyle = getTextSpecStyle(style)
+    this._renderHook()
     return createElement('p', {
       attrs: { 'weex-type': 'text' },
       on: createEventMap(this),

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/textarea.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/textarea.js b/html5/render/vue/components/textarea.js
index a1851ee..63a2e3c 100644
--- a/html5/render/vue/components/textarea.js
+++ b/html5/render/vue/components/textarea.js
@@ -57,6 +57,7 @@ export default {
     //   validateStyles('textarea', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
     const events = extend(createEventMap(this), mapFormEvents(this))
+    this._renderHook()
     return createElement('html:textarea', {
       attrs: {
         'weex-type': 'textarea',

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/video.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/video.js b/html5/render/vue/components/video.js
index b39bf4a..f467881 100644
--- a/html5/render/vue/components/video.js
+++ b/html5/render/vue/components/video.js
@@ -56,6 +56,7 @@ export default {
     // }
 
     // TODO: support playStatus
+    this._renderHook()
     return createElement('html:video', {
       attrs: {
         'weex-type': 'video',

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/components/web.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/web.js b/html5/render/vue/components/web.js
index 1bf95a6..c0f03a9 100644
--- a/html5/render/vue/components/web.js
+++ b/html5/render/vue/components/web.js
@@ -68,6 +68,7 @@ export default {
     //   validateStyles('web', this.$vnode.data && this.$vnode.data.staticStyle)
     // }
 
+    this._renderHook()
     return createElement('iframe', {
       attrs: {
         'weex-type': 'web',

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/index.js b/html5/render/vue/index.js
index 7f158dc..6373a09 100644
--- a/html5/render/vue/index.js
+++ b/html5/render/vue/index.js
@@ -64,4 +64,13 @@ if (typeof window !== 'undefined' && window.Vue) {
   init(window.Vue)
 }
 
+// perf stat for componentCount.
+window._component_count = 0
+
+// perf stat for JSLibInitTime.
+window._jslib_init_end = performance && performance.now() || +new Date()
+window._weex_perf.stat.JSLibInitTime = parseInt(window._jslib_init_end - window._jslib_init_start)
+delete window._jslib_init_end
+delete window._jslib_init_start
+
 export default weex

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index e1476b0..6c9c38b 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -116,6 +116,12 @@ export default {
   },
 
   methods: {
+    _renderHook () {
+      if (!window._first_screen_detected) {
+        window._component_count++
+      }
+    },
+
     _getScopeIds () {
       const arr = []
       let ctx = this

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3c66ca55/html5/render/vue/utils/perf.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/perf.js b/html5/render/vue/utils/perf.js
index 13be79f..af0ce78 100644
--- a/html5/render/vue/utils/perf.js
+++ b/html5/render/vue/utils/perf.js
@@ -1,4 +1,4 @@
-/*
+ /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -22,7 +22,7 @@
  * @fileOverview: perf data recorder.
  */
 
-import { debounce, depress } from './func'
+import { debounce, depress, extend } from './func'
 
 // performance tracker for weex.
 const perf: {
@@ -39,7 +39,25 @@ const perf: {
   renderTime: Array<{ start: number, end: number, duration: number }>,
   entries: Array<{ requestStart: number, responseEnd: number }>,
   time: {},
-  firstAllMountedTime: ?number
+  firstAllMountedTime: ?number,
+  stat: {
+    // info stat.
+    connectionType: string,
+    requestType: string,
+    pageName: string,
+    templateUrl: string,
+    WXSDKVersion: string,
+    bizType: string,
+    JSLibVersion: string,
+
+    // performance stat.
+    screenRenderTime: number,
+    JSTemplateSize: number,
+    componentCount: number,
+    networkTime: number,
+    JSLibInitTime: number,
+    totalTime: number
+  }
 } = window._weex_perf = {
   earliestBeforeCreates: [],
   latestMounts: [],
@@ -51,7 +69,24 @@ const perf: {
   renderTime: [],
   entries: [],
   time: {},
-  firstAllMountedTime: null
+  firstAllMountedTime: null,
+  stat: {
+    // info stat.
+    connectionType: '',
+    requestType: '',
+    pageName: '',
+    templateUrl: '',
+    WXSDKVersion: '',
+    bizType: '',
+    JSLibVersion: '',
+    // performance stat.
+    screenRenderTime: 0,
+    JSTemplateSize: 0,
+    componentCount: 0,
+    networkTime: 0,
+    JSLibInitTime: 0,
+    totalTime: 0
+  }
 }
 
 const tmp = {}
@@ -61,7 +96,53 @@ const IMG_REC_INDENT: number = 500  // record loading events after 500ms towards
 let earliestBeforeUpdateTime: number = 0
 let earliestBeforeCreateTime: number = 0
 
-let isFirstScreenDetected = false
+let statCollected = false
+function collectStat (): void {
+  if (statCollected) {
+    return
+  }
+  statCollected = true
+  const version = window.weex.config.env.weexVersion
+  const protocol = location.protocol
+  extend(perf.stat, {
+    connectionType: protocol.substring(0, protocol.length - 1),
+    requestType: 'network',
+    pageName: location.href,
+    WXSDKVersion: version,
+    bizType: 'weex',
+    JSLibVersion: version
+  })
+
+  // get templateUrl && JSTemplateSize
+  const entries = performance.getEntries && performance.getEntries()
+  if (entries) {
+    const params = window.lib.httpurl(location.href).params
+    const bundle = params.page || params._wx_tpl
+    if (bundle) {
+      const len = entries.length
+      let i = 0
+      while (i < len) {
+        const entry = entries[i]
+        if (entry.entryType === 'resource'
+          && entry.name.indexOf(bundle.replace(/^[./]+/, '')) > -1) {
+          const res: any = extend({}, entry)
+          extend(perf.stat, {
+            templateUrl: res.name,
+            JSTemplateSize: parseInt(res.transferSize / 1024),
+            networkTime: parseInt(res.duration)
+          })
+          break
+        }
+        i++
+      }
+    }
+  }
+}
+
+export function collectStatPerf (name: string, val: string | number): void {
+  if (!name) { return }
+  perf.stat[name] = val
+}
 
 function getNow (): number {
   return performance.now ? performance.now() : new Date().getTime()
@@ -101,15 +182,23 @@ export function tagFirstScreen (time?: number): void {
 
   const num = perf.renderTime.length
   perf[`screenTime${num}`] = time
-  window.weex.emit('renderfinish', time)
-  if (!isFirstScreenDetected) {
-    isFirstScreenDetected = true
+
+  if (!window._first_screen_detected) {
+    window._first_screen_detected = true
+    collectStat()
+    extend(perf.stat, {
+      screenRenderTime: parseInt(time),
+      componentCount: window._component_count
+    })
     window.weex.emit('firstscreenfinish', time)
   }
+
   if (process.env.NODE_ENV === 'development') {
     console.log(`screenTime[${num}]: ${time} ms.`)
     console.log('_weex_perf:', window._weex_perf)
   }
+
+  window.weex.emit('renderfinish', time)
 }
 
 /**
@@ -158,6 +247,7 @@ export function tagRootMounted (): void {
       console.log(`first all mounted time: ${now} ms.`)
     }
   }
+  collectStatPerf('totalTime', parseInt(now))
 }
 
 /**


[32/50] incubator-weex git commit: * [html5] release 0.11.30

Posted by ta...@apache.org.
* [html5] release 0.11.30


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3b241b28
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3b241b28
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3b241b28

Branch: refs/heads/0.13-dev
Commit: 3b241b2804150be052b381cb9bb2b3a7b22622de
Parents: 18f2550
Author: MrRaindrop <te...@gmail.com>
Authored: Mon May 15 17:56:19 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon May 15 17:56:19 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3b241b28/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index c5db963..66fc5ce 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.29",
+    "vue-render": "0.11.30",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3b241b28/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 2c9d17b..e1c8462 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.29",
+  "version": "0.11.30",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[39/50] incubator-weex git commit: * [html5] fix video's playStatus.

Posted by ta...@apache.org.
* [html5] fix video's playStatus.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f8d873b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f8d873b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f8d873b0

Branch: refs/heads/0.13-dev
Commit: f8d873b0ecb36cd23f24d350e5f0108d528187fa
Parents: d4378c0
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 16 20:20:11 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 16 20:20:11 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/video.js | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f8d873b0/html5/render/vue/components/video.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/video.js b/html5/render/vue/components/video.js
index f467881..bd87a03 100644
--- a/html5/render/vue/components/video.js
+++ b/html5/render/vue/components/video.js
@@ -1,4 +1,4 @@
-/*
+ /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -29,7 +29,6 @@ export default {
         return ['play', 'pause'].indexOf(value) !== -1
       }
     },
-
     autoplay: {
       type: [String, Boolean],
       default: false
@@ -38,10 +37,9 @@ export default {
       type: [String, Boolean],
       default: false
     },
-
     playsinline: {
       type: [String, Boolean],
-      default: false
+      default: true
     },
     controls: {
       type: [String, Boolean],
@@ -50,18 +48,25 @@ export default {
   },
 
   render (createElement) {
-    /* istanbul ignore next */
-    // if (process.env.NODE_ENV === 'development') {
-    //   validateStyles('video', this.$vnode.data && this.$vnode.data.staticStyle)
-    // }
-
-    // TODO: support playStatus
     this._renderHook()
+
+    if (this.playStatus === 'play') {
+      this.$nextTick(function () {
+        this.$el && this.$el.play()
+      })
+    }
+    else if (this.playStatus === 'pause') {
+      this.$nextTick(function () {
+        this.$el && this.$el.pause()
+      })
+    }
+
     return createElement('html:video', {
       attrs: {
         'weex-type': 'video',
-        autoplay: (this.autoplay !== 'false' && this.autoplay !== false),
-        autoPlay: (this.autoplay !== 'false' && this.autoplay !== false),
+        autoplay: ((this.autoplay !== 'false' && this.autoplay !== false)
+          || (this.autoPlay !== 'false' && this.autoPlay !== false)),
+        'webkit-playsinline': this.playsinline,
         controls: this.controls,
         src: this.src
       },


[12/50] incubator-weex git commit: * [html5] release vue-render 0.11.20

Posted by ta...@apache.org.
* [html5] release vue-render 0.11.20


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/177bfa16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/177bfa16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/177bfa16

Branch: refs/heads/0.13-dev
Commit: 177bfa16cba445e086c2fe2fb07bae36f5e9e46e
Parents: e30b1a5
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 9 11:52:51 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 9 11:52:51 2017 +0800

----------------------------------------------------------------------
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/177bfa16/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 83a190b..ecd2c7a 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.19",
+    "vue-render": "0.11.20",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/177bfa16/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 43ae33f..540ebd9 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.19",
+  "version": "0.11.20",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[48/50] incubator-weex git commit: * [html5] release v0.11.41

Posted by ta...@apache.org.
* [html5] release v0.11.41


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/4cdfbb80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/4cdfbb80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/4cdfbb80

Branch: refs/heads/0.13-dev
Commit: 4cdfbb808be35e56ce2d38097fadc0e9ad2a81ca
Parents: 98a4f45
Author: MrRaindrop <te...@gmail.com>
Authored: Thu May 25 09:55:41 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu May 25 09:55:41 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/base.js       | 2 +-
 html5/render/vue/utils/perf.js        | 4 ++--
 package.json                          | 2 +-
 packages/weex-vue-render/package.json | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4cdfbb80/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 9393685..a1db14c 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -146,7 +146,7 @@ export default {
       if (process.env.NODE_ENV === 'development') {
         tagBegin('base._fireLazyload')
       }
-      getThrottleLazyload(16)()
+      getThrottleLazyload(500)()
       if (process.env.NODE_ENV === 'development') {
         tagEnd('base._fireLazyload')
       }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4cdfbb80/html5/render/vue/utils/perf.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/perf.js b/html5/render/vue/utils/perf.js
index b7ccbcf..190b78e 100644
--- a/html5/render/vue/utils/perf.js
+++ b/html5/render/vue/utils/perf.js
@@ -92,7 +92,7 @@ const perf: {
 const tmp = {}
 
 const IMG_REC_INDENT: number = 500  // record loading events after 500ms towards last recording.
-const REGEXP_IMG_TYPE = /(.png|.jpg|.webp|.gif)$/  // image file type regexp.
+const REGEXP_IMG_TYPE = /(.png|.jpg|.jpeg|.webp|.gif)$/  // image file type regexp.
 
 let earliestBeforeUpdateTime: number = 0
 let earliestBeforeCreateTime: number = 0
@@ -155,7 +155,7 @@ function getEntries (): Array<any> {
   return performance && performance.getEntries
     ? performance.getEntries()
       .filter(function (entry) {
-        return entry.initiatorType === 'img' || REGEXP_IMG_TYPE.test(entry.name)
+        return REGEXP_IMG_TYPE.test(entry.name)
       })
     : [{ responseEnd: getNow() - IMG_REC_INDENT }]
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4cdfbb80/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 4036fab..fd66a25 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.5",
-    "vue-render": "0.11.40",
+    "vue-render": "0.11.41",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4cdfbb80/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 7f868d3..6f17d2d 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.40",
+  "version": "0.11.41",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[40/50] incubator-weex git commit: * [html5] fix test.

Posted by ta...@apache.org.
* [html5] fix test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d43f5cbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d43f5cbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d43f5cbf

Branch: refs/heads/0.13-dev
Commit: d43f5cbf2231645a5227603d14afb57a2773c208
Parents: f8d873b
Author: MrRaindrop <te...@gmail.com>
Authored: Wed May 17 10:04:55 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed May 17 10:04:55 2017 +0800

----------------------------------------------------------------------
 html5/test/render/vue/core/node.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d43f5cbf/html5/test/render/vue/core/node.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/core/node.js b/html5/test/render/vue/core/node.js
index 8076e4c..910e390 100644
--- a/html5/test/render/vue/core/node.js
+++ b/html5/test/render/vue/core/node.js
@@ -31,7 +31,7 @@ init('core node', (Vue, helper) => {
        * child vnode -> parent vnode.
        *  e.g.  div -> foo (whoes root element is the div.)
        */
-      const evt = new Event('tap', { bubbles: true })
+      const evt = new Event('click', { bubbles: true })
       el.dispatchEvent(evt)
 
       helper.registerDone(id, (tracker) => {
@@ -49,7 +49,7 @@ init('core node', (Vue, helper) => {
        * click inner div. should just trigget the inner handler and
        * shouldn't bubbe to outter div.
        */
-      const evt = new Event('tap', { bubbles: true })
+      const evt = new Event('click', { bubbles: true })
       inner.dispatchEvent(evt)
 
       helper.registerDone(id, (tracker) => {