+ [ios] add gcanvas example & fix wxdevtool crash & move spec to root directory
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e7286623 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e7286623 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e7286623 Branch: refs/heads/0.12-dev Commit: e72866232abccc74284c480284ec1e83dc6586d1 Parents: eb6b55c Author: é½å±± <sunjjb...@163.com> Authored: Mon Apr 17 19:11:27 2017 +0800 Committer: é½å±± <sunjjb...@163.com> Committed: Mon Apr 17 19:11:27 2017 +0800 ---------------------------------------------------------------------- WeexSDK.podspec | 47 ++++++++++++++++++++ examples/index.we | 5 ++- examples/vue/index.vue | 3 ++ examples/vue/market/gcanvas.vue | 40 +++++++++++++++++ ios/playground/Podfile | 2 + .../WeexSDK/Sources/Bridge/WXBridgeContext.m | 2 +- package.json | 4 +- 7 files changed, 100 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e7286623/WeexSDK.podspec ---------------------------------------------------------------------- diff --git a/WeexSDK.podspec b/WeexSDK.podspec new file mode 100644 index 0000000..6ec182f --- /dev/null +++ b/WeexSDK.podspec @@ -0,0 +1,47 @@ +# coding: utf-8 +Pod::Spec.new do |s| + + s.name = "WeexSDK" + + s.version = "0.11.0" + + s.summary = "WeexSDK Source ." + + s.description = <<-DESC + A framework for building Mobile cross-platform UI + DESC + + s.homepage = "https://github.com/alibaba/weex" + s.license = { + :type => 'Copyright', + :text => <<-LICENSE + Alibaba-INC copyright + LICENSE + } + s.authors = { "cxfeng1" => "cxfe...@gmail.com", + "boboning" => "ningli...@163.com", + "yangshengtao" => "yangshengtao1...@163.com", + "kfeagle" => "sunjjb...@163.com", + "acton393" => "zhangxing610...@gmail.com" + } + s.platform = :ios + s.ios.deployment_target = '7.0' + s.source = { :path => '.' } + s.source_files = 'ios/playground/WeexSDK/Sources/**/*.{h,m,mm,c}' + s.resources = 'ios/playground/WeexSDK/Resources/main.js', 'ios/playground/WeexSDK/Resources/wx_load_er...@3x.png' + + s.requires_arc = true + s.prefix_header_file = 'ios/playground/WeexSDK/Sources/Supporting Files/WeexSDK-Prefix.pch' + +# s.xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) DEBUG=1' } + + s.xcconfig = { "OTHER_LINK_FLAG" => '$(inherited) -ObjC'} + + s.user_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => "'$(PODS_ROOT)/WeexSDK'" } + + s.frameworks = 'CoreMedia','MediaPlayer','AVFoundation','AVKit','JavaScriptCore', 'GLKit' + + s.dependency 'SocketRocket' + s.libraries = "stdc++" + +end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e7286623/examples/index.we ---------------------------------------------------------------------- diff --git a/examples/index.we b/examples/index.we index e0b1a9f..aa0b842 100644 --- a/examples/index.we +++ b/examples/index.we @@ -54,7 +54,10 @@ {name: 'showcase/ui', title: 'UI Gallery'}, {name: 'showcase/dropdown/dropdown-demo', title: 'Dropdown'}, {name: 'showcase/pseudo-class', title: 'PseudoClass'}, - {name: 'showcase/boxshadow', title: 'boxshadow'} + {name: 'showcase/boxshadow', title: 'boxshadow'}, + + // market + {name: 'market/gcanvas', title: 'Gcanvas'}, ] } } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e7286623/examples/vue/index.vue ---------------------------------------------------------------------- diff --git a/examples/vue/index.vue b/examples/vue/index.vue index fb4693d..4d263cd 100644 --- a/examples/vue/index.vue +++ b/examples/vue/index.vue @@ -45,6 +45,9 @@ // {name: root + '/showcase/minesweeper', title: 'Minesweeper'}, // {name: root + '/showcase/ui', title: 'UI Gallery'}, // {name: root + '/showcase/dropdown/dropdown-demo', title: 'Dropdown'} + + // market + {name: root + '/market/gcanvas', title: 'Gcanvas'} ] } }, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e7286623/examples/vue/market/gcanvas.vue ---------------------------------------------------------------------- diff --git a/examples/vue/market/gcanvas.vue b/examples/vue/market/gcanvas.vue new file mode 100644 index 0000000..626ece1 --- /dev/null +++ b/examples/vue/market/gcanvas.vue @@ -0,0 +1,40 @@ +<template> + <div ref="test"> + <gcanvas ref="canvas_holder" style="width:750;height:750;"></gcanvas> + </div> +</template> +<script> + // var gcanvas = weex.requireModule('weex-gcanvas'); + + var gcanvas=require('weex-gcanvas'); + + + module.exports = { + + created: function () { + console.log('created gcanvas'); + gcanvas.disable(); + }, + mounted: function () { + var ref = this.$refs.canvas_holder.ref; + gcanvas.start(ref, function () { + var ctx = gcanvas.getContext('2d'); + + ctx.fillStyle = 'red'; + ctx.fillRect(0, 0, 100, 100); + + ctx.fillStyle = 'black'; + ctx.fillRect(100, 100, 100, 100); + ctx.fillRect(25, 210, 700, 5); + + ctx.arc(450, 200, 100, 0, Math.PI * 2, true); + ctx.fill(); + + var img = 'https://img.alicdn.com/tps/TB1TFNdKVXXXXbeaXXXXXXXXXXX-210-330.png'; + ctx.drawImage(img, 100, 200, 210, 330); + //ctx.drawImage(img, 0,0,105,165, 100, 200, 210, 330); + ctx.render(); + }); + } + }; +</script> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e7286623/ios/playground/Podfile ---------------------------------------------------------------------- diff --git a/ios/playground/Podfile b/ios/playground/Podfile index 4949ee8..5ca0552 100644 --- a/ios/playground/Podfile +++ b/ios/playground/Podfile @@ -8,6 +8,8 @@ def common pod 'SDWebImage', '3.7.5' pod 'SocketRocket', '0.4.2' pod 'ATSDK-Weex', '0.0.1' + + pod 'WeexGcanvas', '0.0.1.3' end target 'WeexDemo' do http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e7286623/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index bf057c4..a982e92 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -258,7 +258,7 @@ _Pragma("clang diagnostic pop") \ [self.insStack removeObject:instance]; } - if(_jsBridge){ + if(_jsBridge && [_jsBridge respondsToSelector:@selector(removeTimers:)]){ [_jsBridge removeTimers:instance]; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e7286623/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index 53f65d8..156eaee 100644 --- a/package.json +++ b/package.json @@ -160,6 +160,8 @@ "weex-vdom-tester": "^0.2.0", "weex-wd": "^1.0.22", "wwp": "^0.3.5", - "xml2map": "^1.0.2" + "xml2map": "^1.0.2", + "weex-gcanvas":"^0.3.5" + } }