You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/16 04:05:54 UTC

[01/20] incubator-weex git commit: * [html5] add cycleslider.

Repository: incubator-weex
Updated Branches:
  refs/heads/0.14-dev 87b19c2b8 -> b006e16c7


* [html5] add cycleslider.


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

Branch: refs/heads/0.14-dev
Commit: e1aac5a9ccf4455ccf1594d7ff275939545ee454
Parents: 8b2ee21
Author: MrRaindrop <te...@gmail.com>
Authored: Mon Jun 5 12:42:04 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon Jun 5 12:42:04 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/index.js | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e1aac5a9/html5/render/vue/components/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/index.js b/html5/render/vue/components/index.js
index 77a5df8..6e720ae 100644
--- a/html5/render/vue/components/index.js
+++ b/html5/render/vue/components/index.js
@@ -53,6 +53,7 @@ export default {
   cell,
   scroller,
   slider,
+  cycleslider: slider,
   'slider-neighbor': neighbor,
   indicator,
   refresh,


[15/20] incubator-weex git commit: Merge branch '0.14-dev' into 0.14-dev-web

Posted by so...@apache.org.
Merge branch '0.14-dev' into 0.14-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/cedf279f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cedf279f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cedf279f

Branch: refs/heads/0.14-dev
Commit: cedf279f7e36d057f67681209c4b0ac51f855730
Parents: e377bc3 0d61f2b
Author: MrRaindrop <te...@gmail.com>
Authored: Sat Jun 10 11:55:56 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Sat Jun 10 11:55:56 2017 +0800

----------------------------------------------------------------------
 .travis.yml                                     |   8 +-
 HOW-TO-BUILD.md                                 |  80 +++++
 LICENSE                                         |  22 +-
 POSSIBLE-NOTICES-FOR-BIN-DIST                   |   3 +
 README_RELEASE.md                               |  74 ----
 RUN-RAT.md                                      |  12 +
 .../java/com/alibaba/weex/WXApplication.java    |   2 +
 .../weex/extend/component/WXParallax.java       | 345 +++++++++++++++++++
 android/run-ci.sh                               |   2 +-
 android/sdk/build.gradle                        |  20 +-
 .../com/taobao/weex/LayoutFinishListener.java   |  18 +
 .../taobao/weex/adapter/ICrashInfoReporter.java |  18 +
 .../com/taobao/weex/bridge/WXBridgeManager.java |   2 +-
 .../java/com/taobao/weex/common/Constants.java  |   1 +
 .../weex/common/ICheckBindingScroller.java      |  27 ++
 .../taobao/weex/dom/action/AnimationAction.java |  37 +-
 .../weex/dom/action/ExecutableRenderAction.java |  18 +
 .../weex/dom/action/ModuleInvocationAction.java |  18 +
 .../weex/dom/action/UpdateStyleAction.java      |   4 +-
 .../ui/animation/DimensionUpdateListener.java   |  88 -----
 .../weex/ui/animation/HeightProperty.java       |  35 ++
 .../weex/ui/animation/LayoutParamsProperty.java |  64 ++++
 .../weex/ui/animation/WXAnimationBean.java      |  72 ++--
 .../taobao/weex/ui/animation/WidthProperty.java |  35 ++
 .../taobao/weex/ui/component/WXComponent.java   |  27 +-
 .../taobao/weex/ui/component/WXScroller.java    |   9 +-
 .../taobao/weex/ui/component/WXVContainer.java  |  13 +
 .../ui/component/list/BasicListComponent.java   | 184 +++++++++-
 .../ui/component/list/DefaultDragHelper.java    | 173 ++++++++++
 .../weex/ui/component/list/DragHelper.java      |  57 +++
 .../ui/component/list/DragSupportCallback.java  | 146 ++++++++
 .../weex/ui/component/list/EventTrigger.java    |  25 ++
 .../ExtendedStaggeredGridLayoutManager.java     |  18 +
 .../taobao/weex/utils/WXDataStructureUtil.java  |  21 +-
 .../com/taobao/weex/utils/WXResourceUtils.java  |   2 +-
 .../java/com/taobao/weex/WXSDKInstanceTest.java |  26 +-
 .../weex/adapter/DefaultUriAdapterTest.java     |   4 +-
 .../clipboard/WXClipboardModuleTest.java        |   4 +-
 .../navigator/WXNavigatorModuleTest.java        |   4 +-
 .../appfram/storage/DefaultWXStorageTest.java   |  32 +-
 .../appfram/storage/WXStorageModuleTest.java    |  16 +-
 .../taobao/weex/bridge/WXBridgeManagerTest.java |  14 +-
 .../com/taobao/weex/bridge/WXBridgeTest.java    |   4 +-
 .../com/taobao/weex/bridge/WXHashMapTest.java   |   4 +-
 .../taobao/weex/bridge/WXModuleManagerTest.java |   4 +-
 .../java/com/taobao/weex/dom/WXAttrTest.java    |   4 +-
 .../com/taobao/weex/dom/WXDomModuleTest.java    |   4 +-
 .../com/taobao/weex/dom/WXDomObjectTest.java    |   4 +-
 .../com/taobao/weex/dom/WXDomStatementTest.java |   4 +-
 .../taobao/weex/dom/WXTextDomObjectTest.java    |   4 +-
 .../ui/animation/WXAnimationModuleTest.java     |   4 +-
 .../weex/ui/component/EditComponentTest.java    |   4 +-
 .../taobao/weex/ui/component/TextareaTest.java  |   4 +-
 .../weex/ui/component/WXComponentTest.java      |   4 +-
 .../com/taobao/weex/ui/component/WXDivTest.java |   4 +-
 .../taobao/weex/ui/component/WXEmbedTest.java   |   4 +-
 .../taobao/weex/ui/component/WXImageTest.java   |  14 +-
 .../taobao/weex/ui/component/WXLoadingTest.java |   4 +-
 .../taobao/weex/ui/component/WXRefreshTest.java |   4 +-
 .../weex/ui/component/WXScrollerTest.java       |   4 +-
 .../weex/ui/component/WXSliderNeighborTest.java |   4 +-
 .../taobao/weex/ui/component/WXSliderTest.java  |   4 +-
 .../taobao/weex/ui/component/WXSwitchTest.java  |   4 +-
 .../taobao/weex/ui/component/WXVideoTest.java   |   4 +-
 .../com/taobao/weex/ui/component/WXWebTest.java |   4 +-
 .../component/helper/WXTimeInputHelperTest.java |   4 +-
 .../component/list/DefaultDragHelperTest.java   | 132 +++++++
 .../ui/component/list/WXListComponentTest.java  |   4 +-
 .../taobao/weex/ui/module/WXMetaModuleTest.java |   4 +-
 .../weex/ui/module/WXModalUIModuleTest.java     |   4 +-
 .../weex/ui/module/WXTimerModuleTest.java       |   4 +-
 .../weex/ui/module/WXWebViewModuleTest.java     |   4 +-
 .../weex/ui/view/WXCirclePageAdapterTest.java   |   4 +-
 .../taobao/weex/ui/view/WXScrollViewTest.java   |   4 +-
 .../com/taobao/weex/ui/view/WXWebViewTest.java  |   9 +-
 .../weex/ui/view/gesture/WXGestureTest.java     |   4 +-
 .../com/taobao/weex/utils/TypefaceUtilTest.java |   4 +-
 .../com/taobao/weex/utils/WXFileUtilsTest.java  |  17 +-
 .../com/taobao/weex/utils/WXLogUtilsTest.java   |   7 +-
 .../weex/utils/WXReflectionUtilsTest.java       |   4 +-
 dangerfile.js                                   | 163 ++++++---
 doc/source/cn/references/components/input.md    | 241 ++++++++++---
 doc/source/cn/references/components/list.md     |   2 +-
 doc/source/cn/references/modules/animation.md   |   4 +-
 doc/source/cn/references/modules/websocket.md   |   2 +-
 doc/source/cn/references/weex-variable.md       |   4 +-
 .../cn/v-0.10/references/components/input.md    | 216 ++++++++++--
 doc/source/guide/index.md                       |   6 +-
 doc/source/references/components/input.md       | 233 ++++++++++---
 doc/source/references/components/list.md        |   2 +-
 doc/source/references/modules/animation.md      |  12 +-
 doc/source/references/modules/websocket.md      |   2 +-
 doc/source/references/weex-variable.md          |   4 +-
 doc/themes/weex/languages/cn.yml                |  12 +
 doc/themes/weex/languages/en.yml                |  13 +-
 doc/themes/weex/layout/index.ejs                |  28 ++
 doc/themes/weex/source/css/index.scss           |  19 +-
 doc/themes/weex/source/images/fliggy.png        | Bin 0 -> 19329 bytes
 doc/themes/weex/source/images/juhuasuan.png     | Bin 0 -> 46340 bytes
 doc/themes/weex/source/images/qianniu.png       | Bin 0 -> 19852 bytes
 doc/themes/weex/source/images/taopiaopiao.png   | Bin 0 -> 12460 bytes
 ios/playground/WeexDemo/WXDemoViewController.m  |   6 -
 ios/sdk/WeexSDK.xcodeproj/project.pbxproj       |   4 -
 .../Sources/Component/WXCycleSliderComponent.m  |   9 +-
 .../Sources/Component/WXImageComponent.m        |   7 +-
 .../Sources/Component/WXLoadingComponent.m      |   7 -
 .../Sources/Component/WXScrollerComponent.m     |   5 +-
 ios/sdk/WeexSDK/Sources/Component/WXTransform.h |   5 +-
 ios/sdk/WeexSDK/Sources/Component/WXTransform.m | 109 ++++--
 .../WeexSDK/Sources/Events/WXComponent+Events.m |  15 +-
 .../Sources/Manager/WXComponentManager.m        |   5 +-
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m     |   2 +-
 .../WeexSDK/Sources/Module/WXAnimationModule.m  |  24 ++
 .../WeexSDK/Sources/Module/WXNavigatorModule.m  |   7 -
 ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m  |   4 +-
 .../Sources/View/WXComponent+ViewManagement.m   |   1 -
 ios/sdk/WeexSDK/dependency/SRWebSocket.h        |  17 +-
 ios/sdk/WeexSDK/dependency/SRWebSocket.m        |  18 +-
 ios/sdk/WeexSDKTests/WXURLRewriteTests.m        |  21 --
 ios/sdk/WeexSDKTests/dependency/libOCMock.a     | Bin 2098920 -> 0 bytes
 scripts/release_files.rules                     |   3 +-
 test/pages/css/border.vue                       |  13 +-
 test/screenshot/border-android.png              | Bin 196752 -> 156247 bytes
 test/screenshot/border-ios.png                  | Bin 161202 -> 128206 bytes
 124 files changed, 2669 insertions(+), 667 deletions(-)
----------------------------------------------------------------------



[11/20] incubator-weex git commit: * [html5] fix watching appear on composing component.

Posted by so...@apache.org.
* [html5] fix watching appear on composing 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/4513ef34
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/4513ef34
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/4513ef34

Branch: refs/heads/0.14-dev
Commit: 4513ef340098e2fb573bed7c5c4234b246992327
Parents: e31783a
Author: MrRaindrop <te...@gmail.com>
Authored: Fri Jun 9 11:09:54 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri Jun 9 11:09:54 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/component.js | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4513ef34/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index 409d98a..94c6a63 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -94,13 +94,22 @@ function triggerEvent (elm, handlers, isShow, dir) {
 }
 
 /**
- * get all event listeners. including v-on binding and ons in config.
+ * get all event listeners. including bound handlers in all parent vnodes.
  */
 export function getEventHandlers (context) {
-  const parentListeners = context.$options && context.$options._parentListeners
-  const dataOn = context.$vnode && context.$vnode.data && context.$vnode.data.on
-  const on = extend({}, parentListeners, dataOn)
-  return on
+  let vnode = context.$vnode
+  const handlers = {}
+  const attachedVnodes = []
+  while (vnode) {
+    attachedVnodes.push(vnode)
+    vnode = vnode.parent
+  }
+  attachedVnodes.forEach(function (vnode) {
+    const parentListeners = vnode.componentOptions && vnode.componentOptions.listeners
+    const dataOn = vnode.data && vnode.data.on
+    extend(handlers, parentListeners, dataOn)
+  })
+  return handlers
 }
 
 /**


[10/20] incubator-weex git commit: * [html5] support sticky children in vertical scroller & list.

Posted by so...@apache.org.
* [html5] support sticky children in vertical scroller & list.


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

Branch: refs/heads/0.14-dev
Commit: e31783a95ecc4d36a314a33ed95bb04ea6622be3
Parents: 16fab9c
Author: MrRaindrop <te...@gmail.com>
Authored: Wed Jun 7 17:40:13 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed Jun 7 17:40:13 2017 +0800

----------------------------------------------------------------------
 .../render/vue/components/scrollable/header.js  |  2 +-
 html5/render/vue/core/style.js                  | 95 +++++++++++++++-----
 html5/render/vue/index.js                       |  3 +-
 html5/render/vue/mixins/index.js                |  4 +-
 html5/render/vue/mixins/scrollable.js           |  3 +
 html5/render/vue/mixins/sticky.js               | 65 ++++++++++++++
 html5/render/vue/styles/base.css                |  4 +-
 html5/render/vue/utils/component.js             | 20 +++--
 8 files changed, 163 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/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 3644177..cbb4783 100644
--- a/html5/render/vue/components/scrollable/header.js
+++ b/html5/render/vue/components/scrollable/header.js
@@ -70,7 +70,7 @@ export default {
       on: createEventMap(this),
       ref: 'header',
       staticClass: 'weex-header weex-ct',
-      class: { sticky: this.sticky, iossticky: this.supportSticky },
+      class: { 'weex-sticky': this.sticky, 'weex-ios-sticky': this.supportSticky },
       staticStyle: extractComponentStyle(this)
     }, this.$slots.default)
   }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index 8bb3029..f90d1a9 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -23,7 +23,10 @@ import {
   extendTruthy,
   trimComment,
   normalizeStyle,
-  autoPrefix
+  autoPrefix,
+  isArray,
+  getParentScroller,
+  supportSticky
 } from '../utils'
 import { tagBegin, tagEnd } from '../utils/perf'
 /* istanbul ignore next */
@@ -230,11 +233,47 @@ export function getComponentStyle (context, extract) {
           }
         }
       })
