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/28 08:45:07 UTC
[01/30] incubator-weex git commit: + [html5] support
placeholder-color for input. @notdanger.
Repository: incubator-weex
Updated Branches:
refs/heads/dev 2510206f4 -> 44e959a41
+ [html5] support placeholder-color for input. @notdanger.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/06232f2b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/06232f2b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/06232f2b
Branch: refs/heads/dev
Commit: 06232f2bcdd59ffa50e7e24354b4b12e89569acd
Parents: 76ab14b
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Jun 22 12:05:12 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Jun 22 12:09:01 2017 +0800
----------------------------------------------------------------------
html5/render/vue/components/input.js | 52 ++++++++++++++++----
.../components/scrollable/loading-indicator.js | 11 +----
html5/render/vue/utils/style.js | 16 ++++++
3 files changed, 61 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/06232f2b/html5/render/vue/components/input.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/input.js b/html5/render/vue/components/input.js
index cc8059e..1454988 100644
--- a/html5/render/vue/components/input.js
+++ b/html5/render/vue/components/input.js
@@ -23,9 +23,13 @@
*/
import { extractComponentStyle, createEventMap } from '../core'
import { inputCommon } from '../mixins'
-import { extend, mapFormEvents } from '../utils'
+import { extend, mapFormEvents, appendCss } from '../utils'
// import { validateStyles } from '../validator'
+const ID_PREFIX_PLACEHOLDER_COLOR = 'wipt_plc_'
+const ID_PREFIX_INPUT = 'wipt_'
+let idCount = 0
+
const _css = `
.weex-input, .weex-textarea {
font-size: 0.426667rem;
@@ -35,6 +39,35 @@ const _css = `
}
`
+function setPlaceholderColor (inputVm, placeholderColor) {
+ if (!placeholderColor) {
+ return
+ }
+ const vendors = [
+ '::-webkit-input-placeholder',
+ ':-moz-placeholder',
+ '::-moz-placeholder',
+ ':-ms-input-placeholder',
+ ':placeholder-shown'
+ ]
+ const id = inputVm._id
+ appendCss(
+ vendors.map(function (vendor, idx) {
+ return `#${ID_PREFIX_INPUT}${id}${vendors[idx]}{color:${placeholderColor};}`
+ }).join(''),
+ `${ID_PREFIX_PLACEHOLDER_COLOR}${id}`,
+ true)
+}
+
+function processStyle (vm) {
+ const styles = extractComponentStyle(vm)
+ const phColor = styles.placeholderColor
+ if (phColor) {
+ setPlaceholderColor(vm, phColor)
+ }
+ return styles
+}
+
export default {
mixins: [inputCommon],
props: {
@@ -43,10 +76,11 @@ export default {
default: 'text',
validator (value) {
return [
- 'email', 'number', 'password', 'search', 'tel', 'text', 'url'
+ 'email', 'number', 'password', 'search', 'tel', 'text', 'url', 'date',
+ 'datetime', 'time'
// unsupported type:
- // button, checkbox, color, date, datetime, file, hidden, image,
- // month, radio, range, reset, submit, time, week,
+ // button, checkbox, color, file, hidden, image,
+ // month, radio, range, reset, submit, week,
].indexOf(value) !== -1
}
},
@@ -65,15 +99,15 @@ export default {
},
render (createElement) {
- /* istanbul ignore next */
- // if (process.env.NODE_ENV === 'development') {
- // validateStyles('input', this.$vnode.data && this.$vnode.data.staticStyle)
- // }
+ if (!this._id) {
+ this._id = idCount++
+ }
const events = extend(createEventMap(this), mapFormEvents(this))
this._renderHook()
return createElement('html:input', {
attrs: {
'weex-type': 'input',
+ id: `${ID_PREFIX_INPUT}${this._id}`,
type: this.type,
value: this.value,
disabled: (this.disabled !== 'false' && this.disabled !== false),
@@ -87,7 +121,7 @@ export default {
},
on: this.createKeyboardEvent(events),
staticClass: 'weex-input weex-el',
- staticStyle: extractComponentStyle(this)
+ staticStyle: processStyle(this)
})
},
_css
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/06232f2b/html5/render/vue/components/scrollable/loading-indicator.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/loading-indicator.js b/html5/render/vue/components/scrollable/loading-indicator.js
index 37129fd..59f141e 100644
--- a/html5/render/vue/components/scrollable/loading-indicator.js
+++ b/html5/render/vue/components/scrollable/loading-indicator.js
@@ -17,7 +17,7 @@
* under the License.
*/
import { extractComponentStyle } from '../../core'
-import { getRgb, loopArray } from '../../utils'
+import { getRgb, loopArray, getStyleSheetById } from '../../utils'
const _css = `
.weex-refresh-indicator,
@@ -112,14 +112,7 @@ function getStyleSheet (spinnerVm) {
if (spinnerVm._styleSheet) {
return
}
- const styleSheets = document.styleSheets
- const len = styleSheets.length
- for (let i = 0; i < len; i++) {
- if (styleSheets[i].ownerNode.id === 'weex-cmp-loading-indicator') {
- spinnerVm._styleSheet = styleSheets[i]
- break
- }
- }
+ spinnerVm._styleSheet = getStyleSheetById('weex-cmp-loading-indicator')
}
function setKeyframeColor (spinnerVm, val) {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/06232f2b/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index 5df3750..a9f7ef1 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -287,3 +287,19 @@ export function getRgb (color: string) {
}
}
}
+
+/**
+ * get style sheet with owner node's id
+ * @param {string} id owner node id.
+ */
+export function getStyleSheetById (id?: string) {
+ if (!id) { return }
+ const styleSheets = document.styleSheets
+ const len = styleSheets.length
+ for (let i = 0; i < len; i++) {
+ const styleSheet = styleSheets[i]
+ if (styleSheet.ownerNode.id === id) {
+ return styleSheet
+ }
+ }
+}
[29/30] incubator-weex git commit: Merge branch '0.14-dev' of
gitlab.alibaba-inc.com:weex/weex into 0.14-dev
Posted by so...@apache.org.
Merge branch '0.14-dev' of gitlab.alibaba-inc.com:weex/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/24fbad2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/24fbad2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/24fbad2f
Branch: refs/heads/dev
Commit: 24fbad2f0e0735427c1cb2bf87f68f2a50c094ad
Parents: 5d75a6f 25a6dbd
Author: sospartan <so...@apache.org>
Authored: Wed Jun 28 10:24:00 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Wed Jun 28 10:24:00 2017 +0800
----------------------------------------------------------------------
android/sdk/libs/armeabi/libweexjsc.so | Bin 7575352 -> 7570504 bytes
android/sdk/libs/x86/libweexjsc.so | Bin 12130116 -> 12121924 bytes
.../ui/component/list/BasicListComponent.java | 16 ++++++++++------
3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[05/30] incubator-weex git commit: Merge branch '0.14-dev' of
https://github.com/MrRaindrop/incubator-weex into 0.14-dev
Posted by so...@apache.org.
Merge branch '0.14-dev' of https://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/49ba77ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/49ba77ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/49ba77ff
Branch: refs/heads/dev
Commit: 49ba77ff11f29d7a1a704b52cf291e3f47b2ccf7
Parents: 7fc1190 06232f2
Author: tancy <ro...@gmail.com>
Authored: Thu Jun 22 15:16:58 2017 +0800
Committer: tancy <ro...@gmail.com>
Committed: Thu Jun 22 15:16:58 2017 +0800
----------------------------------------------------------------------
html5/render/vue/components/input.js | 52 ++++++++++++++++----
.../components/scrollable/loading-indicator.js | 11 +----
html5/render/vue/utils/style.js | 16 ++++++
3 files changed, 61 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
[10/30] incubator-weex git commit: + [html5] add unit test for
webSocket module
Posted by so...@apache.org.
+ [html5] add unit test for webSocket module
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/323b8367
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/323b8367
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/323b8367
Branch: refs/heads/dev
Commit: 323b836731f4d66a0b5836aa4ab82bc3cfa43b0a
Parents: dfc5d31
Author: erha19 <fa...@gmail.com>
Authored: Fri Jun 23 16:23:24 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Fri Jun 23 16:23:24 2017 +0800
----------------------------------------------------------------------
html5/test/render/vue/modules/websocket.js | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/323b8367/html5/test/render/vue/modules/websocket.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/modules/websocket.js b/html5/test/render/vue/modules/websocket.js
new file mode 100644
index 0000000..28b5958
--- /dev/null
+++ b/html5/test/render/vue/modules/websocket.js
@@ -0,0 +1,11 @@
+import websocket from '../../../../render/vue/modules/websocket/websocket';
+describe('webSocket module', function() {
+ afterEach(function(done) {
+ // Cleanup
+ websocket.close();
+ done();
+ });
+ it('should have connection lifecycle constants defined on the instance', () => {
+ expect(websocket.WebSocket('wss://echo.websocket.org').CONNECTING).to.be.equal(0);
+ });
+});
[24/30] incubator-weex git commit: [weex-vue-render] add some
features including:
Posted by so...@apache.org.
[weex-vue-render] add some features including:
+ [html5] add 'loadmore' event to horizontal scroller.
* [html5] fix slider's autoplay.
+ [html5] release v0.11.51 @notdanger.
* [html5] fix slider auto-play
+ [html5] support pseudo class.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/45677545
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/45677545
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/45677545
Branch: refs/heads/dev
Commit: 456775451532bba975612e0a8bab08067ced502c
Parents: 06232f2
Author: MrRaindrop <te...@gmail.com>
Authored: Fri Jun 23 14:52:50 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon Jun 26 18:00:16 2017 +0800
----------------------------------------------------------------------
html5/render/vue/README.md | 19 +++++++++-
.../render/vue/components/slider/slideMixin.js | 24 +++++++------
html5/render/vue/core/style.js | 31 ++++++++++++----
html5/render/vue/mixins/scrollable.js | 38 ++++++++++++--------
html5/render/vue/utils/style.js | 28 +++++++++++++++
package.json | 2 +-
packages/weex-vue-render/package.json | 2 +-
7 files changed, 108 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/45677545/html5/render/vue/README.md
----------------------------------------------------------------------
diff --git a/html5/render/vue/README.md b/html5/render/vue/README.md
index e2f39d0..f0d3ba8 100644
--- a/html5/render/vue/README.md
+++ b/html5/render/vue/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/45677545/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 da2c848..73960e5 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -48,7 +48,6 @@ export default {
},
updated () {
- this._startAutoPlay()
const children = this.$children
const len = children && children.length
if (children && len > 0) {
@@ -69,7 +68,6 @@ export default {
mounted () {
this._getWrapperSize()
- this._startAutoPlay()
this._slideTo(this.currentIndex)
fireLazyload(this.$el, true)
},
@@ -79,8 +77,8 @@ export default {
const wrapper = this.$refs.wrapper
if (wrapper) {
const rect = wrapper.getBoundingClientRect()
- this.wrapperWidth = rect.width
- this.wrapperHeight = rect.height
+ this._wrapperWidth = rect.width
+ this._wrapperHeight = rect.height
}
},
@@ -198,7 +196,7 @@ export default {
const match = translate && translate.match(/translate[^(]+\(([+-\d.]+)/)
const innerX = match && match[1] || 0
const dist = innerX - this.innerOffset
- this.innerOffset += step * this.wrapperWidth
+ this.innerOffset += step * this._wrapperWidth
// transform the whole slides group.
inner.style.webkitTransition = `-webkit-transform ${TRANSITION_TIME / 1000}s ease-in-out`
inner.style.transition = `transform ${TRANSITION_TIME / 1000}s ease-in-out`
@@ -341,7 +339,7 @@ export default {
}
node._inShow = true
- const translateX = index * this.wrapperWidth - this.innerOffset
+ const translateX = index * this._wrapperWidth - this.innerOffset
addTransform(node, {
translate: `translate3d(${translateX}px, 0px, 0px)`
})
@@ -439,7 +437,7 @@ export default {
origNode._inShow = true
const transObj = getTransformObj(clone)
transObj.translate = transObj.translate.replace(/[+-\d.]+[pw]x/, ($0) => {
- return pos * this.wrapperWidth - this.innerOffset + 'px'
+ return pos * this._wrapperWidth - this.innerOffset + 'px'
})
this._copyStyle(clone, origNode, styleProps, transObj)
this._removeClone(clone)
@@ -456,6 +454,10 @@ export default {
this.currentIndex = 0
return
}
+
+ // clear autoPlay timer (and restart after updated hook).
+ this._startAutoPlay()
+
/**
* clean nodes. replace current node with non-cloned node.
* set current index to the new index.
@@ -505,7 +507,7 @@ export default {
}
// calculate position offsets according to neighbor scales.
if (Math.abs(i) === 1) {
- const dist = ((this.wrapperWidth - this._neighborWidth * this.neighborScale) / 2
+ const dist = ((this._wrapperWidth - this._neighborWidth * this.neighborScale) / 2
+ this.neighborSpace * weex.config.env.scale) / this.neighborScale
translateX = -i * dist
}
@@ -582,7 +584,7 @@ export default {
this._clearNodesOffset()
}
this._emitScrollEvent('scroll', {
- offsetXRatio: offsetX / this.wrapperWidth
+ offsetXRatio: offsetX / this._wrapperWidth
})
inner.style.transform = `translate3d(${this.innerOffset + offsetX}px, 0, 0)`
inner.style.webkitTransform = `translate3d(${this.innerOffset + offsetX}px, 0, 0)`
@@ -602,7 +604,7 @@ export default {
if (inner) {
this._nodesOffsetCleared = false
// TODO: test the velocity if it's less than 0.2.
- const reset = Math.abs(offsetX / this.wrapperWidth) < 0.2
+ const reset = Math.abs(offsetX / this._wrapperWidth) < 0.2
const direction = offsetX > 0 ? 1 : -1
const newIndex = reset ? this.currentIndex : (this.currentIndex - direction)
this._slideTo(newIndex, true)
@@ -623,7 +625,7 @@ export default {
const throttleTime = THROTTLE_SCROLL_TIME
const cnt = parseInt(TRANSITION_TIME / throttleTime) - 1
const sign = offset > 0 ? 1 : -1
- const r = Math.abs(offset / this.wrapperWidth)
+ const r = Math.abs(offset / this._wrapperWidth)
const throttledScroll = () => {
if (++i > cnt) {
return callback && callback.call(this)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/45677545/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index 063c1e5..7230b74 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -26,11 +26,13 @@ import {
autoPrefix,
isArray,
getParentScroller,
- supportSticky
+ supportSticky,
+ appendCss
} from '../utils'
import { tagBegin, tagEnd } from '../utils/perf'
/* istanbul ignore next */
+let pseudoId = 0
/**
* get scoped class style map from stylesheets in <head>.
*/
@@ -55,6 +57,9 @@ export function getHeadStyleMap () {
*/
return pre
}
+ if (styleSheet.ownerNode.id.match(/weex-pseudo-\d+/)) {
+ return pre
+ }
const strArr = trimComment(styleSheet.ownerNode.textContent.trim()).split(/}/)
const len = strArr.length
const rules = []
@@ -65,7 +70,8 @@ export function getHeadStyleMap () {
}
/**
* should match these cases:
- * .a[data-v-xxx] { color: red }
+ * .a[data-v-xxx] { color: red; }
+ * .a[data-v-xxx]:active { color: green; }
* .a[data-v-xxx], .b[data-v-xxx] { color: red; }
*
* should not match these cases:
@@ -92,6 +98,10 @@ export function getHeadStyleMap () {
}
Array.from(rules).forEach(rule => {
const selector = rule.selectorText || ''
+ let isPseudo = false
+ if (selector.match(/:(?:active|focus|enabled|disabled)/)) {
+ isPseudo = true
+ }
const styleObj = trimComment(rule.cssText).split(';')
.reduce((styleObj, statement) => {
statement = statement.trim()
@@ -101,12 +111,19 @@ export function getHeadStyleMap () {
}
return styleObj
}, {})
- const res = pre[selector]
+ if (isPseudo) {
+ const txt = Object.keys(styleObj).reduce(function (pre, cur) {
+ return pre + `${cur}:${styleObj[cur]}!important;`
+ }, '')
+ appendCss(`${selector}{${txt}}`, `weex-pseudo-${pseudoId++}`)
+ }
+ const objMap = !isPseudo ? pre : pre.pseudo
+ const res = objMap[selector]
if (!res) {
- pre[selector] = styleObj
+ objMap[selector] = styleObj
}
else {
- extend(pre[selector], styleObj)
+ extend(objMap[selector], styleObj)
}
})
/**
@@ -116,7 +133,7 @@ export function getHeadStyleMap () {
*/
needToRemoveStyleSheetNodes.push(styleSheet.ownerNode)
return pre
- }, {})
+ }, { pseudo: {}})
if (!window._no_remove_style_sheets) {
needToRemoveStyleSheetNodes.forEach(function (node) {
node.parentNode.removeChild(node)
@@ -301,7 +318,7 @@ export function processSticky (context) {
return
}
// current only support list and vertical scroller.
- if (container.scrollDirection === 'horizontal') {
+ if (context.scrollDirection === 'horizontal') {
return
}
const stickyChildren = context._stickyChildren
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/45677545/html5/render/vue/mixins/scrollable.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/scrollable.js b/html5/render/vue/mixins/scrollable.js
index 011c8e0..4f7b03c 100644
--- a/html5/render/vue/mixins/scrollable.js
+++ b/html5/render/vue/mixins/scrollable.js
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { getThrottleLazyload, throttle } from '../utils'
+import { getThrottleLazyload, throttle, getRangeWidth } from '../utils'
import { processSticky } from '../core'
const DEFAULT_OFFSET_ACCURACY = 10
@@ -97,8 +97,20 @@ export default {
const wrapper = this.$refs.wrapper
if (wrapper) {
const rect = wrapper.getBoundingClientRect()
- this.wrapperWidth = rect.width
- this.wrapperHeight = rect.height
+ this._wrapperWidth = rect.width
+ this._wrapperHeight = rect.height
+ }
+ const inner = this.$refs.inner
+ const children = inner && inner.children
+ if (inner) {
+ const rect = inner.getBoundingClientRect()
+ this._innerWidth = rect.width
+ this._innerHeight = rect.height
+ }
+ // inner width is always the viewport width somehow in horizontal
+ // scoller, therefore the inner width should be reclaculated.
+ if (this.scrollDirection === 'horizontal' && children) {
+ this._innerWidth = getRangeWidth(inner)
}
},
@@ -115,19 +127,13 @@ export default {
// 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
- }
+ ? this._innerWidth
+ : this._innerHeight
if (!this._innerLength) {
this._innerLength = innerLength
}
if (this._innerLength !== innerLength) {
- console.log(this._innerLength, innerLength)
this._innerLength = innerLength
this._loadmoreReset = true
}
@@ -149,13 +155,15 @@ export default {
const offset = parseInt(this.loadmoreoffset) * weex.config.env.scale
if (wrapper && inner) {
- const innerRect = inner.getBoundingClientRect()
- const wrapperRect = wrapper.getBoundingClientRect()
+ // const innerRect = inner.getBoundingClientRect()
+ // const wrapperRect = wrapper.getBoundingClientRect()
const key = this.scrollDirection === 'horizontal'
? 'width'
: 'height'
- const innerLength = innerRect[key]
- const wrapperLength = wrapperRect[key]
+ // const innerLength = innerRect[key]
+ // const wrapperLength = wrapperRect[key]
+ const innerLength = this[`_inner${key[0].toUpperCase()}${key.substr(1)}`]
+ const wrapperLength = this[`_wrapper${key[0].toUpperCase()}${key.substr(1)}`]
const scrollOffset = this.scrollDirection === 'horizontal'
? wrapper.scrollLeft
: wrapper.scrollTop
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/45677545/html5/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/style.js b/html5/render/vue/utils/style.js
index a9f7ef1..0d74721 100644
--- a/html5/render/vue/utils/style.js
+++ b/html5/render/vue/utils/style.js
@@ -303,3 +303,31 @@ export function getStyleSheetById (id?: string) {
}
}
}
+
+function getChildrenTotalWidth (children) {
+ const len = children.length
+ let total = 0
+ for (let i = 0; i < len; i++) {
+ total += children[i].getBoundingClientRect().width
+ }
+ return total
+}
+/**
+ * get total content width of the element.
+ * @param {HTMLElement} elm
+ */
+export function getRangeWidth (elm: HTMLElement) {
+ const children = elm.children
+ if (!children) {
+ return elm.getBoundingClientRect().width
+ }
+ if (!Range) {
+ return getChildrenTotalWidth(children)
+ }
+ const range = document.createRange()
+ if (!range.selectNodeContents) {
+ return getChildrenTotalWidth(children)
+ }
+ range.selectNodeContents(elm)
+ return range.getBoundingClientRect().width
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/45677545/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 381190f..0a9e951 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"subversion": {
"browser": "0.5.0",
"framework": "0.20.6",
- "vue-render": "0.11.50",
+ "vue-render": "0.11.51",
"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/45677545/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index e97525f..80d6443 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.50",
+ "version": "0.11.51",
"description": "Weex built-in components for Vue 2.x.",
"license": "Apache-2.0",
"main": "dist/index.js",
[13/30] incubator-weex git commit: + [example] macaca modify
Posted by so...@apache.org.
+ [example] macaca modify
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/41cd8dcc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/41cd8dcc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/41cd8dcc
Branch: refs/heads/dev
Commit: 41cd8dcc53b89401fa15434a83474ed2c080d993
Parents: 49ba77f
Author: 齐山 <su...@163.com>
Authored: Sat Jun 24 18:21:03 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Sat Jun 24 18:21:03 2017 +0800
----------------------------------------------------------------------
test/scripts/util.js | 2 +-
test/serve.sh | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/41cd8dcc/test/scripts/util.js
----------------------------------------------------------------------
diff --git a/test/scripts/util.js b/test/scripts/util.js
index 50bf9ee..6e1b581 100644
--- a/test/scripts/util.js
+++ b/test/scripts/util.js
@@ -194,7 +194,7 @@ module.exports = {
return driver.status()
else{
driver._isInit = true;
- return driver.initDriver()
+ return driver.initDriver().sleep(20000)
}
},
quit:function(driver){
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/41cd8dcc/test/serve.sh
----------------------------------------------------------------------
diff --git a/test/serve.sh b/test/serve.sh
index a5485e2..eb2a156 100755
--- a/test/serve.sh
+++ b/test/serve.sh
@@ -1,5 +1,4 @@
#!/bin/bash -eu
npm run build:vue
npm run build:ci &
-port="${serport:-12581}"
-npm run serve:no-port -- -p $port
\ No newline at end of file
+npm run serve:no-port -- -p $serport
\ No newline at end of file
[26/30] incubator-weex git commit: Merge branch '0.14-dev' of
https://github.com/MrRaindrop/incubator-weex into 0.14-dev
Posted by so...@apache.org.
Merge branch '0.14-dev' of https://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/9e57917b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9e57917b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9e57917b
Branch: refs/heads/dev
Commit: 9e57917b91e079fdde54ac53f818d0168cebeeb9
Parents: cfe4659 4567754
Author: tancy <ro...@gmail.com>
Authored: Tue Jun 27 15:04:21 2017 +0800
Committer: tancy <ro...@gmail.com>
Committed: Tue Jun 27 15:04:21 2017 +0800
----------------------------------------------------------------------
html5/render/vue/README.md | 19 +++++++++-
.../render/vue/components/slider/slideMixin.js | 24 +++++++------
html5/render/vue/core/style.js | 31 ++++++++++++----
html5/render/vue/mixins/scrollable.js | 38 ++++++++++++--------
html5/render/vue/utils/style.js | 28 +++++++++++++++
package.json | 2 +-
packages/weex-vue-render/package.json | 2 +-
7 files changed, 108 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
[19/30] incubator-weex git commit: + [ios] macaca update server
Posted by so...@apache.org.
+ [ios] macaca update server
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/91e62945
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/91e62945
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/91e62945
Branch: refs/heads/dev
Commit: 91e6294517a110537018748f7e7910f6acde2b8a
Parents: 8ddc04b
Author: 齐山 <su...@163.com>
Authored: Sun Jun 25 14:25:31 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Sun Jun 25 14:25:31 2017 +0800
----------------------------------------------------------------------
test/serve.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/91e62945/test/serve.sh
----------------------------------------------------------------------
diff --git a/test/serve.sh b/test/serve.sh
index eb2a156..a5485e2 100755
--- a/test/serve.sh
+++ b/test/serve.sh
@@ -1,4 +1,5 @@
#!/bin/bash -eu
npm run build:vue
npm run build:ci &
-npm run serve:no-port -- -p $serport
\ No newline at end of file
+port="${serport:-12581}"
+npm run serve:no-port -- -p $port
\ No newline at end of file
[09/30] incubator-weex git commit: - [html5] remove some useless code
in websocket module
Posted by so...@apache.org.
- [html5] remove some useless code in websocket module
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/dfc5d31b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/dfc5d31b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/dfc5d31b
Branch: refs/heads/dev
Commit: dfc5d31b2efd44729dfe1ba3a6b22598c800f5ad
Parents: 5d31202
Author: erha19 <fa...@gmail.com>
Authored: Fri Jun 23 16:22:50 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Fri Jun 23 16:22:50 2017 +0800
----------------------------------------------------------------------
html5/render/vue/modules/websocket/websocket.js | 38 +++++++++-----------
1 file changed, 17 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/dfc5d31b/html5/render/vue/modules/websocket/websocket.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/websocket/websocket.js b/html5/render/vue/modules/websocket/websocket.js
index f52aa12..b430789 100644
--- a/html5/render/vue/modules/websocket/websocket.js
+++ b/html5/render/vue/modules/websocket/websocket.js
@@ -16,48 +16,44 @@
* specific language governing permissions and limitations
* under the License.
*/
-
/**
* websocket module
*/
-// let instance = null
-
-export default (function () {
- let instance = null
+export default (function() {
const registerListeners = ['onopen', 'onmessage', 'onerror', 'onclose']
const ws = {
- WebSocket: function (url, protocol) {
+ INSTANCE: null,
+ WebSocket: function(url, protocol) {
if (!url) {
return
}
if (!protocol) {
- instance = new WebSocket(url)
+ ws.INSTANCE = new WebSocket(url)
+ } else {
+ ws.INSTANCE = new WebSocket(url, protocol)
}
- else {
- instance = new WebSocket(url, protocol)
- }
- return instance
+ return ws.INSTANCE
},
- send: function (messages) {
- instance && instance.send(messages)
+ send: function(messages) {
+ ws.INSTANCE && ws.INSTANCE.send(messages)
},
- close: function () {
- instance && instance.close()
+ close: function() {
+ ws.INSTANCE && ws.INSTANCE.close()
}
}
for (const i in registerListeners) {
if (registerListeners.hasOwnProperty(i)) {
Object.defineProperty(ws, registerListeners[i], {
- get: function () {
- return instance && instance[registerListeners[i]]
+ get: function() {
+ return ws.INSTANCE && ws.INSTANCE[registerListeners[i]]
},
- set: function (fn) {
- if (instance) {
- instance[registerListeners[i]] = fn
+ set: function(fn) {
+ if (ws.INSTANCE) {
+ ws.INSTANCE[registerListeners[i]] = fn
}
}
})
}
}
return ws
-})()
+})()
\ No newline at end of file
[12/30] incubator-weex git commit: + [ios] add dealloc for sliderview
Posted by so...@apache.org.
+ [ios] add dealloc for sliderview
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/43adf401
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/43adf401
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/43adf401
Branch: refs/heads/dev
Commit: 43adf4012b235cd6b38727b25e790aa260106568
Parents: 49ba77f
Author: 齐山 <su...@163.com>
Authored: Fri Jun 23 17:57:10 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Fri Jun 23 17:57:10 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/43adf401/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
index 690c709..7c7fbd0 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
@@ -80,6 +80,13 @@ typedef NS_ENUM(NSInteger, Direction) {
return self;
}
+- (void)dealloc
+{
+ if (_scrollView) {
+ _scrollView.delegate = nil;
+ }
+}
+
- (void)layoutSubviews
{
[super layoutSubviews];
[11/30] incubator-weex git commit: * [html5] fix websocket module
dange code
Posted by so...@apache.org.
* [html5] fix websocket module dange code
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e6b55f7c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e6b55f7c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e6b55f7c
Branch: refs/heads/dev
Commit: e6b55f7c3bde474a75dfc9757b2e5f0b0b180d93
Parents: 323b836
Author: erha19 <fa...@gmail.com>
Authored: Fri Jun 23 17:34:44 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Fri Jun 23 17:34:44 2017 +0800
----------------------------------------------------------------------
html5/render/vue/modules/websocket/websocket.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e6b55f7c/html5/render/vue/modules/websocket/websocket.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/websocket/websocket.js b/html5/render/vue/modules/websocket/websocket.js
index b430789..743dc1d 100644
--- a/html5/render/vue/modules/websocket/websocket.js
+++ b/html5/render/vue/modules/websocket/websocket.js
@@ -19,35 +19,36 @@
/**
* websocket module
*/
-export default (function() {
+export default (function () {
const registerListeners = ['onopen', 'onmessage', 'onerror', 'onclose']
const ws = {
INSTANCE: null,
- WebSocket: function(url, protocol) {
+ WebSocket: function (url, protocol) {
if (!url) {
return
}
if (!protocol) {
ws.INSTANCE = new WebSocket(url)
- } else {
+ }
+ else {
ws.INSTANCE = new WebSocket(url, protocol)
}
return ws.INSTANCE
},
- send: function(messages) {
+ send: function (messages) {
ws.INSTANCE && ws.INSTANCE.send(messages)
},
- close: function() {
+ close: function () {
ws.INSTANCE && ws.INSTANCE.close()
}
}
for (const i in registerListeners) {
if (registerListeners.hasOwnProperty(i)) {
Object.defineProperty(ws, registerListeners[i], {
- get: function() {
+ get: function () {
return ws.INSTANCE && ws.INSTANCE[registerListeners[i]]
},
- set: function(fn) {
+ set: function (fn) {
if (ws.INSTANCE) {
ws.INSTANCE[registerListeners[i]] = fn
}
@@ -56,4 +57,4 @@ export default (function() {
}
}
return ws
-})()
\ No newline at end of file
+})()
[27/30] incubator-weex git commit: * [android] add observer for
component
Posted by so...@apache.org.
* [android] add observer for 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/a891e2d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/a891e2d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/a891e2d4
Branch: refs/heads/dev
Commit: a891e2d4696444e6cca23a051f611743a28b5e0b
Parents: d26c46f
Author: sospartan <so...@apache.org>
Authored: Wed Jun 14 17:04:28 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Wed Jun 28 10:18:15 2017 +0800
----------------------------------------------------------------------
.../java/com/taobao/weex/ComponentObserver.java | 50 ++++++++++++++++++++
.../java/com/taobao/weex/WXSDKInstance.java | 17 +++++++
.../taobao/weex/ui/component/WXComponent.java | 14 ++++++
3 files changed, 81 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a891e2d4/android/sdk/src/main/java/com/taobao/weex/ComponentObserver.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ComponentObserver.java b/android/sdk/src/main/java/com/taobao/weex/ComponentObserver.java
new file mode 100644
index 0000000..a2bcd09
--- /dev/null
+++ b/android/sdk/src/main/java/com/taobao/weex/ComponentObserver.java
@@ -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.
+ */
+package com.taobao.weex;
+
+import android.view.View;
+
+import com.taobao.weex.ui.component.WXComponent;
+
+/**
+ * Created by sospartan on 14/06/2017.
+ */
+
+public interface ComponentObserver {
+
+ /**
+ * Called after component is create.
+ * Notice: View is not created at this moment.
+ * @param component
+ */
+ void onCreate(WXComponent component);
+
+ /**
+ * Called before component destroy.
+ * @param component
+ */
+ void onPreDestory(WXComponent component);
+
+ /**
+ * Called when component's view is created
+ * @param component
+ * @param view
+ */
+ void onViewCreated(WXComponent component,View view);
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a891e2d4/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
index 2db6fb3..47b7f30 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
@@ -141,6 +141,8 @@ public class WXSDKInstance implements IWXActivityStateListener,DomContext, View.
private LayoutFinishListener mLayoutFinishListener;
+ private ComponentObserver mComponentObserver;
+
/**
* If anchor is created manually(etc. define a layout xml resource ),
@@ -275,6 +277,21 @@ public class WXSDKInstance implements IWXActivityStateListener,DomContext, View.
mUserTrackAdapter=WXSDKManager.getInstance().getIWXUserTrackAdapter();
}
+ /**
+ * Set a Observer for component.
+ * This observer will be called in each component, should not doing
+ * anything will impact render performance.
+ *
+ * @param observer
+ */
+ public void setComponentObserver(ComponentObserver observer){
+ mComponentObserver = observer;
+ }
+
+ public ComponentObserver getComponentObserver(){
+ return mComponentObserver;
+ }
+
public NativeInvokeHelper getNativeInvokeHelper() {
return mNativeInvokeHelper;
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a891e2d4/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
index c0d7c7a..54f822b 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
@@ -41,6 +41,7 @@ import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
+import com.taobao.weex.ComponentObserver;
import com.taobao.weex.IWXActivityStateListener;
import com.taobao.weex.WXEnvironment;
import com.taobao.weex.WXSDKInstance;
@@ -225,6 +226,10 @@ public abstract class WXComponent<T extends View> implements IWXObject, IWXActi
mGestureType = new HashSet<>();
++mComponentNum;
onCreate();
+ ComponentObserver observer;
+ if ((observer = getInstance().getComponentObserver()) != null) {
+ observer.onCreate(this);
+ }
}
protected void onCreate(){
@@ -902,6 +907,10 @@ public abstract class WXComponent<T extends View> implements IWXObject, IWXActi
}
if(mHost != null){
mHost.setId(WXViewUtils.generateViewId());
+ ComponentObserver observer;
+ if ((observer = getInstance().getComponentObserver()) != null) {
+ observer.onViewCreated(this, mHost);
+ }
}
onHostViewInitialized(mHost);
}else{
@@ -1273,6 +1282,11 @@ public abstract class WXComponent<T extends View> implements IWXObject, IWXActi
}
public void destroy() {
+ ComponentObserver observer;
+ if ((observer = getInstance().getComponentObserver()) != null) {
+ observer.onPreDestory(this);
+ }
+
if (WXEnvironment.isApkDebugable() && !WXUtils.isUiThread()) {
throw new WXRuntimeException("[WXComponent] destroy can only be called in main thread");
}
[06/30] incubator-weex git commit: Merge branch '0.14-dev' of
https://github.com/apache/incubator-weex into 0.14-dev
Posted by so...@apache.org.
Merge branch '0.14-dev' of https://github.com/apache/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/5c86cf3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5c86cf3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5c86cf3c
Branch: refs/heads/dev
Commit: 5c86cf3cbedc5988a7b50ae3d967bac03764d104
Parents: d0a5e4d 49ba77f
Author: erha19 <fa...@gmail.com>
Authored: Thu Jun 22 15:23:20 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Thu Jun 22 15:23:20 2017 +0800
----------------------------------------------------------------------
.../ui/component/AbstractEditComponent.java | 14 +-
.../com/taobao/weex/ui/component/Textarea.java | 6 +
.../taobao/weex/ui/component/WXComponent.java | 2 +-
.../com/taobao/weex/ui/view/WXEditText.java | 9 +-
html5/render/vue/components/index.js | 4 +-
html5/render/vue/components/input.js | 52 +++++--
.../components/scrollable/loading-indicator.js | 145 +++++++++++++++++--
.../render/vue/components/scrollable/loading.js | 4 +-
.../render/vue/components/scrollable/refresh.js | 4 +-
html5/render/vue/mixins/style.js | 11 +-
html5/render/vue/styles/base.css | 56 -------
html5/render/vue/utils/func.js | 30 ++++
html5/render/vue/utils/style.js | 49 +++++++
13 files changed, 292 insertions(+), 94 deletions(-)
----------------------------------------------------------------------
[20/30] incubator-weex git commit: + [ios] update text method
Posted by so...@apache.org.
+ [ios] update text method
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f405ffa9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f405ffa9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f405ffa9
Branch: refs/heads/dev
Commit: f405ffa98d3a15c748783fe5dd7e395c00cab0ff
Parents: 91e6294
Author: 齐山 <su...@163.com>
Authored: Sun Jun 25 14:32:15 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Sun Jun 25 14:32:15 2017 +0800
----------------------------------------------------------------------
test/scripts/components/textarea-maxlength.test.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f405ffa9/test/scripts/components/textarea-maxlength.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/textarea-maxlength.test.js b/test/scripts/components/textarea-maxlength.test.js
index 01c873f..c3c583d 100644
--- a/test/scripts/components/textarea-maxlength.test.js
+++ b/test/scripts/components/textarea-maxlength.test.js
@@ -48,7 +48,7 @@ describe('@ignore-android textarea maxlength vue test2 ', function () {
.elementById('status')
.text()
.then((text)=>{
- console.log(text())
+ console.log(text)
assert.equal(text,'1234')
})
})
[04/30] incubator-weex git commit: + [html5] add example for webSocket
Posted by so...@apache.org.
+ [html5] add example for webSocket
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d0a5e4d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d0a5e4d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d0a5e4d1
Branch: refs/heads/dev
Commit: d0a5e4d1f8195623e021b25dd8f19163b6320c2f
Parents: 9df3655
Author: erha19 <75...@qq.com>
Authored: Thu Jun 22 14:52:21 2017 +0800
Committer: erha19 <75...@qq.com>
Committed: Thu Jun 22 14:52:21 2017 +0800
----------------------------------------------------------------------
examples/vue/index.vue | 1 +
examples/vue/modules/websocket.vue | 116 ++++++++++++++++++++++++++++++++
2 files changed, 117 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d0a5e4d1/examples/vue/index.vue
----------------------------------------------------------------------
diff --git a/examples/vue/index.vue b/examples/vue/index.vue
index 69d867d..ebea3ad 100644
--- a/examples/vue/index.vue
+++ b/examples/vue/index.vue
@@ -34,6 +34,7 @@
// module
{name: root + '/modules/instance-api', title: 'Instance API'},
{name: root + '/modules/modal', title: 'Modal'},
+ {name: root + '/modules/webSocket', title: 'WebSocket'},
{name: root + '/modules/stream', title: 'Stream'},
{name: root + '/modules/storage',title:'Storage'},
// {name: 'module/clipboard', title: 'Clipboard'}, // 0.8 , developing
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d0a5e4d1/examples/vue/modules/websocket.vue
----------------------------------------------------------------------
diff --git a/examples/vue/modules/websocket.vue b/examples/vue/modules/websocket.vue
new file mode 100644
index 0000000..72d7ea1
--- /dev/null
+++ b/examples/vue/modules/websocket.vue
@@ -0,0 +1,116 @@
+<template>
+ <scroller>
+ <div>
+ <div style="background-color: #286090">
+ <text class="title" style="height: 80px ;padding: 20px;color: white">websocket</text>
+ </div>
+ <input type="text" placeholder="please input message to send" class="input" autofocus="false" value="" @input="oninput" ref="input" />
+ <div style="flex-direction: row; justify-content: center;">
+ <text class="button" @click="connect">connect</text>
+ <text class="button" @click="send">send</text>
+ <text class="button" @click="close">close</text>
+ </div>
+ <div style="background-color: lightgray">
+ <text class="title" style="height: 80px ;padding: 20px;color: black">method = close</text>
+ </div>
+ <text style="color: black;height: 80px">{{closeinfo}}</text>
+ <div style="background-color: lightgray">
+ <text class="title" style="height: 80px ;padding: 20px;color: black">method = send</text>
+ </div>
+ <text style="color: black;height: 80px">{{sendinfo}}</text>
+ <div style="background-color: lightgray">
+ <text class="title" style="height: 80px ;padding: 20px;color: black">method = onopen</text>
+ </div>
+ <text style="color: black;height: 80px">{{onopeninfo}}</text>
+ <div style="background-color: lightgray">
+ <text class="title" style="height: 80px ;padding: 20px;color: black">method = onmessage</text>
+ </div>
+ <text style="color: black;height: 400px">{{onmessage}}</text>
+ <div style="background-color: lightgray">
+ <text class="title" style="height: 80px ;padding: 20px;color: black">method = onclose</text>
+ </div>
+ <text style="color: black;height: 80px">{{oncloseinfo}}</text>
+ <div style="background-color: lightgray">
+ <text class="title" style="height: 80px ;padding: 20px;color: black">method = onerror</text>
+ </div>
+ <text style="color: black;height: 80px">{{onerrorinfo}}</text>
+ </div>
+ </scroller>
+</template>
+
+<style scoped>
+ .input {
+ font-size: 40px;
+ height: 80px;
+ width: 600px;
+ }
+
+ .button {
+ font-size: 36px;
+ width: 150px;
+ color: #41B883;
+ text-align: center;
+ padding-top: 25px;
+ padding-bottom: 25px;
+ border-width: 2px;
+ border-style: solid;
+ margin-right: 20px;
+ border-color: rgb(162, 217, 192);
+ background-color: rgba(162, 217, 192, 0.2);
+ }
+</style>
+
+<script>
+ var websocket = weex.requireModule('webSocket')
+ export default {
+ data() {
+ return {
+ connectinfo: '',
+ sendinfo: '',
+ onopeninfo: '',
+ onmessage: '',
+ oncloseinfo: '',
+ onerrorinfo: '',
+ closeinfo: '',
+ txtInput: '',
+ navBarHeight: 88,
+ title: 'Navigator',
+ dir: 'examples',
+ baseURL: ''
+ }
+ },
+ methods: {
+ connect: function() {
+ websocket.WebSocket('ws://echo.websocket.org', '');
+ var self = this;
+ self.onopeninfo = 'connecting...'
+ websocket.onopen = function(e) {
+ self.onopeninfo = 'websocket open';
+ }
+ websocket.onmessage = function(e) {
+ self.onmessage = e.data;
+ }
+ websocket.onerror = function(e) {
+ self.onerrorinfo = e.data;
+ }
+ websocket.onclose = function(e) {
+ self.onopeninfo = '';
+ self.oncloseinfo = e.code;
+ }
+ },
+ send: function(e) {
+ var input = this.$refs.input;
+ input.blur();
+ websocket.send(this.txtInput);
+ this.sendinfo = this.txtInput;
+ },
+ oninput: function(event) {
+ this.txtInput = event.value;
+ },
+ close: function(e) {
+ this.closeinfo = 'close connect';
+ websocket.close();
+ },
+ },
+ }
+</script>
\ No newline at end of file
[16/30] incubator-weex git commit: + [example] fix bug toast refect
input
Posted by so...@apache.org.
+ [example] fix bug toast refect input
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1a0813a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1a0813a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1a0813a6
Branch: refs/heads/dev
Commit: 1a0813a653259c1b48e4ec83df6ebf655b8b917d
Parents: f60456c
Author: 齐山 <su...@163.com>
Authored: Sat Jun 24 20:15:52 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Sat Jun 24 20:15:52 2017 +0800
----------------------------------------------------------------------
test/pages/components/textarea-maxlength.vue | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1a0813a6/test/pages/components/textarea-maxlength.vue
----------------------------------------------------------------------
diff --git a/test/pages/components/textarea-maxlength.vue b/test/pages/components/textarea-maxlength.vue
index 503a59f..6c40601 100644
--- a/test/pages/components/textarea-maxlength.vue
+++ b/test/pages/components/textarea-maxlength.vue
@@ -16,17 +16,17 @@
oninput (event) {
this.value = event.value
console.log('oninput:', event.value)
- modal.toast({
- message: `oninput: ${event.value}`,
- duration: 0.8
- })
+// modal.toast({
+// message: `oninput: ${event.value}`,
+// duration: 0.8
+// })
},
onchange (event) {
console.log('onchange:', event.value)
- modal.toast({
- message: `onchange: ${event.value}`,
- duration: 0.8
- })
+// modal.toast({
+// message: `onchange: ${event.value}`,
+// duration: 0.8
+// })
},
}
}
[25/30] incubator-weex git commit: Merge branch '0.14-dev' of
https://git-wip-us.apache.org/repos/asf/incubator-weex into
ios-bugfix-mamaca-0.14-dev-0624
Posted by so...@apache.org.
Merge branch '0.14-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into ios-bugfix-mamaca-0.14-dev-0624
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cfe4659a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cfe4659a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cfe4659a
Branch: refs/heads/dev
Commit: cfe4659af6fe7fe7c64903329b80ebf1bda504b3
Parents: 24474e2 cbc2e2d
Author: 齐山 <su...@163.com>
Authored: Tue Jun 27 14:01:05 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Tue Jun 27 14:01:05 2017 +0800
----------------------------------------------------------------------
examples/vue/index.vue | 1 +
examples/vue/modules/websocket.vue | 116 +++++++++++++++++++
html5/render/vue/env/weex.js | 3 +
html5/render/vue/modules/index.js | 2 +
html5/render/vue/modules/websocket/index.js | 26 +++++
html5/render/vue/modules/websocket/websocket.js | 60 ++++++++++
html5/test/render/vue/modules/websocket.js | 11 ++
.../Sources/Component/WXCycleSliderComponent.m | 7 ++
8 files changed, 226 insertions(+)
----------------------------------------------------------------------
[08/30] incubator-weex git commit: * [andriod] catch
ConcurrentModificationException
Posted by so...@apache.org.
* [andriod] catch ConcurrentModificationException
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/25a6dbd1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/25a6dbd1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/25a6dbd1
Branch: refs/heads/dev
Commit: 25a6dbd17822b5f2cd97ff8bf67cca0b455a06c5
Parents: 9f087ec
Author: zshshr <zh...@gmail.com>
Authored: Thu Jun 22 22:53:39 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Thu Jun 22 22:53:39 2017 +0800
----------------------------------------------------------------------
.../weex/ui/component/list/BasicListComponent.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/25a6dbd1/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index 4f897f3..306be55 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@ -330,16 +330,20 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
super.onScrolled(recyclerView, dx, dy);
List<OnWXScrollListener> listeners = getInstance().getWXScrollListeners();
if (listeners != null && listeners.size() > 0) {
- for (OnWXScrollListener listener : listeners) {
- if (listener != null) {
- if(listener instanceof ICheckBindingScroller){
- if(((ICheckBindingScroller) listener).isNeedScroller(getRef(),null)){
+ try {
+ for (OnWXScrollListener listener : listeners) {
+ if (listener != null) {
+ if (listener instanceof ICheckBindingScroller) {
+ if (((ICheckBindingScroller) listener).isNeedScroller(getRef(), null)) {
+ listener.onScrolled(recyclerView, dx, dy);
+ }
+ } else {
listener.onScrolled(recyclerView, dx, dy);
}
- }else {
- listener.onScrolled(recyclerView, dx, dy);
}
}
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
}
[14/30] incubator-weex git commit: + [example] update maraca
Posted by so...@apache.org.
+ [example] update maraca
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f4b0b46f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f4b0b46f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f4b0b46f
Branch: refs/heads/dev
Commit: f4b0b46fa8ef470f8d02044c4049a91fb5ccdc03
Parents: 41cd8dc
Author: 齐山 <su...@163.com>
Authored: Sat Jun 24 18:59:43 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Sat Jun 24 18:59:43 2017 +0800
----------------------------------------------------------------------
test/scripts/util.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4b0b46f/test/scripts/util.js
----------------------------------------------------------------------
diff --git a/test/scripts/util.js b/test/scripts/util.js
index 6e1b581..74d966e 100644
--- a/test/scripts/util.js
+++ b/test/scripts/util.js
@@ -125,7 +125,7 @@ module.exports = {
return ( isRunInCI ? 60 : 10 ) * 60 * 1000;
},
getGETActionWaitTimeMills:function(){
- return (isRunInCI ? 120 : 5 ) * 1000;
+ return (isRunInCI ? 5 : 1 ) * 1000;
},
diffImage,
createDriver:function(wd){
[15/30] incubator-weex git commit: + [example] revert to before
Posted by so...@apache.org.
+ [example] revert to before
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f60456cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f60456cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f60456cb
Branch: refs/heads/dev
Commit: f60456cbce41d2c00a98d6b7ea0f7fd6a01e78a5
Parents: f4b0b46
Author: 齐山 <su...@163.com>
Authored: Sat Jun 24 19:05:45 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Sat Jun 24 19:05:45 2017 +0800
----------------------------------------------------------------------
test/scripts/util.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f60456cb/test/scripts/util.js
----------------------------------------------------------------------
diff --git a/test/scripts/util.js b/test/scripts/util.js
index 74d966e..6e1b581 100644
--- a/test/scripts/util.js
+++ b/test/scripts/util.js
@@ -125,7 +125,7 @@ module.exports = {
return ( isRunInCI ? 60 : 10 ) * 60 * 1000;
},
getGETActionWaitTimeMills:function(){
- return (isRunInCI ? 5 : 1 ) * 1000;
+ return (isRunInCI ? 120 : 5 ) * 1000;
},
diffImage,
createDriver:function(wd){
[17/30] incubator-weex git commit: + [example] update logic
Posted by so...@apache.org.
+ [example] update logic
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8ddc04bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8ddc04bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8ddc04bc
Branch: refs/heads/dev
Commit: 8ddc04bc3860b6c33eec27ce447e071439aea0b1
Parents: 1a0813a
Author: 齐山 <su...@163.com>
Authored: Sat Jun 24 20:43:08 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Sat Jun 24 20:43:08 2017 +0800
----------------------------------------------------------------------
test/scripts/components/textarea-maxlength.test.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8ddc04bc/test/scripts/components/textarea-maxlength.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/textarea-maxlength.test.js b/test/scripts/components/textarea-maxlength.test.js
index 7473d3d..01c873f 100644
--- a/test/scripts/components/textarea-maxlength.test.js
+++ b/test/scripts/components/textarea-maxlength.test.js
@@ -43,11 +43,13 @@ describe('@ignore-android textarea maxlength vue test2 ', function () {
return driver
.elementById('textarea')
.sendKeys('12345678')
- .sleep(2000)
+ .sleep(3000)
+ .source()
.elementById('status')
.text()
.then((text)=>{
- assert.equal(text,'1234')
+ console.log(text())
+ assert.equal(text,'1234')
})
})
[02/30] incubator-weex git commit: * [android] revert dom interface
for fix crash
Posted by so...@apache.org.
* [android] revert dom interface for fix crash
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9f087ec3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9f087ec3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9f087ec3
Branch: refs/heads/dev
Commit: 9f087ec3aea4a431eaa53b8f4de8e2e604ad066c
Parents: 7b26ee5
Author: zshshr <zh...@gmail.com>
Authored: Thu Jun 22 14:08:39 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Thu Jun 22 14:08:39 2017 +0800
----------------------------------------------------------------------
android/sdk/libs/armeabi/libweexjsc.so | Bin 7575352 -> 7570504 bytes
android/sdk/libs/x86/libweexjsc.so | Bin 12130116 -> 12121924 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9f087ec3/android/sdk/libs/armeabi/libweexjsc.so
----------------------------------------------------------------------
diff --git a/android/sdk/libs/armeabi/libweexjsc.so b/android/sdk/libs/armeabi/libweexjsc.so
index a180660..41b1ee8 100755
Binary files a/android/sdk/libs/armeabi/libweexjsc.so and b/android/sdk/libs/armeabi/libweexjsc.so differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9f087ec3/android/sdk/libs/x86/libweexjsc.so
----------------------------------------------------------------------
diff --git a/android/sdk/libs/x86/libweexjsc.so b/android/sdk/libs/x86/libweexjsc.so
index 9626c3c..c45672a 100755
Binary files a/android/sdk/libs/x86/libweexjsc.so and b/android/sdk/libs/x86/libweexjsc.so differ
[07/30] incubator-weex git commit: - [html5] remove hasOwnproperty
key on ws
Posted by so...@apache.org.
- [html5] remove hasOwnproperty key on ws
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5d312028
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5d312028
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5d312028
Branch: refs/heads/dev
Commit: 5d3120288ed5bbca344401fae6d32d4a1eefa3bd
Parents: 5c86cf3
Author: erha19 <fa...@gmail.com>
Authored: Thu Jun 22 17:15:48 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Thu Jun 22 17:15:48 2017 +0800
----------------------------------------------------------------------
html5/render/vue/modules/websocket/websocket.js | 3 ---
1 file changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5d312028/html5/render/vue/modules/websocket/websocket.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/websocket/websocket.js b/html5/render/vue/modules/websocket/websocket.js
index c5cfa26..f52aa12 100644
--- a/html5/render/vue/modules/websocket/websocket.js
+++ b/html5/render/vue/modules/websocket/websocket.js
@@ -26,9 +26,6 @@ export default (function () {
let instance = null
const registerListeners = ['onopen', 'onmessage', 'onerror', 'onclose']
const ws = {
- hasOwnProperty: function (e) {
- return true
- },
WebSocket: function (url, protocol) {
if (!url) {
return
[18/30] incubator-weex git commit: * [html5] fix lint error in
webSocket test code
Posted by so...@apache.org.
* [html5] fix lint error in webSocket test code
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/96cf5de6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/96cf5de6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/96cf5de6
Branch: refs/heads/dev
Commit: 96cf5de6399ed8ad741e5d8eeac06feee0c3430e
Parents: e6b55f7
Author: erha19 <fa...@gmail.com>
Authored: Sat Jun 24 21:20:19 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Sat Jun 24 21:20:19 2017 +0800
----------------------------------------------------------------------
html5/test/render/vue/modules/websocket.js | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/96cf5de6/html5/test/render/vue/modules/websocket.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/modules/websocket.js b/html5/test/render/vue/modules/websocket.js
index 28b5958..f3534ef 100644
--- a/html5/test/render/vue/modules/websocket.js
+++ b/html5/test/render/vue/modules/websocket.js
@@ -1,11 +1,11 @@
-import websocket from '../../../../render/vue/modules/websocket/websocket';
-describe('webSocket module', function() {
- afterEach(function(done) {
+import websocket from '../../../../render/vue/modules/websocket/websocket'
+describe('webSocket module', function () {
+ afterEach(function (done) {
// Cleanup
- websocket.close();
- done();
- });
+ websocket.close()
+ done()
+ })
it('should have connection lifecycle constants defined on the instance', () => {
- expect(websocket.WebSocket('wss://echo.websocket.org').CONNECTING).to.be.equal(0);
- });
-});
+ expect(websocket.WebSocket('wss://echo.websocket.org').CONNECTING).to.be.equal(0)
+ })
+})
[30/30] incubator-weex git commit: Merge branch '0.14-dev' into dev
Posted by so...@apache.org.
Merge branch '0.14-dev' into 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/44e959a4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/44e959a4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/44e959a4
Branch: refs/heads/dev
Commit: 44e959a418737511c3215fcabb5a121cecc3f7f1
Parents: 2510206 24fbad2
Author: sospartan <so...@apache.org>
Authored: Wed Jun 28 16:44:48 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Wed Jun 28 16:44:48 2017 +0800
----------------------------------------------------------------------
android/sdk/libs/armeabi/libweexjsc.so | Bin 7575352 -> 7570504 bytes
android/sdk/libs/x86/libweexjsc.so | Bin 12130116 -> 12121924 bytes
.../java/com/taobao/weex/ComponentObserver.java | 50 ++++++++
.../java/com/taobao/weex/WXSDKInstance.java | 16 +++
.../taobao/weex/ui/component/WXComponent.java | 14 +++
.../ui/component/list/BasicListComponent.java | 16 ++-
examples/vue/index.vue | 1 +
examples/vue/modules/websocket.vue | 116 +++++++++++++++++++
html5/render/vue/README.md | 19 ++-
html5/render/vue/components/input.js | 52 +++++++--
.../components/scrollable/loading-indicator.js | 11 +-
.../render/vue/components/slider/slideMixin.js | 24 ++--
html5/render/vue/core/style.js | 31 +++--
html5/render/vue/env/weex.js | 3 +
html5/render/vue/mixins/scrollable.js | 38 +++---
html5/render/vue/modules/index.js | 2 +
html5/render/vue/modules/websocket/index.js | 26 +++++
html5/render/vue/modules/websocket/websocket.js | 60 ++++++++++
html5/render/vue/utils/style.js | 44 +++++++
html5/test/render/vue/modules/websocket.js | 11 ++
.../Sources/Component/WXCycleSliderComponent.m | 7 ++
package.json | 2 +-
packages/weex-vue-render/package.json | 2 +-
test/pages/components/textarea-maxlength.vue | 10 +-
.../components/textarea-maxlength.test.js | 6 +-
test/scripts/util.js | 2 +-
26 files changed, 491 insertions(+), 72 deletions(-)
----------------------------------------------------------------------
[21/30] incubator-weex git commit: +[ios] delete mark
Posted by so...@apache.org.
+[ios] delete mark
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7ade9691
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7ade9691
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7ade9691
Branch: refs/heads/dev
Commit: 7ade9691bbf15e465d8680756a3fde524cb76302
Parents: f405ffa
Author: 齐山 <su...@163.com>
Authored: Mon Jun 26 15:42:34 2017 +0800
Committer: GitHub <no...@github.com>
Committed: Mon Jun 26 15:42:34 2017 +0800
----------------------------------------------------------------------
test/pages/components/textarea-maxlength.vue | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7ade9691/test/pages/components/textarea-maxlength.vue
----------------------------------------------------------------------
diff --git a/test/pages/components/textarea-maxlength.vue b/test/pages/components/textarea-maxlength.vue
index 6c40601..a1a9ddc 100644
--- a/test/pages/components/textarea-maxlength.vue
+++ b/test/pages/components/textarea-maxlength.vue
@@ -16,17 +16,9 @@
oninput (event) {
this.value = event.value
console.log('oninput:', event.value)
-// modal.toast({
-// message: `oninput: ${event.value}`,
-// duration: 0.8
-// })
},
onchange (event) {
console.log('onchange:', event.value)
-// modal.toast({
-// message: `onchange: ${event.value}`,
-// duration: 0.8
-// })
},
}
}
@@ -47,4 +39,4 @@
border-color: #41B883;
maxlength:10;
}
-</style>
\ No newline at end of file
+</style>
[28/30] incubator-weex git commit: Merge branch
'0.14-dev-component-observer' into 0.14-dev
Posted by so...@apache.org.
Merge branch '0.14-dev-component-observer' 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/5d75a6f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5d75a6f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5d75a6f2
Branch: refs/heads/dev
Commit: 5d75a6f237552b227934e18b0da23d51a7b688c6
Parents: 9e57917 a891e2d
Author: sospartan <so...@apache.org>
Authored: Wed Jun 28 10:23:38 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Wed Jun 28 10:23:38 2017 +0800
----------------------------------------------------------------------
.../java/com/taobao/weex/ComponentObserver.java | 50 ++++++++++++++++++++
.../java/com/taobao/weex/WXSDKInstance.java | 16 +++++++
.../taobao/weex/ui/component/WXComponent.java | 14 ++++++
3 files changed, 80 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5d75a6f2/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
----------------------------------------------------------------------
diff --cc android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
index 5533843,47b7f30..a8d8a60
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
@@@ -141,8 -141,9 +141,9 @@@ public class WXSDKInstance implements I
private LayoutFinishListener mLayoutFinishListener;
+ private boolean mCurrentGround = false;
+ private ComponentObserver mComponentObserver;
-
/**
* If anchor is created manually(etc. define a layout xml resource ),
* be aware do not add it to twice when {@link IWXRenderListener#onViewCreated(WXSDKInstance, View)}.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5d75a6f2/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
----------------------------------------------------------------------
[03/30] incubator-weex git commit: + [html5] add webSocket api for
web platform @notdanger
Posted by so...@apache.org.
+ [html5] add webSocket api for web platform @notdanger
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9df3655d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9df3655d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9df3655d
Branch: refs/heads/dev
Commit: 9df3655d5e42bb335c09aa21d29fe03979175894
Parents: 9994583
Author: erha19 <75...@qq.com>
Authored: Thu Jun 22 11:57:45 2017 +0800
Committer: erha19 <75...@qq.com>
Committed: Thu Jun 22 14:41:50 2017 +0800
----------------------------------------------------------------------
html5/render/vue/env/weex.js | 3 +
html5/render/vue/modules/index.js | 2 +
html5/render/vue/modules/websocket/index.js | 26 ++++++++
html5/render/vue/modules/websocket/websocket.js | 66 ++++++++++++++++++++
4 files changed, 97 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9df3655d/html5/render/vue/env/weex.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/env/weex.js b/html5/render/vue/env/weex.js
index e5ae94b..9b804cb 100644
--- a/html5/render/vue/env/weex.js
+++ b/html5/render/vue/env/weex.js
@@ -78,6 +78,9 @@ const weex = {
if (!weexModules[name]) {
weexModules[name] = {}
}
+ if (!!meta && meta.mountType === 'full') {
+ weexModules[name] = module
+ }
for (const key in module) {
if (module.hasOwnProperty(key)) {
weexModules[name][key] = utils.bind(module[key], this)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9df3655d/html5/render/vue/modules/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/index.js b/html5/render/vue/modules/index.js
index 4237f9d..27f0592 100644
--- a/html5/render/vue/modules/index.js
+++ b/html5/render/vue/modules/index.js
@@ -33,6 +33,7 @@ import globalEvent from './globalEvent'
import modal from './modal'
import navigator from './navigator'
import webview from './webview'
+import websocket from './websocket'
const legacyModules = {
event,
@@ -57,6 +58,7 @@ export default {
weex.install(legacyModules[k])
}
weex.install(modal)
+ weex.install(websocket)
for (const k in modules) {
weex.registerModule(k, modules[k])
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9df3655d/html5/render/vue/modules/websocket/index.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/websocket/index.js b/html5/render/vue/modules/websocket/index.js
new file mode 100644
index 0000000..273ed58
--- /dev/null
+++ b/html5/render/vue/modules/websocket/index.js
@@ -0,0 +1,26 @@
+/*
+ * 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 websocket from './websocket'
+
+// TODO: rewrite the module meta
+export default {
+ init: function (Weex) {
+ Weex.registerModule('webSocket', websocket, { mountType: 'full' })
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9df3655d/html5/render/vue/modules/websocket/websocket.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/websocket/websocket.js b/html5/render/vue/modules/websocket/websocket.js
new file mode 100644
index 0000000..c5cfa26
--- /dev/null
+++ b/html5/render/vue/modules/websocket/websocket.js
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+/**
+ * websocket module
+ */
+// let instance = null
+
+export default (function () {
+ let instance = null
+ const registerListeners = ['onopen', 'onmessage', 'onerror', 'onclose']
+ const ws = {
+ hasOwnProperty: function (e) {
+ return true
+ },
+ WebSocket: function (url, protocol) {
+ if (!url) {
+ return
+ }
+ if (!protocol) {
+ instance = new WebSocket(url)
+ }
+ else {
+ instance = new WebSocket(url, protocol)
+ }
+ return instance
+ },
+ send: function (messages) {
+ instance && instance.send(messages)
+ },
+ close: function () {
+ instance && instance.close()
+ }
+ }
+ for (const i in registerListeners) {
+ if (registerListeners.hasOwnProperty(i)) {
+ Object.defineProperty(ws, registerListeners[i], {
+ get: function () {
+ return instance && instance[registerListeners[i]]
+ },
+ set: function (fn) {
+ if (instance) {
+ instance[registerListeners[i]] = fn
+ }
+ }
+ })
+ }
+ }
+ return ws
+})()
[22/30] incubator-weex git commit: + [ios] add comment
Posted by so...@apache.org.
+ [ios] add comment
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/24474e2b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/24474e2b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/24474e2b
Branch: refs/heads/dev
Commit: 24474e2b09026c4b534527598fd21fccddef032e
Parents: 7ade969
Author: 齐山 <su...@163.com>
Authored: Mon Jun 26 15:44:54 2017 +0800
Committer: GitHub <no...@github.com>
Committed: Mon Jun 26 15:44:54 2017 +0800
----------------------------------------------------------------------
test/scripts/util.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/24474e2b/test/scripts/util.js
----------------------------------------------------------------------
diff --git a/test/scripts/util.js b/test/scripts/util.js
index 6e1b581..fd9fa43 100644
--- a/test/scripts/util.js
+++ b/test/scripts/util.js
@@ -194,7 +194,7 @@ module.exports = {
return driver.status()
else{
driver._isInit = true;
- return driver.initDriver().sleep(20000)
+ return driver.initDriver().sleep(20000) //ios cannot detect at once
}
},
quit:function(driver){
[23/30] incubator-weex git commit: Merge branch '0.14-dev' of
https://github.com/erha19/incubator-weex into 0.14-dev
Posted by so...@apache.org.
Merge branch '0.14-dev' of https://github.com/erha19/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/cbc2e2d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cbc2e2d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cbc2e2d8
Branch: refs/heads/dev
Commit: cbc2e2d89b5ecd4882968c9f4e1af252f122cdac
Parents: 43adf40 96cf5de
Author: MrRaindrop <te...@gmail.com>
Authored: Mon Jun 26 17:13:24 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon Jun 26 17:13:24 2017 +0800
----------------------------------------------------------------------
examples/vue/index.vue | 1 +
examples/vue/modules/websocket.vue | 116 +++++++++++++++++++
html5/render/vue/env/weex.js | 3 +
html5/render/vue/modules/index.js | 2 +
html5/render/vue/modules/websocket/index.js | 26 +++++
html5/render/vue/modules/websocket/websocket.js | 60 ++++++++++
html5/test/render/vue/modules/websocket.js | 11 ++
7 files changed, 219 insertions(+)
----------------------------------------------------------------------