From 71be9ac54b5f4f2aba17b277610ee8b8eb4530f7 Mon Sep 17 00:00:00 2001 From: acton393 Date: Fri, 12 Jan 2018 18:05:27 +0800 Subject: [PATCH 01/11] * [iOS] support openURL for scan viewController --- ios/playground/WeexDemo/extend/module/WXEventModule.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios/playground/WeexDemo/extend/module/WXEventModule.m b/ios/playground/WeexDemo/extend/module/WXEventModule.m index 9f58090ef1..59e9158498 100644 --- a/ios/playground/WeexDemo/extend/module/WXEventModule.m +++ b/ios/playground/WeexDemo/extend/module/WXEventModule.m @@ -19,7 +19,8 @@ #import "WXEventModule.h" #import "WXDemoViewController.h" -#import +#import "WXScannerVC.h" +#import @implementation WXEventModule @@ -34,6 +35,10 @@ - (void)openURL:(NSString *)url NSString *newURL = url; if ([url hasPrefix:@"//"]) { newURL = [NSString stringWithFormat:@"http:%@", url]; + } else if ([url hasPrefix:@"weex://go/scan"]){ + WXScannerVC * sannerVC = [WXScannerVC new]; + [[weexInstance.viewController navigationController] pushViewController:sannerVC animated:YES]; + return; } else if (![url hasPrefix:@"http"]) { // relative path newURL = [NSURL URLWithString:url relativeToURL:weexInstance.scriptURL].absoluteString; From de4577f8f469c869da415bee510c665befe36ac9 Mon Sep 17 00:00:00 2001 From: acton393 Date: Mon, 15 Jan 2018 11:42:47 +0800 Subject: [PATCH 02/11] * [iOS] add title bar modules --- .../WeexDemo/WXDemoViewController.m | 1 + .../WeexDemo/extend/module/WXTitleBarModule.h | 14 +++++++ .../WeexDemo/extend/module/WXTitleBarModule.m | 41 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 ios/playground/WeexDemo/extend/module/WXTitleBarModule.h create mode 100644 ios/playground/WeexDemo/extend/module/WXTitleBarModule.m diff --git a/ios/playground/WeexDemo/WXDemoViewController.m b/ios/playground/WeexDemo/WXDemoViewController.m index 280ba75260..552303aea4 100644 --- a/ios/playground/WeexDemo/WXDemoViewController.m +++ b/ios/playground/WeexDemo/WXDemoViewController.m @@ -181,6 +181,7 @@ - (void)render [WXPrerenderManager renderFromCache:[self.url absoluteString]]; return; } + _instance.viewController = self; NSURL *URL = [self testURL: [self.url absoluteString]]; NSString *randomURL = [NSString stringWithFormat:@"%@%@random=%d",URL.absoluteString,URL.query?@"&":@"?",arc4random()]; [_instance renderWithURL:[NSURL URLWithString:randomURL] options:@{@"bundleUrl":URL.absoluteString} data:nil]; diff --git a/ios/playground/WeexDemo/extend/module/WXTitleBarModule.h b/ios/playground/WeexDemo/extend/module/WXTitleBarModule.h new file mode 100644 index 0000000000..057c6187d8 --- /dev/null +++ b/ios/playground/WeexDemo/extend/module/WXTitleBarModule.h @@ -0,0 +1,14 @@ +// +// WXTitleBarModule.h +// WeexDemo +// +// Created by zifan.zx on 2018/1/15. +// Copyright © 2018年 taobao. All rights reserved. +// + +#import +#import + +@interface WXTitleBarModule : NSObject + +@end diff --git a/ios/playground/WeexDemo/extend/module/WXTitleBarModule.m b/ios/playground/WeexDemo/extend/module/WXTitleBarModule.m new file mode 100644 index 0000000000..8e9358c652 --- /dev/null +++ b/ios/playground/WeexDemo/extend/module/WXTitleBarModule.m @@ -0,0 +1,41 @@ +// +// WXTitleBarModule.m +// WeexDemo +// +// Created by zifan.zx on 2018/1/15. +// Copyright © 2018年 taobao. All rights reserved. +// + +#import "WXTitleBarModule.h" + +@implementation WXTitleBarModule +@synthesize weexInstance; + +WX_EXPORT_METHOD(@selector(setTitle:)) +WX_EXPORT_METHOD(@selector(showTitleBar:)) + +- (void)setTitle:(NSString*)title +{ + if (title) { + [weexInstance.viewController.navigationController setTitle:title]; + } +} + +- (void)setStytle:(NSDictionary*)styles +{ + if (styles[@"backgroundColor"]) { + [weexInstance.viewController.navigationController.navigationBar setBackgroundColor:[WXConvert UIColor:styles[@"backgroundColor"]]]; + } + if (styles[@"foregroundColor"]) { + weexInstance.viewController.navigationController.navigationItem.leftBarButtonItem.tintColor = [WXConvert UIColor:styles[@"foregroundColor"]]; + weexInstance.viewController.navigationController.navigationItem.rightBarButtonItem.tintColor = [WXConvert UIColor:styles[@"foregroundColor"]]; + [weexInstance.viewController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[WXConvert UIColor:styles[@"foregroundColor"]]}]; + } +} + +- (void)showTitleBar:(BOOL)show +{ + [weexInstance.viewController.navigationController setNavigationBarHidden:show]; +} + +@end From 4952f18213907a514889403b37df08b30cd3fdff Mon Sep 17 00:00:00 2001 From: acton393 Date: Mon, 15 Jan 2018 12:28:07 +0800 Subject: [PATCH 03/11] * [iOS] register titleBar --- ios/playground/Podfile | 2 +- ios/playground/WeexDemo/AppDelegate.m | 2 +- ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m | 7 ------- ios/playground/WeexDemo/WXDemoViewController.m | 3 +++ ios/playground/WeexDemo/extend/module/WXTitleBarModule.m | 7 ++++--- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ios/playground/Podfile b/ios/playground/Podfile index b65ccd4b67..53e1347af8 100644 --- a/ios/playground/Podfile +++ b/ios/playground/Podfile @@ -4,7 +4,7 @@ platform :ios, '7.0' def common pod 'WeexSDK', :path=>'../../' - pod 'WXDevtool', '0.15.3' + pod 'WXDevtool', '0.15.3',:configurations => ['Debug'] pod 'SDWebImage', '3.7.5' pod 'SocketRocket', '0.4.2' pod 'ATSDK-Weex', '0.0.1' diff --git a/ios/playground/WeexDemo/AppDelegate.m b/ios/playground/WeexDemo/AppDelegate.m index 0414933b5e..5cdad0059f 100644 --- a/ios/playground/WeexDemo/AppDelegate.m +++ b/ios/playground/WeexDemo/AppDelegate.m @@ -115,11 +115,11 @@ - (void)initWeexSDK [WXSDKEngine registerHandler:[WXImgLoaderDefaultImpl new] withProtocol:@protocol(WXImgLoaderProtocol)]; [WXSDKEngine registerHandler:[WXEventModule new] withProtocol:@protocol(WXEventModuleProtocol)]; [WXSDKEngine registerHandler:[WXConfigCenterDefaultImpl new] withProtocol:@protocol(WXConfigCenterProtocol)]; - [WXSDKEngine registerComponent:@"select" withClass:NSClassFromString(@"WXSelectComponent")]; [WXSDKEngine registerModule:@"event" withClass:[WXEventModule class]]; [WXSDKEngine registerModule:@"syncTest" withClass:[WXSyncTestModule class]]; + [WXSDKEngine registerModule:@"titleBar" withClass:NSClassFromString(@"WXTitleBarModule")]; [WXSDKEngine registerExtendCallNative:@"test" withClass:NSClassFromString(@"WXExtendCallNativeTest")]; [WXSDKEngine registerModule:@"ext" withClass:[WXExtModule class]]; diff --git a/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m b/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m index 4490bd4afd..cec71a0274 100644 --- a/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m +++ b/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m @@ -38,14 +38,7 @@ - (void)setupNaviBar self.navigationController.navigationBar.barTintColor = WEEX_COLOR; self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; self.navigationController.navigationBar.translucent = NO; - }else { - // iOS 6.1 or earlier - self.navigationController.navigationBar.tintColor = WEEX_COLOR; } - - [self.navigationController.navigationBar setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: - [UIColor whiteColor], NSForegroundColorAttributeName, nil]]; - self.navigationItem.title = @"Weex Playground"; if (!self.navigationItem.leftBarButtonItem) { UIBarButtonItem *leftItem; if(![[self.navigationController.viewControllers objectAtIndex:0] isEqual:self]) { diff --git a/ios/playground/WeexDemo/WXDemoViewController.m b/ios/playground/WeexDemo/WXDemoViewController.m index 552303aea4..9d1bd9f57f 100644 --- a/ios/playground/WeexDemo/WXDemoViewController.m +++ b/ios/playground/WeexDemo/WXDemoViewController.m @@ -185,6 +185,9 @@ - (void)render NSURL *URL = [self testURL: [self.url absoluteString]]; NSString *randomURL = [NSString stringWithFormat:@"%@%@random=%d",URL.absoluteString,URL.query?@"&":@"?",arc4random()]; [_instance renderWithURL:[NSURL URLWithString:randomURL] options:@{@"bundleUrl":URL.absoluteString} data:nil]; + [self.navigationController.navigationBar setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: + [UIColor whiteColor], NSForegroundColorAttributeName, nil]]; + self.navigationItem.title = _instance.pageName; } - (void)updateInstanceState:(WXState)state diff --git a/ios/playground/WeexDemo/extend/module/WXTitleBarModule.m b/ios/playground/WeexDemo/extend/module/WXTitleBarModule.m index 8e9358c652..aad08e2983 100644 --- a/ios/playground/WeexDemo/extend/module/WXTitleBarModule.m +++ b/ios/playground/WeexDemo/extend/module/WXTitleBarModule.m @@ -13,18 +13,19 @@ @implementation WXTitleBarModule WX_EXPORT_METHOD(@selector(setTitle:)) WX_EXPORT_METHOD(@selector(showTitleBar:)) +WX_EXPORT_METHOD(@selector(setStyle:)) - (void)setTitle:(NSString*)title { if (title) { - [weexInstance.viewController.navigationController setTitle:title]; + [weexInstance.viewController.navigationItem setTitle:title]; } } -- (void)setStytle:(NSDictionary*)styles +- (void)setStyle:(NSDictionary*)styles { if (styles[@"backgroundColor"]) { - [weexInstance.viewController.navigationController.navigationBar setBackgroundColor:[WXConvert UIColor:styles[@"backgroundColor"]]]; + weexInstance.viewController.navigationController.navigationBar.barTintColor = [WXConvert UIColor:styles[@"backgroundColor"]]; } if (styles[@"foregroundColor"]) { weexInstance.viewController.navigationController.navigationItem.leftBarButtonItem.tintColor = [WXConvert UIColor:styles[@"foregroundColor"]]; From 1ba62702dfd80d103792eaf4a0d893e139a773fb Mon Sep 17 00:00:00 2001 From: acton393 Date: Mon, 15 Jan 2018 14:38:54 +0800 Subject: [PATCH 04/11] * [iOS] add titlebar file to project --- .../WeexDemo.xcodeproj/project.pbxproj | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/ios/playground/WeexDemo.xcodeproj/project.pbxproj b/ios/playground/WeexDemo.xcodeproj/project.pbxproj index 351693bea6..b5681d9266 100644 --- a/ios/playground/WeexDemo.xcodeproj/project.pbxproj +++ b/ios/playground/WeexDemo.xcodeproj/project.pbxproj @@ -37,6 +37,7 @@ 8A0B5EFFF75BF82EA481983D /* libPods-WeexUITestDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E48C20F443AA337D1FE97622 /* libPods-WeexUITestDemo.a */; }; C43CDA031F1C6E01005A6B03 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C43CDA021F1C6E01005A6B03 /* libz.tbd */; }; C47B78D21F299E27001D3B0C /* WXExtendCallNativeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = C47B78D11F299E27001D3B0C /* WXExtendCallNativeTest.m */; }; + DC15A3C7200C505C009C8977 /* WXTitleBarModule.m in Sources */ = {isa = PBXBuildFile; fileRef = DC15A3C6200C505C009C8977 /* WXTitleBarModule.m */; }; DC20B8E61ECADA2500845F39 /* WXConfigCenterDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = DC20B8E51ECADA2500845F39 /* WXConfigCenterDefaultImpl.m */; }; DC5B53691E8CED9400E02125 /* WXScannerHistoryVC.m in Sources */ = {isa = PBXBuildFile; fileRef = DC5B53681E8CED9400E02125 /* WXScannerHistoryVC.m */; }; DC5E503E1D0D97130059F0EB /* weex.png in Resources */ = {isa = PBXBuildFile; fileRef = DC5E503C1D0D97130059F0EB /* weex.png */; }; @@ -100,6 +101,8 @@ C43CDA021F1C6E01005A6B03 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; C47B78D01F299E27001D3B0C /* WXExtendCallNativeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXExtendCallNativeTest.h; sourceTree = ""; }; C47B78D11F299E27001D3B0C /* WXExtendCallNativeTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXExtendCallNativeTest.m; sourceTree = ""; }; + DC15A3C5200C505C009C8977 /* WXTitleBarModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WXTitleBarModule.h; path = extend/module/WXTitleBarModule.h; sourceTree = ""; }; + DC15A3C6200C505C009C8977 /* WXTitleBarModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = WXTitleBarModule.m; path = extend/module/WXTitleBarModule.m; sourceTree = ""; }; DC20B8E41ECADA2500845F39 /* WXConfigCenterDefaultImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXConfigCenterDefaultImpl.h; sourceTree = ""; }; DC20B8E51ECADA2500845F39 /* WXConfigCenterDefaultImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXConfigCenterDefaultImpl.m; sourceTree = ""; }; DC5B53671E8CED9400E02125 /* WXScannerHistoryVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXScannerHistoryVC.h; path = Scanner/WXScannerHistoryVC.h; sourceTree = ""; }; @@ -306,6 +309,8 @@ children = ( DCABAFFF1D02975E001C8592 /* WXEventModule.h */, DCABB0001D02975E001C8592 /* WXEventModule.m */, + DC15A3C5200C505C009C8977 /* WXTitleBarModule.h */, + DC15A3C6200C505C009C8977 /* WXTitleBarModule.m */, 7478481C1E0CD4910044500D /* WXSyncTestModule.h */, 7478481D1E0CD4910044500D /* WXSyncTestModule.m */, 847CAF2F1F39E3F100551725 /* WXExtModule.h */, @@ -407,6 +412,7 @@ TargetAttributes = { 775BEE7A1C1E8ECC008D1629 = { CreatedOnToolsVersion = 7.1.1; + DevelopmentTeam = G7EDFK7C8C; }; 775BEE931C1E8ECC008D1629 = { CreatedOnToolsVersion = 7.1.1; @@ -507,6 +513,7 @@ ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-WeexUITestDemo-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -519,9 +526,20 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-WeexUITestDemo/Pods-WeexUITestDemo-resources.sh", + "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/ATSDK.bundle", + "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/en.lproj", + "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/zh-Hans.lproj", + "${PODS_ROOT}/GCanvas/GCanvas.framework/default.glsl", + "${PODS_ROOT}/GCanvas/GCanvas.framework/grad.glsl", + "${PODS_ROOT}/GCanvas/GCanvas.framework/pattern.glsl", + "${PODS_ROOT}/GCanvas/GCanvas.framework/radiation.glsl", + "${PODS_ROOT}/../../../pre-build/native-bundle-main.js", + "${PODS_ROOT}/../../sdk/WeexSDK/Resources/wx_load_error@3x.png", ); name = "[CP] Copy Pods Resources"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -554,6 +572,7 @@ ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-WeexDemo-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -566,9 +585,20 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-WeexDemo/Pods-WeexDemo-resources.sh", + "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/ATSDK.bundle", + "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/en.lproj", + "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/zh-Hans.lproj", + "${PODS_ROOT}/GCanvas/GCanvas.framework/default.glsl", + "${PODS_ROOT}/GCanvas/GCanvas.framework/grad.glsl", + "${PODS_ROOT}/GCanvas/GCanvas.framework/pattern.glsl", + "${PODS_ROOT}/GCanvas/GCanvas.framework/radiation.glsl", + "${PODS_ROOT}/../../../pre-build/native-bundle-main.js", + "${PODS_ROOT}/../../sdk/WeexSDK/Resources/wx_load_error@3x.png", ); name = "[CP] Copy Pods Resources"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -591,6 +621,7 @@ 7478481E1E0CD4910044500D /* WXSyncTestModule.m in Sources */, 775BEE831C1E8ECC008D1629 /* AppDelegate.m in Sources */, 847CAF311F39E3F100551725 /* WXExtModule.m in Sources */, + DC15A3C7200C505C009C8977 /* WXTitleBarModule.m in Sources */, DC20B8E61ECADA2500845F39 /* WXConfigCenterDefaultImpl.m in Sources */, DCABAFF41D029685001C8592 /* WXATViewHierarchyPlugin.m in Sources */, 775BEE801C1E8ECC008D1629 /* main.m in Sources */, @@ -733,7 +764,7 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = G7EDFK7C8C; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -763,7 +794,7 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = G7EDFK7C8C; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", From ba2eb96e46c8bd45ae9db85a7dbdedafd19d4050 Mon Sep 17 00:00:00 2001 From: acton393 Date: Mon, 15 Jan 2018 14:46:08 +0800 Subject: [PATCH 05/11] * [iOS] remove devtool in release mode --- ios/playground/WeexDemo/Scanner/WXScannerVC.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/playground/WeexDemo/Scanner/WXScannerVC.m b/ios/playground/WeexDemo/Scanner/WXScannerVC.m index e5a0c9680d..848185de0c 100644 --- a/ios/playground/WeexDemo/Scanner/WXScannerVC.m +++ b/ios/playground/WeexDemo/Scanner/WXScannerVC.m @@ -23,7 +23,9 @@ #import "UIViewController+WXDemoNaviBar.h" #import "WXDemoViewController.h" #import "WXDebugTool.h" +#if DEBUG #import +#endif #import @interface WXScannerVC () @@ -208,12 +210,14 @@ - (BOOL)remoteDebug:(NSURL *)url } return YES; } else if ([[elts firstObject] isEqualToString:@"_wx_devtool"]) { +#ifdef DEBUG NSString *devToolURL = [[elts lastObject] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [WXDevTool launchDevToolDebugWithUrl:devToolURL]; if ([[[self.navigationController viewControllers] objectAtIndex:0] isKindOfClass:NSClassFromString(@"WXDemoViewController")]) { WXDemoViewController * vc = (WXDemoViewController*)[[self.navigationController viewControllers] objectAtIndex:0]; [self.navigationController popToViewController:vc animated:NO]; } +#endif return YES; } From ed6ff69be9c14ac360d66aa732d28649c186168c Mon Sep 17 00:00:00 2001 From: Hanks Date: Mon, 15 Jan 2018 15:15:08 +0800 Subject: [PATCH 06/11] * [example] update examples of playground app on ios --- ios/playground/bundlejs/about.weex.js | 4 ++++ ios/playground/bundlejs/examples.weex.js | 4 ++++ ios/playground/bundlejs/guide.weex.js | 4 ++++ ios/playground/bundlejs/landing.weex.js | 4 ++++ ios/playground/bundlejs/lesson.weex.js | 4 ++++ ios/playground/bundlejs/news.weex.js | 4 ++++ 6 files changed, 24 insertions(+) create mode 100644 ios/playground/bundlejs/about.weex.js create mode 100644 ios/playground/bundlejs/examples.weex.js create mode 100644 ios/playground/bundlejs/guide.weex.js create mode 100644 ios/playground/bundlejs/landing.weex.js create mode 100644 ios/playground/bundlejs/lesson.weex.js create mode 100644 ios/playground/bundlejs/news.weex.js diff --git a/ios/playground/bundlejs/about.weex.js b/ios/playground/bundlejs/about.weex.js new file mode 100644 index 0000000000..f2ad07fe1e --- /dev/null +++ b/ios/playground/bundlejs/about.weex.js @@ -0,0 +1,4 @@ +// { "framework": "Vue" } +"use weex:vue"; + +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(3),o=n(11);t.exports=n(4)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(9),o=n(30),i=n(16),a=Object.defineProperty;e.f=n(4)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(10)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(52),o=n(14);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(20)("wks"),o=n(12),i=n(0).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!0},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports={}},function(t,e,n){var r=n(34),o=n(21);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(20)("keys"),o=n(12);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(0),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(3).f,o=n(1),i=n(6)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){e.f=n(6)},function(t,e,n){var r=n(0),o=n(8),i=n(15),a=n(23),u=n(3).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fetchNews=e.fetchDoodle=e.readAbout=e.saveAbout=e.fetchAbout=e.readGuide=e.saveGuide=e.fetchGuide=e.readExamples=e.saveExamples=e.fetchExamples=void 0;var r=i(n(42)),o=i(n(27));function i(t){return t&&t.__esModule?t:{default:t}}e.createLink=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];for(var r in e)"string"==typeof e[r]&&n.push(s(r)+"="+s(e[r]));if("Web"===WXEnvironment.platform)return n.unshift("page="+t+".web.js"),"/?"+n.join("&");return""+function(){var t=weex.config.bundleUrl,e=t.indexOf("your_current_IP")>=0||t.indexOf("file://assets/")>=0,n=t.indexOf("file:///")>=0&&t.indexOf("WeexDemo.app")>0;if(e)return"file://assets/";if(n)return t.substring(0,t.lastIndexOf("/")+1);return""}()+t+".weex.js"+(n.length?"?"+n.join("&"):"")},e.createURL=f,e.i18n=l,e.parseLanguage=d,e.setLanguage=function(t){var e=d(t);e&&u.setItem("WEEX_PLAYGROUND_LANGUAGE",e)},e.clearStorageLanguage=function(){u.removeItem("WEEX_PLAYGROUND_LANGUAGE")},e.getStorageLanguage=v,e.getSystemLanguage=h,e.getLanguage=y,e.jumpTo=function(t,e){y(function(n){u.setItem("CURRENT_DOCUMENT_URL",l(t,n)),c.push({url:f("bf0305c14b511b24a4e616f53926432b",{language:n,title:l(e,n)})})})},e.viewSource=function(t){y(function(e){c.push({url:f("0def402b8db7e05d0376bcc7f9c238d3",{hash:t,language:e})})})},e.setTitleBar=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";if("[object Object]"!==Object.prototype.toString.apply(t))return;var n=weex.requireModule("titleBar");if(t.color||t.backgroundColor)try{n.setStyle({foregroundColor:t.color||"#FFFFFF",backgroundColor:t.backgroundColor||"#00B4FF"})}catch(t){}var r=l(t.title,e);if(r)try{n.setTitle(r)}catch(t){}},e.fetchData=x,e.saveData=b,e.readData=w;var a=weex.requireModule("stream"),u=weex.requireModule("storage"),c=weex.requireModule("navigator"),s="function"==typeof encodeURIComponent?encodeURIComponent:"function"==typeof encodeURI?encodeURI:function(t){return t};function f(t,e){if("Web"===WXEnvironment.platform)return"http://dotwe.org/raw/htmlVue/"+t;var n="http://dotwe.org/raw/dist/"+t+".bundle.wx",r=function(t){if(!t||"object"!==(void 0===t?"undefined":(0,o.default)(t)))return"";var e=[];for(var n in t)"string"==typeof t[n]&&e.push(s(n)+"="+s(t[n]));return e.join("&")}(e);return"TB"===WXEnvironment.appName?n+"?_wx_tpl="+n+"&"+r:"WXSample"===WXEnvironment.appName?n+"?"+r:n+"?wx_weex=true&"+r}function l(t,e){return"string"==typeof t?t:"[object Object]"===Object.prototype.toString.call(t)?t[this&&this.language||e||"en"]:void 0}var p=/(en|zh)\_?\w*/i;function d(t){var e=p.exec(t+"");return e&&e[1]?e[1]:""}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if("function"!==!(void 0===t||(0,o.default)(t)))try{u.getItem("WEEX_PLAYGROUND_LANGUAGE",function(n){if("success"===n.result){var r=d(n.data);r?t(r):e()}else e(n)})}catch(t){e(t)}}function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if("function"!==!(void 0===t||(0,o.default)(t)))if("web"===WXEnvironment.platform.toLowerCase()){var n=d(window.navigator.language);n?t(n):e()}else try{(weex.requireModule("locale")||weex.requireModule("local")).getLanguage(function(n){var r=d(n);r?t(r):e()})}catch(t){e(t)}}var g=/.+[\?\&]{1}language=([\d\w]+)[\?\&]?.*/i;function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},e=g.exec(weex.config.bundleUrl||""),n=d(e&&e[1]);n?t(n):v(t,function(){h(t,function(){t("en")})})}var m={doodle:"WEEX_PLAYGROUND_APP_DOODLE",guide:"WEEX_PLAYGROUND_APP_GUIDE",examples:"WEEX_PLAYGROUND_APP_EXAMPLES",news:"WEEX_PLAYGROUND_APP_NEWS",about:"WEEX_PLAYGROUND_APP_ABOUT"};function x(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};try{a.fetch({url:"http://dotwe.org/query/weex-playground-app",method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},type:"json",body:"name="+t},function(t){t.ok&&t.data&&t.data.success?e(t.data):n(t)})}catch(t){n(t)}}function b(t,e){var n=m[t];n&&e&&"object"===(void 0===e?"undefined":(0,o.default)(e))&&(e.timestamp=Date.now(),u.setItem(n,(0,r.default)(e)))}function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=m[t];if(!r)return n();try{u.getItem(r,function(r){if("success"===r.result){var o=JSON.parse(r.data);if(o&&Array.isArray(o[t]))return e(o[t])}n(r)})}catch(t){n(t)}}e.fetchExamples=function(){for(var t=arguments.length,e=Array(t),n=0;ndocument.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(u.prototype=r(t),n=new u,u.prototype=null,n[a]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(1),o=n(5),i=n(53)(!1),a=n(19)("IE_PROTO");t.exports=function(t,e){var n,u=o(t),c=0,s=[];for(n in u)n!=a&&r(u,n)&&s.push(n);for(;e.length>c;)r(u,n=e[c++])&&(~i(s,n)||s.push(n));return s}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(34),o=n(21).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=i(n(39)),o=i(n(79));function i(t){return t&&t.__esModule?t:{default:t}}Vue.mixin(o.default),r.default.el="#root",new Vue(r.default)},function(t,e,n){var r,o,i=[];i.push(n(40)),r=n(41);var a=n(78);if(o=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(Object.keys(r).some(function(t){return"default"!==t&&"__esModule"!==t})&&console.error("named exports are not supported in *.vue files."),o=r=r.default),"function"==typeof o&&(o=o.options),o.__file="/Users/Hanks/Codes/work/weex-vue-examples/src/pages/About.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o._scopeId="data-v-6a7331ce",o.style=o.style||{},i.forEach(function(t){for(var e in t)o.style[e]=t[e]}),"object"==typeof weex&&weex&&weex.document)try{weex.document.registerStyleSheets(o._scopeId,i)}catch(t){}t.exports=r},function(t,e){t.exports={list:{backgroundColor:"#F5F5F5"},item:{paddingTop:"30",paddingBottom:"30",paddingLeft:"60",paddingRight:"40",borderBottomWidth:"1",borderBottomStyle:"solid",borderBottomColor:"#E6E6E6",backgroundColor:"#FFFFFF",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},"item-1":{borderTopWidth:"1",borderTopStyle:"solid",borderTopColor:"#E6E6E6"},"item-title":{fontSize:"42",color:"#606060"},"item-value":{fontSize:"36",color:"#999999"},"arrow-icon":{width:"22",height:"36"},copyright:{marginTop:"50",paddingBottom:"20"},"copyright-text":{fontSize:"22",color:"#A0A0A0",textAlign:"center"}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(26)),i=n(74),a=(r=i)&&r.__esModule?r:{default:r};var u=weex.requireModule("picker"),c=new BroadcastChannel("language"),s={en:"Follow System",zh:"跟随系统"};e.default={components:{AppInfoCard:a.default},data:function(){return{language:"en",followSystem:!0,navigationBarOptions:{title:{zh:"关于 Weex",en:"About Weex"}},tips:{LANGUAGE:{en:"Language",zh:"语言"}},items:[{title:{en:"Weex Official Website",zh:"Weex 官方网站"},link:{en:"http://weex-project.io/",zh:"http://weex-project.io/cn/"}},{title:{en:"Apache Software Foundation",zh:"Apache 软件基金会"},link:"http://www.apache.org/"},{title:{en:"Who is using Weex",zh:"谁在使用 Weex"},link:{en:"http://weex-project.io/who-is-using-weex.html",zh:"http://weex-project.io/cn/who-is-using-weex.html"}},{title:{en:"Contribution",zh:"参与贡献"},link:{en:"http://weex-project.io/guide/contributing.html",zh:"http://weex-project.io/cn/guide/contributing.html"}},{title:{en:"Release Note",zh:"版本变更"},link:{en:"http://weex-project.io/releasenote.html",zh:"http://weex-project.io/cn/releasenote.html"}},{title:{en:"FAQ",zh:"常见问题"},link:{en:"http://weex-project.io/faq.html",zh:"http://weex-project.io/cn/faq.html"}}]}},watch:{language:function(){this.followSystem||o.setLanguage(this.language),c.postMessage({language:this.language})}},computed:{languageName:function(){return this.followSystem?this.i18n(s):this.i18n({en:"English",zh:"简体中文"})}},created:function(){var t=this;o.readAbout(function(e){t.items=e}),o.getStorageLanguage(function(e){return t.followSystem=!1},function(){return t.followSystem=!0})},methods:{chooseLanguage:function(){var t=this,e=["","en","zh"],n=this.followSystem?0:e.indexOf(this.language);u.pick({index:n,items:[this.i18n(s),"English","中文"]},function(n){var r=n.result,i=n.data;if("success"===r){var a=e[i];a?(t.followSystem=!1,t.language=a):(t.followSystem=!0,o.clearStorageLanguage(),o.getSystemLanguage(function(e){t.language=e},function(e){t.language="en"}))}})}}}},function(t,e,n){t.exports={default:n(43),__esModule:!0}},function(t,e,n){var r=n(8),o=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return o.stringify.apply(o,arguments)}},function(t,e,n){t.exports={default:n(45),__esModule:!0}},function(t,e,n){n(46),n(59),t.exports=n(23).f("iterator")},function(t,e,n){"use strict";var r=n(47)(!0);n(28)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(13),o=n(14);t.exports=function(t){return function(e,n){var i,a,u=String(o(e)),c=r(n),s=u.length;return c<0||c>=s?t?"":void 0:(i=u.charCodeAt(c))<55296||i>56319||c+1===s||(a=u.charCodeAt(c+1))<56320||a>57343?t?u.charAt(c):i:t?u.slice(c,c+2):a-56320+(i-55296<<10)+65536}}},function(t,e,n){var r=n(49);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(33),o=n(11),i=n(22),a={};n(2)(a,n(6)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(3),o=n(9),i=n(18);t.exports=n(4)?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),u=a.length,c=0;u>c;)r.f(t,n=a[c++],e[n]);return t}},function(t,e,n){var r=n(35);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(5),o=n(54),i=n(55);t.exports=function(t){return function(e,n,a){var u,c=r(e),s=o(c.length),f=i(a,s);if(t&&n!=n){for(;s>f;)if((u=c[f++])!=u)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(13),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(13),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(1),o=n(58),i=n(19)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){var r=n(14);t.exports=function(t){return Object(r(t))}},function(t,e,n){n(60);for(var r=n(0),o=n(2),i=n(17),a=n(6)("toStringTag"),u="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(64),__esModule:!0}},function(t,e,n){n(65),n(71),n(72),n(73),t.exports=n(8).Symbol},function(t,e,n){"use strict";var r=n(0),o=n(1),i=n(4),a=n(29),u=n(32),c=n(66).KEY,s=n(10),f=n(20),l=n(22),p=n(12),d=n(6),v=n(23),h=n(24),g=n(67),y=n(68),m=n(9),x=n(7),b=n(5),w=n(16),_=n(11),S=n(33),O=n(69),E=n(70),j=n(3),A=n(18),L=E.f,C=j.f,P=O.f,M=r.Symbol,T=r.JSON,k=T&&T.stringify,F="prototype",D=d("_hidden"),N=d("toPrimitive"),R={}.propertyIsEnumerable,W=f("symbol-registry"),U=f("symbols"),I=f("op-symbols"),G=Object[F],z="function"==typeof M,X=r.QObject,B=!X||!X[F]||!X[F].findChild,V=i&&s(function(){return 7!=S(C({},"a",{get:function(){return C(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=L(G,e);r&&delete G[e],C(t,e,n),r&&t!==G&&C(G,e,r)}:C,q=function(t){var e=U[t]=S(M[F]);return e._k=t,e},J=z&&"symbol"==typeof M.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof M},Y=function(t,e,n){return t===G&&Y(I,e,n),m(t),e=w(e,!0),m(n),o(U,e)?(n.enumerable?(o(t,D)&&t[D][e]&&(t[D][e]=!1),n=S(n,{enumerable:_(0,!1)})):(o(t,D)||C(t,D,_(1,{})),t[D][e]=!0),V(t,e,n)):C(t,e,n)},H=function(t,e){m(t);for(var n,r=g(e=b(e)),o=0,i=r.length;i>o;)Y(t,n=r[o++],e[n]);return t},K=function(t){var e=R.call(this,t=w(t,!0));return!(this===G&&o(U,t)&&!o(I,t))&&(!(e||!o(this,t)||!o(U,t)||o(this,D)&&this[D][t])||e)},$=function(t,e){if(t=b(t),e=w(e,!0),t!==G||!o(U,e)||o(I,e)){var n=L(t,e);return!n||!o(U,e)||o(t,D)&&t[D][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=P(b(t)),r=[],i=0;n.length>i;)o(U,e=n[i++])||e==D||e==c||r.push(e);return r},Z=function(t){for(var e,n=t===G,r=P(n?I:b(t)),i=[],a=0;r.length>a;)!o(U,e=r[a++])||n&&!o(G,e)||i.push(U[e]);return i};z||(u((M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===G&&e.call(I,n),o(this,D)&&o(this[D],t)&&(this[D][t]=!1),V(this,t,_(1,n))};return i&&B&&V(G,t,{configurable:!0,set:e}),q(t)})[F],"toString",function(){return this._k}),E.f=$,j.f=Y,n(37).f=O.f=Q,n(25).f=K,n(36).f=Z,i&&!n(15)&&u(G,"propertyIsEnumerable",K,!0),v.f=function(t){return q(d(t))}),a(a.G+a.W+a.F*!z,{Symbol:M});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)d(tt[et++]);for(var nt=A(d.store),rt=0;nt.length>rt;)h(nt[rt++]);a(a.S+a.F*!z,"Symbol",{for:function(t){return o(W,t+="")?W[t]:W[t]=M(t)},keyFor:function(t){if(!J(t))throw TypeError(t+" is not a symbol!");for(var e in W)if(W[e]===t)return e},useSetter:function(){B=!0},useSimple:function(){B=!1}}),a(a.S+a.F*!z,"Object",{create:function(t,e){return void 0===e?S(t):H(S(t),e)},defineProperty:Y,defineProperties:H,getOwnPropertyDescriptor:$,getOwnPropertyNames:Q,getOwnPropertySymbols:Z}),T&&a(a.S+a.F*(!z||s(function(){var t=M();return"[null]"!=k([t])||"{}"!=k({a:t})||"{}"!=k(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(x(e)||void 0!==t)&&!J(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!J(e))return e}),r[1]=e,k.apply(T,r)}}),M[F][N]||n(2)(M[F],N,M[F].valueOf),l(M,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(12)("meta"),o=n(7),i=n(1),a=n(3).f,u=0,c=Object.isExtensible||function(){return!0},s=!n(10)(function(){return c(Object.preventExtensions({}))}),f=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!c(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!c(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return s&&l.NEED&&c(t)&&!i(t,r)&&f(t),t}}},function(t,e,n){var r=n(18),o=n(36),i=n(25);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,u=n(t),c=i.f,s=0;u.length>s;)c.call(t,a=u[s++])&&e.push(a);return e}},function(t,e,n){var r=n(35);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(5),o=n(37).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(r(t))}},function(t,e,n){var r=n(25),o=n(11),i=n(5),a=n(16),u=n(1),c=n(30),s=Object.getOwnPropertyDescriptor;e.f=n(4)?s:function(t,e){if(t=i(t),e=a(e,!0),c)try{return s(t,e)}catch(t){}if(u(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e){},function(t,e,n){n(24)("asyncIterator")},function(t,e,n){n(24)("observable")},function(t,e,n){var r,o,i=[];i.push(n(75)),r=n(76);var a=n(77);if(o=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(Object.keys(r).some(function(t){return"default"!==t&&"__esModule"!==t})&&console.error("named exports are not supported in *.vue files."),o=r=r.default),"function"==typeof o&&(o=o.options),o.__file="/Users/Hanks/Codes/work/weex-vue-examples/src/components/AppInfoCard.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o._scopeId="data-v-6e3be69f",o.style=o.style||{},i.forEach(function(t){for(var e in t)o.style[e]=t[e]}),"object"==typeof weex&&weex&&weex.document)try{weex.document.registerStyleSheets(o._scopeId,i)}catch(t){}t.exports=r},function(t,e){t.exports={card:{width:"650",justifyContent:"center",borderWidth:"1",borderColor:"#DDDDDD",borderRadius:"20",paddingTop:"50",paddingRight:"50",paddingBottom:"50",paddingLeft:"50",marginTop:"50",marginRight:"50",marginBottom:"50",marginLeft:"50",backgroundColor:"#FFFFFF"},title:{fontSize:"34",textAlign:"center",color:"#808080",marginBottom:"20"},version:{fontSize:"80",textAlign:"center",marginBottom:"30",color:"#323232"},group:{marginTop:"10",flexDirection:"row"},label:{width:"260",fontSize:"32",textAlign:"right",color:"#888888"},value:{width:"230",paddingLeft:"50",fontSize:"32",color:"#414141"}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(27),i=(r=o)&&r.__esModule?r:{default:r};var a="- invalid -";e.default={data:function(){return{version:a,jsfmVersion:a,platform:a,osVersion:a,deviceModel:a}},created:function(){try{this.jsfmVersion=getJSFMVersion()}catch(t){this.jsfmVersion="≤ 0.15.6"}"object"===("undefined"==typeof WXEnvironment?"undefined":(0,i.default)(WXEnvironment))&&(this.version=WXEnvironment.weexVersion||"- - -",this.platform=WXEnvironment.platform||"- - -",this.osVersion=WXEnvironment.osVersion||"- - -",this.deviceModel=WXEnvironment.deviceModel||"- - -")}}},function(t,e){t.exports={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:["card"]},[e("div",{staticClass:["info"]},[e("text",{staticClass:["title"]},[this._v("Weex SDK Version")]),e("text",{staticClass:["version"]},[this._v(this._s(this.version))]),e("div",{staticClass:["group"]},[e("text",{staticClass:["label"]},[this._v("JS Framework")]),e("text",{staticClass:["value"]},[this._v(this._s(this.jsfmVersion))])]),e("div",{staticClass:["group"]},[e("text",{staticClass:["label"]},[this._v("platform")]),e("text",{staticClass:["value"]},[this._v(this._s(this.platform))])]),e("div",{staticClass:["group"]},[e("text",{staticClass:["label"]},[this._v("osVersion")]),e("text",{staticClass:["value"]},[this._v(this._s(this.osVersion))])]),e("div",{staticClass:["group"]},[e("text",{staticClass:["label"]},[this._v("deviceModel")]),e("text",{staticClass:["value"]},[this._v(this._s(this.deviceModel))])])])])},staticRenderFns:[]},t.exports.render._withStripped=!0},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("list",{staticClass:["list"]},[n("cell",{appendAsTree:!0,attrs:{append:"tree"}},[n("app-info-card")],1),t._l(t.items,function(e,r){return n("cell",{key:r,class:["item-cell","item-cell-"+(r+1)],appendAsTree:!0,attrs:{append:"tree"}},[e.link?n("div",{class:["item","item-"+(r+1)],on:{click:function(n){t.jumpTo(e.link,e.title)}}},[n("text",{staticClass:["item-title"]},[t._v(t._s(t.i18n(e.title)))]),n("image",{staticClass:["arrow-icon"],attrs:{src:"https://gw.alicdn.com/tfs/TB1iL2fkLDH8KJjy1XcXXcpdXXa-32-49.png"}})]):t._e()])}),n("cell",{staticClass:["item-cell"],appendAsTree:!0,attrs:{append:"tree"}},[n("div",{staticClass:["item"],on:{click:t.chooseLanguage}},[n("text",{staticClass:["item-title"]},[t._v(t._s(t.i18n(t.tips.LANGUAGE)))]),n("text",{staticClass:["item-value"]},[t._v(t._s(t.languageName))])])]),t._m(0)],2)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("cell",{appendAsTree:!0,attrs:{append:"tree"}},[e("div",{staticClass:["copyright"]},[e("text",{staticClass:["copyright-text"]},[this._v("Copyright(c) 2017 The Apache Software Foundation.")]),e("text",{staticClass:["copyright-text"]},[this._v("Licensed under the Apache License, Version 2.0")])])])}]},t.exports.render._withStripped=!0},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(26));var o=weex.requireModule("storage");e.default={filters:{i18n:r.i18n,url:r.createURL,link:r.createLink},methods:{createLink:r.createLink,createURL:r.createURL,i18n:r.i18n,getLanguage:r.getLanguage,fetchData:r.fetchData,saveData:r.saveData,readData:r.readData,jumpTo:r.jumpTo},created:function(){var t=this;r.getLanguage(function(e){t.language=e,r.setTitleBar(t.navigationBarOptions,e)}),new BroadcastChannel("language").onmessage=function(e){e.data&&e.data.language&&(t.language=e.data.language)}},beforeDestroy:function(){o.removeItem("CURRENT_DOCUMENT_URL"),o.removeItem("CURRENT_SOURCE_HASH")}}}]); \ No newline at end of file diff --git a/ios/playground/bundlejs/examples.weex.js b/ios/playground/bundlejs/examples.weex.js new file mode 100644 index 0000000000..16eae2b352 --- /dev/null +++ b/ios/playground/bundlejs/examples.weex.js @@ -0,0 +1,4 @@ +// { "framework": "Vue" } +"use weex:vue"; + +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=37)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(3),o=n(11);t.exports=n(4)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(9),o=n(29),i=n(17),a=Object.defineProperty;e.f=n(4)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(10)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(52),o=n(15);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(21)("wks"),o=n(12),i=n(0).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fetchNews=e.fetchDoodle=e.readAbout=e.saveAbout=e.fetchAbout=e.readGuide=e.saveGuide=e.fetchGuide=e.readExamples=e.saveExamples=e.fetchExamples=void 0;var r=i(n(41)),o=i(n(43));function i(t){return t&&t.__esModule?t:{default:t}}e.createLink=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];for(var r in e)"string"==typeof e[r]&&n.push(s(r)+"="+s(e[r]));if("Web"===WXEnvironment.platform)return n.unshift("page="+t+".web.js"),"/?"+n.join("&");return""+function(){var t=weex.config.bundleUrl,e=t.indexOf("your_current_IP")>=0||t.indexOf("file://assets/")>=0,n=t.indexOf("file:///")>=0&&t.indexOf("WeexDemo.app")>0;if(e)return"file://assets/";if(n)return t.substring(0,t.lastIndexOf("/")+1);return""}()+t+".weex.js"+(n.length?"?"+n.join("&"):"")},e.createURL=f,e.i18n=l,e.parseLanguage=d,e.setLanguage=function(t){var e=d(t);e&&u.setItem("WEEX_PLAYGROUND_LANGUAGE",e)},e.clearStorageLanguage=function(){u.removeItem("WEEX_PLAYGROUND_LANGUAGE")},e.getStorageLanguage=v,e.getSystemLanguage=g,e.getLanguage=h,e.jumpTo=function(t,e){h(function(n){u.setItem("CURRENT_DOCUMENT_URL",l(t,n)),c.push({url:f("bf0305c14b511b24a4e616f53926432b",{language:n,title:l(e,n)})})})},e.viewSource=function(t){h(function(e){c.push({url:f("0def402b8db7e05d0376bcc7f9c238d3",{hash:t,language:e})})})},e.setTitleBar=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";if("[object Object]"!==Object.prototype.toString.apply(t))return;var n=weex.requireModule("titleBar");if(t.color||t.backgroundColor)try{n.setStyle({foregroundColor:t.color||"#FFFFFF",backgroundColor:t.backgroundColor||"#00B4FF"})}catch(t){}var r=l(t.title,e);if(r)try{n.setTitle(r)}catch(t){}},e.fetchData=b,e.saveData=x,e.readData=_;var a=weex.requireModule("stream"),u=weex.requireModule("storage"),c=weex.requireModule("navigator"),s="function"==typeof encodeURIComponent?encodeURIComponent:"function"==typeof encodeURI?encodeURI:function(t){return t};function f(t,e){if("Web"===WXEnvironment.platform)return"http://dotwe.org/raw/htmlVue/"+t;var n="http://dotwe.org/raw/dist/"+t+".bundle.wx",r=function(t){if(!t||"object"!==(void 0===t?"undefined":(0,o.default)(t)))return"";var e=[];for(var n in t)"string"==typeof t[n]&&e.push(s(n)+"="+s(t[n]));return e.join("&")}(e);return"TB"===WXEnvironment.appName?n+"?_wx_tpl="+n+"&"+r:"WXSample"===WXEnvironment.appName?n+"?"+r:n+"?wx_weex=true&"+r}function l(t,e){return"string"==typeof t?t:"[object Object]"===Object.prototype.toString.call(t)?t[this&&this.language||e||"en"]:void 0}var p=/(en|zh)\_?\w*/i;function d(t){var e=p.exec(t+"");return e&&e[1]?e[1]:""}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if("function"!==!(void 0===t||(0,o.default)(t)))try{u.getItem("WEEX_PLAYGROUND_LANGUAGE",function(n){if("success"===n.result){var r=d(n.data);r?t(r):e()}else e(n)})}catch(t){e(t)}}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if("function"!==!(void 0===t||(0,o.default)(t)))if("web"===WXEnvironment.platform.toLowerCase()){var n=d(window.navigator.language);n?t(n):e()}else try{(weex.requireModule("locale")||weex.requireModule("local")).getLanguage(function(n){var r=d(n);r?t(r):e()})}catch(t){e(t)}}var y=/.+[\?\&]{1}language=([\d\w]+)[\?\&]?.*/i;function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},e=y.exec(weex.config.bundleUrl||""),n=d(e&&e[1]);n?t(n):v(t,function(){g(t,function(){t("en")})})}var m={doodle:"WEEX_PLAYGROUND_APP_DOODLE",guide:"WEEX_PLAYGROUND_APP_GUIDE",examples:"WEEX_PLAYGROUND_APP_EXAMPLES",news:"WEEX_PLAYGROUND_APP_NEWS",about:"WEEX_PLAYGROUND_APP_ABOUT"};function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};try{a.fetch({url:"http://dotwe.org/query/weex-playground-app",method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},type:"json",body:"name="+t},function(t){t.ok&&t.data&&t.data.success?e(t.data):n(t)})}catch(t){n(t)}}function x(t,e){var n=m[t];n&&e&&"object"===(void 0===e?"undefined":(0,o.default)(e))&&(e.timestamp=Date.now(),u.setItem(n,(0,r.default)(e)))}function _(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=m[t];if(!r)return n();try{u.getItem(r,function(r){if("success"===r.result){var o=JSON.parse(r.data);if(o&&Array.isArray(o[t]))return e(o[t])}n(r)})}catch(t){n(t)}}e.fetchExamples=function(){for(var t=arguments.length,e=Array(t),n=0;n0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!0},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports={}},function(t,e,n){var r=n(33),o=n(22);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(21)("keys"),o=n(12);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(3).f,o=n(1),i=n(6)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){e.f=n(6)},function(t,e,n){var r=n(0),o=n(8),i=n(16),a=n(24),u=n(3).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";var r=n(16),o=n(28),i=n(31),a=n(2),u=n(1),c=n(18),s=n(50),f=n(23),l=n(57),p=n(6)("iterator"),d=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,e,n,g,y,h,m){s(n,e,g);var b,x,_,w=function(t){if(!d&&t in A)return A[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",O="values"==y,E=!1,A=t.prototype,C=A[p]||A["@@iterator"]||y&&A[y],j=!d&&C||w(y),L=y?O?w("entries"):j:void 0,T="Array"==e?A.entries||C:C;if(T&&(_=l(T.call(new t)))!==Object.prototype&&_.next&&(f(_,S,!0),r||u(_,p)||a(_,p,v)),O&&C&&"values"!==C.name&&(E=!0,j=function(){return C.call(this)}),r&&!m||!d&&!E&&A[p]||a(A,p,j),c[e]=j,c[S]=v,y)if(b={values:O?j:w("values"),keys:h?j:w("keys"),entries:L},m)for(x in b)x in A||i(A,x,b[x]);else o(o.P+o.F*(d||E),e,b);return b}},function(t,e,n){var r=n(0),o=n(8),i=n(48),a=n(2),u="prototype",c=function(t,e,n){var s,f,l,p=t&c.F,d=t&c.G,v=t&c.S,g=t&c.P,y=t&c.B,h=t&c.W,m=d?o:o[e]||(o[e]={}),b=m[u],x=d?r:v?r[e]:(r[e]||{})[u];d&&(n=e);for(s in n)(f=!p&&x&&void 0!==x[s])&&s in m||(l=f?x[s]:n[s],m[s]=d&&"function"!=typeof x[s]?n[s]:y&&f?i(l,r):h&&x[s]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[u]=t[u],e}(l):g&&"function"==typeof l?i(Function.call,l):l,g&&((m.virtual||(m.virtual={}))[s]=l,t&c.R&&b&&!b[s]&&a(b,s,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){t.exports=!n(4)&&!n(10)(function(){return 7!=Object.defineProperty(n(30)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(7),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){t.exports=n(2)},function(t,e,n){var r=n(9),o=n(51),i=n(22),a=n(20)("IE_PROTO"),u=function(){},c=function(){var t,e=n(30)("iframe"),r=i.length;for(e.style.display="none",n(56).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("