-      delete style[k]
+      if (k !== 'position') { delete style[k] }
     }
   }
+
+  /**
+   * If position is 'sticky', then add it to the stickyChildren of the parent scroller.
+   */
+  const pos = style.position
+  const reg = /sticky$/
+  if (isArray(pos) && pos[0].match(reg) || (pos + '').match(reg)) {
+    delete style.position
+    // use native sticky.
+    if (supportSticky()) {
+      context.$nextTick(function () {
+        const el = context.$el
+        if (el) {
+          el.classList.add('weex-ios-sticky')
+        }
+      })
+    }
+    // use re-implementation of sticky.
+    else if (!context._stickyAdded) {
+      const uid = context._uid
+      const scroller = getParentScroller(context)
+      if (scroller) {
+        context._stickyAdded = true
+        if (!scroller._stickyChildren) {
+          scroller._stickyChildren = {}
+        }
+        scroller._stickyChildren[uid] = context
+      }
+      context.$nextTick(function () {
+        const el = context.$el
+        if (el) {
+          context._initOffsetTop = el.offsetTop
+        }
+      })
+    }
+  }
+
   return style
-  // return addPrefix(normalizeStyle(style))
 }
 
 export function extractComponentStyle (context) {
@@ -242,27 +281,37 @@ export function extractComponentStyle (context) {
 }
 
 /**
- * get { width, height } (size) of current component from components' styles.
+ * process sticky children in scrollable components.
+ * current only support list and vertical scroller.
  */
-export function getSize (context) {
-  if (!context.$vnode) {
-    if (process.env.NODE_ENV === 'development') {
-      return console.error('[vue-render] getComponentStyle failed: no $vnode in context.')
-    }
-    return {}
+export function processSticky (context) {
+  /**
+   * current browser support 'sticky' or '-webkit-sticky', so there's no need
+   * to do further more.
+   */
+  if (supportSticky()) {
+    return
   }
-  const data = context.$vnode.data
-  const wh = {}
-  const classes = typeof data.class === 'string' ? data.class.split(' ') : (data.class || [])
-  const staticClass = typeof data.staticClass === 'string' ? data.staticClass.split(' ') : (data.class || [])
-  const clsNms = staticClass.concat(classes)
-  function extendWHFrom (to, from) {
-    if (!from) { return }
-    from.width && (to.width = from.width)
-    from.height && (to.height = from.height)
+  // current only support list and vertical scroller.
+  if (container.scrollDirection === 'horizontal') {
+    return
+  }
+  const stickyChildren = context._stickyChildren
+  const len = stickyChildren && stickyChildren.length || 0
+  if (len <= 0) { return }
+
+  const container = context.$el
+  if (!container) { return }
+  const scrollTop = container.scrollTop
+
+  let stickyChild
+  for (let i = 0; i < len; i++) {
+    stickyChild = stickyChildren[i]
+    if (stickyChild._initOffsetTop < scrollTop) {
+      stickyChild._addSticky()
+    }
+    else {
+      stickyChild._removeSticky()
+    }
   }
-  extendWHFrom(wh, this._getScopeStyle(clsNms))
-  extendWHFrom(wh, data.staticStyle)
-  extendWHFrom(wh, data.style)
-  return wh
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/html5/render/vue/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/index.js b/html5/render/vue/index.js
index 9c3c38c..5795c6b 100644
--- a/html5/render/vue/index.js
+++ b/html5/render/vue/index.js
@@ -19,7 +19,7 @@
 import weex from './env'
 import { setVue } from './env'
 import components from './components'
-import { base, style } from './mixins'
+import { base, style, sticky } from './mixins'
 // import styleMixin from './mixins/style'
 
 /**
@@ -60,6 +60,7 @@ function init (Vue/*, options = {}*/) {
   //     + `[${Object.keys(components).join(', ')}].`)
   Vue.mixin(base)
   Vue.mixin(style)
+  Vue.mixin(sticky)
   // }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/html5/render/vue/mixins/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/index.js b/html5/render/vue/mixins/index.js
index f91bdd4..7807b1a 100644
--- a/html5/render/vue/mixins/index.js
+++ b/html5/render/vue/mixins/index.js
@@ -20,10 +20,12 @@ import base from './base'
 import style from './style'
 import scrollable from './scrollable'
 import inputCommon from './input-common'
+import sticky from './sticky'
 
 export {
   base,
   scrollable,
   style,
-  inputCommon
+  inputCommon,
+  sticky
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/html5/render/vue/mixins/scrollable.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/scrollable.js b/html5/render/vue/mixins/scrollable.js
index 7adcf02..011c8e0 100644
--- a/html5/render/vue/mixins/scrollable.js
+++ b/html5/render/vue/mixins/scrollable.js
@@ -17,6 +17,7 @@
  * under the License.
  */
 import { getThrottleLazyload, throttle } from '../utils'
+import { processSticky } from '../core'
 
 const DEFAULT_OFFSET_ACCURACY = 10
 const DEFAULT_LOADMORE_OFFSET = 0
@@ -109,6 +110,8 @@ export default {
       getThrottleLazyload(25, this.$el, 'scroll')()
       getThrottledScroll(this)(event)
 
+      processSticky(this)
+
       // fire loadmore event.
       const inner = this.$refs.inner
       if (inner) {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/html5/render/vue/mixins/sticky.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/sticky.js b/html5/render/vue/mixins/sticky.js
new file mode 100644
index 0000000..8beb91a
--- /dev/null
+++ b/html5/render/vue/mixins/sticky.js
@@ -0,0 +1,65 @@
+/*
+ * 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 {
+  getParentScroller
+} from '../utils'
+
+export default {
+  destroyed () {
+    if (!this._stickyAdded) { return }
+    const scroller = getParentScroller(this)
+    if (!scroller) { return }
+    delete scroller._stickyChildren[this._uid]
+  },
+
+  methods: {
+    _addSticky () {
+      const el = this.$el
+      if (!el || el.nodeType === 1) {
+        if (process.env.NODE_ENV === 'development') {
+          console.error(`[vue-render] $el doesn't exist to add sticky.`)
+        }
+        return
+      }
+      el.classList.add('sticky')
+      if (!this._placeholder) {
+        this._placeholder = el.cloneNode(true)
+      }
+      this._placeholder.style.display = 'block'
+      this._placeholder.style.width = this.$el.offsetWidth + 'px'
+      this._placeholder.style.height = this.$el.offsetHeight + 'px'
+      el.parentNode.insertBefore(this._placeholder, this.$el)
+    },
+
+    _removeSticky () {
+      const el = this.$el
+      if (!el || el.nodeType === 1) {
+        if (process.env.NODE_ENV === 'development') {
+          console.error(`[vue-render] $el doesn't exist to remove sticky.`)
+        }
+        return
+      }
+      el.classList.remove('sticky')
+      if (this._placeholder) {
+        this._placeholder.parentNode.removeChild(this._placeholder)
+      }
+      this._placeholder = null
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/html5/render/vue/styles/base.css
----------------------------------------------------------------------
diff --git a/html5/render/vue/styles/base.css b/html5/render/vue/styles/base.css
index 17d0738..37728df 100644
--- a/html5/render/vue/styles/base.css
+++ b/html5/render/vue/styles/base.css
@@ -106,14 +106,14 @@ body > .weex-scroller {
   height: 100%;
 }
 
-.iossticky {
+.weex-ios-sticky {
   position: -webkit-sticky !important;
   position: sticky !important;
   z-index: 9999;
   top: 0;
 }
 
-.sticky {
+.weex-sticky {
   position: fixed;
   top: 0;
   z-index: 9999;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e31783a9/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index adcba9d..409d98a 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -19,12 +19,22 @@
 import { throttle, extend } from './func'
 import { createEvent } from './event'
 
-export function getParentScroller (vnode) {
-  if (!vnode) return null
-  if (vnode.weexType === 'scroller' || vnode.weexType === 'list') {
-    return vnode
+const scrollableTypes = ['scroller', 'list']
+
+export function getParentScroller (vm) {
+  if (!vm) return null
+  if (vm._parentScroller) {
+    return vm._parentScroller
+  }
+  function _getParentScroller (parent) {
+    if (!parent) { return }
+    if (scrollableTypes.indexOf(parent.weexType) > -1) {
+      vm._parentScroller = parent
+      return parent
+    }
+    return _getParentScroller(parent.$parent)
   }
-  return getParentScroller(vnode.$parent)
+  return _getParentScroller(vm.$parent)
 }
 
 export function hasIntersection (rect, ctRect) {


[18/20] incubator-weex git commit: * [html5] fix slider's error when there's no children at first.

Posted by so...@apache.org.
* [html5] fix slider's error when there's no children at first.


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

Branch: refs/heads/0.14-dev
Commit: f6fe550b79967243e26ddd2bf8f96a48c44a9522
Parents: 3471c85
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Jun 15 11:45:57 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Jun 15 11:45:57 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/slideMixin.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6fe550b/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 2655fbb..84ca705 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -59,7 +59,6 @@ export default {
       }
     }
     fireLazyload(this.$el, true)
-    this._preIndex = this._showNodes[0].index
     if (this._preIndex !== this.currentIndex) {
       this._slideTo(this.currentIndex)
     }
@@ -162,6 +161,9 @@ export default {
     },
 
     _slideTo (index, isTouchScroll) {
+      if (this.frameCount <= 0) {
+        return
+      }
       if (!this.infinite || this.infinite === 'false') {
         if (index === -1 || index > (this.frameCount - 1)) {
           this._slideTo(this.currentIndex)


[08/20] incubator-weex git commit: * [html5] release 0.11.47

Posted by so...@apache.org.
* [html5] release 0.11.47


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

Branch: refs/heads/0.14-dev
Commit: b4c4692da72d87418426bec9ff0307335a66d4f9
Parents: d812503
Author: MrRaindrop <te...@gmail.com>
Authored: Wed Jun 7 11:45:54 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed Jun 7 11:45:54 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/b4c4692d/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index d27c6c6..1779fec 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.6",
-    "vue-render": "0.11.46",
+    "vue-render": "0.11.47",
     "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/b4c4692d/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index a4a9dfa..68deec4 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.46",
+  "version": "0.11.47",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[09/20] incubator-weex git commit: * [html5] update

Posted by so...@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/16fab9cc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/16fab9cc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/16fab9cc

Branch: refs/heads/0.14-dev
Commit: 16fab9cc9b4239127b92efc0ce666caf0997fd4b
Parents: b4c4692
Author: MrRaindrop <te...@gmail.com>
Authored: Wed Jun 7 11:59:44 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed Jun 7 11:59:44 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/component.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/16fab9cc/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index f724532..adcba9d 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -162,7 +162,7 @@ export function triggerAppear (context, visible) {
     if (scroller && scroller.$el) {
       container = scroller.$el
     }
-    const visible = isElementVisible(context.$el, container)
+    visible = isElementVisible(context.$el, container)
   }
   return detectAppear(context, visible)
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/16fab9cc/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1779fec..3920251 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.6",
-    "vue-render": "0.11.47",
+    "vue-render": "0.11.48",
     "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/16fab9cc/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 68deec4..bd5f5fd 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.47",
+  "version": "0.11.48",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[17/20] incubator-weex git commit: * [html5] fix example waterfall.vue

Posted by so...@apache.org.
* [html5] fix example waterfall.vue


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

Branch: refs/heads/0.14-dev
Commit: 3471c8548d46079c09b470c7ecec2905e2af263e
Parents: 95eb56c
Author: MrRaindrop <te...@gmail.com>
Authored: Wed Jun 14 20:53:37 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed Jun 14 20:53:37 2017 +0800

----------------------------------------------------------------------
 examples/vue/components/waterfall.vue | 165 ++++++++++++++---------------
 1 file changed, 78 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3471c854/examples/vue/components/waterfall.vue
----------------------------------------------------------------------
diff --git a/examples/vue/components/waterfall.vue b/examples/vue/components/waterfall.vue
index ab39b7f..8ed7f66 100644
--- a/examples/vue/components/waterfall.vue
+++ b/examples/vue/components/waterfall.vue
@@ -1,16 +1,16 @@
 <template>
-  <waterfall class="page" ref="waterfall"
+  <waterfall class="page"
   v-bind:style="{padding:padding}"
-  :column-width="columnWidth" :column-count="columnCount" :column-gap="columnGap"
+  :columnWidth="columnWidth" :columnCount="columnCount" :columnGap="columnGap"
   :show-scrollbar="showScrollbar" :scrollable="scrollable"
-  @scroll="recylerScroll" @loadmore="loadmore" loadmoreoffset=3000
+  @scroll="recylerScroll"
   >
     <refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
       <loading-indicator class="indicator"></loading-indicator>
       <text class="refreshText">{{refreshText}}</text>
     </refresh>
     <header class="header" ref="header" v-if="showHeader">
-      <image class="banner" src="https://gw.alicdn.com/tps/TB1ESN1PFXXXXX1apXXXXXXXXXX-1000-600.jpg" resize="cover">
+      <div class="banner" src="https://gw.alicdn.com/tps/TB1ESN1PFXXXXX1apXXXXXXXXXX-1000-600.jpg" resize="cover">
         <div class="bannerInfo">
           <image class="avatar" src="https://gw.alicdn.com/tps/TB1EP9bPFXXXXbpXVXXXXXXXXXX-150-110.jpg" resize="cover"></image>
           <text class="name">Adam Cat</text>
@@ -21,9 +21,9 @@
         <div class="bannerPhotoWrap">
           <image class="bannerPhoto" v-for="photo in banner.photos" :src="photo.src"></image>
         </div>
-      </image>
+      </div>
     </header>
-    <header class="stickyHeader" @click="showOrRemoveHeader">
+    <header class="stickyHeader">
       <div v-if="stickyHeaderType === 'none'" class="stickyWrapper">
         <text class="stickyText">Sticky Header</text>
       </div>
@@ -41,7 +41,7 @@
         <text class="stickyText">Content Offset:{{contentOffset}}</text>
       </div>
     </header>
-    <cell v-for="(item, index) in items" :key="item.src" class="cell">
+    <cell v-for="(item, index) in items" :key="index" :ref="`cell${index}`" class="cell">
       <div class="item" @click="onItemclick(item.behaviour, index)" @appear="itemAppear(item.src)" @disappear="itemDisappear(item.src)">
         <text v-if="item.name" class="itemName">{{item.name}}</text>
         <image class="itemPhoto" :src="item.src"></image>
@@ -49,22 +49,19 @@
         <text v-if="item.behaviourName" class="itemClickBehaviour"> {{item.behaviourName}}</text>
       </div>
     </cell>
-    <header class="footer">
-      <text class="stickyText">Footer</text>
-    </header>
     <div class="fixedItem" @click="scrollToTop">
       <text class="fixedText">Top</text>
     </div>
   </waterfall>
 </template>
 
-<style>
+<style scoped>
   .page {
     background-color: #EFEFEF;
   }
   .refresh {
-    height: 128;
-    width: 750;
+    height: 128px;
+    width: 750px;
     flex-direction: row;
     align-items: center;
     justify-content: center;
@@ -75,81 +72,82 @@
   }
   .indicator {
     color: #888888;
-    height: 40;
-    width: 40;
-    margin-right: 30;
+    height: 40px;
+    width: 40px;
+    margin-right: 30px;
   }
   .header {
+    background-color: #fff;
   }
   .banner {
-    height: 377;
+    height: 377px;
     flex-direction: row;
   }
   .bannerInfo {
-    width:270;
+    width: 270px;
     align-items: center;
     justify-content: center;
   }
   .avatar {
-    width: 148;
-    height: 108;
-    border-radius: 54;
-    border-width: 4;
+    width: 148px;
+    height: 108px;
+    border-radius: 54px;
+    border-width: 4px;
     border-color: #FFFFFF;
-    margin-bottom: 14;
+    margin-bottom: 14px;
   }
   .name {
     font-weight: bold;
-    font-size:32;
+    font-size:32px;
     color:#ffffff;
-    line-height:32;
+    line-height:32px;
     text-align:center;
-    margin-bottom: 16;
+    margin-bottom: 16px;
   }
   .titleWrap {
-    width: 100;
-    height: 24;
-    margin-bottom: 10;
+    width: 100px;
+    height: 24px;
+    margin-bottom: 10px;
     background-color: rgba(255,255,255,0.80);
-    border-radius: 12;
+    border-radius: 12px;
     justify-content: center;
     align-items: center;
   }
   .title {
-    font-size: 20;
+    font-size: 20px;
     color: #000000;
   }
   .bannerPhotoWrap {
-    width: 449;
-    height: 305;
+    width: 449px;
+    height: 305px;
     background-color: #FFFFFF;
-    border-radius: 12;
-    margin-top: 35;
-    padding: 12;
+    border-radius: 12px;
+    margin-top: 35px;
+    padding: 12px;
     flex-direction: row;
     justify-content: space-between;
     flex-wrap:wrap;
   }
   .bannerPhoto {
-    width: 137;
-    height: 137;
-    margin-bottom: 6;
+    width: 137px;
+    height: 137px;
+    margin-bottom: 6px;
   }
   .stickyHeader {
     position: sticky;
-    height: 94;
+    height: 94px;
     flex-direction: row;
-    padding-bottom:6;
+    padding-bottom:6px;
   }
   .stickyWrapper {
     flex-direction: row;
     background-color:#00cc99;
     justify-content: center;
     align-items: center;
-    flex:1;
+    flex: 1;
   }
   .stickyTextImageWrapper {
-    flex:1;
+    flex: 1;
     justify-content: center;
     align-items: center;
     flex-direction: row;
@@ -157,75 +155,69 @@
   .stickyText {
     color: #FFFFFF;
     font-weight: bold;
-    font-size:32;
-    margin-right: 12;
+    font-size: 32px;
+    margin-right: 12px;
   }
   .stickyImage {
-    width: 64;
-    height: 64;
-    border-radius: 32;
+    width: 64px;
+    height: 64px;
+    border-radius: 32px;
   }
 
   .cell {
-    padding-top: 6;
-    padding-bottom: 6;
+    padding-top: 6px;
+    padding-bottom: 6px;
   }
   .item {
     background-color: #FFFFFF;
     align-items: center;
   }
   .itemName {
-    font-size:28;
+    font-size: 28px;
     color:#333333;
-    line-height:42;
+    line-height: 42px;
     text-align:left;
-    margin-top: 24;
+    margin-top: 24px;
   }
   .itemPhoto {
-    margin-top: 18;
-    width: 220;
-    height: 220;
-    margin-bottom: 18;
+    margin-top: 18px;
+    width: 220px;
+    height: 220px;
+    margin-bottom: 18px;
   }
   .itemDesc {
-    font-size:24;
-    margin:12;
-    color:#999999;
-    line-height:36;
-    text-align:left;
+    font-size: 24px;
+    margin: 12px;
+    color: #999999;
+    line-height: 36px;
+    text-align: left;
   }
   .itemClickBehaviour {
-    font-size:36;
-    color:#00cc99;
-    line-height:36;
+    font-size: 36px;
+    color: #00cc99;
+    line-height: 36px;
     text-align:center;
-    margin-top: 6;
-    margin-left: 24;
-    margin-right: 24;
-    margin-bottom: 30;
-  }
-  .footer {
-    height: 94;
-    justify-content: center;
-    align-items: center;
-    background-color: #00cc99;
+    margin-top: 6px;
+    margin-left: 24px;
+    margin-right: 24px;
+    margin-bottom: 30px;
   }
 
   .fixedItem {
     position: fixed;
-    width:78;
-    height:78;
-    background-color:#00cc99;
-    right: 32;
-    bottom: 32;
-    border-radius: 39;
+    width: 78px;
+    height: 78px;
+    background-color: #00cc99;
+    right: 32px;
+    bottom: 32px;
+    border-radius: 39px;
     align-items: center;
     justify-content: center;
   }
   .fixedText {
-    font-size: 36;
+    font-size: 36px;
     color: white;
-    line-height: 36;
+    line-height: 36px;
   }
 
 </style>
@@ -335,10 +327,6 @@
       recylerScroll: function(e) {
         this.contentOffset = e.contentOffset.y
       },
-      loadmore: function(e) {
-        console.log('receive loadmore event')
-        // this.$refs.waterfall.resetLoadmore()
-      },
       showOrRemoveHeader: function() {
         this.showHeader = !this.showHeader
       },
@@ -427,10 +415,12 @@
       },
 
       scrollToTop: function() {
+        // weex.requireModule('dom').scrollToElement(this.$refs.cell0)
         weex.requireModule('dom').scrollToElement(this.$refs.header)
       },
 
       setRecyclerPadding: function() {
+        debugger;
         this.padding = (this.padding == 0 ? 12 : 0);
       },
 
@@ -439,6 +429,7 @@
       },
 
       moveCell: function(index) {
+        
         if (index == 0) {
           this.items.splice(this.items.length - 1, 0, this.items.splice(index, 1)[0]);
         } else {


[19/20] incubator-weex git commit: * [html5] fix indicator & slider when there's no children.

Posted by so...@apache.org.
* [html5] fix indicator & slider when there's no children.


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

Branch: refs/heads/0.14-dev
Commit: 569d3334290a2025abee40227a14c5bdb463d078
Parents: f6fe550
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Jun 15 12:04:59 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Jun 15 12:04:59 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/slider/indicator.js  |  8 +-------
 html5/render/vue/components/slider/slideMixin.js | 11 +++++++----
 2 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/569d3334/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 09189bb..e38bd6c 100644
--- a/html5/render/vue/components/slider/indicator.js
+++ b/html5/render/vue/components/slider/indicator.js
@@ -58,9 +58,6 @@ function getIndicatorItemStyle (spec, isActive) {
 function _render (context, h) {
   const children = []
   const mergedStyle = extractComponentStyle(context)
-  // const mergedStyle = context._getComponentStyle(context.$vnode.data)
-  // context.$vnode.data.cached = {}
-  // extendKeys(context.$vnode.data.cached, mergedStyle, ['width', 'height'])
   const indicatorSpecStyle = extendKeys(
       {},
       mergedStyle,
@@ -173,14 +170,11 @@ export default {
       active: 0
     }
   },
-  // props: {
-  //   count: [Number, String],
-  //   active: [Number, String]
-  // },
   render (createElement) {
     const { count, active } = this.$vnode.data.attrs || {}
     this.count = count
     this.active = active
+    if (!this.count) { return }
     this._renderHook()
     return _render(this, createElement)
   },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/569d3334/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 84ca705..da2c848 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -52,10 +52,13 @@ export default {
     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()
+      for (let i = 0; i < len; i++) {
+        const vm = children[i]
+        if (vm.$options._componentTag === 'indicator'
+          || vm.$vnode.data.ref === 'indicator') {
+          vm._watcher.get()
+          break
+        }
       }
     }
     fireLazyload(this.$el, true)


[14/20] incubator-weex git commit: Merge branch '0.14-dev' into 0.14-dev-web

Posted by so...@apache.org.
Merge branch '0.14-dev' into 0.14-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/e377bc39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e377bc39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e377bc39

Branch: refs/heads/0.14-dev
Commit: e377bc395f99299b0e98b7a0e579351bf04627a7
Parents: 23c815e b69f612
Author: MrRaindrop <te...@gmail.com>
Authored: Sat Jun 10 11:51:05 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Sat Jun 10 11:51:05 2017 +0800

----------------------------------------------------------------------
 .flowconfig                                     |   1 +
 .gitignore                                      |   3 +
 .travis.yml                                     |   4 +-
 .wwprc                                          |   3 -
 LICENSE                                         |  87 ++++++-
 NOTICE                                          |   5 +
 POSSIBLE-NOTICES-FOR-BIN-DIST                   |  25 +-
 README_RELEASE.md                               |  74 ++++++
 WeexSDK.podspec                                 |   2 +-
 android/build.gradle                            |  12 +-
 android/commons/build.gradle                    |   1 +
 .../adapter/DefaultWebSocketAdapter.java        |  54 ++++-
 .../weex/commons/util/RequestIdGenerator.java   |  15 ++
 .../weex/commons/util/WSEventReporter.java      | 192 ++++++++++++++++
 android/playground/app/build.gradle             |   2 +-
 .../java/com/alibaba/weex/WXApplication.java    |   2 +
 .../extend/adapter/InterceptWXHttpAdapter.java  |  57 +++--
 android/sdk/build.gradle                        |  13 ++
 android/sdk/libs/armeabi/libweexjsc.so          | Bin 7652256 -> 7566292 bytes
 .../java/com/taobao/weex/WXEnvironment.java     |   1 +
 .../main/java/com/taobao/weex/WXSDKEngine.java  |   6 +
 .../java/com/taobao/weex/WXSDKInstance.java     |   2 +
 .../main/java/com/taobao/weex/WXSDKManager.java |  15 +-
 .../taobao/weex/adapter/DefaultUriAdapter.java  |  13 +-
 .../taobao/weex/adapter/ICrashInfoReporter.java |   9 +
 .../com/taobao/weex/bridge/WXBridgeManager.java |  55 ++---
 .../com/taobao/weex/common/WXPerformance.java   |   9 +-
 .../taobao/weex/ui/IExternalModuleGetter.java   |  30 +++
 .../taobao/weex/ui/IExternalMoudleGetter.java   |  29 ---
 .../ui/component/AbstractEditComponent.java     |  16 +-
 .../taobao/weex/ui/component/WXComponent.java   |  23 +-
 .../ui/component/list/StickyHeaderHelper.java   |  29 +--
 .../ExtendedStaggeredGridLayoutManager.java     |  31 +++
 .../weex/ui/view/listview/WXRecyclerView.java   |   2 +-
 .../taobao/weex/utils/WXSoInstallMgrSdk.java    |   4 +
 .../java/com/taobao/weex/utils/WXViewUtils.java |   3 +-
 .../java/com/taobao/weex/WXSDKEngineTest.java   |   1 -
 .../weex/adapter/DefaultUriAdapterTest.java     |   9 +-
 bin/commit-msg.sh                               |  12 -
 bin/dist-browser.sh                             |  44 ----
 bin/dist-js-framework.sh                        |  40 ----
 bin/dist-vue.sh                                 |  43 ----
 bin/install-hooks.sh                            |   7 -
 bin/pre-commit.sh                               |  11 -
 bin/pre-push.sh                                 |  12 -
 bin/release.sh                                  |   4 -
 bin/welcome.sh                                  |  11 -
 dangerfile.js                                   |   9 +-
 doc/package.json                                |   5 +-
 doc/source/cn/guide/integrate-to-your-app.md    |   1 +
 doc/source/cn/references/common-style.md        |  44 +++-
 doc/source/cn/references/components/input.md    |   4 +-
 doc/source/cn/references/components/list.md     |  22 ++
 doc/source/cn/references/components/scroller.md |  19 +-
 doc/source/cn/references/components/slider.md   |   9 +-
 doc/source/cn/references/components/text.md     |  33 +++
 .../cn/references/components/waterfall.md       |  13 +-
 doc/source/cn/references/modules/dom.md         |  24 +-
 doc/source/cn/references/modules/globalevent.md |   8 +-
 doc/source/cn/references/modules/websocket.md   | 128 ++++++-----
 doc/source/guide/integrate-to-your-app.md       |   1 +
 doc/source/references/common-style.md           |  38 +++
 doc/source/references/components/input.md       |   4 +-
 doc/source/references/components/list.md        |   5 +
 doc/source/references/components/scroller.md    |   3 +
 doc/source/references/components/slider.md      |   4 +-
 doc/source/references/components/text.md        |  36 ++-
 doc/source/references/components/waterfall.md   |  13 +-
 doc/source/references/modules/dom.md            |  19 ++
 doc/source/references/modules/globalevent.md    |   8 +-
 doc/source/references/modules/websocket.md      | 128 ++++++-----
 doc/themes/weex/layout/_partial/article.ejs     |   2 +-
 .../weex/layout/_partial/post/summary.ejs       |  17 +-
 doc/themes/weex/layout/page.ejs                 |   1 +
 doc/themes/weex/layout/post.ejs                 |   7 +
 doc/themes/weex/scripts/helper.js               |  18 ++
 doc/themes/weex/source/css/post.scss            |  32 ++-
 doc/themes/weex/source/js/common.js             |  32 ++-
 html5/frameworks/legacy/core/array.js           |  18 --
 html5/frameworks/legacy/core/dep.js             |  18 --
 html5/frameworks/legacy/core/object.js          |  18 --
 html5/frameworks/legacy/core/observer.js        |  18 --
 html5/frameworks/legacy/core/state.js           |  18 --
 html5/frameworks/legacy/core/watcher.js         |  18 --
 .../WeexDemo.xcodeproj/project.pbxproj          |   2 +-
 ios/sdk/LICENSE                                 | 202 ----------------
 ios/sdk/NOTICE                                  |  13 --
 ios/sdk/WeexSDK.xcodeproj/project.pbxproj       |   2 +-
 .../WeexSDK/Sources/Bridge/WXBridgeContext.h    |   6 +-
 .../Sources/Component/WXCycleSliderComponent.m  |   6 +-
 .../Sources/Component/WXEmbedComponent.m        |   6 +
 .../WeexSDK/Sources/Component/WXListComponent.m |  33 ++-
 .../Sources/Component/WXScrollerComponent.m     |   9 +-
 .../Sources/Component/WXSliderComponent.m       |   1 +
 .../WeexSDK/Sources/Component/WXTextComponent.m |  34 ++-
 ios/sdk/WeexSDK/Sources/Component/WXTransform.h |   4 +
 ios/sdk/WeexSDK/Sources/Component/WXTransform.m |  38 +++
 .../Sources/Controller/WXBaseViewController.m   |   6 -
 .../WeexSDK/Sources/Events/WXComponent+Events.m |   8 +
 .../WeexSDK/Sources/Layout/WXComponent+Layout.h |  23 +-
 .../WeexSDK/Sources/Layout/WXComponent+Layout.m |  23 +-
 ios/sdk/WeexSDK/Sources/Layout/WXLayoutDefine.h |  23 +-
 ios/sdk/WeexSDK/Sources/Model/WXComponent.h     |   5 +
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m     |  39 ++--
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h   |  12 +-
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m   |  16 +-
 ios/sdk/WeexSDK/Sources/Module/WXDomModule.m    |   1 +
 ios/sdk/WeexSDK/Sources/Utility/WXDefine.h      |   2 +-
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.h     |   7 +
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m     |  16 ++
 .../Sources/View/WXComponent+ViewManagement.m   |  14 +-
 ios/sdk/WeexSDK/Sources/WeexSDK.h               |   1 +
 ios/sdk/WeexSDKTests/testRootView.js            |  18 ++
 package.json                                    |  10 +-
 scripts/build_from_source.sh                    |  43 ++++
 scripts/commit-msg.sh                           |  28 +++
 scripts/dist-browser.sh                         |  60 +++++
 scripts/dist-js-framework.sh                    |  56 +++++
 scripts/dist-vue.sh                             |  58 +++++
 scripts/generate_apache_release.sh              |  35 +++
 scripts/install-hooks.sh                        |  23 ++
 scripts/pre-commit.sh                           |  27 +++
 scripts/pre-push.sh                             |  28 +++
 scripts/rat-ant-build.xml                       |  39 ++--
 scripts/release.sh                              |  20 ++
 scripts/release_files.rules                     |  67 ++++++
 scripts/replace-header.sh                       |   4 -
 scripts/welcome.sh                              |  27 +++
 test/mocha.opts                                 |   2 +-
 test/pages/components/scroller-fixed.vue        |  14 +-
 test/pages/components/slider-common.vue         | 229 +++++++++++++++++++
 test/run.sh                                     |   7 +
 test/scripts/components/recycler.test.js        |  12 +-
 test/scripts/components/scroll-event.test.js    |  14 +-
 test/scripts/components/scroller-fixed.test.js  |   5 +-
 test/scripts/components/slider-common.test.js   | 100 ++++++++
 test/scripts/util.js                            |  30 ++-
 137 files changed, 2371 insertions(+), 955 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e377bc39/package.json
----------------------------------------------------------------------


[16/20] incubator-weex git commit: * [html5] add waterfall and release 0.11.50. @notdanger * [html5] relase v0.11.49

Posted by so...@apache.org.
* [html5] add waterfall and release 0.11.50. @notdanger
* [html5] relase v0.11.49

+ [html5] add osName & osVerison for weex.config.env

+ [html5] add waterfall.

* [html5] add zIndex to fixed element.

+ [html5] add waterfall related styles.

* [html5] fix scrollToElement in waterfall.

* [html5] fix waterfall padding.

+ [html5] release 0.11.50

* [html5] add note for bundling.


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

Branch: refs/heads/0.14-dev
Commit: 95eb56c440e4ece9c7aa0bcde9448e6340bda857
Parents: cedf279
Author: MrRaindrop <te...@gmail.com>
Authored: Sun Jun 11 14:03:31 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed Jun 14 17:11:31 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/index.js            |   2 +
 .../vue/components/scrollable/waterfall.js      | 338 +++++++++++++++++++
 html5/render/vue/config.js                      |  21 ++
 html5/render/vue/core/style.js                  |  10 +-
 html5/render/vue/env/wx-env.js                  |  12 +-
 html5/render/vue/mixins/base.js                 |   4 +-
 html5/render/vue/modules/dom.js                 |  18 +-
 html5/render/vue/styles/base.css                |  26 +-
 html5/render/vue/utils/component.js             |   5 +-
 package.json                                    |   2 +-
 packages/weex-vue-render/README.md              |  19 +-
 packages/weex-vue-render/package.json           |   2 +-
 12 files changed, 438 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/components/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/index.js b/html5/render/vue/components/index.js
index 6e720ae..68c5739 100644
--- a/html5/render/vue/components/index.js
+++ b/html5/render/vue/components/index.js
@@ -24,6 +24,7 @@ import image from './image'
 import input from './input'
 import header from './scrollable/header'
 import list from './scrollable/list'
+import waterfall from './scrollable/waterfall'
 import cell from './scrollable/list/cell'
 import scroller from './scrollable/scroller'
 import slider from './slider'
@@ -50,6 +51,7 @@ export default {
   switch: _switch,
   header,
   list,
+  waterfall,
   cell,
   scroller,
   slider,

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/components/scrollable/waterfall.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/waterfall.js b/html5/render/vue/components/scrollable/waterfall.js
new file mode 100644
index 0000000..2239f00
--- /dev/null
+++ b/html5/render/vue/components/scrollable/waterfall.js
@@ -0,0 +1,338 @@
+/*
+ * 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.
+ */
+
+/**
+ * @fileoverview waterfall
+ * NOTE: only support full screen width waterfall.
+ */
+import { extractComponentStyle, createEventMap } from '../../core'
+import { scrollable } from '../../mixins'
+import { extend } from '../../utils'
+
+const NORMAL_GAP_SIZE = 32
+const DEFAULT_COLUMN_COUNT = 1
+
+export default {
+  mixins: [scrollable],
+  props: {
+    /**
+     * specified gap size.
+     * value can be number or 'normal'. 'normal' (32px) by default.
+     */
+    columnGap: {
+      type: [String, Number],
+      default: 'normal',
+      validator (val) {
+        if (!val || val === 'normal') {
+          return true
+        }
+        val = parseInt(val)
+        return !isNaN(val) && val > 0
+      }
+    },
+    /**
+     * the maximum column counts.
+     * value can be number or 'auto'. 1 by default.
+     */
+    columnCount: {
+      type: [String, Number],
+      default: DEFAULT_COLUMN_COUNT,
+      validator (val) {
+        val = parseInt(val)
+        return !isNaN(val) && val > 0
+      }
+    },
+    /**
+     * the mimimum column width.
+     * value can be number or 'auto'. 'auto' by default.
+     */
+    columnWidth: {
+      type: [String, Number],
+      default: 'auto',
+      validator (val) {
+        if (!val || val === 'auto') {
+          return true
+        }
+        val = parseInt(val)
+        return !isNaN(val) && val > 0
+      }
+    }
+  },
+
+  mounted () {
+    this._nextTick()
+  },
+
+  updated () {
+    this.$nextTick(this._nextTick())
+  },
+
+  methods: {
+    _createChildren (h, rootStyle) {
+      const slots = this.$slots.default || []
+      this._headers = []
+      this._others = []
+      this._cells = slots.filter(vnode => {
+        if (!vnode.tag || !vnode.componentOptions) return false
+        const tag = vnode.componentOptions.tag
+        if (tag === 'refresh' || tag === 'loading') {
+          this[`_${tag}`] = vnode
+          return false
+        }
+        if (tag === 'header') {
+          this._headers.push(vnode)
+          return false
+        }
+        if (tag !== 'cell') {
+          this._others.push(vnode)
+          return false
+        }
+        return true
+      })
+      this._reCalc(rootStyle)
+      this._genColumns(h)
+      let children = []
+      this._refresh && children.push(this._refresh)
+      children = children
+        .concat(this._headers)
+        .concat(this._others)
+      children.push(h('html:div', {
+        ref: 'columns',
+        staticClass: 'weex-waterfall-inner-columns weex-ct'
+      }, this._columns))
+      this._loading && children.push(this._loading)
+      return [
+        h('html:div', {
+          ref: 'inner',
+          staticClass: 'weex-waterfall-inner weex-ct'
+        }, children)
+      ]
+    },
+
+    _reCalc (rootStyle) {
+      /**
+       * NOTE: columnGap and columnWidth can't both be auto.
+       * NOTE: the formula:
+       *  totalWidth = n * w + (n - 1) * gap
+       * 1. if columnCount = n then calc w
+       * 2. if columnWidth = w then calc n
+       * 3. if columnWidth = w and columnCount = n then calc totalWidth
+       *    3.1 if totalWidth < ctWidth then increase columnWidth
+       *    3.2 if totalWidth > ctWidth then decrease columnCount
+       */
+      let width, gap, cnt, ctWidth
+      const scale = weex.config.env.scale
+      const el = this.$el
+      function getCtWidth (width, style) {
+        const padding = style.padding
+          ? parseInt(style.padding) * 2
+          : parseInt(style.paddingLeft || 0) + parseInt(style.paddingRight || 0)
+        return width - padding
+      }
+      if (el && el.nodeType === 1) {  // already mounted
+        const cstyle = window.getComputedStyle(el)
+        ctWidth = getCtWidth(el.getBoundingClientRect().width, cstyle)
+      }
+      else {  // not mounted.
+        // only support full screen width for waterfall component.
+        ctWidth = getCtWidth(document.documentElement.clientWidth, rootStyle)
+      }
+
+      gap = this.columnGap
+      if (gap && gap !== 'normal') {
+        gap = parseInt(gap)
+      }
+      else {
+        gap = NORMAL_GAP_SIZE
+      }
+      gap = gap * scale
+
+      width = this.columnWidth
+      cnt = this.columnCount
+      if (width && width !== 'auto') {
+        width = parseInt(width) * scale
+      }
+      if (cnt && cnt !== 'auto') {
+        cnt = parseInt(cnt)
+      }
+
+      // 0. if !columnCount && !columnWidth
+      if (cnt === 'auto' && width === 'auto') {
+        if (process.env.NODE_ENV === 'development') {
+          console.warn(`[vue-render] waterfall's columnWidth and columnCount shouldn't`
+          + ` both be auto at the same time.`)
+          cnt = DEFAULT_COLUMN_COUNT
+          width = ctWidth
+        }
+      }
+      // 1. if columnCount = n then calc w.
+      else if (cnt !== 'auto' && width === 'auto') {
+        width = (ctWidth - (cnt - 1) * gap) / cnt
+      }
+      // 2. if columnWidth = w then calc n.
+      else if (cnt === 'auto' && width !== 'auto') {
+        cnt = (ctWidth + gap) / (width + gap)
+      }
+      // 3. if columnWidth = w and columnCount = n then calc totalWidth
+      else if (cnt !== 'auto' && width !== 'auto') {
+        let totalWidth
+        const adjustCountAndWidth = () => {
+          totalWidth = cnt * width + (cnt - 1) * gap
+          if (totalWidth < ctWidth) {
+            width += (ctWidth - totalWidth) / cnt
+          }
+          else if (totalWidth > ctWidth && cnt > 1) {
+            cnt--
+            adjustCountAndWidth()
+          }
+          else if (totalWidth > ctWidth) {  // cnt === 1
+            width = ctWidth
+          }
+        }
+        adjustCountAndWidth()
+      }
+      this._columnCount = cnt
+      this._columnWidth = width
+      this._columnGap = gap
+    },
+
+    _genColumns (createElement) {
+      this._columns = []
+      const cells = this._cells
+      const columnCnt = this._columnCount
+      const len = cells.length
+      const columnCells = this._columnCells = Array(columnCnt).join('.').split('.').map(function () { return [] })
+      // spread cells to the columns using simpole polling algorithm.
+      for (let i = 0; i < len; i++) {
+        (cells[i].data.attrs || (cells[i].data.attrs = {}))['data-cell'] = i
+        columnCells[i % columnCnt].push(cells[i])
+      }
+      for (let i = 0; i < columnCnt; i++) {
+        this._columns.push(createElement('html:div', {
+          ref: `column${i}`,
+          attrs: {
+            'data-column': i
+          },
+          staticClass: 'weex-ct',
+          staticStyle: {
+            width: this._columnWidth + 'px',
+            marginLeft: i === 0 ? 0 : this._columnGap + 'px'
+          }
+        }, columnCells[i]))
+      }
+    },
+
+    _nextTick () {
+      this._reLayoutChildren()
+    },
+
+    _reLayoutChildren () {
+      /**
+       * treat the shortest column bottom as the match standard.
+       * whichever cell exceeded it would be rearranged.
+       * 1. m = shortest column bottom.
+       * 2. get all cell ids who is below m.
+       * 3. calculate which cell should be in which column.
+       */
+      const columnCnt = this._columnCount
+      const columnDoms = []
+      const columnAppendFragments = []
+      const columnBottoms = []
+      let minBottom = Number.MAX_SAFE_INTEGER
+      let minBottomColumnIndex = 0
+
+      // 1. find the shortest column bottom.
+      for (let i = 0; i < columnCnt; i++) {
+        const columnDom = this._columns[i].elm
+        const lastChild = columnDom.lastElementChild
+        const bottom = lastChild ? lastChild.getBoundingClientRect().bottom : 0
+        columnDoms.push(columnDom)
+        columnBottoms[i] = bottom
+        columnAppendFragments.push(document.createDocumentFragment())
+        if (bottom < minBottom) {
+          minBottom = bottom
+          minBottomColumnIndex = i
+        }
+      }
+
+      // 2. get all cell ids who is below m.
+      const belowCellIds = []
+      const belowCells = {}
+      for (let i = 0; i < columnCnt; i++) {
+        if (i === minBottomColumnIndex) {
+          continue
+        }
+        const columnDom = columnDoms[i]
+        const cellsInColumn = columnDom.querySelectorAll('section.weex-cell')
+        const len = cellsInColumn.length
+        for (let j = len - 1; j >= 0; j--) {
+          const cellDom = cellsInColumn[j]
+          const cellRect = cellDom.getBoundingClientRect()
+          if (cellRect.top > minBottom) {
+            const id = ~~cellDom.getAttribute('data-cell')
+            belowCellIds.push(id)
+            belowCells[id] = { elm: cellDom, height: cellRect.height }
+            columnBottoms[i] -= cellRect.height
+          }
+        }
+      }
+
+      // 3. calculate which cell should be in which column and rearrange them
+      //  in the dom tree.
+      belowCellIds.sort(function (a, b) { return a > b })
+      const cellIdsLen = belowCellIds.length
+      function addToShortestColumn (belowCell) {
+        // find shortest bottom.
+        minBottom = Math.min(...columnBottoms)
+        minBottomColumnIndex = columnBottoms.indexOf(minBottom)
+        const { elm: cellElm, height: cellHeight } = belowCell
+        columnAppendFragments[minBottomColumnIndex].appendChild(cellElm)
+        columnBottoms[minBottomColumnIndex] += cellHeight
+      }
+      for (let i = 0; i < cellIdsLen; i++) {
+        addToShortestColumn(belowCells[belowCellIds[i]])
+      }
+      for (let i = 0; i < columnCnt; i++) {
+        columnDoms[i].appendChild(columnAppendFragments[i])
+      }
+    }
+  },
+
+  render (createElement) {
+    this.weexType = 'waterfall'
+    this._cells = this.$slots.default || []
+    this.$nextTick(() => {
+      this.updateLayout()
+    })
+    this._renderHook()
+    const mergedStyle = extractComponentStyle(this)
+    return createElement('main', {
+      ref: 'wrapper',
+      attrs: { 'weex-type': 'waterfall' },
+      on: extend(createEventMap(this), {
+        scroll: this.handleScroll,
+        touchstart: this.handleTouchStart,
+        touchmove: this.handleTouchMove,
+        touchend: this.handleTouchEnd
+      }),
+      staticClass: 'weex-waterfall weex-waterfall-wrapper weex-ct',
+      staticStyle: mergedStyle
+    }, this._createChildren(createElement, mergedStyle))
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/config.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/config.js b/html5/render/vue/config.js
new file mode 100644
index 0000000..86c2489
--- /dev/null
+++ b/html5/render/vue/config.js
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+export default {
+  scrollableTypes: ['scroller', 'list', 'waterfall']
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index f90d1a9..063c1e5 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -242,7 +242,15 @@ export function getComponentStyle (context, extract) {
    */
   const pos = style.position
   const reg = /sticky$/
-  if (isArray(pos) && pos[0].match(reg) || (pos + '').match(reg)) {
+  if (pos === 'fixed') {
+    context.$nextTick(function () {
+      const el = context.$el
+      if (el) {
+        el.classList.add('weex-fixed')
+      }
+    })
+  }
+  else if (isArray(pos) && pos[0].match(reg) || (pos + '').match(reg)) {
     delete style.position
     // use native sticky.
     if (supportSticky()) {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/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 13d8a4f..4da3174 100644
--- a/html5/render/vue/env/wx-env.js
+++ b/html5/render/vue/env/wx-env.js
@@ -29,14 +29,22 @@ import { extend } from '../utils'
 export function initEnv (viewportInfo, envInfo) {
   const browserName = envInfo.browser ? envInfo.browser.name : navigator.appName
   const browserVersion = envInfo.browser ? envInfo.browser.version.val : null
+  let osName = envInfo.os.name
+  if (osName.match(/(iPhone|iPad|iPod)/i)) {
+    osName = 'iOS'
+  }
+  else if (osName.match(/Android/i)) {
+    osName = 'Android'
+  }
+  const osVersion = envInfo.os.version.val
   const env = {
     platform: 'Web',
     weexVersion: 'process.env.WEEX_VERSION',
     userAgent: navigator.userAgent,
     appName: browserName,
     appVersion: browserVersion,
-    osName: envInfo.browser ? envInfo.browser.name : null,
-    osVersion: envInfo.browser ? envInfo.browser.version.val : null,
+    osName,
+    osVersion,
     deviceModel: envInfo.os.name || null
   }
   /**

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 7afd37b..aa77d1f 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -37,7 +37,7 @@ import {
 
 // import { extractComponentStyle } from '../core'
 
-const scrollableTypes = ['scroller', 'list']
+import config from '../config'
 
 let lazyloadWatched = false
 function watchLazyload () {
@@ -141,7 +141,7 @@ export default {
 
     _getParentScroller () {
       let parent = this
-      while (parent && scrollableTypes.indexOf(parent.$options._componentTag) <= -1) {
+      while (parent && config.scrollableTypes.indexOf(parent.$options._componentTag) <= -1) {
         parent = parent.$options.parent
       }
       return parent

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/modules/dom.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/dom.js b/html5/render/vue/modules/dom.js
index 8280ab5..c9241a7 100644
--- a/html5/render/vue/modules/dom.js
+++ b/html5/render/vue/modules/dom.js
@@ -17,6 +17,7 @@
  * under the License.
  */
 import { camelToKebab, appendCss, isArray } from '../utils'
+import config from '../config'
 
 function getParentScroller (vnode) {
   if (!vnode) return null
@@ -25,7 +26,7 @@ function getParentScroller (vnode) {
     ? vnode.componentInstance || vnode.context : null
   if (!vm) return null
   const type = vm.$el && vm.$el.getAttribute('weex-type')
-  if (type === 'scroller' || type === 'list') {
+  if (config.scrollableTypes.indexOf(type) > -1) {
     return vm
   }
   return getParentScroller(vm.$parent)
@@ -116,11 +117,22 @@ export default {
       })[scrollDirection]
 
       const ctRect = ct.getBoundingClientRect()
-      const elRect = el.getBoundingClientRect()
+      let elRect = el.getBoundingClientRect()
+
+      /**
+       * if it's a waterfall, and you want to scroll to a header, then just
+       * scroll to the top.
+       */
+      if (scroller
+        && scroller.weexType === 'waterfall'
+        && scroller._headers
+        && scroller._headers.indexOf(vnode.$vnode || vnode) > -1) {
+        // it's in waterfall. just scroll to the top.
+        elRect = ct.firstElementChild.getBoundingClientRect()
+      }
 
       const dir = dSuffix.toLowerCase()
       let offset = (isWindow ? 0 : ct[`scroll${dSuffix}`]) + elRect[dir] - ctRect[dir]
-      // let offset = el[`offset${dSuffix}`]
 
       if (options) {
         offset += options.offset && options.offset * weex.config.env.scale || 0

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/styles/base.css
----------------------------------------------------------------------
diff --git a/html5/render/vue/styles/base.css b/html5/render/vue/styles/base.css
index 37728df..119a3af 100644
--- a/html5/render/vue/styles/base.css
+++ b/html5/render/vue/styles/base.css
@@ -65,27 +65,34 @@
 }
 
 body > .weex-list,
-body > .weex-scroller {
+body > .weex-scroller,
+body > .weex-waterfall {
   max-height: 100%;
 }
 
 .weex-list-wrapper,
-.weex-scroller-wrapper {
+.weex-scroller-wrapper,
+.weex-waterfall-wrapper {
   -webkit-overflow-scrolling: touch;
 }
 
-.weex-list-wrapper {
+.weex-list-wrapper,
+.weex-waterfall-wrapper {
   overflow-y: scroll !important;
+  overflow-x: hidden !important;
 }
 
 .weex-list-inner,
-.weex-scroller-inner {
+.weex-scroller-inner,
+.weex-waterfall-inner {
   -webkit-overflow-scrolling: touch;
-  width: 100%;
 }
 
-.weex-scroller-inner::-webkit-scrollbar {
-    width: 0;
+.weex-waterfall-inner-columns {
+  -webkit-flex-direction: row;
+      -ms-flex-direction: row;
+          flex-direction: row;
+  -webkit-box-orient: horizontal;
 }
 
 .weex-scroller-wrapper.weex-scroller-vertical {
@@ -113,6 +120,11 @@ body > .weex-scroller {
   top: 0;
 }
 
+.weex-fixed {
+  position: fixed;
+  z-index: 1;
+}
+
 .weex-sticky {
   position: fixed;
   top: 0;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index 94c6a63..f587b26 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -18,8 +18,7 @@
  */
 import { throttle, extend } from './func'
 import { createEvent } from './event'
-
-const scrollableTypes = ['scroller', 'list']
+import config from '../config'
 
 export function getParentScroller (vm) {
   if (!vm) return null
@@ -28,7 +27,7 @@ export function getParentScroller (vm) {
   }
   function _getParentScroller (parent) {
     if (!parent) { return }
-    if (scrollableTypes.indexOf(parent.weexType) > -1) {
+    if (config.scrollableTypes.indexOf(parent.weexType) > -1) {
       vm._parentScroller = parent
       return parent
     }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index b425321..4c375e2 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.6",
-    "vue-render": "0.11.48",
+    "vue-render": "0.11.50",
     "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/95eb56c4/packages/weex-vue-render/README.md
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/README.md b/packages/weex-vue-render/README.md
index e2f39d0..f0d3ba8 100644
--- a/packages/weex-vue-render/README.md
+++ b/packages/weex-vue-render/README.md
@@ -27,7 +27,24 @@ If you perfer cdn way, and use script tag to import a script link, just import i
 
 ## use vue-loader to bundle .vue file
 
-**NOTE: ** after `v0.11.3` there's no need to add `$processStyle` and `autoprefixer` in your vue-loader config anymore. The runtime render will take care of it once for all.
+NOTE: you should inject `$processStyle` to preprocess vnode's style in vue-loader's postTransformNode hook.
+
+```javascript
+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})`
+      }
+    }
+  ],
+}
+```
 
 ## component -> dom map
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/95eb56c4/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index bd5f5fd..e97525f 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.48",
+  "version": "0.11.50",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[03/20] incubator-weex git commit: * [html5] add globalEvent API.

Posted by so...@apache.org.
* [html5] add globalEvent API.


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

Branch: refs/heads/0.14-dev
Commit: cb398736a26b46c652fc66c1b9cee399ad8df4b9
Parents: 4b68aa1
Author: MrRaindrop <te...@gmail.com>
Authored: Tue Jun 6 14:47:05 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue Jun 6 14:47:05 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/globalEvent.js | 50 ++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cb398736/html5/render/vue/modules/globalEvent.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/globalEvent.js b/html5/render/vue/modules/globalEvent.js
new file mode 100644
index 0000000..66b7969
--- /dev/null
+++ b/html5/render/vue/modules/globalEvent.js
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+/**
+ * globalEvent API:
+ * @doc http://weex.apache.org/cn/references/modules/globalevent.html
+ */
+// track varies kinds of events and listeners.
+const handlerTraker = {}
+
+export default {
+  /**
+   * addEventListener
+   * @param {string} evt - the event name to add a listener on.
+   */
+  addEventListener (evt, callback) {
+    // const cb = e => this.sender.performCallback(callbackId, e)
+    const cb = e => callback && callback(e)
+    if (!handlerTraker[evt]) {
+      handlerTraker[evt] = [cb]
+    }
+    else {
+      handlerTraker.push(cb)
+    }
+    document.addEventListener(evt, cb)
+  },
+
+  /**
+   * removeEventListener
+   * @param {string} evt - the event name to remove a listener from.
+   */
+  removeEventListener (evt) {
+    handlerTraker[evt].forEach(cb => document.removeEventListener(evt, cb))
+  }
+}


[06/20] incubator-weex git commit: * [html5] register globalEvent api.

Posted by so...@apache.org.
* [html5] register globalEvent api.


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

Branch: refs/heads/0.14-dev
Commit: 8b39d074fed88f7bb149dad9a7f937f4cee1b928
Parents: 4744851
Author: MrRaindrop <te...@gmail.com>
Authored: Tue Jun 6 21:39:02 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue Jun 6 21:39:02 2017 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8b39d074/html5/render/vue/modules/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/index.js b/html5/render/vue/modules/index.js
index b937cc7..4237f9d 100644
--- a/html5/render/vue/modules/index.js
+++ b/html5/render/vue/modules/index.js
@@ -29,6 +29,7 @@ import clipboard from '../../browser/extend/api/clipboard'
 // custom modules
 import animation from './animation'
 import dom from './dom'
+import globalEvent from './globalEvent'
 import modal from './modal'
 import navigator from './navigator'
 import webview from './webview'
@@ -45,6 +46,7 @@ const legacyModules = {
 const modules = {
   animation,
   dom,
+  globalEvent,
   navigator,
   webview
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8b39d074/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 7fc76d5..d27c6c6 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.6",
-    "vue-render": "0.11.45",
+    "vue-render": "0.11.46",
     "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/8b39d074/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 391b90c..a4a9dfa 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.45",
+  "version": "0.11.46",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[13/20] incubator-weex git commit: * [html5] hide scrollbar.

Posted by so...@apache.org.
* [html5] hide scrollbar.


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

Branch: refs/heads/0.14-dev
Commit: 23c815ee435fcfdafea08d0f28b8aeb75467729a
Parents: d7a0a3a
Author: MrRaindrop <te...@gmail.com>
Authored: Fri Jun 9 11:26:51 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri Jun 9 11:26:51 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/styles/reset.css | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/23c815ee/html5/render/vue/styles/reset.css
----------------------------------------------------------------------
diff --git a/html5/render/vue/styles/reset.css b/html5/render/vue/styles/reset.css
index 563a2ef..6a33a37 100644
--- a/html5/render/vue/styles/reset.css
+++ b/html5/render/vue/styles/reset.css
@@ -58,3 +58,8 @@
 .weex-root textarea {
   resize: none;
 }
+
+/* show no scroll bar. */
+::-webkit-scrollbar {
+  display: none;
+}


[02/20] incubator-weex git commit: * [html5] fix scrollable.

Posted by so...@apache.org.
* [html5] fix scrollable.


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

Branch: refs/heads/0.14-dev
Commit: 4b68aa101853916cd2e8eb84556dec8bba619fcc
Parents: e1aac5a
Author: MrRaindrop <te...@gmail.com>
Authored: Tue Jun 6 11:43:09 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue Jun 6 11:43:09 2017 +0800

----------------------------------------------------------------------
 .../vue/components/scrollable/list/index.js     | 10 ---
 .../vue/components/scrollable/scroller.js       | 15 ----
 html5/render/vue/mixins/scrollable.js           | 84 ++++++++++++++++----
 3 files changed, 69 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4b68aa10/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 682d6ef..e781fe9 100644
--- a/html5/render/vue/components/scrollable/list/index.js
+++ b/html5/render/vue/components/scrollable/list/index.js
@@ -25,13 +25,6 @@ import listMixin from './listMixin'
 export default {
   name: 'list',
   mixins: [scrollable, listMixin],
-  props: {
-    loadmoreoffset: {
-      type: [String, Number],
-      default: 0
-    }
-  },
-
   computed: {
     wrapperClass () {
       const classArray = ['weex-list', 'weex-list-wrapper', 'weex-ct']
@@ -42,9 +35,6 @@ export default {
   },
 
   methods: {
-    resetLoadmore () {
-      this._availableToFireLoadmore = true
-    },
     createChildren (h) {
       const slots = this.$slots.default || []
       this._cells = slots.filter(vnode => {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4b68aa10/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 954af1b..3151fae 100644
--- a/html5/render/vue/components/scrollable/scroller.js
+++ b/html5/render/vue/components/scrollable/scroller.js
@@ -31,15 +31,6 @@ export default {
       validator (value) {
         return ['horizontal', 'vertical'].indexOf(value) !== -1
       }
-    },
-    loadmoreoffset: {
-      type: [String, Number],
-      default: 0
-    },
-    // TODO: support loadmore retry
-    loadmoreretry: {
-      type: [String, Number],
-      default: 0
     }
   },
 
@@ -69,12 +60,6 @@ export default {
           staticClass: 'weex-scroller-inner weex-ct'
         }, this._cells)
       ]
-    },
-    scrollTo (vnode) {
-      if (vnode && vnode.$el) {
-        // TODO: add animation
-        this.$el.scrollTop = vnode.$el.offsetTop
-      }
     }
   },
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4b68aa10/html5/render/vue/mixins/scrollable.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/scrollable.js b/html5/render/vue/mixins/scrollable.js
index 9eb1209..7adcf02 100644
--- a/html5/render/vue/mixins/scrollable.js
+++ b/html5/render/vue/mixins/scrollable.js
@@ -18,7 +18,11 @@
  */
 import { getThrottleLazyload, throttle } from '../utils'
 
+const DEFAULT_OFFSET_ACCURACY = 10
+const DEFAULT_LOADMORE_OFFSET = 0
+
 function getThrottledScroll (context) {
+  const scale = weex.config.env.scale
   if (!context._throttleScroll) {
     const wrapper = context.$refs.wrapper
     const inner = context.$refs.inner
@@ -30,7 +34,7 @@ function getThrottledScroll (context) {
       const offset = context.scrollDirection === 'horizontal'
         ? wrapper.scrollLeft
         : wrapper.scrollTop
-      const indent = parseInt(context.offsetAccuracy)
+      const indent = parseInt(context.offsetAccuracy) * scale
       function triggerScroll () {
         const rect = inner.getBoundingClientRect()
         evt.contentSize = { width: rect.width, height: rect.height }
@@ -52,16 +56,10 @@ function getThrottledScroll (context) {
         }
         context.$emit('scroll', evt)
       }
-      if (indent
-        && !isNaN(indent)
-        && indent > 0
-        && Math.abs(offset - preOffset) >= indent) {
+      if (Math.abs(offset - preOffset) >= indent) {
         triggerScroll()
         preOffset = offset
       }
-      else if (!indent || isNaN(indent) || indent <= 0) {
-        triggerScroll()
-      }
     }, 16, true)
   }
   return context._throttleScroll
@@ -69,8 +67,30 @@ function getThrottledScroll (context) {
 
 export default {
   props: {
-    offsetAccuracy: [Number, String]
+    loadmoreoffset: {
+      type: [String, Number],
+      default: DEFAULT_LOADMORE_OFFSET,
+      validator (value) {
+        const val = parseInt(value)
+        return !isNaN(val) && val >= DEFAULT_LOADMORE_OFFSET
+      }
+    },
+
+    offsetAccuracy: {
+      type: [Number, String],
+      default: DEFAULT_OFFSET_ACCURACY,
+      validator (value) {
+        const val = parseInt(value)
+        return !isNaN(val) && val >= DEFAULT_OFFSET_ACCURACY
+      }
+    }
+  },
+
+  created () {
+    // should call resetLoadmore() to enable loadmore event.
+    this._loadmoreReset = true
   },
+
   methods: {
     updateLayout () {
       const wrapper = this.$refs.wrapper
@@ -81,11 +101,37 @@ export default {
       }
     },
 
+    resetLoadmore () {
+      this._loadmoreReset = true
+    },
+
     handleScroll (event) {
       getThrottleLazyload(25, this.$el, 'scroll')()
       getThrottledScroll(this)(event)
-      if (this.reachBottom()) {
-        this.$emit('loadmore', event)
+
+      // fire loadmore event.
+      const inner = this.$refs.inner
+      if (inner) {
+        const innerRect = inner.getBoundingClientRect()
+        const innerLength = this.scrollDirection === 'horizontal'
+          ? innerRect.width
+          : innerRect.height
+        // hscroller not support loadmore event yet.
+        if (this.scrollDirection === 'horizontal') {
+          return
+        }
+        if (!this._innerLength) {
+          this._innerLength = innerLength
+        }
+        if (this._innerLength !== innerLength) {
+          console.log(this._innerLength, innerLength)
+          this._innerLength = innerLength
+          this._loadmoreReset = true
+        }
+        if (this._loadmoreReset && this.reachBottom()) {
+          this._loadmoreReset = false
+          this.$emit('loadmore', event)
+        }
       }
     },
 
@@ -97,12 +143,20 @@ export default {
     reachBottom () {
       const wrapper = this.$refs.wrapper
       const inner = this.$refs.inner
-      const offset = Number(this.loadmoreoffset) || 0
+      const offset = parseInt(this.loadmoreoffset) * weex.config.env.scale
 
       if (wrapper && inner) {
-        const innerHeight = inner.getBoundingClientRect().height
-        const wrapperHeight = wrapper.getBoundingClientRect().height
-        return wrapper.scrollTop >= innerHeight - wrapperHeight - offset
+        const innerRect = inner.getBoundingClientRect()
+        const wrapperRect = wrapper.getBoundingClientRect()
+        const key = this.scrollDirection === 'horizontal'
+          ? 'width'
+          : 'height'
+        const innerLength = innerRect[key]
+        const wrapperLength = wrapperRect[key]
+        const scrollOffset = this.scrollDirection === 'horizontal'
+          ? wrapper.scrollLeft
+          : wrapper.scrollTop
+        return scrollOffset >= innerLength - wrapperLength - offset
       }
       return false
     },


[12/20] incubator-weex git commit: * [html5] adjust lazyload detecting frequency.

Posted by so...@apache.org.
* [html5] adjust lazyload detecting frequency.


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

Branch: refs/heads/0.14-dev
Commit: d7a0a3a6f7594b5b1dbba9dabe3afabe0a7ac31b
Parents: 4513ef3
Author: MrRaindrop <te...@gmail.com>
Authored: Fri Jun 9 11:24:11 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri Jun 9 11:24:11 2017 +0800

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


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


[20/20] incubator-weex git commit: Merge branch '0.14-dev' of github.com:MrRaindrop/incubator-weex into 0.14-dev

Posted by so...@apache.org.
Merge branch '0.14-dev' of github.com:MrRaindrop/incubator-weex into 0.14-dev


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

Branch: refs/heads/0.14-dev
Commit: b006e16c764917d4f593f824f78501874f1a0438
Parents: 87b19c2 569d333
Author: sospartan <so...@apache.org>
Authored: Fri Jun 16 12:04:58 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Fri Jun 16 12:04:58 2017 +0800

----------------------------------------------------------------------
 examples/vue/components/waterfall.vue           | 165 +++++----
 html5/render/vue/components/index.js            |   3 +
 .../render/vue/components/scrollable/header.js  |   2 +-
 .../vue/components/scrollable/list/index.js     |  10 -
 .../vue/components/scrollable/scroller.js       |  15 -
 .../vue/components/scrollable/waterfall.js      | 338 +++++++++++++++++++
 html5/render/vue/components/slider/indicator.js |   8 +-
 .../render/vue/components/slider/slideMixin.js  |  15 +-
 html5/render/vue/config.js                      |  21 ++
 html5/render/vue/core/style.js                  | 103 ++++--
 html5/render/vue/env/wx-env.js                  |  12 +-
 html5/render/vue/index.js                       |   3 +-
 html5/render/vue/mixins/base.js                 |  15 +-
 html5/render/vue/mixins/index.js                |   4 +-
 html5/render/vue/mixins/scrollable.js           |  87 ++++-
 html5/render/vue/mixins/sticky.js               |  65 ++++
 html5/render/vue/modules/dom.js                 |  18 +-
 html5/render/vue/modules/globalEvent.js         |  69 ++++
 html5/render/vue/modules/index.js               |   2 +
 html5/render/vue/styles/base.css                |  30 +-
 html5/render/vue/styles/reset.css               |   5 +
 html5/render/vue/utils/component.js             | 187 +++++++---
 package.json                                    |   2 +-
 packages/weex-vue-render/README.md              |  19 +-
 packages/weex-vue-render/package.json           |   2 +-
 25 files changed, 959 insertions(+), 241 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b006e16c/package.json
----------------------------------------------------------------------


[07/20] incubator-weex git commit: * [html5] fix appear events.

Posted by so...@apache.org.
* [html5] fix appear events.


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

Branch: refs/heads/0.14-dev
Commit: d8125036f7dbe9f5ecf1c1060e4676f62c030cfb
Parents: 8b39d07
Author: MrRaindrop <te...@gmail.com>
Authored: Wed Jun 7 11:44:23 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed Jun 7 11:44:23 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/base.js     |   9 +-
 html5/render/vue/utils/component.js | 159 +++++++++++++++++++++----------
 2 files changed, 117 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d8125036/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index a1db14c..ad9fe15 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -19,6 +19,8 @@
 import {
   getThrottleLazyload,
   watchAppear,
+  triggerAppear,
+  triggerDisappear,
   extend
 } from '../utils'
 
@@ -98,7 +100,7 @@ export default {
     if (this.$el && (i = j = this.$vnode) && (i = i.data) && (j = j.componentOptions)) {
       this.$el.attrs = extend({}, i.attrs, j.propsData)
     }
-
+    triggerAppear(this)
     watchAppear(this)
   },
 
@@ -112,7 +114,10 @@ export default {
     if (process.env.NODE_ENV === 'development') {
       tagUpdated()
     }
-    watchAppear(this)
+  },
+
+  destroyed () {
+    triggerDisappear(this)
   },
 
   methods: {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d8125036/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index c810e8d..f724532 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -83,57 +83,118 @@ function triggerEvent (elm, handlers, isShow, dir) {
   }
 }
 
+/**
+ * get all event listeners. including v-on binding and ons in config.
+ */
+export function getEventHandlers (context) {
+  const parentListeners = context.$options && context.$options._parentListeners
+  const dataOn = context.$vnode && context.$vnode.data && context.$vnode.data.on
+  const on = extend({}, parentListeners, dataOn)
+  return on
+}
+
+/**
+ * Watch element's visibility to tell whether should trigger a appear/disappear
+ * event in scroll handler.
+ */
 export function watchAppear (context) {
-  if (!context || !context.$el) return null
-  const el = context.$el
-  context.$nextTick(() => {
-    if ((context.$options && context.$options._parentListeners)
-      || (context.$vnode && context.$vnode.data && context.$vnode.data.on)) {
-      const on = extend({}, context.$options._parentListeners, context.$vnode.data.on)
-      if (on.appear || on.disappear) {
-        const scroller = getParentScroller(context)
-        let isWindow = false
-        let container = window
-        if (scroller && scroller.$el) {
-          container = scroller.$el
-        }
-        else {
-          isWindow = true
-        }
-        const visible = isElementVisible(el, isWindow ? document.body : container)
-        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)
-          }
-        }
+  const el = context && context.$el
+  if (!el) { return }
+
+  const handlers = getEventHandlers(context)
+  if (!handlers.appear && !handlers.disappear) {
+    return
+  }
+
+  let isWindow = false
+  let container = window
+  const scroller = getParentScroller(context)
+  if (scroller && scroller.$el) {
+    container = scroller.$el
+  }
+  else {
+    isWindow = true
+  }
+
+  // add current vm to the container's appear watch list.
+  if (!container._watchAppearList) {
+    container._watchAppearList = []
+  }
+  container._watchAppearList.push(context)
+  if (container._scrollWatched) { return }
+
+  /**
+   * Code below will only exec once for binding scroll handler for parent container.
+   */
+  container._scrollWatched = true
+  const scrollHandler = throttle(event => {
+    /**
+     * detect scrolling direction.
+     * direction only support up & down yet.
+     * TODO: direction support left & right.
+     */
+    const scrollTop = isWindow ? window.pageYOffset : container.scrollTop
+    const preTop = container._lastScrollTop
+    container._lastScrollTop = scrollTop
+    const dir = scrollTop < preTop
+      ? 'down' : scrollTop > preTop
+      ? 'up' : null
+
+    const watchAppearList = container._watchAppearList || []
+    const len = watchAppearList.length
+    for (let i = 0; i < len; i++) {
+      const vm = watchAppearList[i]
+      const visible = isElementVisible(vm.$el, isWindow ? document.body : container)
+      detectAppear(vm, visible, dir)
+    }
+  }, 25, true)
+  container.addEventListener('scroll', scrollHandler, false)
+}
 
-        let lastScrollTop = container.scrollTop || window.pageYOffset
-        // no need to watch the same vComponent again.
-        if (!context._scrollWatched) {
-          context._scrollWatched = true
-          const handler = throttle(event => {
-            const visible = isElementVisible(el, isWindow ? document.body : container)
-            if (visible !== context._visible) {
-              context._visible = visible
-              const scrollTop = container.scrollTop || window.pageYOffset
-              const dir = scrollTop < lastScrollTop
-                ? 'down' : scrollTop > lastScrollTop
-                ? 'up' : null
-              triggerEvent(el, on, visible, dir)
-              lastScrollTop = scrollTop
-            }
-          }, 25, true)
+/**
+ * trigger a appear event.
+ */
+export function triggerAppear (context, visible) {
+  if (!context || !context.$el) { return }
+  if (!visible) {
+    let container = document.body
+    const scroller = getParentScroller(context)
+    if (scroller && scroller.$el) {
+      container = scroller.$el
+    }
+    const visible = isElementVisible(context.$el, container)
+  }
+  return detectAppear(context, visible)
+}
 
-          container.addEventListener('scroll', handler, false)
-        }
-      }
+/**
+ * trigger a disappear event.
+ */
+export function triggerDisappear (context) {
+  return detectAppear(context, false)
+}
+
+/**
+ * decide whether to trigger a appear/disappear event.
+ * @param {VueComponent} context
+ * @param {boolean} visible
+ * @param {string} dir
+ */
+export function detectAppear (context, visible, dir = null) {
+  const el = context && context.$el
+  if (!el) { return }
+  const handlers = getEventHandlers(context)
+  if (!handlers[visible ? 'appear' : 'disappear']) { return }
+  /**
+   * if the component hasn't appeared for once yet, then it shouldn't trigger
+   * a disappear event at all.
+   */
+  if (!visible && !context._appearedOnce) { return }
+  if (!context._visible === visible) {
+    if (!context._appearedOnce) {
+      context._appearedOnce = true
     }
-  })
+    context._visible = visible
+    triggerEvent(el, handlers, visible, dir)
+  }
 }


[05/20] incubator-weex git commit: * [html5] release v0.11.45

Posted by so...@apache.org.
* [html5] release v0.11.45


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

Branch: refs/heads/0.14-dev
Commit: 47448511d7b6b3877dd68eded31cb46bdc034703
Parents: afff3e4
Author: MrRaindrop <te...@gmail.com>
Authored: Tue Jun 6 21:22:46 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue Jun 6 21:22:46 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/47448511/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 0d543b7..7fc76d5 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.6",
-    "vue-render": "0.11.44",
+    "vue-render": "0.11.45",
     "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/47448511/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index cac8980..391b90c 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.44",
+  "version": "0.11.45",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",


[04/20] incubator-weex git commit: * [html5] update.

Posted by so...@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/afff3e4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/afff3e4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/afff3e4b

Branch: refs/heads/0.14-dev
Commit: afff3e4bc9c30030716fa0d1256ef06ba378ac91
Parents: cb39873
Author: MrRaindrop <te...@gmail.com>
Authored: Tue Jun 6 20:14:51 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue Jun 6 20:14:51 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/globalEvent.js | 35 +++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/afff3e4b/html5/render/vue/modules/globalEvent.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/globalEvent.js b/html5/render/vue/modules/globalEvent.js
index 66b7969..638f244 100644
--- a/html5/render/vue/modules/globalEvent.js
+++ b/html5/render/vue/modules/globalEvent.js
@@ -26,25 +26,44 @@ const handlerTraker = {}
 export default {
   /**
    * addEventListener
+   * NOTE: one callback can only be bound to the same event once. Bind a callback twice doesn't
+   *  mean it will be called twice when the event fired once.
    * @param {string} evt - the event name to add a listener on.
    */
   addEventListener (evt, callback) {
-    // const cb = e => this.sender.performCallback(callbackId, e)
-    const cb = e => callback && callback(e)
-    if (!handlerTraker[evt]) {
-      handlerTraker[evt] = [cb]
+    if (!callback) {
+      if (process.env.NODE_ENV === 'development') {
+        console.error(`[vue-render] missing callback arg in globalEvent.addEventListener.`)
+      }
+      return
     }
-    else {
-      handlerTraker.push(cb)
+    let handlers = handlerTraker[evt]
+    if (!handlers) {
+      handlers = handlerTraker[evt] = []
     }
-    document.addEventListener(evt, cb)
+    const len = handlers.length
+    for (let i = 0; i < len; i++) {
+      if (handlers[i] === callback) {
+        // this callback is already bound. no need to bind it again.
+        return
+      }
+    }
+    handlers.push(callback)
+    document.addEventListener(evt, callback)
   },
 
   /**
    * removeEventListener
+   * NOTE: remove all the event handlers for the specified event type.
    * @param {string} evt - the event name to remove a listener from.
    */
   removeEventListener (evt) {
-    handlerTraker[evt].forEach(cb => document.removeEventListener(evt, cb))
+    const handlers = handlerTraker[evt]
+    if (!handlers) {
+      // evt handlers has been already removed.
+      return
+    }
+    handlers.forEach(cb => document.removeEventListener(evt, cb))
+    delete handlerTraker[evt]
   }
 }