@dolphinweex/weex-vue-render 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.common.js +67 -5
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -3460,7 +3460,7 @@ function applySrc (item, src, placeholderSrc) {
|
|
|
3460
3460
|
* 1. apply src immediately in case javscript blocks the image loading
|
|
3461
3461
|
* before next tick.
|
|
3462
3462
|
*/
|
|
3463
|
-
item.style.backgroundImage = "url(" + (src ? encodeURI(src) : '') + ")";
|
|
3463
|
+
item.style.backgroundImage = "url(" + (src ? encodeURI(decodeURI(src)) : '') + ")";
|
|
3464
3464
|
item.removeAttribute(lazyloadAttr);
|
|
3465
3465
|
/**
|
|
3466
3466
|
* 2. then load the img src with Image constructor (but would not post
|
|
@@ -3468,7 +3468,7 @@ function applySrc (item, src, placeholderSrc) {
|
|
|
3468
3468
|
*/
|
|
3469
3469
|
item._src_loading = src;
|
|
3470
3470
|
preLoadImg(src, function (evt) {
|
|
3471
|
-
item.style.backgroundImage = "url(" + (src ? encodeURI(src) : '') + ")";
|
|
3471
|
+
item.style.backgroundImage = "url(" + (src ? encodeURI(decodeURI(src)) : '') + ")";
|
|
3472
3472
|
var ref = this;
|
|
3473
3473
|
var naturalWidth = ref.width;
|
|
3474
3474
|
var naturalHeight = ref.height;
|
|
@@ -3486,7 +3486,7 @@ function applySrc (item, src, placeholderSrc) {
|
|
|
3486
3486
|
dispatchNativeEvent(item, 'load', params);
|
|
3487
3487
|
if (placeholderSrc) {
|
|
3488
3488
|
preLoadImg(placeholderSrc, function () {
|
|
3489
|
-
item.style.backgroundImage = "url(" + (placeholderSrc ? encodeURI(placeholderSrc) : '') + ")";
|
|
3489
|
+
item.style.backgroundImage = "url(" + (placeholderSrc ? encodeURI(decodeURI(placeholderSrc)) : '') + ")";
|
|
3490
3490
|
});
|
|
3491
3491
|
}
|
|
3492
3492
|
finallCb();
|
|
@@ -3985,7 +3985,7 @@ function initEnv (viewportInfo, envInfo) {
|
|
|
3985
3985
|
osName: osName,
|
|
3986
3986
|
osVersion: osVersion,
|
|
3987
3987
|
|
|
3988
|
-
deviceModel: device_display.deviceModel ||
|
|
3988
|
+
deviceModel: device_display.deviceModel || "",
|
|
3989
3989
|
appEnv: device_display.appEnv,
|
|
3990
3990
|
versionCode: device_display.versionCode,
|
|
3991
3991
|
idfa: device_display.idfa,
|
|
@@ -6281,6 +6281,67 @@ var scroller = {
|
|
|
6281
6281
|
}
|
|
6282
6282
|
};
|
|
6283
6283
|
|
|
6284
|
+
function getGCanvas (weex) {
|
|
6285
|
+
var extractComponentStyle = weex.extractComponentStyle;
|
|
6286
|
+
var ref = weex.utils;
|
|
6287
|
+
var dispatchNativeEvent = ref.dispatchNativeEvent;
|
|
6288
|
+
|
|
6289
|
+
return {
|
|
6290
|
+
name: 'weex-gcanvas',
|
|
6291
|
+
mounted: function mounted() {
|
|
6292
|
+
var wrapper = this.$refs.gcanvas;
|
|
6293
|
+
var rate = 750 / document.documentElement.clientWidth
|
|
6294
|
+
wrapper.width = wrapper.clientWidth * rate;
|
|
6295
|
+
wrapper.height = wrapper.clientWidth * rate;
|
|
6296
|
+
|
|
6297
|
+
var context = wrapper.getContext(type || '2d')
|
|
6298
|
+
context.scale(rate, rate)
|
|
6299
|
+
},
|
|
6300
|
+
methods:{
|
|
6301
|
+
getContext: function (type) {
|
|
6302
|
+
var wrapper = this.$refs.gcanvas;
|
|
6303
|
+
var context = wrapper.getContext(type || '2d')
|
|
6304
|
+
return context
|
|
6305
|
+
},
|
|
6306
|
+
|
|
6307
|
+
getContextAsyn: function (type, callback) {
|
|
6308
|
+
var wrapper = this.$refs.gcanvas;
|
|
6309
|
+
var context = wrapper.getContext(type || '2d')
|
|
6310
|
+
callback(context)
|
|
6311
|
+
},
|
|
6312
|
+
|
|
6313
|
+
drawImage: function (url) {
|
|
6314
|
+
var wrapper = this.$refs.gcanvas;
|
|
6315
|
+
var context = wrapper.getContext(type || '2d')
|
|
6316
|
+
|
|
6317
|
+
var img = new Image();
|
|
6318
|
+
img.src = url
|
|
6319
|
+
arguments[0] = img
|
|
6320
|
+
return context.drawImage.apply(context, arguments)
|
|
6321
|
+
}
|
|
6322
|
+
},
|
|
6323
|
+
render: function render (createElement) {
|
|
6324
|
+
var attrs = this.$vnode.data.attrs;
|
|
6325
|
+
return createElement('canvas', {
|
|
6326
|
+
attrs: {
|
|
6327
|
+
'weex-type': 'gcanvas'
|
|
6328
|
+
},
|
|
6329
|
+
ref: 'gcanvas',
|
|
6330
|
+
staticClass: 'weex-gcanvas weex-ct',
|
|
6331
|
+
staticStyle: extractComponentStyle(this)
|
|
6332
|
+
})
|
|
6333
|
+
}
|
|
6334
|
+
}
|
|
6335
|
+
}
|
|
6336
|
+
|
|
6337
|
+
var gcanvas = {
|
|
6338
|
+
init: function (Weex) {
|
|
6339
|
+
Weex.registerComponent('gcanvas', getGCanvas(Weex))
|
|
6340
|
+
}
|
|
6341
|
+
};
|
|
6342
|
+
|
|
6343
|
+
|
|
6344
|
+
|
|
6284
6345
|
/*
|
|
6285
6346
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
6286
6347
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -7208,7 +7269,7 @@ var recycleList = {
|
|
|
7208
7269
|
}
|
|
7209
7270
|
};
|
|
7210
7271
|
|
|
7211
|
-
__$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nbody > .weex-list,\nbody > .weex-recycle,\nbody > .weex-scroller,\nbody > .weex-waterfall {\n max-height: 100%;\n}\n\n.weex-list-wrapper,\n.weex-recycle-wrapper,\n.weex-scroller-wrapper,\n.weex-waterfall-wrapper {\n -webkit-overflow-scrolling: touch;\n}\n\n.weex-list-wrapper,\n.weex-waterfall-wrapper, \n.weex-recycle-wrapper {\n overflow-y: scroll !important;\n overflow-x: hidden !important;\n align-items: flex-start !important;\n justify-content: flex-start !important;\n}\n\n.weex-list-inner,\n.weex-recycle-inner,\n.weex-scroller-inner,\n.weex-waterfall-inner {\n -webkit-overflow-scrolling: touch;\n align-items: inherit; \n}\n\n.weex-waterfall-inner-columns {\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n}\n\n.weex-scroller-wrapper.weex-scroller-vertical,\n.weex-recycle-wrapper.weex-recycle-vertical {\n overflow-x: hidden;\n overflow-y: scroll;\n}\n\n.weex-scroller-wrapper.weex-scroller-horizontal,\n.weex-recycle-wrapper.weex-recycle-horizontal {\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.weex-scroller-wrapper.weex-scroller-disabled {\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.weex-scroller-horizontal .weex-scroller-inner,\n.weex-recycle-horizontal .weex-recycle-inner {\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n height: 100%;\n}\n\n.weex-cell {\n width: 100%;\n}\n\n.weex-refresh,\n.weex-loading {\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n}\n",undefined);
|
|
7272
|
+
__$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nbody > .weex-list,\nbody > .weex-recycle,\nbody > .weex-scroller,\nbody > .weex-waterfall {\n max-height: 100%;\n}\n\n.weex-list-wrapper,\n.weex-recycle-wrapper,\n.weex-scroller-wrapper,\n.weex-waterfall-wrapper {\n -webkit-overflow-scrolling: touch;\n}\n\n.weex-list-wrapper,\n.weex-waterfall-wrapper, \n.weex-recycle-wrapper {\n overflow-y: scroll !important;\n overflow-x: hidden !important;\n align-items: flex-start !important;\n justify-content: flex-start !important;\n}\n\n.weex-list-inner,\n.weex-recycle-inner,\n.weex-scroller-inner,\n.weex-waterfall-inner {\n -webkit-overflow-scrolling: touch;\n align-items: inherit; \n}\n\n.weex-waterfall-inner-columns { \n margin:0 auto; \n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n}\n\n.weex-scroller-wrapper.weex-scroller-vertical,\n.weex-recycle-wrapper.weex-recycle-vertical {\n overflow-x: hidden;\n overflow-y: scroll;\n}\n\n.weex-scroller-wrapper.weex-scroller-horizontal,\n.weex-recycle-wrapper.weex-recycle-horizontal {\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.weex-scroller-wrapper.weex-scroller-disabled {\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.weex-scroller-horizontal .weex-scroller-inner,\n.weex-recycle-horizontal .weex-recycle-inner {\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n height: 100%;\n}\n\n.weex-cell {\n width: 100%;\n}\n\n.weex-refresh,\n.weex-loading {\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n}\n",undefined);
|
|
7212
7273
|
|
|
7213
7274
|
/*
|
|
7214
7275
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
@@ -7236,6 +7297,7 @@ var modules = [
|
|
|
7236
7297
|
waterfall,
|
|
7237
7298
|
// cell,
|
|
7238
7299
|
header,
|
|
7300
|
+
gcanvas,
|
|
7239
7301
|
loading,
|
|
7240
7302
|
refresh,
|
|
7241
7303
|
loadingIndicator$1,
|
package/package.json
CHANGED