You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2017/01/24 08:18:16 UTC
[01/50] [abbrv] incubator-weex git commit: * [doc] upgrade to latest
version of gitbook
Repository: incubator-weex
Updated Branches:
refs/heads/master a277cf7f1 -> 9ca297a31
* [doc] upgrade to latest version of gitbook
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/50452956
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/50452956
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/50452956
Branch: refs/heads/master
Commit: 504529568e250b8b5b9125539eeee74440313211
Parents: dd9fe6e
Author: lvscar <lv...@gmail.com>
Authored: Thu May 19 18:19:18 2016 +0800
Committer: lvscar <lv...@gmail.com>
Committed: Thu May 19 18:19:18 2016 +0800
----------------------------------------------------------------------
doc/SUMMARY.md | 28 +++++-----
doc/_layouts/website/languages.html | 2 +-
doc/_layouts/website/page.html | 89 +++++++++++-------------------
doc/_layouts/website/summary.html | 61 ++++++++++----------
doc/_layouts/website/weex_header.html | 24 ++++++++
5 files changed, 100 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/50452956/doc/SUMMARY.md
----------------------------------------------------------------------
diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md
index eaf87cd..5aa7055 100644
--- a/doc/SUMMARY.md
+++ b/doc/SUMMARY.md
@@ -32,20 +32,20 @@
* [Text Style](/references/text-style.md)
* [Common Event](/references/common-event.md)
* [Special Element](/components/special-element.md)
- * [<div>](/components/div.md)
- * [<scroller>](/components/scroller.md)
- * [<list>](/components/list.md)
- * [<cell>](/components/cell.md)
- * [<text>](/components/text.md)
- * [<image>](/components/image.md)
- * [<input>](/components/input.md)
- * [<switch>](/components/switch.md)
- * [<slider>](/components/slider.md)
- * [<indicator>](/components/indicator.md)
- * [<video>](/components/video.md)
- * [<a>](/components/a.md)
- * [<web>](/components/web.md)
- * [<wxc-tabbar>](/components/wxc-tabbar.md)
+ * [div](/components/div.md)
+ * [scroller](/components/scroller.md)
+ * [list](/components/list.md)
+ * [cell](/components/cell.md)
+ * [text](/components/text.md)
+ * [image](/components/image.md)
+ * [input](/components/input.md)
+ * [switch](/components/switch.md)
+ * [slider](/components/slider.md)
+ * [indicator](/components/indicator.md)
+ * [video](/components/video.md)
+ * [a](/components/a.md)
+ * [web](/components/web.md)
+ * [wxc-tabbar](/components/wxc-tabbar.md)
* [Built-in Modules](/modules/README.md)
* [dom](/modules/dom.md)
* [steam](/modules/stream.md)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/50452956/doc/_layouts/website/languages.html
----------------------------------------------------------------------
diff --git a/doc/_layouts/website/languages.html b/doc/_layouts/website/languages.html
index 1af8ca2..a9d43be 100644
--- a/doc/_layouts/website/languages.html
+++ b/doc/_layouts/website/languages.html
@@ -10,7 +10,7 @@
<ul class="languages">
{% for lang in languages.list %}
<li>
- <a href="../{{ lang.id }}/">{{ lang.title }}</a>
+ <a href="{{ (lang.id + "/README.md")|contentURL }}">{{ lang.title }}</a>
</li>
{% endfor %}
</ul>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/50452956/doc/_layouts/website/page.html
----------------------------------------------------------------------
diff --git a/doc/_layouts/website/page.html b/doc/_layouts/website/page.html
index f32ec08..fa288af 100644
--- a/doc/_layouts/website/page.html
+++ b/doc/_layouts/website/page.html
@@ -12,17 +12,14 @@
{% if page.previous and page.previous.path %}
<link rel="prev" href="{{ page.previous.path|resolveFile }}" />
{% endif %}
- <link rel="stylesheet" href="http://alibaba.github.io/weex/css/site.css">
- <!--
- <link rel="stylesheet" href="http://127.0.0.1/taobao/weex/docs/ali_addition/weex_doc.css">
- -->
+
<link rel="stylesheet" href="http://alibaba.github.io/weex/css/weex_doc.css" >
<link rel="icon" type="image/x-icon" href="http://alibaba.github.io/weex/img/favicon.ico">
-
{% endblock %}
{% block javascript %}
- <script src="{{ "app.js"|resolveAsset }}"></script>
+ <script src="{{ "gitbook.js"|resolveAsset }}"></script>
+ <script src="{{ "theme.js"|resolveAsset }}"></script>
{% for resource in plugins.resources.js %}
{% if resource.url %}
<script src="{{ resource.url }}"></script>
@@ -30,58 +27,25 @@
<script src="{{ resource.path|resolveAsset }}"></script>
{% endif %}
{% endfor %}
- <script>
- require(["gitbook"], function(gitbook) {
- gitbook.start({{ config.pluginsConfig|dump|safe }});
- });
- </script>
-
-
{% endblock %}
{% block body %}
-<div class="book"
- data-level="{{ page.level }}"
- data-chapter-title="{{ page.title }}"
- data-filepath="{{ file.path }}"
- data-basepath="{{ './'|resolveFile }}"
- data-revision="{{ gitbook.time }}"
- data-innerlanguage="{{ innerlanguage }}">
-
- <div class="weex-doc-header">
- <div class="top-bar">
- <div class="top-bar-title"></div>
- <div class="top-bar-left">
- <ul class="menu" role="menubar" >
- <li role="menuitem">
- <a href='http://alibaba.github.io/weex/index.html'>Weex</a>
- </li>
- <li role="menuitem">
- Docs
- </li>
- <li role="menuitem">
- <a href='http://alibaba.github.io/weex/demo.html'>Demo</a>
- </li>
- <li role="menuitem">
- </li>
- <li role="menuitem" >
- <a href="http://alibaba.github.io/weex/community.html">Community</a>
- </li>
- </ul>
- </div>
- <div class="top-bar-right">
- <ul class="menu">
- <li><a href="https://github.com/alibaba/weex/">Github</a>
- </li>
- </ul>
- </div>
- </div>
- </div>
+<div class="book">
- {% include "website/summary.html" %}
+ {% include "website/weex_header.html" %}
+
+ <div class="book-summary">
+ {% block book_sidebar %}
+ {% block search_input %}{% endblock %}
+ {% block book_summary %}
+ <nav role="navigation">
+ {% include "website/summary.html" %}
+ </nav>
+ {% endblock %}
+ {% endblock %}
+ </div>
<div class="book-body">
-
{% block book_body %}
<div class="body-inner">
{% block book_inner %}
@@ -89,11 +53,13 @@
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
- <section class="normal markdown-section">
- {% block page %}
- {{ page.content|safe }}
+ {% block search_results %}
+ <section class="normal markdown-section">
+ {% block page %}
+ {{ page.content|safe }}
+ {% endblock %}
+ </section>
{% endblock %}
- </section>
</div>
</div>
{% endblock %}
@@ -101,17 +67,24 @@
{% block book_navigation %}
{% if page.previous and page.previous.path %}
- <a href="{{ page.previous.path|resolveFile }}" class="navigation navigation-prev {% if not (page.next and page.next.path) %}navigation-unique{% endif %}" aria-label="Previous page: {{ page.previous.title }}">
+ <a href="{{ page.previous.path|resolveFile }}{{ page.previous.anchor }}" class="navigation navigation-prev {% if not (page.next and page.next.path) %}navigation-unique{% endif %}" aria-label="Previous page: {{ page.previous.title }}">
<i class="fa fa-angle-left"></i>
</a>
{% endif %}
{% if page.next and page.next.path %}
- <a href="{{ page.next.path|resolveFile }}" class="navigation navigation-next {% if not (page.previous and page.previous.path) %}navigation-unique{% endif %}" aria-label="Next page: {{ page.next.title }}">
+ <a href="{{ page.next.path|resolveFile }}{{ page.next.anchor }}" class="navigation navigation-next {% if not (page.previous and page.previous.path) %}navigation-unique{% endif %}" aria-label="Next page: {{ page.next.title }}">
<i class="fa fa-angle-right"></i>
</a>
{% endif %}
{% endblock %}
{% endblock %}
</div>
+
+ <script>
+ var gitbook = gitbook || [];
+ gitbook.push(function() {
+ gitbook.page.hasChanged({{ template.getJSContext()|dump|safe }});
+ });
+ </script>
</div>
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/50452956/doc/_layouts/website/summary.html
----------------------------------------------------------------------
diff --git a/doc/_layouts/website/summary.html b/doc/_layouts/website/summary.html
index 3169d22..0c6f967 100644
--- a/doc/_layouts/website/summary.html
+++ b/doc/_layouts/website/summary.html
@@ -8,7 +8,7 @@
{% else %}
<span>
{% endif %}
- {% if article.level != "0" %}
+ {% if article.level != "0" and config.pluginsConfig['theme-default'].showLevel %}
<b>{{ article.level }}.</b>
{% endif %}
{{ article.title }}
@@ -20,43 +20,42 @@
{% if article.articles.length > 0 %}
<ul class="articles">
- {{ articles(article.articles) }}
+ {{ articles(article.articles, file, config) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}
-<div class="book-summary">
- {% block book_summary %}
- <nav role="navigation">
- <ul class="summary">
- {% set _divider = false %}
- {% if config.links.sidebar %}
- {% for linkTitle, link in config.links.sidebar %}
- {% set _divider = true %}
- <li>
- <a href="{{ link }}" target="_blank" class="custom-link">{{ linkTitle }}</a>
- </li>
- {% endfor %}
- {% endif %}
+<ul class="summary">
+ {% set _divider = false %}
+ {% if config.links.sidebar %}
+ {% for linkTitle, link in config.links.sidebar %}
+ {% set _divider = true %}
+ <li>
+ <a href="{{ link }}" target="_blank" class="custom-link">{{ linkTitle }}</a>
+ </li>
+ {% endfor %}
+ {% endif %}
- {% if _divider %}
- <li class="divider"></li>
- {% endif %}
+ {% if _divider %}
+ <li class="divider"></li>
+ {% endif %}
+ {% for part in summary.parts %}
+ {% if part.title %}
+ <li class="header">{{ part.title }}</li>
+ {% elif not loop.first %}
+ <li class="divider"></li>
+ {% endif %}
+ {{ articles(part.articles, file, config) }}
+ {% endfor %}
- {% for part in summary.parts %}
- {{ articles(part.articles) }}
- <li class="divider"></li>
- {% endfor %}
+ <li class="divider"></li>
- <li>
- <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
- {{ "GITBOOK_LINK"|t }}
- </a>
- </li>
- </ul>
- </nav>
- {% endblock %}
-</div>
\ No newline at end of file
+ <li>
+ <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
+ {{ "GITBOOK_LINK"|t }}
+ </a>
+ </li>
+</ul>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/50452956/doc/_layouts/website/weex_header.html
----------------------------------------------------------------------
diff --git a/doc/_layouts/website/weex_header.html b/doc/_layouts/website/weex_header.html
new file mode 100644
index 0000000..e716199
--- /dev/null
+++ b/doc/_layouts/website/weex_header.html
@@ -0,0 +1,24 @@
+<div class="weex-doc-header">
+ <div class="top-bar">
+ <div class="top-bar-title" onclick="location='http://weex.alibaba-inc.com/en-site/'" ></div>
+ <div class="top-bar-left">
+ <ul class="menu" role="menubar" >
+ <li role="menuitem">
+ <a href='http://weex.alibaba-inc.com/en-site/demo.html'>Showcase</a>
+ </li>
+ <li role="menuitem" >
+ <a href="http://weex.alibaba-inc.com/en-site/download.html">Download</a>
+ </li>
+ </ul>
+ </div>
+ <div class="top-bar-right">
+ <ul class="menu">
+ <li>
+ <a href="http://gitlab.alibaba-inc.com/groups/weex/">
+ <img class='github' src='http://weex.alibaba-inc.com/en-site/img/github.png' alt='github' > </a>
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+
[50/50] [abbrv] incubator-weex git commit: * [ios] add UITest target
pod file
Posted by ji...@apache.org.
* [ios] add UITest target pod file
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9ca297a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9ca297a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9ca297a3
Branch: refs/heads/master
Commit: 9ca297a3189e9fb5db84729a38007835072be405
Parents: 51653ea
Author: acton393 <zh...@gmail.com>
Authored: Tue Jun 14 11:01:31 2016 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Jun 14 11:01:31 2016 +0800
----------------------------------------------------------------------
ios/playground/Podfile | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9ca297a3/ios/playground/Podfile
----------------------------------------------------------------------
diff --git a/ios/playground/Podfile b/ios/playground/Podfile
index f46aeeb..c981d67 100644
--- a/ios/playground/Podfile
+++ b/ios/playground/Podfile
@@ -9,3 +9,10 @@ target 'WeexDemo' do
pod 'ATSDK-Weex', '0.0.1'
end
+target 'WeexUITestDemo' do
+ pod 'WeexSDK', :path=>'../sdk/'
+ pod 'SDWebImage', '3.7.5'
+ pod 'SocketRocket', '0.4.2'
+ pod 'ATSDK-Weex', '0.0.1'
+end
+
[05/50] [abbrv] incubator-weex git commit: Doc mention camelcase
(#348)
Posted by ji...@apache.org.
Doc mention camelcase (#348)
* * [doc] test synax highlight
* * [doc] add kebab case suggestion
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d77c0d0d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d77c0d0d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d77c0d0d
Branch: refs/heads/master
Commit: d77c0d0d0389db9893c57601aed96404f62cb63d
Parents: 32847dc
Author: lvs(zikuan.ly) <lv...@gmail.com>
Authored: Thu May 26 20:35:03 2016 +0800
Committer: luics <lu...@gmail.com>
Committed: Thu May 26 20:35:03 2016 +0800
----------------------------------------------------------------------
doc/demo/hello-world.md | 2 +-
doc/references/common-attrs.md | 4 ++++
doc/syntax/data-binding.md | 16 ++++++++--------
doc/syntax/main.md | 4 ++++
4 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/demo/hello-world.md
----------------------------------------------------------------------
diff --git a/doc/demo/hello-world.md b/doc/demo/hello-world.md
index e315464..dab5329 100644
--- a/doc/demo/hello-world.md
+++ b/doc/demo/hello-world.md
@@ -6,7 +6,7 @@ Weex Hello World
## weex code
hello_world.we
-```
+```html
<template>
<div>
<text>Hello World</text>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/references/common-attrs.md
----------------------------------------------------------------------
diff --git a/doc/references/common-attrs.md b/doc/references/common-attrs.md
index c38f586..639cea1 100644
--- a/doc/references/common-attrs.md
+++ b/doc/references/common-attrs.md
@@ -73,3 +73,7 @@ onappear="loadMore"
register event handlers on weex tag
[more information](../syntax/events.md)
+
+### Notes!
+weex is basically following [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute) naming rule , so please **do not use CamelCase** in your attribute , **kebab-case** with \u201c-\u201d as delimiter is much better.
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/syntax/data-binding.md
----------------------------------------------------------------------
diff --git a/doc/syntax/data-binding.md b/doc/syntax/data-binding.md
index e36f872..e9cb967 100644
--- a/doc/syntax/data-binding.md
+++ b/doc/syntax/data-binding.md
@@ -4,7 +4,7 @@ In Weex, we use the *mustache* syntax `{{...}}` to bind data in `<template>` whi
## Binding data path
-```
+```html
<template>
<container>
<text style="font-size: {{size}}">{{title}}</text>
@@ -25,7 +25,7 @@ The code above will bind the `title` and `size` data field to `template`.
We can also use `.` syntax to bind cascading data structure. Let's look at the following code snippet:
-```
+```html
<template>
<container>
<text style="font-size: {{title.size}}">{{title.value}}</text>
@@ -48,7 +48,7 @@ We can also use `.` syntax to bind cascading data structure. Let's look at the f
Inside data bindings, Weex supports simply javascript expressions, e.g.
-```
+```html
<template>
<container style="flex-direction: row;">
<text>{{firstName + ' ' + lastName}}</text>
@@ -74,7 +74,7 @@ The expression will be evaluated in the data scope of current context.
According to simple operations, in-template expressions are very convenient. But if you want to put more logic into the template, you should use a computed property.
e.g.
-```
+```html
<template>
<container style="flex-direction: row;">
<text>{{fullName}}</text>
@@ -122,7 +122,7 @@ Otherwise when you call `changeName` after click, the setter will be invoked and
the style of a component can be bind using the `style` attribute:
-```
+```html
<template>
<text style="font-size: {{size}}; color: {{color}}; ...">...</text>
</template>
@@ -130,7 +130,7 @@ the style of a component can be bind using the `style` attribute:
while style can also get bound with `class` attribute, multiple classnames can be split by spaces:
-```
+```html
<template>
<container>
<text class="{{size}}"></text>
@@ -147,7 +147,7 @@ here if `{{size}}` and `{{status}}` have empty value, then only `class="title"`
The event handler is an attribute which name has a prefix `on...`. The other part of attribute name is event type and the value is event handler name. We don't need to add mustache around the method name or add parentheses to call it.
-```
+```html
<template>
<text onclick="toggle">Toggle</text>
</template>
@@ -167,7 +167,7 @@ The event handler is an attribute which name has a prefix `on...`. The other par
`if` attribute can control the display of a component by a truthy/falsy value.
-```
+```html
<template>
<container style="flex-direction: column;">
<text onclick="toggle">Toggle</text>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/syntax/main.md
----------------------------------------------------------------------
diff --git a/doc/syntax/main.md b/doc/syntax/main.md
index b5150f8..229864b 100644
--- a/doc/syntax/main.md
+++ b/doc/syntax/main.md
@@ -70,6 +70,10 @@ Both the two `text` components above have the same `font-size`, which is `64` pi
* [See common styles in Weex](../references/common-style.md)
+
+### Notes!
+weex is basically following [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute) naming rule , so please **do not use CamelCase** in your attribute , **long-name** with \u201c-\u201d as delimiter is much better.
+
## `<script>`
The syntax is JavaScript (ES5) and it describes data and behavior of a Weex page. Here we create three paragraphs:
[33/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/calculator.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/calculator.js b/ios/playground/bundlejs/showcase/calculator.js
new file mode 100644
index 0000000..d87e4dd
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/calculator.js
@@ -0,0 +1,1485 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/70765ef005f962901c201ee23e67ecca", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ var OP = ['+', '-', '*', '/'];
+ var inputs = [];
+ __weex_module__.exports = {
+ data: function () {return {
+ result: ''
+ }},
+ methods: {
+ input: function(e) {
+ var value = e.target.attr['value'];
+ var lastOne = inputs.length ? inputs[inputs.length - 1] : '';
+ if (OP.indexOf(lastOne) > -1 && OP.indexOf(value) > -1) {
+ return;
+ }
+
+ inputs.push(value);
+ var buf = [], char;
+ for (var i = 0; i < inputs.length; i++) {
+ char = inputs[i];
+ if (OP.indexOf(char) > -1) {
+ char = ' ' + char + ' ';
+ }
+ buf.push(char);
+ }
+ this.result = buf.join('');
+ },
+ calculate: function() {
+ var result = eval(this.result);
+ inputs = [result];
+ this.result = result;
+ },
+ clear: function() {
+ inputs = [];
+ this.result = '';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "padding": 5
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "result"
+ ],
+ "attr": {
+ "value": function () {return this.result}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "1"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "2"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "3"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn",
+ "btn-operator"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "+"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "4"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "5"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "6"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn",
+ "btn-operator"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "-"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "7"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "8"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "9"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn",
+ "btn-operator"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "*"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "0"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "input"
+ },
+ "attr": {
+ "value": "."
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn"
+ ],
+ "events": {
+ "click": "clear"
+ },
+ "attr": {
+ "value": "AC"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "btn",
+ "btn-operator"
+ ],
+ "events": {
+ "click": "calculate"
+ },
+ "attr": {
+ "value": "="
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "row": {
+ "flexDirection": "row"
+ },
+ "result": {
+ "textAlign": "right",
+ "backgroundColor": "#666666",
+ "fontSize": 40,
+ "color": "#FFFFFF",
+ "height": 100,
+ "padding": 30,
+ "margin": 5
+ },
+ "btn": {
+ "flex": 1,
+ "textAlign": "center",
+ "backgroundColor": "#eeeeee",
+ "fontSize": 36,
+ "height": 100,
+ "padding": 30,
+ "margin": 5
+ },
+ "btn-operator": {
+ "backgroundColor": "#666699",
+ "fontSize": 40,
+ "color": "#FFFFFF"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/70765ef005f962901c201ee23e67ecca", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/banner.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/banner.js b/ios/playground/bundlejs/showcase/new-fashion/banner.js
new file mode 100644
index 0000000..c02c298
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/banner.js
@@ -0,0 +1,92 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/182cfd86f4ae8de2b3d0ea308cf05b5f", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/182cfd86f4ae8de2b3d0ea308cf05b5f", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/banners.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/banners.js b/ios/playground/bundlejs/showcase/new-fashion/banners.js
new file mode 100644
index 0000000..2a88fa2
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/banners.js
@@ -0,0 +1,188 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/b7cd3d95d7e22a543af40cfb7441e8c6", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ space: 0,
+ width: 0,
+ height: 0,
+ spmc:0,
+ spmdprefix:'',
+ ds: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ var ds = self.ds;
+ var length = ds.length;
+ for (var i = 0; i < length; i++) {
+ var item = ds[i];
+ item.index = i;
+ item.space = (i % length === 0) ? 0 : self.space;
+ }
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='row'},
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginLeft": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='column'},
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginTop": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/b7cd3d95d7e22a543af40cfb7441e8c6", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/brand.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/brand.js b/ios/playground/bundlejs/showcase/new-fashion/brand.js
new file mode 100644
index 0000000..6e32ebc
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/brand.js
@@ -0,0 +1,278 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/c913f50614100cbae8ac0e99f5f32376", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(18);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_742: 742,
+ NUMBER_230: 230,
+ NUMBER_4: 4
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self._randomBrand();
+ },
+ _randomBrand: function () {
+ var self = this;
+ var bannerItems = self.ds.bannerItems;
+ bannerItems = bannerItems.sort(function(){
+ return Math.random()-0.5;
+ });
+ self.bannerItems = bannerItems.slice(0,8);
+ for(var i=0;i<bannerItems.length;i++){
+ var item = bannerItems[i];
+ if(i%2===0){
+ item.img = item.leftImg;
+ item.url = item.rightUrl;
+ }else{
+ item.img = item.rightImg;
+ item.url = item.rightUrl;
+ }
+ }
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "classList": [
+ "container"
+ ],
+ "children": [
+ {
+ "type": "image",
+ "shown": function () {return this.ds.floorTitle},
+ "classList": [
+ "title"
+ ],
+ "attr": {
+ "src": function () {return this.ds.floorTitle}
+ }
+ },
+ {
+ "type": "container",
+ "style": {
+ "marginLeft": 4,
+ "marginRight": 4
+ },
+ "children": [
+ {
+ "type": "banners",
+ "attr": {
+ "ds": function () {return this.bannerItems},
+ "direction": "column",
+ "width": function () {return this.NUMBER_742},
+ "height": function () {return this.NUMBER_230},
+ "space": function () {return this.NUMBER_4}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ },
+ "container": {
+ "marginBottom": 4,
+ "backgroundColor": "#C0BABC"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/c913f50614100cbae8ac0e99f5f32376", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ },
+
+/***/ 18:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/banners", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ space: 0,
+ width: 0,
+ height: 0,
+ spmc:0,
+ spmdprefix:'',
+ ds: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ var ds = self.ds;
+ var length = ds.length;
+ for (var i = 0; i < length; i++) {
+ var item = ds[i];
+ item.index = i;
+ item.space = (i % length === 0) ? 0 : self.space;
+ }
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='row'},
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginLeft": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='column'},
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginTop": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/category.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/category.js b/ios/playground/bundlejs/showcase/new-fashion/category.js
new file mode 100644
index 0000000..2d28e84
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/category.js
@@ -0,0 +1,750 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/5431263137f2dd27df2998658c228e48", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_248: 248,
+ NUMBER_155: 155,
+ NUMBER_373: 373,
+ NUMBER_237: 237,
+ NUMBER_186: 186,
+ NUMBER_208: 208,
+ NUMBER_750: 750,
+ subItemBg: '//gw.alicdn.com/tps/TB1QzUfLVXXXXaOXVXXXXXXXXXX-248-86.jpg',
+ items: [],
+ subItems: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self._loadData();
+ },
+
+ _loadData: function () {
+ var self = this;
+ var content = {
+ "main": [{
+ "shopList": [{
+ "id": "619123122",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1Cl5MLVXXXXXTaXXXSutbFXXX.jpg",
+ "finalScore": "0.884765209440857",
+ "shopUrl": "http://liangpinpuzi.tmall.com/campaign-3735-7.htm",
+ "entityType": "SHOP",
+ "brandId": "7724367"
+ }, {
+ "id": "880734502",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1HN2XLVXXXXbkXFXXSutbFXXX.jpg",
+ "finalScore": "0.8822246866512714",
+ "shopUrl": "http://sanzhisongshu.tmall.com/campaign-3735-7.htm",
+ "entityType": "SHOP",
+ "brandId": "147280915"
+ }, {
+ "id": "392147177",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1yq6dLVXXXXbXXpXXSutbFXXX.jpg",
+ "finalScore": "0.8805854724243631",
+ "shopUrl": "http://zhouheiya.tmall.com/campaign-3735-6.htm",
+ "entityType": "SHOP",
+ "brandId": "111496"
+ }, {
+ "id": "2081058060",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1w4jxLVXXXXaxXXXXtKXbFXXX.gif",
+ "finalScore": "0.8640439551049249",
+ "shopUrl": "http://rongxintang.tmall.com/campaign-3735-6.htm",
+ "entityType": "SHOP",
+ "brandId": "8709890"
+ }],
+ "finalScore": "4.657333333333334",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#fff5a3",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/newfood?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_12_735362&pos=1",
+ "leftBannerImg": "http://img.alicdn.com/tps/i1/TB1LHh4MXXXXXbsXpXXeWjm2pXX-750-240.jpg",
+ "_pos_": "1",
+ "industryBenefit": null,
+ "industryId": "12",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i4/TB1wshUMXXXXXXaXVXXeWjm2pXX-750-240.jpg"
+ }, {
+ "shopList": [{
+ "id": "520557274",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1aMjXLVXXXXbUaXXXSutbFXXX.jpg",
+ "finalScore": "0.8986382989845325",
+ "shopUrl": "http://newbalance.tmall.com/campaign-3735-20.htm",
+ "entityType": "SHOP",
+ "brandId": "20584"
+ }, {
+ "id": "746866993",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1pXG9LVXXXXaLXFXXSutbFXXX.jpg",
+ "finalScore": "0.8917855242977327",
+ "shopUrl": "http://vans.tmall.com/campaign-3735-19.htm",
+ "entityType": "SHOP",
+ "brandId": "29529"
+ }, {
+ "id": "1612713147",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1jHfXLVXXXXXPXFXXSutbFXXX.jpg",
+ "finalScore": "0.8895943606442631",
+ "shopUrl": "http://dcshoecousa.tmall.com/campaign-3735-8.htm",
+ "entityType": "SHOP",
+ "brandId": "3851662"
+ }, {
+ "id": "2379251418",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1sbLlLVXXXXbeXXXXSutbFXXX.jpg",
+ "finalScore": "0.8881539668874383",
+ "shopUrl": "http://baijinydhw.tmall.com/campaign-3735-2.htm",
+ "entityType": "SHOP",
+ "brandId": "20579"
+ }],
+ "finalScore": "4.545333333333334",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#cbdbfe",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/ydhw?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_8_735362&pos=2",
+ "leftBannerImg": "http://img.alicdn.com/tps/i3/TB1h4kzLVXXXXawXpXXeWjm2pXX-750-240.jpg",
+ "_pos_": "2",
+ "industryBenefit": null,
+ "industryId": "8",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i4/TB19VMjLVXXXXaeaXXXeWjm2pXX-750-240.jpg"
+ }, {
+ "shopList": [{
+ "id": "811383091",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1q49ZLVXXXXaJXVXXSutbFXXX.jpg",
+ "finalScore": "0.8723682716749482",
+ "shopUrl": "http://tongrentangbj.tmall.com/campaign-3735-9.htm",
+ "entityType": "SHOP",
+ "brandId": "44652"
+ }, {
+ "id": "838914626",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1GQYbLVXXXXaXXVXXSutbFXXX.jpg",
+ "finalScore": "0.5027131908086584",
+ "shopUrl": "http://jouo.tmall.com/campaign-3735-3.htm",
+ "entityType": "SHOP",
+ "brandId": "14170081"
+ }, {
+ "id": "1077716829",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1rdW2LVXXXXagapXXSutbFXXX.jpg",
+ "finalScore": "0.5015387557024262",
+ "shopUrl": "http://wetcode.tmall.com/campaign-3735-14.htm",
+ "entityType": "SHOP",
+ "brandId": "3675642"
+ }, {
+ "id": "1664976033",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1Q.rpLVXXXXXiXpXXSutbFXXX.jpg",
+ "finalScore": "0.5014897109669442",
+ "shopUrl": "http://hanhoohzp.tmall.com/campaign-3735-17.htm",
+ "entityType": "SHOP",
+ "brandId": "78888695"
+ }],
+ "finalScore": "4.526666666666666",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#ffd1b6",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/getbeauty?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_2_735362&pos=3",
+ "leftBannerImg": "http://img.alicdn.com/tps/i4/TB1Djt9MXXXXXanXXXXeWjm2pXX-750-240.jpg",
+ "_pos_": "3",
+ "industryBenefit": null,
+ "industryId": "2",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i3/TB1_gVQMXXXXXX9XVXXeWjm2pXX-750-240.jpg"
+ }, {
+ "shopList": [{
+ "id": "2153169655",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1nlK7LVXXXXaRXFXXSutbFXXX.jpg",
+ "finalScore": "0.8820210808835905",
+ "shopUrl": "http://ctkicks.tmall.com/campaign-3735-15.htm",
+ "entityType": "SHOP",
+ "brandId": "20584"
+ }, {
+ "id": "2784101115",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1RrS.LVXXXXcrXpXXSutbFXXX.jpg",
+ "finalScore": "0.5930383227012586",
+ "shopUrl": "http://tomtailor.tmall.com/campaign-3735-0.htm",
+ "entityType": "SHOP",
+ "brandId": "213474060"
+ }, {
+ "id": "2183813726",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1kmS_LVXXXXaBaXXXSutbFXXX.jpg",
+ "finalScore": "0.5882558957771681",
+ "shopUrl": "http://huaiyuan.tmall.com/campaign-3735-5.htm",
+ "entityType": "SHOP",
+ "brandId": "29465"
+ }, {
+ "id": "1785908005",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1dB6zLVXXXXcJXXXXSutbFXXX.jpg",
+ "finalScore": "0.5694211862124341",
+ "shopUrl": "http://axonus.tmall.com/campaign-3735-1.htm",
+ "entityType": "SHOP",
+ "brandId": "115035841"
+ }],
+ "finalScore": "4.413955555555555",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#b9eaf2",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/guojixfs?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_1_735362&pos=4",
+ "leftBannerImg": "http://img.alicdn.com/tps/i3/TB1_T7ALVXXXXXOXXXXeWjm2pXX-750-240.jpg",
+ "_pos_": "4",
+ "industryBenefit": null,
+ "industryId": "1",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i2/TB1s7koLVXXXXafXFXXeWjm2pXX-750-240.jpg"
+ }, {
+ "shopList": [{
+ "id": "2453054335",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1RX_vLVXXXXchXpXXSutbFXXX.jpg",
+ "finalScore": "0.8463447899590267",
+ "shopUrl": "http://nanshizixing.tmall.com/campaign-3735-2.htm",
+ "entityType": "SHOP",
+ "brandId": "844502560"
+ }, {
+ "id": "1041773234",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1Q7jpLVXXXXX8XpXXSutbFXXX.jpg",
+ "finalScore": "0.560952734503075",
+ "shopUrl": "http://dapu.tmall.com/campaign-3735-8.htm",
+ "entityType": "SHOP",
+ "brandId": "14493763"
+ }, {
+ "id": "300031438",
+ "picUrl": "//img.alicdn.com/tps/i1/TB13VC4LVXXXXarXVXXSutbFXXX.jpg",
+ "finalScore": "0.5450674634839442",
+ "shopUrl": "http://kangerxin.tmall.com/campaign-3735-10.htm",
+ "entityType": "SHOP",
+ "brandId": "3781905"
+ }, {
+ "id": "92042735",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1PxYcLVXXXXasaXXXSutbFXXX.jpg",
+ "finalScore": "0.5448023228053981",
+ "shopUrl": "http://shuixing.tmall.com/campaign-3735-10.htm",
+ "entityType": "SHOP",
+ "brandId": "3685660"
+ }],
+ "finalScore": "4.13",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#bbffe5",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/jfjs?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_4_735362&pos=5",
+ "leftBannerImg": "http://img.alicdn.com/tps/i3/TB1jeoCLVXXXXcoXXXXeWjm2pXX-750-240.jpg",
+ "_pos_": "5",
+ "industryBenefit": null,
+ "industryId": "4",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i4/TB1C5.fLVXXXXb3aXXXeWjm2pXX-750-240.jpg"
+ }, {
+ "shopList": [{
+ "id": "822428555",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1g46aLVXXXXcUXVXXSutbFXXX.jpg",
+ "finalScore": "0.9183458776971917",
+ "shopUrl": "http://playboyyd.tmall.com/campaign-3735-11.htm",
+ "entityType": "SHOP",
+ "brandId": "29510"
+ }, {
+ "id": "196993935",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1pHG8LVXXXXbraXXXSutbFXXX.jpg",
+ "finalScore": "0.9105525246667775",
+ "shopUrl": "https://uniqlo.tmall.com/campaign-3735-56.htm",
+ "entityType": "SHOP",
+ "brandId": "29527"
+ }, {
+ "id": "505753958",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1WKYyLVXXXXXHXXXXSutbFXXX.jpg",
+ "finalScore": "0.90750966370726",
+ "shopUrl": "http://bonas.tmall.com/campaign-3735-11.htm",
+ "entityType": "SHOP",
+ "brandId": "3486580"
+ }, {
+ "id": "2113823580",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1itHkLVXXXXX9XFXXSutbFXXX.jpg",
+ "finalScore": "0.5900977955635289",
+ "shopUrl": "http://kafanya.tmall.com/campaign-3735-7.htm",
+ "entityType": "SHOP",
+ "brandId": "110684218"
+ }],
+ "finalScore": "4.088",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#ffc7c9",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/neiyi328?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_9_735362&pos=6",
+ "leftBannerImg": "http://img.alicdn.com/tps/i1/TB1tl3tLVXXXXbbXFXXeWjm2pXX-750-240.jpg",
+ "_pos_": "6",
+ "industryBenefit": null,
+ "industryId": "9",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i2/TB1AkIyLVXXXXbjXpXXeWjm2pXX-750-240.jpg"
+ }],
+ "sub": [{
+ "shopList": null,
+ "finalScore": "4.033333333333333",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/zbps?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_3_735362&pos=7",
+ "entityType": "OTHER",
+ "colour": "#bbffe5",
+ "industryTitle": "\u73e0\u5b9d\u914d\u9970",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "7",
+ "industryBenefit": "\u5927\u724c1\u6298\u79d2\u6740",
+ "industryId": "3",
+ "industryImg": "//img.alicdn.com/tps/i1/TB1s5y.LVXXXXb.aXXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "3.8773333333333335",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/dqc?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_15_735362&pos=8",
+ "entityType": "OTHER",
+ "colour": "#b4ebff",
+ "industryTitle": "\u6570\u7801",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "8",
+ "industryBenefit": "\u75af\u62a2\u5927\u724c\u65b0\u54c1",
+ "industryId": "15",
+ "industryImg": "//img.alicdn.com/tps/i4/TB1_xG.LVXXXXbWaXXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "3.8359999999999994",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/man?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_6_735362&pos=9",
+ "entityType": "OTHER",
+ "colour": "#cbe9a9",
+ "industryTitle": "\u7537\u88c5",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "9",
+ "industryBenefit": "\u65b0\u54c1\u4f4e\u81f39.9\u5143",
+ "industryId": "6",
+ "industryImg": "//img.alicdn.com/tps/i1/TB1mO2qLVXXXXXiXFXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "3.243333333333333",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/xihu?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_13_735362&pos=10",
+ "entityType": "OTHER",
+ "colour": "#cdffa4",
+ "industryTitle": "\u6d17\u62a4",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "10",
+ "industryBenefit": "\u7206\u6b3e1\u5206\u94b1\u62a2",
+ "industryId": "13",
+ "industryImg": "//img.alicdn.com/tps/i3/TB1Ft_CLVXXXXX2XXXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "3.1553333333333335",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/myxfs?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_5_735362&pos=11",
+ "entityType": "OTHER",
+ "colour": "#f8e1ff",
+ "industryTitle": "\u6bcd\u5a74\u7ae5\u88c5",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "11",
+ "industryBenefit": "\u8de8\u5e97\u6ee1299\u51cf40",
+ "industryId": "5",
+ "industryImg": "//img.alicdn.com/tps/i4/TB1c.HvLVXXXXXPXpXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "2.6739999999999995",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/nvzhuang?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_7_735362&pos=12",
+ "entityType": "OTHER",
+ "colour": "#d5cbe8",
+ "industryTitle": "\u5973\u88c5",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "12",
+ "industryBenefit": "\u6298\u540e\u7528\u5238\u62a2\u65b0",
+ "industryId": "7",
+ "industryImg": "//img.alicdn.com/tps/i3/TB1JdfsLVXXXXbRXpXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "0.0",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/mobilephone?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_14_735362&pos=13",
+ "entityType": "OTHER",
+ "colour": "#c5ffdf",
+ "industryTitle": "\u624b\u673a",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "13",
+ "industryBenefit": "1\u5143\u62a2\u4f18\u60e0\u5238",
+ "industryId": "14",
+ "industryImg": "//img.alicdn.com/tps/i4/TB1M3zhLVXXXXX4XVXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "0.0",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/xiangbaohuanxin?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_11_735362&pos=14",
+ "entityType": "OTHER",
+ "colour": "#ffccdc",
+ "industryTitle": "\u7bb1\u5305",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "14",
+ "industryBenefit": "\u6781\u81f4\u7115\u65b0\u5c16\u8d27",
+ "industryId": "11",
+ "industryImg": "//img.alicdn.com/tps/i3/TB1gE6kLVXXXXcrXFXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }, {
+ "shopList": null,
+ "finalScore": "0.0",
+ "industryUrl": "//pages.tmall.com/wow/act/15617/newnv?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_10_735362&pos=15",
+ "entityType": "OTHER",
+ "colour": "#fff8ee",
+ "industryTitle": "\u978b\u5c65",
+ "bannerUrl": null,
+ "leftBannerImg": null,
+ "_pos_": "15",
+ "industryBenefit": "\u6f6e\u54c1\u7cbe\u9009\u978b\u5c65",
+ "industryId": "10",
+ "industryImg": "//img.alicdn.com/tps/i3/TB1.qzpLVXXXXX.XFXXrdvGIFXX-248-155.jpg",
+ "rightBannerImg": null
+ }],
+ "isFormal": "false",
+ "exposureParam": "//ac.mmstat.com/1.gif?apply=vote&abbucket=_AB-M1011_B14&com=02&acm=03654.1003.1.735362&cod=03654&cache=U5revsTn&aldid=KXPpnvEH&logtype=4&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.735362&ip=",
+ "id": "03654"
+ }
+ self._processData(content);
+ // self.$sendMtop({
+ // api: 'mtop.taobao.aladdin.service.AldRecommendService.newFashionIndustry',
+ // v: '1.0',
+ // isHttps: true,
+ // sessionOption: 'AutoLoginOnly',
+ // timer: 3000
+ // }, function (result) {
+ // console.log('in category load mtop data:', result)
+ // if(typeof result==='string') result = JSON.parse(result);
+ // var content = self.ds._backup;
+ // if (result.data && result.data.resultValue) {
+ // content = result.data.resultValue;
+ // }
+ // self._processData(content);
+ // });
+ },
+ _processData: function (content) {
+ var self = this;
+ var items = content.main;
+ var subItems = content.sub;
+ for (var j = 0; j < items.length; j++) {
+ var item = items[j];
+ item.index= j;
+ item.bannerImg = j % 2 === 0 ? item.leftBannerImg : item.rightBannerImg;
+ if(item.shopList){
+ for(var n=0;n<item.shopList.length;n++){
+ item.shopList[n].idx = n;
+ }
+ }
+ }
+
+ for (var i = 0; i < subItems.length; i++) {
+ var subItem = subItems[i];
+ subItem.index= i;
+ subItem.top = (i - i % 3) / 3 * (241 + 3);
+ subItem.left = i % 3 * (248 + 3);
+ }
+
+ self.items = items;
+ self.subItems = subItems;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "image",
+ "shown": function () {return this.ds.floorTitle},
+ "classList": [
+ "title"
+ ],
+ "attr": {
+ "src": function () {return this.ds.floorTitle}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "item-container"
+ ],
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.items},
+ "style": {
+ "width": 750,
+ "paddingBottom": 14,
+ "backgroundColor": function () {return this.colour}
+ },
+ "children": [
+ {
+ "type": "container",
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_750},
+ "height": function () {return this.NUMBER_237},
+ "src": function () {return this.bannerImg},
+ "href": function () {return this.bannerUrl}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "shop-list"
+ ],
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.shopList},
+ "classList": [
+ "shop-img-container"
+ ],
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_186},
+ "height": function () {return this.NUMBER_208},
+ "src": function () {return this.picUrl},
+ "href": function () {return this.shopUrl}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "sub-item-container"
+ ],
+ "style": {
+ "height": function () {return Math.round(this.subItems.length/3)*(241+3)}
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.subItems},
+ "classList": [
+ "sub-item"
+ ],
+ "style": {
+ "top": function () {return this.top},
+ "left": function () {return this.left}
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "sub-item-bg"
+ ],
+ "attr": {
+ "src": function () {return this.subItemBg}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "sub-item-img"
+ ],
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_248},
+ "height": function () {return this.NUMBER_155},
+ "src": function () {return this.industryImg},
+ "href": function () {return this.industryUrl}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "sub-item-title"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "industry-title"
+ ],
+ "attr": {
+ "href": function () {return this.industryUrl},
+ "value": function () {return this.industryTitle}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "industry-benefit"
+ ],
+ "attr": {
+ "href": function () {return this.industryUrl},
+ "value": function () {return this.industryBenefit}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ },
+ "shop-list": {
+ "flexDirection": "row"
+ },
+ "shop-img-container": {
+ "marginRight": 2
+ },
+ "sub-item": {
+ "position": "absolute",
+ "width": 248,
+ "height": 241,
+ "alignItems": "center",
+ "backgroundColor": "#ffffff"
+ },
+ "sub-item-bg": {
+ "width": 248,
+ "height": 86
+ },
+ "sub-item-title": {
+ "position": "absolute",
+ "left": 0,
+ "top": 0,
+ "width": 248,
+ "textAlign": "center"
+ },
+ "industry-title": {
+ "fontSize": 28,
+ "color": "#484848",
+ "textAlign": "center",
+ "marginTop": 10,
+ "height": 34
+ },
+ "industry-benefit": {
+ "fontSize": 24,
+ "color": "#999999",
+ "textAlign": "center"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/5431263137f2dd27df2998658c228e48", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/coupon.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/coupon.js b/ios/playground/bundlejs/showcase/new-fashion/coupon.js
new file mode 100644
index 0000000..687e969
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/coupon.js
@@ -0,0 +1,176 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/12e3fae9066debee37a22f0980a88637", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ var IS_WEB = typeof window !== 'undefined';
+ var IS_APP = !IS_WEB || /AliApp\((?:tb|tm)/i.test(navigator.userAgent);
+
+ __weex_module__.exports = {
+ data: function () {return {
+ currentStatus: '//img.alicdn.com/tps/i4/TB1cYBKMXXXXXayaXXXkxHk2pXX-750-228.jpg_q75.jpg'
+ }},
+ methods: {
+ ready: function () {
+ },
+ handleClick: function (e) {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "image",
+ "shown": function () {return this.ds.floorTitle},
+ "classList": [
+ "title"
+ ],
+ "attr": {
+ "src": function () {return this.ds.floorTitle}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "img"
+ ],
+ "attr": {
+ "src": function () {return this.currentStatus}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "my-coupon"
+ ],
+ "events": {
+ "click": "handleClick"
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "guides"
+ ],
+ "events": {
+ "click": "handleClick"
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "lottery"
+ ],
+ "events": {
+ "click": "handleClick"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ },
+ "wrapper": {
+ "color": "#FF4550",
+ "width": 750,
+ "height": 230
+ },
+ "my-coupon": {
+ "width": 180,
+ "height": 39,
+ "position": "absolute",
+ "top": 15,
+ "right": 149
+ },
+ "guides": {
+ "height": 39,
+ "width": 110,
+ "position": "absolute",
+ "top": 15,
+ "right": 32
+ },
+ "lottery": {
+ "width": 348,
+ "height": 76,
+ "position": "absolute",
+ "top": 132,
+ "right": 70
+ },
+ "info": {
+ "fontSize": 18,
+ "position": "absolute",
+ "top": 84,
+ "right": 70
+ },
+ "img": {
+ "width": 750,
+ "height": 230
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/12e3fae9066debee37a22f0980a88637", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[10/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/dependency/SRWebSocket.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/dependency/SRWebSocket.m b/ios/sdk/WeexSDK/dependency/SRWebSocket.m
new file mode 100644
index 0000000..a0d41fc
--- /dev/null
+++ b/ios/sdk/WeexSDK/dependency/SRWebSocket.m
@@ -0,0 +1,1812 @@
+//
+// Copyright 2012 Square Inc.
+//
+// Licensed 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 "SRWebSocket.h"
+
+#if TARGET_OS_IPHONE
+#define HAS_ICU
+#endif
+
+#ifdef HAS_ICU
+#import <unicode/utf8.h>
+#endif
+
+#if TARGET_OS_IPHONE
+#import <Endian.h>
+#else
+#import <CoreServices/CoreServices.h>
+#endif
+
+#import <CommonCrypto/CommonDigest.h>
+#import <Security/SecRandom.h>
+
+#if OS_OBJECT_USE_OBJC_RETAIN_RELEASE
+#define sr_dispatch_retain(x)
+#define sr_dispatch_release(x)
+#define maybe_bridge(x) ((__bridge void *) x)
+#else
+#define sr_dispatch_retain(x) dispatch_retain(x)
+#define sr_dispatch_release(x) dispatch_release(x)
+#define maybe_bridge(x) (x)
+#endif
+
+#if !__has_feature(objc_arc)
+#error SocketRocket must be compiled with ARC enabled
+#endif
+
+
+typedef enum {
+ SROpCodeTextFrame = 0x1,
+ SROpCodeBinaryFrame = 0x2,
+ // 3-7 reserved.
+ SROpCodeConnectionClose = 0x8,
+ SROpCodePing = 0x9,
+ SROpCodePong = 0xA,
+ // B-F reserved.
+} SROpCode;
+
+typedef struct {
+ BOOL fin;
+// BOOL rsv1;
+// BOOL rsv2;
+// BOOL rsv3;
+ uint8_t opcode;
+ BOOL masked;
+ uint64_t payload_length;
+} frame_header;
+
+static NSString *const SRWebSocketAppendToSecKeyString = @"258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
+
+static inline int32_t validate_dispatch_data_partial_string(NSData *data);
+static inline void SRFastLog(NSString *format, ...);
+
+@interface NSData (SRWebSocket)
+
+- (NSString *)stringBySHA1ThenBase64Encoding;
+
+@end
+
+
+@interface NSString (SRWebSocket)
+
+- (NSString *)stringBySHA1ThenBase64Encoding;
+
+@end
+
+
+@interface NSURL (SRWebSocket)
+
+// The origin isn't really applicable for a native application.
+// So instead, just map ws -> http and wss -> https.
+- (NSString *)SR_origin;
+
+@end
+
+
+@interface _SRRunLoopThread : NSThread
+
+@property (nonatomic, readonly) NSRunLoop *runLoop;
+
+@end
+
+
+static NSString *newSHA1String(const char *bytes, size_t length) {
+ uint8_t md[CC_SHA1_DIGEST_LENGTH];
+
+ assert(length >= 0);
+ assert(length <= UINT32_MAX);
+ CC_SHA1(bytes, (CC_LONG)length, md);
+
+ NSData *data = [NSData dataWithBytes:md length:CC_SHA1_DIGEST_LENGTH];
+
+ if ([data respondsToSelector:@selector(base64EncodedStringWithOptions:)]) {
+ return [data base64EncodedStringWithOptions:0];
+ }
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ return [data base64Encoding];
+#pragma clang diagnostic pop
+}
+
+@implementation NSData (SRWebSocket)
+
+- (NSString *)stringBySHA1ThenBase64Encoding;
+{
+ return newSHA1String(self.bytes, self.length);
+}
+
+@end
+
+
+@implementation NSString (SRWebSocket)
+
+- (NSString *)stringBySHA1ThenBase64Encoding;
+{
+ return newSHA1String(self.UTF8String, self.length);
+}
+
+@end
+
+NSString *const SRWebSocketErrorDomain = @"SRWebSocketErrorDomain";
+NSString *const SRHTTPResponseErrorKey = @"HTTPResponseStatusCode";
+
+// Returns number of bytes consumed. Returning 0 means you didn't match.
+// Sends bytes to callback handler;
+typedef size_t (^stream_scanner)(NSData *collected_data);
+
+typedef void (^data_callback)(SRWebSocket *webSocket, NSData *data);
+
+@interface SRIOConsumer : NSObject {
+ stream_scanner _scanner;
+ data_callback _handler;
+ size_t _bytesNeeded;
+ BOOL _readToCurrentFrame;
+ BOOL _unmaskBytes;
+}
+@property (nonatomic, copy, readonly) stream_scanner consumer;
+@property (nonatomic, copy, readonly) data_callback handler;
+@property (nonatomic, assign) size_t bytesNeeded;
+@property (nonatomic, assign, readonly) BOOL readToCurrentFrame;
+@property (nonatomic, assign, readonly) BOOL unmaskBytes;
+
+@end
+
+// This class is not thread-safe, and is expected to always be run on the same queue.
+@interface SRIOConsumerPool : NSObject
+
+- (id)initWithBufferCapacity:(NSUInteger)poolSize;
+
+- (SRIOConsumer *)consumerWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;
+- (void)returnConsumer:(SRIOConsumer *)consumer;
+
+@end
+
+@interface SRWebSocket () <NSStreamDelegate>
+
+@property (nonatomic) SRReadyState readyState;
+
+@property (nonatomic) NSOperationQueue *delegateOperationQueue;
+@property (nonatomic) dispatch_queue_t delegateDispatchQueue;
+
+// Specifies whether SSL trust chain should NOT be evaluated.
+// By default this flag is set to NO, meaning only secure SSL connections are allowed.
+// For DEBUG builds this flag is ignored, and SSL connections are allowed regardless
+// of the certificate trust configuration
+@property (nonatomic, readwrite) BOOL allowsUntrustedSSLCertificates;
+
+@end
+
+
+@implementation SRWebSocket {
+ NSInteger _webSocketVersion;
+
+ NSOperationQueue *_delegateOperationQueue;
+ dispatch_queue_t _delegateDispatchQueue;
+
+ dispatch_queue_t _workQueue;
+ NSMutableArray *_consumers;
+
+ NSInputStream *_inputStream;
+ NSOutputStream *_outputStream;
+
+ NSMutableData *_readBuffer;
+ NSUInteger _readBufferOffset;
+
+ NSMutableData *_outputBuffer;
+ NSUInteger _outputBufferOffset;
+
+ uint8_t _currentFrameOpcode;
+ size_t _currentFrameCount;
+ size_t _readOpCount;
+ uint32_t _currentStringScanPosition;
+ NSMutableData *_currentFrameData;
+
+ NSString *_closeReason;
+
+ NSString *_secKey;
+ NSString *_basicAuthorizationString;
+
+ BOOL _pinnedCertFound;
+
+ uint8_t _currentReadMaskKey[4];
+ size_t _currentReadMaskOffset;
+
+ BOOL _consumerStopped;
+
+ BOOL _closeWhenFinishedWriting;
+ BOOL _failed;
+
+ BOOL _secure;
+ NSURLRequest *_urlRequest;
+
+ BOOL _sentClose;
+ BOOL _didFail;
+ int _closeCode;
+
+ BOOL _isPumping;
+
+ NSMutableSet *_scheduledRunloops;
+
+ // We use this to retain ourselves.
+ __strong SRWebSocket *_selfRetain;
+
+ NSArray *_requestedProtocols;
+ SRIOConsumerPool *_consumerPool;
+}
+
+@synthesize delegate = _delegate;
+@synthesize url = _url;
+@synthesize readyState = _readyState;
+@synthesize protocol = _protocol;
+
+static __strong NSData *CRLFCRLF;
+
++ (void)initialize;
+{
+ CRLFCRLF = [[NSData alloc] initWithBytes:"\r\n\r\n" length:4];
+}
+
+- (id)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols allowsUntrustedSSLCertificates:(BOOL)allowsUntrustedSSLCertificates;
+{
+ self = [super init];
+ if (self) {
+ assert(request.URL);
+ _url = request.URL;
+ _urlRequest = request;
+ _allowsUntrustedSSLCertificates = allowsUntrustedSSLCertificates;
+
+ _requestedProtocols = [protocols copy];
+
+ [self _SR_commonInit];
+ }
+
+ return self;
+}
+
+- (id)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols;
+{
+ return [self initWithURLRequest:request protocols:protocols allowsUntrustedSSLCertificates:NO];
+}
+
+- (id)initWithURLRequest:(NSURLRequest *)request;
+{
+ return [self initWithURLRequest:request protocols:nil];
+}
+
+- (id)initWithURL:(NSURL *)url;
+{
+ return [self initWithURL:url protocols:nil];
+}
+
+- (id)initWithURL:(NSURL *)url protocols:(NSArray *)protocols;
+{
+ NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
+ return [self initWithURLRequest:request protocols:protocols];
+}
+
+- (id)initWithURL:(NSURL *)url protocols:(NSArray *)protocols allowsUntrustedSSLCertificates:(BOOL)allowsUntrustedSSLCertificates;
+{
+ NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
+ return [self initWithURLRequest:request protocols:protocols allowsUntrustedSSLCertificates:allowsUntrustedSSLCertificates];
+}
+
+- (void)_SR_commonInit;
+{
+ NSString *scheme = _url.scheme.lowercaseString;
+ assert([scheme isEqualToString:@"ws"] || [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"wss"] || [scheme isEqualToString:@"https"]);
+
+ if ([scheme isEqualToString:@"wss"] || [scheme isEqualToString:@"https"]) {
+ _secure = YES;
+ }
+
+ _readyState = SR_CONNECTING;
+ _consumerStopped = YES;
+ _webSocketVersion = 13;
+
+ _workQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
+
+ // Going to set a specific on the queue so we can validate we're on the work queue
+ dispatch_queue_set_specific(_workQueue, (__bridge void *)self, maybe_bridge(_workQueue), NULL);
+
+ _delegateDispatchQueue = dispatch_get_main_queue();
+ sr_dispatch_retain(_delegateDispatchQueue);
+
+ _readBuffer = [[NSMutableData alloc] init];
+ _outputBuffer = [[NSMutableData alloc] init];
+
+ _currentFrameData = [[NSMutableData alloc] init];
+
+ _consumers = [[NSMutableArray alloc] init];
+
+ _consumerPool = [[SRIOConsumerPool alloc] init];
+
+ _scheduledRunloops = [[NSMutableSet alloc] init];
+
+ [self _initializeStreams];
+
+ // default handlers
+}
+
+- (void)assertOnWorkQueue;
+{
+ assert(dispatch_get_specific((__bridge void *)self) == maybe_bridge(_workQueue));
+}
+
+- (void)dealloc
+{
+ _inputStream.delegate = nil;
+ _outputStream.delegate = nil;
+
+ [_inputStream close];
+ [_outputStream close];
+
+ if (_workQueue) {
+ sr_dispatch_release(_workQueue);
+ _workQueue = NULL;
+ }
+
+ if (_receivedHTTPHeaders) {
+ CFRelease(_receivedHTTPHeaders);
+ _receivedHTTPHeaders = NULL;
+ }
+
+ if (_delegateDispatchQueue) {
+ sr_dispatch_release(_delegateDispatchQueue);
+ _delegateDispatchQueue = NULL;
+ }
+}
+
+#ifndef NDEBUG
+
+- (void)setReadyState:(SRReadyState)aReadyState;
+{
+ [self willChangeValueForKey:@"readyState"];
+ assert(aReadyState > _readyState);
+ _readyState = aReadyState;
+ [self didChangeValueForKey:@"readyState"];
+}
+
+#endif
+
+- (void)open;
+{
+ assert(_url);
+ NSAssert(_readyState == SR_CONNECTING, @"Cannot call -(void)open on SRWebSocket more than once");
+
+ _selfRetain = self;
+
+ [self openConnection];
+}
+
+// Calls block on delegate queue
+- (void)_performDelegateBlock:(dispatch_block_t)block;
+{
+ if (_delegateOperationQueue) {
+ [_delegateOperationQueue addOperationWithBlock:block];
+ } else {
+ assert(_delegateDispatchQueue);
+ dispatch_async(_delegateDispatchQueue, block);
+ }
+}
+
+- (void)setDelegateDispatchQueue:(dispatch_queue_t)queue;
+{
+ if (queue) {
+ sr_dispatch_retain(queue);
+ }
+
+ if (_delegateDispatchQueue) {
+ sr_dispatch_release(_delegateDispatchQueue);
+ }
+
+ _delegateDispatchQueue = queue;
+}
+
+- (BOOL)_checkHandshake:(CFHTTPMessageRef)httpMessage;
+{
+ NSString *acceptHeader = CFBridgingRelease(CFHTTPMessageCopyHeaderFieldValue(httpMessage, CFSTR("Sec-WebSocket-Accept")));
+
+ if (acceptHeader == nil) {
+ return NO;
+ }
+
+ NSString *concattedString = [_secKey stringByAppendingString:SRWebSocketAppendToSecKeyString];
+ NSString *expectedAccept = [concattedString stringBySHA1ThenBase64Encoding];
+
+ return [acceptHeader isEqualToString:expectedAccept];
+}
+
+- (void)_HTTPHeadersDidFinish;
+{
+ NSInteger responseCode = CFHTTPMessageGetResponseStatusCode(_receivedHTTPHeaders);
+
+ if (responseCode >= 400) {
+ SRFastLog(@"Request failed with response code %d", responseCode);
+ [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2132 userInfo:@{NSLocalizedDescriptionKey:[NSString stringWithFormat:@"received bad response code from server %ld", (long)responseCode], SRHTTPResponseErrorKey:@(responseCode)}]];
+ return;
+ }
+
+ if(![self _checkHandshake:_receivedHTTPHeaders]) {
+ [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2133 userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Invalid Sec-WebSocket-Accept response"] forKey:NSLocalizedDescriptionKey]]];
+ return;
+ }
+
+ NSString *negotiatedProtocol = CFBridgingRelease(CFHTTPMessageCopyHeaderFieldValue(_receivedHTTPHeaders, CFSTR("Sec-WebSocket-Protocol")));
+ if (negotiatedProtocol) {
+ // Make sure we requested the protocol
+ if ([_requestedProtocols indexOfObject:negotiatedProtocol] == NSNotFound) {
+ [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2133 userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Server specified Sec-WebSocket-Protocol that wasn't requested"] forKey:NSLocalizedDescriptionKey]]];
+ return;
+ }
+
+ _protocol = negotiatedProtocol;
+ }
+
+ self.readyState = SR_OPEN;
+
+ if (!_didFail) {
+ [self _readFrameNew];
+ }
+
+ [self _performDelegateBlock:^{
+ if ([self.delegate respondsToSelector:@selector(webSocketDidOpen:)]) {
+ [self.delegate webSocketDidOpen:self];
+ };
+ }];
+}
+
+
+- (void)_readHTTPHeader;
+{
+ if (_receivedHTTPHeaders == NULL) {
+ _receivedHTTPHeaders = CFHTTPMessageCreateEmpty(NULL, NO);
+ }
+
+ [self _readUntilHeaderCompleteWithCallback:^(SRWebSocket *self, NSData *data) {
+ CFHTTPMessageAppendBytes(_receivedHTTPHeaders, (const UInt8 *)data.bytes, data.length);
+
+ if (CFHTTPMessageIsHeaderComplete(_receivedHTTPHeaders)) {
+ SRFastLog(@"Finished reading headers %@", CFBridgingRelease(CFHTTPMessageCopyAllHeaderFields(_receivedHTTPHeaders)));
+ [self _HTTPHeadersDidFinish];
+ } else {
+ [self _readHTTPHeader];
+ }
+ }];
+}
+
+- (void)didConnect;
+{
+ SRFastLog(@"Connected");
+ CFHTTPMessageRef request = CFHTTPMessageCreateRequest(NULL, CFSTR("GET"), (__bridge CFURLRef)_url, kCFHTTPVersion1_1);
+
+ // Set host first so it defaults
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Host"), (__bridge CFStringRef)(_url.port ? [NSString stringWithFormat:@"%@:%@", _url.host, _url.port] : _url.host));
+
+ NSMutableData *keyBytes = [[NSMutableData alloc] initWithLength:16];
+ SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes);
+
+ if ([keyBytes respondsToSelector:@selector(base64EncodedStringWithOptions:)]) {
+ _secKey = [keyBytes base64EncodedStringWithOptions:0];
+ } else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ _secKey = [keyBytes base64Encoding];
+#pragma clang diagnostic pop
+ }
+
+ assert([_secKey length] == 24);
+
+ // Apply cookies if any have been provided
+ NSDictionary * cookies = [NSHTTPCookie requestHeaderFieldsWithCookies:[self requestCookies]];
+ for (NSString * cookieKey in cookies) {
+ NSString * cookieValue = [cookies objectForKey:cookieKey];
+ if ([cookieKey length] && [cookieValue length]) {
+ CFHTTPMessageSetHeaderFieldValue(request, (__bridge CFStringRef)cookieKey, (__bridge CFStringRef)cookieValue);
+ }
+ }
+
+ // set header for http basic auth
+ if (_url.user.length && _url.password.length) {
+ NSData *userAndPassword = [[NSString stringWithFormat:@"%@:%@", _url.user, _url.password] dataUsingEncoding:NSUTF8StringEncoding];
+ NSString *userAndPasswordBase64Encoded;
+ if ([keyBytes respondsToSelector:@selector(base64EncodedStringWithOptions:)]) {
+ userAndPasswordBase64Encoded = [userAndPassword base64EncodedStringWithOptions:0];
+ } else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ userAndPasswordBase64Encoded = [userAndPassword base64Encoding];
+#pragma clang diagnostic pop
+ }
+ _basicAuthorizationString = [NSString stringWithFormat:@"Basic %@", userAndPasswordBase64Encoded];
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Authorization"), (__bridge CFStringRef)_basicAuthorizationString);
+ }
+
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Upgrade"), CFSTR("websocket"));
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Connection"), CFSTR("Upgrade"));
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Key"), (__bridge CFStringRef)_secKey);
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Version"), (__bridge CFStringRef)[NSString stringWithFormat:@"%ld", (long)_webSocketVersion]);
+
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Origin"), (__bridge CFStringRef)_url.SR_origin);
+
+ if (_requestedProtocols) {
+ CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Protocol"), (__bridge CFStringRef)[_requestedProtocols componentsJoinedByString:@", "]);
+ }
+
+ [_urlRequest.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+ CFHTTPMessageSetHeaderFieldValue(request, (__bridge CFStringRef)key, (__bridge CFStringRef)obj);
+ }];
+
+ NSData *message = CFBridgingRelease(CFHTTPMessageCopySerializedMessage(request));
+
+ CFRelease(request);
+
+ [self _writeData:message];
+ [self _readHTTPHeader];
+}
+
+- (void)_initializeStreams;
+{
+ assert(_url.port.unsignedIntValue <= UINT32_MAX);
+ uint32_t port = _url.port.unsignedIntValue;
+ if (port == 0) {
+ if (!_secure) {
+ port = 80;
+ } else {
+ port = 443;
+ }
+ }
+ NSString *host = _url.host;
+
+ CFReadStreamRef readStream = NULL;
+ CFWriteStreamRef writeStream = NULL;
+
+ CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)host, port, &readStream, &writeStream);
+
+ _outputStream = CFBridgingRelease(writeStream);
+ _inputStream = CFBridgingRelease(readStream);
+
+ _inputStream.delegate = self;
+ _outputStream.delegate = self;
+}
+
+- (void)_updateSecureStreamOptions;
+{
+ if (_secure) {
+ NSMutableDictionary *SSLOptions = [[NSMutableDictionary alloc] init];
+
+ [_outputStream setProperty:(__bridge id)kCFStreamSocketSecurityLevelNegotiatedSSL forKey:(__bridge id)kCFStreamPropertySocketSecurityLevel];
+
+ // If we're using pinned certs, don't validate the certificate chain
+ if ([_urlRequest SR_SSLPinnedCertificates].count) {
+ [SSLOptions setValue:@NO forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain];
+ }
+
+#if DEBUG
+ self.allowsUntrustedSSLCertificates = YES;
+#endif
+
+ if (self.allowsUntrustedSSLCertificates) {
+ [SSLOptions setValue:@NO forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain];
+ SRFastLog(@"Allowing connection to any root cert");
+ }
+
+ [_outputStream setProperty:SSLOptions
+ forKey:(__bridge id)kCFStreamPropertySSLSettings];
+ }
+}
+
+- (void)openConnection;
+{
+ [self _updateSecureStreamOptions];
+
+ if (!_scheduledRunloops.count) {
+ [self scheduleInRunLoop:[NSRunLoop SR_networkRunLoop] forMode:NSDefaultRunLoopMode];
+ }
+
+
+ [_outputStream open];
+ [_inputStream open];
+}
+
+- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;
+{
+ [_outputStream scheduleInRunLoop:aRunLoop forMode:mode];
+ [_inputStream scheduleInRunLoop:aRunLoop forMode:mode];
+
+ [_scheduledRunloops addObject:@[aRunLoop, mode]];
+}
+
+- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;
+{
+ [_outputStream removeFromRunLoop:aRunLoop forMode:mode];
+ [_inputStream removeFromRunLoop:aRunLoop forMode:mode];
+
+ [_scheduledRunloops removeObject:@[aRunLoop, mode]];
+}
+
+- (void)close;
+{
+ [self closeWithCode:SRStatusCodeNormal reason:nil];
+}
+
+- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;
+{
+ assert(code);
+ dispatch_async(_workQueue, ^{
+ if (self.readyState == SR_CLOSING || self.readyState == SR_CLOSED) {
+ return;
+ }
+
+ BOOL wasConnecting = self.readyState == SR_CONNECTING;
+
+ self.readyState = SR_CLOSING;
+
+ SRFastLog(@"Closing with code %d reason %@", code, reason);
+
+ if (wasConnecting) {
+ [self closeConnection];
+ return;
+ }
+
+ size_t maxMsgSize = [reason maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+ NSMutableData *mutablePayload = [[NSMutableData alloc] initWithLength:sizeof(uint16_t) + maxMsgSize];
+ NSData *payload = mutablePayload;
+
+ ((uint16_t *)mutablePayload.mutableBytes)[0] = EndianU16_BtoN(code);
+
+ if (reason) {
+ NSRange remainingRange = {0};
+
+ NSUInteger usedLength = 0;
+
+ BOOL success = [reason getBytes:(char *)mutablePayload.mutableBytes + sizeof(uint16_t) maxLength:payload.length - sizeof(uint16_t) usedLength:&usedLength encoding:NSUTF8StringEncoding options:NSStringEncodingConversionExternalRepresentation range:NSMakeRange(0, reason.length) remainingRange:&remainingRange];
+ #pragma unused (success)
+
+ assert(success);
+ assert(remainingRange.length == 0);
+
+ if (usedLength != maxMsgSize) {
+ payload = [payload subdataWithRange:NSMakeRange(0, usedLength + sizeof(uint16_t))];
+ }
+ }
+
+
+ [self _sendFrameWithOpcode:SROpCodeConnectionClose data:payload];
+ });
+}
+
+- (void)_closeWithProtocolError:(NSString *)message;
+{
+ // Need to shunt this on the _callbackQueue first to see if they received any messages
+ [self _performDelegateBlock:^{
+ [self closeWithCode:SRStatusCodeProtocolError reason:message];
+ dispatch_async(_workQueue, ^{
+ [self closeConnection];
+ });
+ }];
+}
+
+- (void)_failWithError:(NSError *)error;
+{
+ dispatch_async(_workQueue, ^{
+ if (self.readyState != SR_CLOSED) {
+ _failed = YES;
+ [self _performDelegateBlock:^{
+ if ([self.delegate respondsToSelector:@selector(webSocket:didFailWithError:)]) {
+ [self.delegate webSocket:self didFailWithError:error];
+ }
+ }];
+
+ self.readyState = SR_CLOSED;
+ _selfRetain = nil;
+
+ SRFastLog(@"Failing with error %@", error.localizedDescription);
+
+ [self closeConnection];
+ }
+ });
+}
+
+- (void)_writeData:(NSData *)data;
+{
+ [self assertOnWorkQueue];
+
+ if (_closeWhenFinishedWriting) {
+ return;
+ }
+ [_outputBuffer appendData:data];
+ [self _pumpWriting];
+}
+
+- (void)send:(id)data;
+{
+ NSAssert(self.readyState != SR_CONNECTING, @"Invalid State: Cannot call send: until connection is open");
+ // TODO: maybe not copy this for performance
+ data = [data copy];
+ dispatch_async(_workQueue, ^{
+ if ([data isKindOfClass:[NSString class]]) {
+ [self _sendFrameWithOpcode:SROpCodeTextFrame data:[(NSString *)data dataUsingEncoding:NSUTF8StringEncoding]];
+ } else if ([data isKindOfClass:[NSData class]]) {
+ [self _sendFrameWithOpcode:SROpCodeBinaryFrame data:data];
+ } else if (data == nil) {
+ [self _sendFrameWithOpcode:SROpCodeTextFrame data:data];
+ } else {
+ assert(NO);
+ }
+ });
+}
+
+- (void)sendPing:(NSData *)data;
+{
+ NSAssert(self.readyState == SR_OPEN, @"Invalid State: Cannot call send: until connection is open");
+ // TODO: maybe not copy this for performance
+ data = [data copy] ?: [NSData data]; // It's okay for a ping to be empty
+ dispatch_async(_workQueue, ^{
+ [self _sendFrameWithOpcode:SROpCodePing data:data];
+ });
+}
+
+- (void)handlePing:(NSData *)pingData;
+{
+ // Need to pingpong this off _callbackQueue first to make sure messages happen in order
+ [self _performDelegateBlock:^{
+ dispatch_async(_workQueue, ^{
+ [self _sendFrameWithOpcode:SROpCodePong data:pingData];
+ });
+ }];
+}
+
+- (void)handlePong:(NSData *)pongData;
+{
+ SRFastLog(@"Received pong");
+ [self _performDelegateBlock:^{
+ if ([self.delegate respondsToSelector:@selector(webSocket:didReceivePong:)]) {
+ [self.delegate webSocket:self didReceivePong:pongData];
+ }
+ }];
+}
+
+- (void)_handleMessage:(id)message
+{
+ SRFastLog(@"Received message");
+ [self _performDelegateBlock:^{
+ [self.delegate webSocket:self didReceiveMessage:message];
+ }];
+}
+
+
+static inline BOOL closeCodeIsValid(int closeCode) {
+ if (closeCode < 1000) {
+ return NO;
+ }
+
+ if (closeCode >= 1000 && closeCode <= 1011) {
+ if (closeCode == 1004 ||
+ closeCode == 1005 ||
+ closeCode == 1006) {
+ return NO;
+ }
+ return YES;
+ }
+
+ if (closeCode >= 3000 && closeCode <= 3999) {
+ return YES;
+ }
+
+ if (closeCode >= 4000 && closeCode <= 4999) {
+ return YES;
+ }
+
+ return NO;
+}
+
+// Note from RFC:
+//
+// If there is a body, the first two
+// bytes of the body MUST be a 2-byte unsigned integer (in network byte
+// order) representing a status code with value /code/ defined in
+// Section 7.4. Following the 2-byte integer the body MAY contain UTF-8
+// encoded data with value /reason/, the interpretation of which is not
+// defined by this specification.
+
+- (void)handleCloseWithData:(NSData *)data;
+{
+ size_t dataSize = data.length;
+ __block uint16_t closeCode = 0;
+
+ SRFastLog(@"Received close frame");
+
+ if (dataSize == 1) {
+ // TODO handle error
+ [self _closeWithProtocolError:@"Payload for close must be larger than 2 bytes"];
+ return;
+ } else if (dataSize >= 2) {
+ [data getBytes:&closeCode length:sizeof(closeCode)];
+ _closeCode = EndianU16_BtoN(closeCode);
+ if (!closeCodeIsValid(_closeCode)) {
+ [self _closeWithProtocolError:[NSString stringWithFormat:@"Cannot have close code of %d", _closeCode]];
+ return;
+ }
+ if (dataSize > 2) {
+ _closeReason = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(2, dataSize - 2)] encoding:NSUTF8StringEncoding];
+ if (!_closeReason) {
+ [self _closeWithProtocolError:@"Close reason MUST be valid UTF-8"];
+ return;
+ }
+ }
+ } else {
+ _closeCode = SRStatusNoStatusReceived;
+ }
+
+ [self assertOnWorkQueue];
+
+ if (self.readyState == SR_OPEN) {
+ [self closeWithCode:1000 reason:nil];
+ }
+ dispatch_async(_workQueue, ^{
+ [self closeConnection];
+ });
+}
+
+- (void)closeConnection;
+{
+ [self assertOnWorkQueue];
+ SRFastLog(@"Trying to disconnect");
+ _closeWhenFinishedWriting = YES;
+ [self _pumpWriting];
+}
+
+- (void)_handleFrameWithData:(NSData *)frameData opCode:(NSInteger)opcode;
+{
+ // Check that the current data is valid UTF8
+
+ BOOL isControlFrame = (opcode == SROpCodePing || opcode == SROpCodePong || opcode == SROpCodeConnectionClose);
+ if (!isControlFrame) {
+ [self _readFrameNew];
+ } else {
+ dispatch_async(_workQueue, ^{
+ [self _readFrameContinue];
+ });
+ }
+
+ switch (opcode) {
+ case SROpCodeTextFrame: {
+ NSString *str = [[NSString alloc] initWithData:frameData encoding:NSUTF8StringEncoding];
+ if (str == nil && frameData) {
+ [self closeWithCode:SRStatusCodeInvalidUTF8 reason:@"Text frames must be valid UTF-8"];
+ dispatch_async(_workQueue, ^{
+ [self closeConnection];
+ });
+
+ return;
+ }
+ [self _handleMessage:str];
+ break;
+ }
+ case SROpCodeBinaryFrame:
+ [self _handleMessage:[frameData copy]];
+ break;
+ case SROpCodeConnectionClose:
+ [self handleCloseWithData:frameData];
+ break;
+ case SROpCodePing:
+ [self handlePing:frameData];
+ break;
+ case SROpCodePong:
+ [self handlePong:frameData];
+ break;
+ default:
+ [self _closeWithProtocolError:[NSString stringWithFormat:@"Unknown opcode %ld", (long)opcode]];
+ // TODO: Handle invalid opcode
+ break;
+ }
+}
+
+- (void)_handleFrameHeader:(frame_header)frame_header curData:(NSData *)curData;
+{
+ assert(frame_header.opcode != 0);
+
+ if (self.readyState != SR_OPEN) {
+ return;
+ }
+
+
+ BOOL isControlFrame = (frame_header.opcode == SROpCodePing || frame_header.opcode == SROpCodePong || frame_header.opcode == SROpCodeConnectionClose);
+
+ if (isControlFrame && !frame_header.fin) {
+ [self _closeWithProtocolError:@"Fragmented control frames not allowed"];
+ return;
+ }
+
+ if (isControlFrame && frame_header.payload_length >= 126) {
+ [self _closeWithProtocolError:@"Control frames cannot have payloads larger than 126 bytes"];
+ return;
+ }
+
+ if (!isControlFrame) {
+ _currentFrameOpcode = frame_header.opcode;
+ _currentFrameCount += 1;
+ }
+
+ if (frame_header.payload_length == 0) {
+ if (isControlFrame) {
+ [self _handleFrameWithData:curData opCode:frame_header.opcode];
+ } else {
+ if (frame_header.fin) {
+ [self _handleFrameWithData:_currentFrameData opCode:frame_header.opcode];
+ } else {
+ // TODO add assert that opcode is not a control;
+ [self _readFrameContinue];
+ }
+ }
+ } else {
+ assert(frame_header.payload_length <= SIZE_T_MAX);
+ [self _addConsumerWithDataLength:(size_t)frame_header.payload_length callback:^(SRWebSocket *self, NSData *newData) {
+ if (isControlFrame) {
+ [self _handleFrameWithData:newData opCode:frame_header.opcode];
+ } else {
+ if (frame_header.fin) {
+ [self _handleFrameWithData:self->_currentFrameData opCode:frame_header.opcode];
+ } else {
+ // TODO add assert that opcode is not a control;
+ [self _readFrameContinue];
+ }
+
+ }
+ } readToCurrentFrame:!isControlFrame unmaskBytes:frame_header.masked];
+ }
+}
+
+/* From RFC:
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-------+-+-------------+-------------------------------+
+ |F|R|R|R| opcode|M| Payload len | Extended payload length |
+ |I|S|S|S| (4) |A| (7) | (16/64) |
+ |N|V|V|V| |S| | (if payload len==126/127) |
+ | |1|2|3| |K| | |
+ +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - +
+ | Extended payload length continued, if payload len == 127 |
+ + - - - - - - - - - - - - - - - +-------------------------------+
+ | |Masking-key, if MASK set to 1 |
+ +-------------------------------+-------------------------------+
+ | Masking-key (continued) | Payload Data |
+ +-------------------------------- - - - - - - - - - - - - - - - +
+ : Payload Data continued ... :
+ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ | Payload Data continued ... |
+ +---------------------------------------------------------------+
+ */
+
+static const uint8_t SRFinMask = 0x80;
+static const uint8_t SROpCodeMask = 0x0F;
+static const uint8_t SRRsvMask = 0x70;
+static const uint8_t SRMaskMask = 0x80;
+static const uint8_t SRPayloadLenMask = 0x7F;
+
+
+- (void)_readFrameContinue;
+{
+ assert((_currentFrameCount == 0 && _currentFrameOpcode == 0) || (_currentFrameCount > 0 && _currentFrameOpcode > 0));
+
+ [self _addConsumerWithDataLength:2 callback:^(SRWebSocket *self, NSData *data) {
+ __block frame_header header = {0};
+
+ const uint8_t *headerBuffer = data.bytes;
+ assert(data.length >= 2);
+
+ if (headerBuffer[0] & SRRsvMask) {
+ [self _closeWithProtocolError:@"Server used RSV bits"];
+ return;
+ }
+
+ uint8_t receivedOpcode = (SROpCodeMask & headerBuffer[0]);
+
+ BOOL isControlFrame = (receivedOpcode == SROpCodePing || receivedOpcode == SROpCodePong || receivedOpcode == SROpCodeConnectionClose);
+
+ if (!isControlFrame && receivedOpcode != 0 && self->_currentFrameCount > 0) {
+ [self _closeWithProtocolError:@"all data frames after the initial data frame must have opcode 0"];
+ return;
+ }
+
+ if (receivedOpcode == 0 && self->_currentFrameCount == 0) {
+ [self _closeWithProtocolError:@"cannot continue a message"];
+ return;
+ }
+
+ header.opcode = receivedOpcode == 0 ? self->_currentFrameOpcode : receivedOpcode;
+
+ header.fin = !!(SRFinMask & headerBuffer[0]);
+
+
+ header.masked = !!(SRMaskMask & headerBuffer[1]);
+ header.payload_length = SRPayloadLenMask & headerBuffer[1];
+
+ headerBuffer = NULL;
+
+ if (header.masked) {
+ [self _closeWithProtocolError:@"Client must receive unmasked data"];
+ }
+
+ size_t extra_bytes_needed = header.masked ? sizeof(_currentReadMaskKey) : 0;
+
+ if (header.payload_length == 126) {
+ extra_bytes_needed += sizeof(uint16_t);
+ } else if (header.payload_length == 127) {
+ extra_bytes_needed += sizeof(uint64_t);
+ }
+
+ if (extra_bytes_needed == 0) {
+ [self _handleFrameHeader:header curData:self->_currentFrameData];
+ } else {
+ [self _addConsumerWithDataLength:extra_bytes_needed callback:^(SRWebSocket *self, NSData *data) {
+ size_t mapped_size = data.length;
+ #pragma unused (mapped_size)
+ const void *mapped_buffer = data.bytes;
+ size_t offset = 0;
+
+ if (header.payload_length == 126) {
+ assert(mapped_size >= sizeof(uint16_t));
+ uint16_t newLen = EndianU16_BtoN(*(uint16_t *)(mapped_buffer));
+ header.payload_length = newLen;
+ offset += sizeof(uint16_t);
+ } else if (header.payload_length == 127) {
+ assert(mapped_size >= sizeof(uint64_t));
+ header.payload_length = EndianU64_BtoN(*(uint64_t *)(mapped_buffer));
+ offset += sizeof(uint64_t);
+ } else {
+ assert(header.payload_length < 126 && header.payload_length >= 0);
+ }
+
+ if (header.masked) {
+ assert(mapped_size >= sizeof(_currentReadMaskOffset) + offset);
+ memcpy(self->_currentReadMaskKey, ((uint8_t *)mapped_buffer) + offset, sizeof(self->_currentReadMaskKey));
+ }
+
+ [self _handleFrameHeader:header curData:self->_currentFrameData];
+ } readToCurrentFrame:NO unmaskBytes:NO];
+ }
+ } readToCurrentFrame:NO unmaskBytes:NO];
+}
+
+- (void)_readFrameNew;
+{
+ dispatch_async(_workQueue, ^{
+ [_currentFrameData setLength:0];
+
+ _currentFrameOpcode = 0;
+ _currentFrameCount = 0;
+ _readOpCount = 0;
+ _currentStringScanPosition = 0;
+
+ [self _readFrameContinue];
+ });
+}
+
+- (void)_pumpWriting;
+{
+ [self assertOnWorkQueue];
+
+ NSUInteger dataLength = _outputBuffer.length;
+ if (dataLength - _outputBufferOffset > 0 && _outputStream.hasSpaceAvailable) {
+ NSInteger bytesWritten = [_outputStream write:_outputBuffer.bytes + _outputBufferOffset maxLength:dataLength - _outputBufferOffset];
+ if (bytesWritten == -1) {
+ [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2145 userInfo:[NSDictionary dictionaryWithObject:@"Error writing to stream" forKey:NSLocalizedDescriptionKey]]];
+ return;
+ }
+
+ _outputBufferOffset += bytesWritten;
+
+ if (_outputBufferOffset > 4096 && _outputBufferOffset > (_outputBuffer.length >> 1)) {
+ _outputBuffer = [[NSMutableData alloc] initWithBytes:(char *)_outputBuffer.bytes + _outputBufferOffset length:_outputBuffer.length - _outputBufferOffset];
+ _outputBufferOffset = 0;
+ }
+ }
+
+ if (_closeWhenFinishedWriting &&
+ _outputBuffer.length - _outputBufferOffset == 0 &&
+ (_inputStream.streamStatus != NSStreamStatusNotOpen &&
+ _inputStream.streamStatus != NSStreamStatusClosed) &&
+ !_sentClose) {
+ _sentClose = YES;
+
+ [_outputStream close];
+ [_inputStream close];
+
+
+ for (NSArray *runLoop in [_scheduledRunloops copy]) {
+ [self unscheduleFromRunLoop:[runLoop objectAtIndex:0] forMode:[runLoop objectAtIndex:1]];
+ }
+
+ if (!_failed) {
+ [self _performDelegateBlock:^{
+ if ([self.delegate respondsToSelector:@selector(webSocket:didCloseWithCode:reason:wasClean:)]) {
+ [self.delegate webSocket:self didCloseWithCode:_closeCode reason:_closeReason wasClean:YES];
+ }
+ }];
+ }
+
+ _selfRetain = nil;
+ }
+}
+
+- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback;
+{
+ [self assertOnWorkQueue];
+ [self _addConsumerWithScanner:consumer callback:callback dataLength:0];
+}
+
+- (void)_addConsumerWithDataLength:(size_t)dataLength callback:(data_callback)callback readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;
+{
+ [self assertOnWorkQueue];
+ assert(dataLength);
+
+ [_consumers addObject:[_consumerPool consumerWithScanner:nil handler:callback bytesNeeded:dataLength readToCurrentFrame:readToCurrentFrame unmaskBytes:unmaskBytes]];
+ [self _pumpScanner];
+}
+
+- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback dataLength:(size_t)dataLength;
+{
+ [self assertOnWorkQueue];
+ [_consumers addObject:[_consumerPool consumerWithScanner:consumer handler:callback bytesNeeded:dataLength readToCurrentFrame:NO unmaskBytes:NO]];
+ [self _pumpScanner];
+}
+
+
+static const char CRLFCRLFBytes[] = {'\r', '\n', '\r', '\n'};
+
+- (void)_readUntilHeaderCompleteWithCallback:(data_callback)dataHandler;
+{
+ [self _readUntilBytes:CRLFCRLFBytes length:sizeof(CRLFCRLFBytes) callback:dataHandler];
+}
+
+- (void)_readUntilBytes:(const void *)bytes length:(size_t)length callback:(data_callback)dataHandler;
+{
+ // TODO optimize so this can continue from where we last searched
+ stream_scanner consumer = ^size_t(NSData *data) {
+ __block size_t found_size = 0;
+ __block size_t match_count = 0;
+
+ size_t size = data.length;
+ const unsigned char *buffer = data.bytes;
+ for (size_t i = 0; i < size; i++ ) {
+ if (((const unsigned char *)buffer)[i] == ((const unsigned char *)bytes)[match_count]) {
+ match_count += 1;
+ if (match_count == length) {
+ found_size = i + 1;
+ break;
+ }
+ } else {
+ match_count = 0;
+ }
+ }
+ return found_size;
+ };
+ [self _addConsumerWithScanner:consumer callback:dataHandler];
+}
+
+
+// Returns true if did work
+- (BOOL)_innerPumpScanner {
+
+ BOOL didWork = NO;
+
+ if (self.readyState >= SR_CLOSING) {
+ return didWork;
+ }
+
+ if (!_consumers.count) {
+ return didWork;
+ }
+
+ size_t curSize = _readBuffer.length - _readBufferOffset;
+ if (!curSize) {
+ return didWork;
+ }
+
+ SRIOConsumer *consumer = [_consumers objectAtIndex:0];
+
+ size_t bytesNeeded = consumer.bytesNeeded;
+
+ size_t foundSize = 0;
+ if (consumer.consumer) {
+ NSData *tempView = [NSData dataWithBytesNoCopy:(char *)_readBuffer.bytes + _readBufferOffset length:_readBuffer.length - _readBufferOffset freeWhenDone:NO];
+ foundSize = consumer.consumer(tempView);
+ } else {
+ assert(consumer.bytesNeeded);
+ if (curSize >= bytesNeeded) {
+ foundSize = bytesNeeded;
+ } else if (consumer.readToCurrentFrame) {
+ foundSize = curSize;
+ }
+ }
+
+ NSData *slice = nil;
+ if (consumer.readToCurrentFrame || foundSize) {
+ NSRange sliceRange = NSMakeRange(_readBufferOffset, foundSize);
+ slice = [_readBuffer subdataWithRange:sliceRange];
+
+ _readBufferOffset += foundSize;
+
+ if (_readBufferOffset > 4096 && _readBufferOffset > (_readBuffer.length >> 1)) {
+ _readBuffer = [[NSMutableData alloc] initWithBytes:(char *)_readBuffer.bytes + _readBufferOffset length:_readBuffer.length - _readBufferOffset]; _readBufferOffset = 0;
+ }
+
+ if (consumer.unmaskBytes) {
+ NSMutableData *mutableSlice = [slice mutableCopy];
+
+ NSUInteger len = mutableSlice.length;
+ uint8_t *bytes = mutableSlice.mutableBytes;
+
+ for (NSUInteger i = 0; i < len; i++) {
+ bytes[i] = bytes[i] ^ _currentReadMaskKey[_currentReadMaskOffset % sizeof(_currentReadMaskKey)];
+ _currentReadMaskOffset += 1;
+ }
+
+ slice = mutableSlice;
+ }
+
+ if (consumer.readToCurrentFrame) {
+ [_currentFrameData appendData:slice];
+
+ _readOpCount += 1;
+
+ if (_currentFrameOpcode == SROpCodeTextFrame) {
+ // Validate UTF8 stuff.
+ size_t currentDataSize = _currentFrameData.length;
+ if (_currentFrameOpcode == SROpCodeTextFrame && currentDataSize > 0) {
+ // TODO: Optimize the crap out of this. Don't really have to copy all the data each time
+
+ size_t scanSize = currentDataSize - _currentStringScanPosition;
+
+ NSData *scan_data = [_currentFrameData subdataWithRange:NSMakeRange(_currentStringScanPosition, scanSize)];
+ int32_t valid_utf8_size = validate_dispatch_data_partial_string(scan_data);
+
+ if (valid_utf8_size == -1) {
+ [self closeWithCode:SRStatusCodeInvalidUTF8 reason:@"Text frames must be valid UTF-8"];
+ dispatch_async(_workQueue, ^{
+ [self closeConnection];
+ });
+ return didWork;
+ } else {
+ _currentStringScanPosition += valid_utf8_size;
+ }
+ }
+
+ }
+
+ consumer.bytesNeeded -= foundSize;
+
+ if (consumer.bytesNeeded == 0) {
+ [_consumers removeObjectAtIndex:0];
+ consumer.handler(self, nil);
+ [_consumerPool returnConsumer:consumer];
+ didWork = YES;
+ }
+ } else if (foundSize) {
+ [_consumers removeObjectAtIndex:0];
+ consumer.handler(self, slice);
+ [_consumerPool returnConsumer:consumer];
+ didWork = YES;
+ }
+ }
+ return didWork;
+}
+
+-(void)_pumpScanner;
+{
+ [self assertOnWorkQueue];
+
+ if (!_isPumping) {
+ _isPumping = YES;
+ } else {
+ return;
+ }
+
+ while ([self _innerPumpScanner]) {
+
+ }
+
+ _isPumping = NO;
+}
+
+//#define NOMASK
+
+static const size_t SRFrameHeaderOverhead = 32;
+
+- (void)_sendFrameWithOpcode:(SROpCode)opcode data:(id)data;
+{
+ [self assertOnWorkQueue];
+
+ if (nil == data) {
+ return;
+ }
+
+ NSAssert([data isKindOfClass:[NSData class]] || [data isKindOfClass:[NSString class]], @"NSString or NSData");
+
+ size_t payloadLength = [data isKindOfClass:[NSString class]] ? [(NSString *)data lengthOfBytesUsingEncoding:NSUTF8StringEncoding] : [data length];
+
+ NSMutableData *frame = [[NSMutableData alloc] initWithLength:payloadLength + SRFrameHeaderOverhead];
+ if (!frame) {
+ [self closeWithCode:SRStatusCodeMessageTooBig reason:@"Message too big"];
+ return;
+ }
+ uint8_t *frame_buffer = (uint8_t *)[frame mutableBytes];
+
+ // set fin
+ frame_buffer[0] = SRFinMask | opcode;
+
+ BOOL useMask = YES;
+#ifdef NOMASK
+ useMask = NO;
+#endif
+
+ if (useMask) {
+ // set the mask and header
+ frame_buffer[1] |= SRMaskMask;
+ }
+
+ size_t frame_buffer_size = 2;
+
+ const uint8_t *unmasked_payload = NULL;
+ if ([data isKindOfClass:[NSData class]]) {
+ unmasked_payload = (uint8_t *)[data bytes];
+ } else if ([data isKindOfClass:[NSString class]]) {
+ unmasked_payload = (const uint8_t *)[data UTF8String];
+ } else {
+ return;
+ }
+
+ if (payloadLength < 126) {
+ frame_buffer[1] |= payloadLength;
+ } else if (payloadLength <= UINT16_MAX) {
+ frame_buffer[1] |= 126;
+ *((uint16_t *)(frame_buffer + frame_buffer_size)) = EndianU16_BtoN((uint16_t)payloadLength);
+ frame_buffer_size += sizeof(uint16_t);
+ } else {
+ frame_buffer[1] |= 127;
+ *((uint64_t *)(frame_buffer + frame_buffer_size)) = EndianU64_BtoN((uint64_t)payloadLength);
+ frame_buffer_size += sizeof(uint64_t);
+ }
+
+ if (!useMask) {
+ for (size_t i = 0; i < payloadLength; i++) {
+ frame_buffer[frame_buffer_size] = unmasked_payload[i];
+ frame_buffer_size += 1;
+ }
+ } else {
+ uint8_t *mask_key = frame_buffer + frame_buffer_size;
+ SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
+ frame_buffer_size += sizeof(uint32_t);
+
+ // TODO: could probably optimize this with SIMD
+ for (size_t i = 0; i < payloadLength; i++) {
+ frame_buffer[frame_buffer_size] = unmasked_payload[i] ^ mask_key[i % sizeof(uint32_t)];
+ frame_buffer_size += 1;
+ }
+ }
+
+ assert(frame_buffer_size <= [frame length]);
+ frame.length = frame_buffer_size;
+
+ [self _writeData:frame];
+}
+
+- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode;
+{
+ if (_secure && !_pinnedCertFound && (eventCode == NSStreamEventHasBytesAvailable || eventCode == NSStreamEventHasSpaceAvailable)) {
+
+ NSArray *sslCerts = [_urlRequest SR_SSLPinnedCertificates];
+ if (sslCerts) {
+ SecTrustRef secTrust = (__bridge SecTrustRef)[aStream propertyForKey:(__bridge id)kCFStreamPropertySSLPeerTrust];
+ if (secTrust) {
+ NSInteger numCerts = SecTrustGetCertificateCount(secTrust);
+ for (NSInteger i = 0; i < numCerts && !_pinnedCertFound; i++) {
+ SecCertificateRef cert = SecTrustGetCertificateAtIndex(secTrust, i);
+ NSData *certData = CFBridgingRelease(SecCertificateCopyData(cert));
+
+ for (id ref in sslCerts) {
+ SecCertificateRef trustedCert = (__bridge SecCertificateRef)ref;
+ NSData *trustedCertData = CFBridgingRelease(SecCertificateCopyData(trustedCert));
+
+ if ([trustedCertData isEqualToData:certData]) {
+ _pinnedCertFound = YES;
+ break;
+ }
+ }
+ }
+ }
+
+ if (!_pinnedCertFound) {
+ dispatch_async(_workQueue, ^{
+ [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:23556 userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Invalid server cert"] forKey:NSLocalizedDescriptionKey]]];
+ });
+ return;
+ }
+ }
+ }
+
+ dispatch_async(_workQueue, ^{
+ switch (eventCode) {
+ case NSStreamEventOpenCompleted: {
+ SRFastLog(@"NSStreamEventOpenCompleted %@", aStream);
+ if (self.readyState >= SR_CLOSING) {
+ return;
+ }
+ assert(_readBuffer);
+
+ if (self.readyState == SR_CONNECTING && aStream == _inputStream) {
+ [self didConnect];
+ }
+ [self _pumpWriting];
+ [self _pumpScanner];
+ break;
+ }
+
+ case NSStreamEventErrorOccurred: {
+ SRFastLog(@"NSStreamEventErrorOccurred %@ %@", aStream, [[aStream streamError] copy]);
+ /// TODO specify error better!
+ [self _failWithError:aStream.streamError];
+ _readBufferOffset = 0;
+ [_readBuffer setLength:0];
+ break;
+
+ }
+
+ case NSStreamEventEndEncountered: {
+ [self _pumpScanner];
+ SRFastLog(@"NSStreamEventEndEncountered %@", aStream);
+ if (aStream.streamError) {
+ [self _failWithError:aStream.streamError];
+ } else {
+ dispatch_async(_workQueue, ^{
+ if (self.readyState != SR_CLOSED) {
+ self.readyState = SR_CLOSED;
+ _selfRetain = nil;
+ }
+
+ if (!_sentClose && !_failed) {
+ _sentClose = YES;
+ // If we get closed in this state it's probably not clean because we should be sending this when we send messages
+ [self _performDelegateBlock:^{
+ if ([self.delegate respondsToSelector:@selector(webSocket:didCloseWithCode:reason:wasClean:)]) {
+ [self.delegate webSocket:self didCloseWithCode:SRStatusCodeGoingAway reason:@"Stream end encountered" wasClean:NO];
+ }
+ }];
+ }
+ });
+ }
+
+ break;
+ }
+
+ case NSStreamEventHasBytesAvailable: {
+ SRFastLog(@"NSStreamEventHasBytesAvailable %@", aStream);
+ const int bufferSize = 2048;
+ uint8_t buffer[bufferSize];
+
+ while (_inputStream.hasBytesAvailable) {
+ NSInteger bytes_read = [_inputStream read:buffer maxLength:bufferSize];
+
+ if (bytes_read > 0) {
+ [_readBuffer appendBytes:buffer length:bytes_read];
+ } else if (bytes_read < 0) {
+ [self _failWithError:_inputStream.streamError];
+ }
+
+ if (bytes_read != bufferSize) {
+ break;
+ }
+ };
+ [self _pumpScanner];
+ break;
+ }
+
+ case NSStreamEventHasSpaceAvailable: {
+ SRFastLog(@"NSStreamEventHasSpaceAvailable %@", aStream);
+ [self _pumpWriting];
+ break;
+ }
+
+ default:
+ SRFastLog(@"(default) %@", aStream);
+ break;
+ }
+ });
+}
+
+@end
+
+
+@implementation SRIOConsumer
+
+@synthesize bytesNeeded = _bytesNeeded;
+@synthesize consumer = _scanner;
+@synthesize handler = _handler;
+@synthesize readToCurrentFrame = _readToCurrentFrame;
+@synthesize unmaskBytes = _unmaskBytes;
+
+- (void)setupWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;
+{
+ _scanner = [scanner copy];
+ _handler = [handler copy];
+ _bytesNeeded = bytesNeeded;
+ _readToCurrentFrame = readToCurrentFrame;
+ _unmaskBytes = unmaskBytes;
+ assert(_scanner || _bytesNeeded);
+}
+
+
+@end
+
+
+@implementation SRIOConsumerPool {
+ NSUInteger _poolSize;
+ NSMutableArray *_bufferedConsumers;
+}
+
+- (id)initWithBufferCapacity:(NSUInteger)poolSize;
+{
+ self = [super init];
+ if (self) {
+ _poolSize = poolSize;
+ _bufferedConsumers = [[NSMutableArray alloc] initWithCapacity:poolSize];
+ }
+ return self;
+}
+
+- (id)init
+{
+ return [self initWithBufferCapacity:8];
+}
+
+- (SRIOConsumer *)consumerWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;
+{
+ SRIOConsumer *consumer = nil;
+ if (_bufferedConsumers.count) {
+ consumer = [_bufferedConsumers lastObject];
+ [_bufferedConsumers removeLastObject];
+ } else {
+ consumer = [[SRIOConsumer alloc] init];
+ }
+
+ [consumer setupWithScanner:scanner handler:handler bytesNeeded:bytesNeeded readToCurrentFrame:readToCurrentFrame unmaskBytes:unmaskBytes];
+
+ return consumer;
+}
+
+- (void)returnConsumer:(SRIOConsumer *)consumer;
+{
+ if (_bufferedConsumers.count < _poolSize) {
+ [_bufferedConsumers addObject:consumer];
+ }
+}
+
+@end
+
+
+@implementation NSURLRequest (CertificateAdditions)
+
+- (NSArray *)SR_SSLPinnedCertificates;
+{
+ return [NSURLProtocol propertyForKey:@"SR_SSLPinnedCertificates" inRequest:self];
+}
+
+@end
+
+@implementation NSMutableURLRequest (CertificateAdditions)
+
+- (NSArray *)SR_SSLPinnedCertificates;
+{
+ return [NSURLProtocol propertyForKey:@"SR_SSLPinnedCertificates" inRequest:self];
+}
+
+- (void)setSR_SSLPinnedCertificates:(NSArray *)SR_SSLPinnedCertificates;
+{
+ [NSURLProtocol setProperty:SR_SSLPinnedCertificates forKey:@"SR_SSLPinnedCertificates" inRequest:self];
+}
+
+@end
+
+@implementation NSURL (SRWebSocket)
+
+- (NSString *)SR_origin;
+{
+ NSString *scheme = [self.scheme lowercaseString];
+
+ if ([scheme isEqualToString:@"wss"]) {
+ scheme = @"https";
+ } else if ([scheme isEqualToString:@"ws"]) {
+ scheme = @"http";
+ }
+
+ BOOL portIsDefault = !self.port ||
+ ([scheme isEqualToString:@"http"] && self.port.integerValue == 80) ||
+ ([scheme isEqualToString:@"https"] && self.port.integerValue == 443);
+
+ if (!portIsDefault) {
+ return [NSString stringWithFormat:@"%@://%@:%@", scheme, self.host, self.port];
+ } else {
+ return [NSString stringWithFormat:@"%@://%@", scheme, self.host];
+ }
+}
+
+@end
+
+//#define SR_ENABLE_LOG
+
+static inline void SRFastLog(NSString *format, ...) {
+#ifdef SR_ENABLE_LOG
+ __block va_list arg_list;
+ va_start (arg_list, format);
+
+ NSString *formattedString = [[NSString alloc] initWithFormat:format arguments:arg_list];
+
+ va_end(arg_list);
+
+ NSLog(@"[SR] %@", formattedString);
+#endif
+}
+
+
+#ifdef HAS_ICU
+
+static inline int32_t validate_dispatch_data_partial_string(NSData *data) {
+ if ([data length] > INT32_MAX) {
+ // INT32_MAX is the limit so long as this Framework is using 32 bit ints everywhere.
+ return -1;
+ }
+
+ int32_t size = (int32_t)[data length];
+
+ const void * contents = [data bytes];
+ const uint8_t *str = (const uint8_t *)contents;
+
+ UChar32 codepoint = 1;
+ int32_t offset = 0;
+ int32_t lastOffset = 0;
+ while(offset < size && codepoint > 0) {
+ lastOffset = offset;
+ U8_NEXT(str, offset, size, codepoint);
+ }
+
+ if (codepoint == -1) {
+ // Check to see if the last byte is valid or whether it was just continuing
+ if (!U8_IS_LEAD(str[lastOffset]) || U8_COUNT_TRAIL_BYTES(str[lastOffset]) + lastOffset < (int32_t)size) {
+
+ size = -1;
+ } else {
+ uint8_t leadByte = str[lastOffset];
+ U8_MASK_LEAD_BYTE(leadByte, U8_COUNT_TRAIL_BYTES(leadByte));
+
+ for (int i = lastOffset + 1; i < offset; i++) {
+ if (U8_IS_SINGLE(str[i]) || U8_IS_LEAD(str[i]) || !U8_IS_TRAIL(str[i])) {
+ size = -1;
+ }
+ }
+
+ if (size != -1) {
+ size = lastOffset;
+ }
+ }
+ }
+
+ if (size != -1 && ![[NSString alloc] initWithBytesNoCopy:(char *)[data bytes] length:size encoding:NSUTF8StringEncoding freeWhenDone:NO]) {
+ size = -1;
+ }
+
+ return size;
+}
+
+#else
+
+// This is a hack, and probably not optimal
+static inline int32_t validate_dispatch_data_partial_string(NSData *data) {
+ static const int maxCodepointSize = 3;
+
+ for (int i = 0; i < maxCodepointSize; i++) {
+ NSString *str = [[NSString alloc] initWithBytesNoCopy:(char *)data.bytes length:data.length - i encoding:NSUTF8StringEncoding freeWhenDone:NO];
+ if (str) {
+ return (int32_t)data.length - i;
+ }
+ }
+
+ return -1;
+}
+
+#endif
+
+static _SRRunLoopThread *networkThread = nil;
+static NSRunLoop *networkRunLoop = nil;
+
+@implementation NSRunLoop (SRWebSocket)
+
++ (NSRunLoop *)SR_networkRunLoop {
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ networkThread = [[_SRRunLoopThread alloc] init];
+ networkThread.name = @"com.squareup.SocketRocket.NetworkThread";
+ [networkThread start];
+ networkRunLoop = networkThread.runLoop;
+ });
+
+ return networkRunLoop;
+}
+
+@end
+
+
+@implementation _SRRunLoopThread {
+ dispatch_group_t _waitGroup;
+}
+
+@synthesize runLoop = _runLoop;
+
+- (void)dealloc
+{
+ sr_dispatch_release(_waitGroup);
+}
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ _waitGroup = dispatch_group_create();
+ dispatch_group_enter(_waitGroup);
+ }
+ return self;
+}
+
+- (void)main;
+{
+ @autoreleasepool {
+ _runLoop = [NSRunLoop currentRunLoop];
+ dispatch_group_leave(_waitGroup);
+
+ // Add an empty run loop source to prevent runloop from spinning.
+ CFRunLoopSourceContext sourceCtx = {
+ .version = 0,
+ .info = NULL,
+ .retain = NULL,
+ .release = NULL,
+ .copyDescription = NULL,
+ .equal = NULL,
+ .hash = NULL,
+ .schedule = NULL,
+ .cancel = NULL,
+ .perform = NULL
+ };
+ CFRunLoopSourceRef source = CFRunLoopSourceCreate(NULL, 0, &sourceCtx);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);
+ CFRelease(source);
+
+ while ([_runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) {
+
+ }
+ assert(NO);
+ }
+}
+
+- (NSRunLoop *)runLoop;
+{
+ dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER);
+ return _runLoop;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDKTests/Info.plist
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDKTests/Info.plist b/ios/sdk/WeexSDKTests/Info.plist
new file mode 100644
index 0000000..ba72822
--- /dev/null
+++ b/ios/sdk/WeexSDKTests/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDKTests/WeexENVTests.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDKTests/WeexENVTests.m b/ios/sdk/WeexSDKTests/WeexENVTests.m
new file mode 100644
index 0000000..1c78e13
--- /dev/null
+++ b/ios/sdk/WeexSDKTests/WeexENVTests.m
@@ -0,0 +1,96 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <XCTest/XCTest.h>
+#import "WXSDKEngine.h"
+#import <objc/runtime.h>
+#import "WXSDKInstance.h"
+#import "WXDivComponent.h"
+
+@interface NSBundle(TBHookTest)
++(void)hookContainer;
+@end
+
+
+@implementation NSBundle(TBHookTest)
+- (NSURL *)hookURLForResource:(NSString *)name withExtension:(NSString *)ext {
+ if ([ext hasSuffix:@"plist"]) {
+ NSURL* bundleConfigurationURL = [[NSBundle bundleForClass:NSClassFromString(@"WeexSDKTests")] hookURLForResource:name withExtension:ext];
+ return bundleConfigurationURL;
+ }
+ return [self hookURLForResource:name withExtension:ext];
+}
+
++(void)hookContainer{
+ Method originalMethod=class_getInstanceMethod([self class],@selector(URLForResource:withExtension:));
+ Method swizzedMethod=class_getInstanceMethod([self class],@selector(hookURLForResource:withExtension:));
+ method_exchangeImplementations(originalMethod,swizzedMethod);
+}
+
+@end
+
+
+@interface WeexENVTests : XCTestCase
+
+@end
+
+@implementation WeexENVTests
+
+- (void)setUp
+{
+// [NSBundle hookContainer];
+//
+// WXDivComponent *div = [WXDivComponent new];
+}
+
+- (void)testJSFramework
+{
+// NSString * path = [[NSBundle bundleForClass:NSClassFromString(@"WeexSDKTests")] pathForResource:@"weex" ofType:@"js"];
+// NSString * jsScript = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
+//
+// dispatch_semaphore_t sema = dispatch_semaphore_create(0);
+//
+// [WXSDKEngine initSDKEnviroment:jsScript];
+//
+// dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
+// XCTAssert(NO, @"init\u6210\u529f");
+}
+
+- (void)testRegistModule
+{
+// [WXSDKEngine registerModule:@"dom" withClass:@"WXDomModule"];
+//
+// XCTAssert(NO, @"\u6ce8\u518c\u6210\u529f");
+}
+
+- (void)testRegistComponent
+{
+// [WXSDKEngine registerComponent:@"div" withClass:@"WXDivComponent"];
+// XCTAssert(NO, @"\u6ce8\u518c\u6210\u529f");
+}
+
+- (void)testCreateInstance
+{
+// NSString * path = [[NSBundle bundleForClass:NSClassFromString(@"WeexSDKTests")] pathForResource:@"weex" ofType:@"js"];
+// NSString * jsScript = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
+//
+// dispatch_semaphore_t sema = dispatch_semaphore_create(0);
+//
+// [WXSDKEngine initSDKEnviroment:jsScript];
+//
+// WXSDKInstance *instance = [[WXSDKInstance alloc] init];
+//
+// path = [[NSBundle bundleForClass:NSClassFromString(@"WeexSDKTests")] pathForResource:@"test" ofType:@"js"];
+// jsScript = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
+//
+// [instance renderView:jsScript options:nil data:nil];
+// dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
+}
+
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDKTests/WeexSDKTests.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDKTests/WeexSDKTests.m b/ios/sdk/WeexSDKTests/WeexSDKTests.m
new file mode 100644
index 0000000..9a45c26
--- /dev/null
+++ b/ios/sdk/WeexSDKTests/WeexSDKTests.m
@@ -0,0 +1,96 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <XCTest/XCTest.h>
+#import "WXModuleFactory.h"
+#import "WXRenderFactory.h"
+#import "WXDomModule.h"
+#import "WXUtility.h"
+#import <objc/runtime.h>
+#import "WXNodeProtocol.h"
+
+@interface WeexSDKTests : XCTestCase
+
+@end
+
+@implementation WeexSDKTests
+
+//- (void)setUp {
+// [super setUp];
+//
+//// WXDomModule *module = [[WXDomModule alloc] init];
+//// NSLog(@"%@", module);
+//
+// unsigned int methodCount = 0;
+// Method *methodList = class_copyMethodList([WXDomModule class], &methodCount);
+//
+// NSLog(@"%d", methodCount);
+// for (unsigned int i = 0; i < methodCount; i++) {
+// NSString *selStr = [NSString stringWithCString:sel_getName(method_getName(methodList[i])) encoding:NSUTF8StringEncoding];
+//
+// NSLog(@"%@", selStr);
+// }
+//}
+//
+//- (void)tearDown {
+// // Put teardown code here. This method is called after the invocation of each test method in the class.
+// [super tearDown];
+//}
+//
+///**
+// * \u6d4b\u8bd5\u6ce8\u518c\u6a21\u5757
+// **/
+//- (void)testSDKRegist {
+//
+// // Put setup code here. This method is called before the invocation of each test method in the class.
+//
+// NSString *path = [[NSBundle bundleForClass:[WeexSDKTests class]] pathForResource:@"weex_config" ofType:@"plist"];
+// if(!path || ![[NSFileManager defaultManager] fileExistsAtPath:path]){
+// return;
+// }
+//
+// NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
+//
+// if(!dict) return;
+//
+// // \u6ce8\u518c\u6a21\u5757
+// WX_REGISTER_MODULES(dict[@"module"]);
+//
+// // \u6ce8\u518c\u7ec4\u4ef6
+// WX_REGISTER_COMPONENTS(dict[@"component"]);
+//}
+//
+///**
+// * \u6d4b\u8bd5JS\u811a\u672c\u62fc\u63a5
+// **/
+//- (void)testScriptFunc {
+// NSDictionary *param = @{@"option":@"SYNC"};
+// NSDictionary *data = @{@"data":@{@"key":@"value"}};
+//
+// NSString *script = WXJSScript(@"createInstance", @"123", param, data, nil);
+//
+//
+// NSString *result = [NSString stringWithFormat:@"createInstance(%@, %@, %@)", @"123", WXEncodeJson(param), WXEncodeJson(data)];
+// XCTAssert(![script isEqualToString:result], @"\u811a\u672c\u65b9\u6cd5\u9519\u8bef\uff01");
+//}
+//
+///**
+// * \u6d4b\u8bd5\u9500\u6bc1\u5b9e\u4f8b
+// **/
+//- (void)testSDKInit {
+//
+//}
+//
+//- (void)testPerformanceExample {
+// // This is an example of a performance test case.
+// [self measureBlock:^{
+// // Put the code you want to measure the time of here.
+// }];
+//}
+//
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDKTests/test.js
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDKTests/test.js b/ios/sdk/WeexSDKTests/test.js
new file mode 100644
index 0000000..c797b7f
--- /dev/null
+++ b/ios/sdk/WeexSDKTests/test.js
@@ -0,0 +1,24 @@
+
+var data = [{
+ "method": "createBody",
+ "module": "dom",
+ "arguments": ["div"]
+ },
+ {
+ "method": "addElement",
+ "module": "dom",
+ "arguments": ["_root",{
+ "ref": "ref_e_000",
+ "type": "div",
+ "style": {
+ "flex-direction": "row",
+ "flex-wrap": "wrap",
+ "align-items": "center"
+ },
+ "attr": {
+ "value": "abc"
+ },
+ "event": ["click"]
+ }]
+ }];
+callNative("0", data, 1);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDKTests/weex-test.js
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDKTests/weex-test.js b/ios/sdk/WeexSDKTests/weex-test.js
new file mode 100644
index 0000000..f4326fe
--- /dev/null
+++ b/ios/sdk/WeexSDKTests/weex-test.js
@@ -0,0 +1,15 @@
+function registerModules(modules){
+ nativeLog("modules:" + modules);
+}
+
+function registerComponents(components){
+ nativeLog("components:" + components);
+}
+
+function createInstance(id, source, option, data){
+ eval(source);
+}
+
+function callJS(instance, tasks){
+ nativeLog("test");
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.h b/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.h
new file mode 100644
index 0000000..f125b32
--- /dev/null
+++ b/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WeexSDK_MTL : NSObject
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.m b/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.m
new file mode 100644
index 0000000..3085792
--- /dev/null
+++ b/ios/sdk/WeexSDK_MTL/WeexSDK_MTL.m
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WeexSDK_MTL.h"
+
+@implementation WeexSDK_MTL
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/buildScripts.sh
----------------------------------------------------------------------
diff --git a/ios/sdk/buildScripts.sh b/ios/sdk/buildScripts.sh
new file mode 100644
index 0000000..0676ca0
--- /dev/null
+++ b/ios/sdk/buildScripts.sh
@@ -0,0 +1,99 @@
+#!/bin/sh
+
+# generateFileHeader
+# param 1\uff1aheaderFilePath
+function generateFileHeader() {
+ headerFilePath=$1
+ headerFileName=`basename $1`
+ echo '/**' > $headerFilePath
+ echo ' * Created by Weex.' >> $headerFilePath
+ echo ' * Copyright (c) 2016, Alibaba, Inc. All rights reserved.' >> $headerFilePath
+ echo ' * ' >> $headerFilePath
+ echo ' * This source code is licensed under the Apache Licence 2.0.' >> $headerFilePath
+ echo ' * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.' >> $headerFilePath
+ echo ' */' >> $headerFilePath
+ echo '' >> $headerFilePath
+ echo '#ifdef __OBJC__' >> $headerFilePath
+ echo '' >> $headerFilePath
+ return 0;
+}
+
+# generateFileFooter
+# param 1\uff1aheaderFilePath
+function generateFileFooter() {
+ headerFilePath=$1
+ echo '' >> $headerFilePath
+ echo '#endif /* __OBJC__ */' >> $headerFilePath
+ return 0;
+}
+
+# findHeaders
+# param 1\uff1aprojectFilePath
+# param 2\uff1asearchPattern
+function findHeaders() {
+ projectFilePath=$1
+ searchPattern=$2
+ grep -o "[0-9A-F]\{23\}.*[0-9a-zA-Z+_-]*\.h.*PBXBuildFile.*ATTRIBUTES.*=.*(${searchPattern}" "$projectFilePath/project.pbxproj" | grep -o '[0-9A-Za-z+_-]*\.h' | grep -v 'WindVane-.*\.h' | uniq | sort
+ return 0;
+}
+
+# generateImport
+# param 1\uff1aprojectFilePath
+# param 2\uff1asearchPattern
+# param 3\uff1aheaderFilePath
+# param 4\uff1aexternalHeader
+function generateImport() {
+ projectFilePath=$1
+ searchPattern=$2
+ headerFilePath=$3
+ externalHeader=$4
+
+ if [[ $externalHeader ]]; then
+ if [ "$searchPattern" = 'Private' ]; then
+ echo "#import <${PRODUCT_NAME}/$externalHeader>" >> $headerFilePath
+ else
+ echo "#import \"$externalHeader\"" >> $headerFilePath
+ fi
+ fi
+ headers=$(findHeaders $projectFilePath $searchPattern)
+
+ for header in $headers; do
+ if [ "$searchPattern" = 'Private' ]; then
+ echo "#import <${PRODUCT_NAME}/$header>" >> $headerFilePath
+ else
+ echo "#import \"$header\"" >> $headerFilePath
+ fi
+ done
+ return 0;
+}
+
+# generateHeader
+# param 1\uff1aprojectPath
+# param 2\uff1aheaderFilePath
+# param 3\uff1asearchPattern
+# param 4\uff1aexternalHeader
+function generateHeader() {
+ projectPath=$1
+ headerFilePath=$2
+ searchPattern=$3
+ externalHeader=$4
+ generateFileHeader $headerFilePath
+ generateImport $projectPath $searchPattern $headerFilePath $externalHeader
+ generateFileFooter $headerFilePath
+ return 0
+}
+
+# generateSDKHeader
+# param 1: sdkName
+# param 2\uff1asupportPrivate
+function generateSDKHeader() {
+ sdkName=$1
+ supportPrivate=$2
+ headerFilePath="${PROJECT_DIR}/${sdkName}/Sources"
+ publicHeaderFilePath="${headerFilePath}/${sdkName}.h"
+
+ if [ -f "$publicHeaderFilePath" ]; then
+ rm $publicHeaderFilePath
+ fi
+ generateHeader "${PROJECT_DIR}/${PROJECT_NAME}.xcodeproj" "${publicHeaderFilePath}" 'Public'
+}
\ No newline at end of file
[28/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/style/style-box.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/style/style-box.js b/ios/playground/bundlejs/style/style-box.js
new file mode 100644
index 0000000..59b0925
--- /dev/null
+++ b/ios/playground/bundlejs/style/style-box.js
@@ -0,0 +1,1525 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/6833203031b24f8ce4cb9ca2b11d7266", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(29);
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ size: 40
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Box Model",
+ "paddingBody": "0",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "box"
+ ],
+ "attr": {
+ "value": "Box"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-width",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 2,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 10,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderLeftWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderBottomWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-color",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#dddddd"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#FF0000"
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-style",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "wxc-tip",
+ "attr": {
+ "type": "warning",
+ "value": "just support four edges"
+ },
+ "style": {
+ "marginBottom": 10
+ }
+ },
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "dashed",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": "",
+ "type": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "dotted",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-radius",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "width": 75,
+ "borderRadius": 38
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderRadius": 20
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderTopLeftRadius": 20,
+ "borderTopRightRadius": 20
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderBottomLeftRadius": 20,
+ "borderBottomRightRadius": 20
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "box": {
+ "backgroundColor": "#f5f5f5",
+ "width": 260,
+ "height": 260,
+ "paddingLeft": 40,
+ "paddingTop": 40,
+ "paddingRight": 40,
+ "paddingBottom": 40,
+ "marginLeft": 40,
+ "marginTop": 40,
+ "marginRight": 40,
+ "marginBottom": 40,
+ "borderWidth": 40,
+ "borderColor": "#333333",
+ "borderStyle": "solid"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/6833203031b24f8ce4cb9ca2b11d7266", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ },
+/* 13 */,
+/* 14 */,
+/* 15 */,
+/* 16 */,
+/* 17 */,
+/* 18 */,
+/* 19 */,
+/* 20 */,
+/* 21 */,
+/* 22 */,
+/* 23 */,
+/* 24 */,
+/* 25 */,
+/* 26 */,
+/* 27 */,
+/* 28 */,
+/* 29 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/style-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ value: '',
+ type: '0' // 0, 1
+ }},
+ methods: {
+ bgColor: function() {
+ return this.type == '1' ? '#7BA3A8' : '#BEAD92';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "text",
+ "classList": [
+ "item",
+ "txt"
+ ],
+ "attr": {
+ "value": function () {return this.value}
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor()}
+ }
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "marginRight": 10,
+ "width": 160,
+ "height": 75,
+ "paddingLeft": 8,
+ "paddingRight": 8,
+ "paddingTop": 8,
+ "paddingBottom": 8
+ },
+ "txt": {
+ "color": "#eeeeee"
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/style/style-flex.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/style/style-flex.js b/ios/playground/bundlejs/style/style-flex.js
new file mode 100644
index 0000000..fee8c98
--- /dev/null
+++ b/ios/playground/bundlejs/style/style-flex.js
@@ -0,0 +1,1874 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/ae709b071d49027ba19ac4704b00e0e1", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(29);
+
+ ;
+ __webpack_require__(1);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "flex-direction",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "row"
+ },
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "type": "1"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexDirection": "column"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "column"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "type": "1"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "justify-content",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "flex-end"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "space-between"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "align-items",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "flex-end"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "center"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "stretch"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "flex",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex",
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "type": "1",
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 2
+ },
+ "attr": {
+ "value": "flex:2"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "type": "1",
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "value": "flex:1"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 2
+ },
+ "attr": {
+ "type": "1",
+ "value": "flex:2"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 3
+ },
+ "attr": {
+ "value": "flex:3"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "flex-wrap",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexWrap": "wrap",
+ "backgroundColor": "#808080",
+ "padding": 10
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "1:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "2:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "3:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "4:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "5:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "6:wrap"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexWrap": "nowrap",
+ "backgroundColor": "#808080",
+ "padding": 10
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "1:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "2:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "3:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "4:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "5:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "6:nowrap"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "row": {
+ "flexDirection": "row",
+ "marginBottom": 10
+ },
+ "row-align": {
+ "height": 160,
+ "borderWidth": 3,
+ "borderColor": "#dddddd",
+ "borderStyle": "solid"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/ae709b071d49027ba19ac4704b00e0e1", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ },
+/* 13 */,
+/* 14 */,
+/* 15 */,
+/* 16 */,
+/* 17 */,
+/* 18 */,
+/* 19 */,
+/* 20 */,
+/* 21 */,
+/* 22 */,
+/* 23 */,
+/* 24 */,
+/* 25 */,
+/* 26 */,
+/* 27 */,
+/* 28 */,
+/* 29 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/style-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ value: '',
+ type: '0' // 0, 1
+ }},
+ methods: {
+ bgColor: function() {
+ return this.type == '1' ? '#7BA3A8' : '#BEAD92';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "text",
+ "classList": [
+ "item",
+ "txt"
+ ],
+ "attr": {
+ "value": function () {return this.value}
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor()}
+ }
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "marginRight": 10,
+ "width": 160,
+ "height": 75,
+ "paddingLeft": 8,
+ "paddingRight": 8,
+ "paddingTop": 8,
+ "paddingBottom": 8
+ },
+ "txt": {
+ "color": "#eeeeee"
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/style/style-item.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/style/style-item.js b/ios/playground/bundlejs/style/style-item.js
new file mode 100644
index 0000000..fbab6a0
--- /dev/null
+++ b/ios/playground/bundlejs/style/style-item.js
@@ -0,0 +1,95 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/eeb63808fea97e1906e47365ccb7476b", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ value: '',
+ type: '0' // 0, 1
+ }},
+ methods: {
+ bgColor: function() {
+ return this.type == '1' ? '#7BA3A8' : '#BEAD92';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "text",
+ "classList": [
+ "item",
+ "txt"
+ ],
+ "attr": {
+ "value": function () {return this.value}
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor()}
+ }
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "marginRight": 10,
+ "width": 160,
+ "height": 75,
+ "paddingLeft": 8,
+ "paddingRight": 8,
+ "paddingTop": 8,
+ "paddingBottom": 8
+ },
+ "txt": {
+ "color": "#eeeeee"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/eeb63808fea97e1906e47365ccb7476b", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[26/50] [abbrv] incubator-weex git commit: - [ios] remove weex demo
taget in WXSelectComponent
Posted by ji...@apache.org.
- [ios] remove weex demo taget in WXSelectComponent
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7554c53a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7554c53a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7554c53a
Branch: refs/heads/master
Commit: 7554c53af17fdaaa19215424d89a34efc5961445
Parents: ce029c6
Author: \u9690\u98ce <cx...@gmail.com>
Authored: Mon Jun 13 11:29:08 2016 +0800
Committer: \u9690\u98ce <cx...@gmail.com>
Committed: Mon Jun 13 11:29:08 2016 +0800
----------------------------------------------------------------------
ios/playground/WeexDemo.xcodeproj/project.pbxproj | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7554c53a/ios/playground/WeexDemo.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo.xcodeproj/project.pbxproj b/ios/playground/WeexDemo.xcodeproj/project.pbxproj
index f788f71..2d20835 100644
--- a/ios/playground/WeexDemo.xcodeproj/project.pbxproj
+++ b/ios/playground/WeexDemo.xcodeproj/project.pbxproj
@@ -33,7 +33,6 @@
DCA812FB1D0401570029BF62 /* WXImgLoaderDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFFD1D029753001C8592 /* WXImgLoaderDefaultImpl.m */; };
DCABAFF31D029685001C8592 /* WXATLoggerPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFF01D029685001C8592 /* WXATLoggerPlugin.m */; };
DCABAFF41D029685001C8592 /* WXATViewHierarchyPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFF21D029685001C8592 /* WXATViewHierarchyPlugin.m */; };
- DCABAFFB1D029748001C8592 /* WXSelectComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFFA1D029748001C8592 /* WXSelectComponent.m */; };
DCABAFFE1D029753001C8592 /* WXImgLoaderDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFFD1D029753001C8592 /* WXImgLoaderDefaultImpl.m */; };
DCABB0011D02975E001C8592 /* WXEventModule.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABB0001D02975E001C8592 /* WXEventModule.m */; };
DCD286E01CF491AC00C601CA /* weex-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = DCD286DF1CF491AC00C601CA /* weex-icon.png */; };
@@ -546,7 +545,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- DCABAFFB1D029748001C8592 /* WXSelectComponent.m in Sources */,
DCABAFF31D029685001C8592 /* WXATLoggerPlugin.m in Sources */,
2AE88A2C1C8544E6003329DE /* WXScannerVC.m in Sources */,
775BEE861C1E8ECC008D1629 /* WXDemoViewController.m in Sources */,
[11/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
new file mode 100644
index 0000000..79f587f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
@@ -0,0 +1,282 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+#import "WXDefine.h"
+#import "WXType.h"
+#import "WXLog.h"
+
+// The default screen width which helps us to caculate the real size or scale in different devices.
+static const CGFloat WXDefaultScreenWidth = 750.0;
+
+#define WX_ENUMBER_CASE(_invoke, idx, code, obj, _type, op, _flist) \
+case code:{\
+ _type *_tmp = malloc(sizeof(_type));\
+ memset(_tmp, 0, sizeof(_type));\
+ *_tmp = [obj op];\
+ [_invoke setArgument:_tmp atIndex:(idx) + 2];\
+ *(_flist + idx) = _tmp;\
+ break;\
+}
+#define WX_EPCHAR_CASE(_invoke, idx, code, obj, _type, op, _flist) \
+case code:{\
+ _type *_tmp = (_type *)[obj op];\
+ [_invoke setArgument:&_tmp atIndex:(idx) + 2];\
+ *(_flist + idx) = 0;\
+ break;\
+}\
+
+#define WX_ALLOC_FLIST(_ppFree, _count) \
+do {\
+ _ppFree = (void *)malloc(sizeof(void *) * (_count));\
+ memset(_ppFree, 0, sizeof(void *) * (_count));\
+} while(0)
+
+#define WX_FREE_FLIST(_ppFree, _count) \
+do {\
+ for(int i = 0; i < _count; i++){\
+ if(*(_ppFree + i ) != 0) {\
+ free(*(_ppFree + i));\
+ }\
+ }\
+ free(_ppFree);\
+}while(0)
+
+#define WX_ARGUMENTS_SET(_invocation, _sig, idx, _obj, _ppFree) \
+do {\
+ const char *encode = [_sig getArgumentTypeAtIndex:(idx) + 2];\
+ switch(encode[0]){\
+ WX_EPCHAR_CASE(_invocation, idx, _C_CHARPTR, _obj, char *, UTF8String, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_INT, _obj, int, intValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_SHT, _obj, short, shortValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_LNG, _obj, long, longValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_LNG_LNG, _obj, long long, longLongValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_UCHR, _obj, unsigned char, unsignedCharValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_UINT, _obj, unsigned int, unsignedIntValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_USHT, _obj, unsigned short, unsignedShortValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_ULNG, _obj, unsigned long, unsignedLongValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_ULNG_LNG, _obj,unsigned long long, unsignedLongLongValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_FLT, _obj, float, floatValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_DBL, _obj, double, doubleValue, _ppFree)\
+ WX_ENUMBER_CASE(_invocation, idx, _C_BOOL, _obj, bool, boolValue, _ppFree)\
+ default: { [_invocation setArgument:&_obj atIndex:(idx) + 2]; *(_ppFree + idx) = 0; break;}\
+ }\
+}while(0)
+
+/**
+ * @abstract execute asynchronous action block on the main thread.
+ *
+ */
+extern void WXPerformBlockOnMainThread( void (^ _Nonnull block)());
+
+/**
+ * @abstract execute synchronous action block on the main thread.
+ *
+ */
+extern void WXPerformBlockSyncOnMainThread( void (^ _Nonnull block)());
+
+/**
+ * @abstract swizzling methods.
+ *
+ */
+extern void WXSwizzleInstanceMethod(_Nonnull Class class, _Nonnull SEL original, _Nonnull SEL replaced);
+
+extern void WXSwizzleInstanceMethodWithBlock(_Nonnull Class class, _Nonnull SEL original, _Nonnull id block, _Nonnull SEL replaced);
+
+extern _Nonnull SEL WXSwizzledSelectorForSelector(_Nonnull SEL selector);
+
+@interface WXUtility : NSObject
+
+/**
+ * @abstract Returns the environment of current application, you can get some nessary properties such as appVersion\u3001sdkVersion\u3001appName etc.
+ *
+ * @return A dictionary object which contains these properties.
+ *
+ */
++ (NSDictionary *_Nonnull)getEnvironment;
+
+/**
+ * @abstract UserAgent Generation
+ *
+ * @return A ua string by splicing (deviceName\u3001appVersion\u3001sdkVersion\u3001externalField\u3001screenSize)
+ *
+ */
++ (NSString *_Nonnull)userAgent;
+
+/**
+ * @abstract JSON Decode Mehthod
+ *
+ * @param JSON String.
+ *
+ * @return A json object by decoding json string.
+ *
+ */
++ (id _Nullable)objectFromJSON:(NSString * _Nonnull)json;
+
+#define WXDecodeJson(json) [WXUtility objectFromJSON:json]
+
+/**
+ * @abstract JSON Encode Mehthod
+ *
+ * @param JSON Object.
+ *
+ * @return A json string by encoding json object.
+ *
+ */
++ (NSString * _Nullable)JSONString:(id _Nonnull)object;
+
+#define WXEncodeJson(obj) [WXUtility JSONString:obj]
+
+/**
+ * @abstract JSON Object Copy Mehthod
+ *
+ * @param JSON Object.
+ *
+ * @return A json object by copying.
+ *
+ */
++ (id _Nullable)copyJSONObject:(id _Nonnull)object;
+
+#define WXCopyJson(obj) [WXUtility copyJSONObject:obj]
+
+/**
+ *
+ * Checks if a String is whitespace, empty ("") or nil
+ * @code
+ * [WXUtility isBlankString: nil] = true
+ * [WXUtility isBlankString: ""] = true
+ * [WXUtility isBlankString: " "] = true
+ * [WXUtility isBlankString: "bob"] = false
+ * [WXUtility isBlankString: " bob "] = false
+ * @endcode
+ * @param string the String to check, may be null
+ *
+ * @return true if the String is null, empty or whitespace
+ */
++ (BOOL)isBlankString:(NSString * _Nullable)string ;
+
+/**
+ * @abstract Returns a standard error object
+ *
+ * @param error code.
+ *
+ * @param error message.
+ *
+ * @return A error object type of NSError.
+ *
+ */
++ (NSError * _Nonnull)errorWithCode:(NSInteger)code message:(NSString * _Nullable)message;
+
+/**
+ * @abstract Returns a Font Object by setting some properties such as size\u3001weight\u3001style and fontFamily.
+ *
+ * @param textSize.
+ *
+ * @param textWeight. The type of WXTextWeight (Normal or Bold).
+ *
+ * @param textStyle. The type of WXTextStyle (Normal or Italic).
+ *
+ * @param fontFamily.
+ *
+ * @return A font object according to the above params.
+ *
+ */
++ (UIFont *_Nonnull)fontWithSize:(CGFloat)size textWeight:(WXTextWeight)textWeight textStyle:(WXTextStyle)textStyle fontFamily:(NSString *_Nullable)fontFamily;
+
+/**
+ * @abstract Returns the scale of the main screen.
+ *
+ */
+CGFloat WXScreenScale();
+
+/**
+ * @abstract Returns the metrics of the main screen.
+ *
+ */
+CGSize WXScreenSize();
+
+/**
+ * @abstract Returns the resize radio of the main screen.
+ *
+ * @discussion If orientation is equal to landscape, the value is caculated as follows: WXScreenSize().height / WXDefaultScreenWidth, otherwise, WXScreenSize().width / WXDefaultScreenWidth.
+ *
+ */
+CGFloat WXScreenResizeRadio(void);
+
+/**
+ * @abstract Returns a Round float coordinates to the main screen pixel.
+ *
+ */
+CGFloat WXRoundPixelValue(CGFloat value);
+
+/**
+ * @abstract Returns a Floor float coordinates to the main screen pixel.
+ *
+ */
+CGFloat WXFloorPixelValue(CGFloat value);
+
+/**
+ * @abstract Returns a Ceil float coordinates to the main screen pixel.
+ *
+ */
+CGFloat WXCeilPixelValue(CGFloat value);
+
+/**
+ * @abstract Returns a resized pixel which is caculated according to the WXScreenResizeRadio.
+ *
+ */
+CGFloat WXPixelResize(CGFloat value);
+
+/**
+ * @abstract Returns a resized frame which is caculated according to the WXScreenResizeRadio.
+ *
+ */
+CGRect WXPixelFrameResize(CGRect value);
+
+/**
+ * @abstract Returns a resized point which is caculated according to the WXScreenResizeRadio.
+ *
+ */
+CGPoint WXPixelPointResize(CGPoint value);
+
+/**
+ * @abstract Returns the document directory path.
+ *
+ */
++ (NSString *_Nonnull)documentDirectory;
+
+#define WXDocumentPath [WXUtility documentDirectory]
+
+/**
+ * @abstract Returns the system cache directory path.
+ *
+ */
++ (NSString *_Nonnull)cacheDirectory;
+
+#define WXCachePath [WXUtility cacheDirectory]
+
+/**
+ * @abstract Returns the system library directory path.
+ *
+ */
++ (NSString *_Nonnull)libraryDirectory;
+
+#define WXLibararyPath [WXUtility libraryDirectory]
+
+/**
+ * @abstract Returns the global cache whose size is 5M.
+ *
+ */
++ (NSCache *_Nonnull)globalCache;
+
+#define WXGlobalCache [WXUtility globalCache]
+
++ (void)addStatTrack:(NSString *_Nonnull)appName;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
new file mode 100644
index 0000000..21bdd9f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -0,0 +1,389 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXUtility.h"
+#import "WXLog.h"
+#import "WXSDKEngine.h"
+#import "WXAppConfiguration.h"
+#import <objc/runtime.h>
+#import <objc/message.h>
+#import <sys/utsname.h>
+#import <UIKit/UIScreen.h>
+
+void WXPerformBlockOnMainThread(void (^ _Nonnull block)())
+{
+ if ([NSThread isMainThread]) {
+ block();
+ } else {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ block();
+ });
+ }
+}
+
+void WXPerformBlockSyncOnMainThread(void (^ _Nonnull block)())
+{
+ if ([NSThread isMainThread]) {
+ block();
+ } else {
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ block();
+ });
+ }
+}
+
+void WXSwizzleInstanceMethod(Class class, SEL original, SEL replaced)
+{
+ Method originalMethod = class_getInstanceMethod(class, original);
+ Method newMethod = class_getInstanceMethod(class, replaced);
+
+ BOOL didAddMethod = class_addMethod(class, original, method_getImplementation(newMethod), method_getTypeEncoding(newMethod));
+ if (didAddMethod) {
+ class_replaceMethod(class, replaced, method_getImplementation(newMethod), method_getTypeEncoding(newMethod));
+ } else {
+ method_exchangeImplementations(originalMethod, newMethod);
+ }
+}
+
+void WXSwizzleInstanceMethodWithBlock(Class class, SEL original, id block, SEL replaced)
+{
+ Method originalMethod = class_getInstanceMethod(class, original);
+ IMP implementation = imp_implementationWithBlock(block);
+
+ class_addMethod(class, replaced, implementation, method_getTypeEncoding(originalMethod));
+ Method newMethod = class_getInstanceMethod(class, replaced);
+ method_exchangeImplementations(originalMethod, newMethod);
+}
+
+SEL WXSwizzledSelectorForSelector(SEL selector)
+{
+ return NSSelectorFromString([NSString stringWithFormat:@"wx_swizzle_%x_%@", arc4random(), NSStringFromSelector(selector)]);
+}
+
+CGFloat WXScreenScale(void)
+{
+ static CGFloat _scale;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _scale = [UIScreen mainScreen].scale;
+ });
+ return _scale;
+}
+
+CGSize WXScreenSize(void)
+{
+ return [UIScreen mainScreen].bounds.size;
+}
+
+CGFloat WXScreenResizeRadio(void)
+{
+ static CGFloat resizeScale;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ CGSize size = WXScreenSize();
+ CGFloat deviceWidth;
+ if (size.width > size.height) {
+ // Landscape
+ deviceWidth = size.height;
+ } else {
+ deviceWidth = size.width;
+ }
+
+ resizeScale = deviceWidth / WXDefaultScreenWidth;
+ });
+
+ return resizeScale;
+}
+
+CGFloat WXRoundPixelValue(CGFloat value)
+{
+ CGFloat scale = WXScreenScale();
+ return round(value * scale) / scale;
+}
+
+CGFloat WXCeilPixelValue(CGFloat value)
+{
+ CGFloat scale = WXScreenScale();
+ return ceil(value * scale) / scale;
+}
+
+CGFloat WXFloorPixelValue(CGFloat value)
+{
+ CGFloat scale = WXScreenScale();
+ return floor(value * scale) / scale;
+}
+
+CGFloat WXPixelResize(CGFloat value)
+{
+ return WXCeilPixelValue(value * WXScreenResizeRadio());
+}
+
+CGRect WXPixelFrameResize(CGRect value)
+{
+ CGRect new = CGRectMake(value.origin.x * WXScreenResizeRadio(),
+ value.origin.y * WXScreenResizeRadio(),
+ value.size.width * WXScreenResizeRadio(),
+ value.size.height * WXScreenResizeRadio());
+ return new;
+}
+
+CGPoint WXPixelPointResize(CGPoint value)
+{
+ CGPoint new = CGPointMake(value.x * WXScreenResizeRadio(),
+ value.y * WXScreenResizeRadio());
+ return new;
+}
+
+@implementation WXUtility
+
++ (NSDictionary *)getEnvironment
+{
+ NSString *platform = @"iOS";
+ NSString *sysVersion = [[UIDevice currentDevice] systemVersion];
+ NSString *weexVersion = WX_SDK_VERSION;
+ NSString *machine = [self deviceName] ? : @"";
+ NSString *appVersion = [WXAppConfiguration appVersion] ? : @"";
+ NSString *appName = [WXAppConfiguration appName] ? : @"";
+
+ CGFloat deviceWidth = [[UIScreen mainScreen] bounds].size.width;
+ CGFloat deviceHeight = [[UIScreen mainScreen] bounds].size.height;
+ CGFloat scale = [[UIScreen mainScreen] scale];
+
+ NSMutableDictionary *data = [NSMutableDictionary dictionaryWithDictionary:@{
+ @"platform":platform,
+ @"osVersion":sysVersion,
+ @"weexVersion":weexVersion,
+ @"deviceModel":machine,
+ @"appName":appName,
+ @"appVersion":appVersion,
+ @"deviceWidth":@(deviceWidth * scale),
+ @"deviceHeight":@(deviceHeight * scale),
+ @"scale":@(scale),
+ @"logLevel":[WXLog logLevelString]
+ }];
+ return data;
+}
+
++ (NSString *)userAgent
+{
+ // Device UA
+ NSString *deviceUA = [NSString stringWithFormat:@"%@(iOS/%@)", [self deviceName]?:@"UNKNOWN", [[UIDevice currentDevice] systemVersion]]?:@"0.0.0";
+
+ // App UA
+ NSString *appUA = [NSString stringWithFormat:@"%@(%@/%@)", [WXAppConfiguration appGroup]?:@"WeexGroup", [WXAppConfiguration appName]?:@"WeexApp", [WXAppConfiguration appVersion]?:@"0.0.0"];
+
+ // Weex UA
+ NSString *weexUA = [NSString stringWithFormat:@"Weex/%@", WX_SDK_VERSION];
+
+ // external UA
+ NSString *externalUA = [WXAppConfiguration externalUserAgent] ? [NSString stringWithFormat:@" %@", [WXAppConfiguration externalUserAgent]] : @"";
+
+ // Screen Size
+ CGFloat w = [[UIScreen mainScreen] bounds].size.width;
+ CGFloat h = [[UIScreen mainScreen] bounds].size.height;
+ CGFloat s = [[UIScreen mainScreen] scale];
+ NSString * screenUA = [NSString stringWithFormat:@"%dx%d", (int)(s * w), (int)(s * h)];
+
+ // New UA
+ return [NSString stringWithFormat:@"%@ %@ %@%@ %@", deviceUA, appUA, weexUA, externalUA, screenUA];
+}
+
++ (id)objectFromJSON:(NSString *)json
+{
+ if (!json) return nil;
+
+ NSData *data = [json dataUsingEncoding:NSUTF8StringEncoding];
+ NSError *error = nil;
+ id obj = [NSJSONSerialization JSONObjectWithData:data
+ options:NSJSONReadingAllowFragments | NSJSONReadingMutableContainers | NSJSONReadingMutableLeaves
+ error:&error];
+ if(error){
+ WXLogError(@"%@", [error description]);
+ return nil;
+ }
+
+ return obj;
+}
+
++ (NSString *)JSONString:(id)object
+{
+ if(!object) return nil;
+
+ NSError *error = nil;
+ if([object isKindOfClass:[NSArray class]] || [object isKindOfClass:[NSDictionary class]]){
+ NSData *data = [NSJSONSerialization dataWithJSONObject:object
+ options:NSJSONWritingPrettyPrinted
+ error:&error];
+ if (error) {
+ WXLogError(@"%@", [error description]);
+ return nil;
+ }
+
+ return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+
+ } else if ([object isKindOfClass:[NSString class]]) {
+ NSArray *array = @[object];
+ NSData *data = [NSJSONSerialization dataWithJSONObject:array
+ options:NSJSONWritingPrettyPrinted
+ error:&error];
+ if (error) {
+ WXLogError(@"%@", [error description]);
+ return nil;
+ }
+
+ NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+ if (string.length <= 4) {
+ WXLogError(@"json convert length less than 4 chars.");
+ return nil;
+ }
+
+ return [string substringWithRange:NSMakeRange(2, string.length - 4)];
+ } else {
+ WXLogError(@"object isn't avaliable class");
+ return nil;
+ }
+}
+
++ (id)copyJSONObject:(id)object
+{
+ if ([object isKindOfClass:[NSArray class]]) {
+ NSArray *array = (NSArray *)object;
+ NSMutableArray *copyObjs = [NSMutableArray array];
+
+ [array enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+ id copyObj = [self copyJSONObject:obj];
+ [copyObjs insertObject:copyObj atIndex:idx];
+ }];
+
+ return copyObjs;
+ } else if ([object isKindOfClass:[NSDictionary class]]) {
+ NSDictionary *dict = (NSDictionary *)object;
+ NSMutableDictionary *copyObjs = [NSMutableDictionary dictionary];
+
+ [dict enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
+ id copyObj = [self copyJSONObject:obj];
+ [copyObjs setObject:copyObj forKey:key];
+ }];
+
+ return copyObjs;
+ } else {
+ return [object copy];
+ }
+}
+
++ (BOOL)isBlankString:(NSString *)string {
+ if (string == nil || string == NULL || [string isKindOfClass:[NSNull class]]) {
+ return true;
+ }
+ if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] == 0) {
+ return true;
+ }
+
+ return false;
+}
+
++ (NSError *)errorWithCode:(NSInteger)code message:(NSString *)message
+{
+ message = message ? : @"";
+ return [NSError errorWithDomain:@"WeexErrorDomain" code:code userInfo:@{@"errMsg":message}];
+}
+
++ (UIFont *)fontWithSize:(CGFloat)size textWeight:(WXTextWeight)textWeight textStyle:(WXTextStyle)textStyle fontFamily:(NSString *)fontFamily
+{
+ CGFloat fontSize = (isnan(size) || size == 0) ? WX_TEXT_FONT_SIZE : size;
+ UIFont *font;
+
+ if (fontFamily) {
+ font = [UIFont fontWithName:fontFamily size:fontSize];
+ if (!font) {
+ WXLogWarning(@"Unknown fontFamily:%@", fontFamily);
+ font = [UIFont systemFontOfSize:fontSize];
+ }
+ } else {
+ font = [UIFont systemFontOfSize:fontSize];
+ }
+
+ UIFontDescriptor *fontD = font.fontDescriptor;
+ UIFontDescriptorSymbolicTraits traits = 0;
+ traits = (textStyle == WXTextStyleItalic) ? (traits | UIFontDescriptorTraitItalic) : traits;
+ traits = (textWeight == WXTextWeightBold) ? (traits | UIFontDescriptorTraitBold) : traits;
+ fontD = [fontD fontDescriptorWithSymbolicTraits:traits];
+ font = [UIFont fontWithDescriptor:fontD size:0];
+
+ return font;
+}
+
++ (NSString *)documentDirectory
+{
+ static NSString *docPath = nil;
+ if (!docPath){
+ docPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
+ }
+ return docPath;
+}
+
++ (NSString *)cacheDirectory
+{
+ static NSString *cachePath = nil;
+ if (!cachePath) {
+ cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
+ }
+ return cachePath;
+}
+
++ (NSString *)libraryDirectory
+{
+ static NSString *libPath = nil;
+ if (!libPath) {
+ libPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).firstObject;
+ }
+ return libPath;
+}
+
++ (NSCache *)globalCache
+{
+ static NSCache *cache;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ cache = [NSCache new];
+ cache.totalCostLimit = 5 * 1024 * 1024;
+
+ [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:nil usingBlock:^(__unused NSNotification *note) {
+ [cache removeAllObjects];
+ }];
+ });
+ return cache;
+}
+
++ (NSString *)deviceName
+{
+ struct utsname systemInfo;
+ uname(&systemInfo);
+ return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
+}
+
++ (void)addStatTrack:(NSString *)appName
+{
+ if (!appName) {
+ return;
+ }
+
+ // App name for non-commercial use
+ NSString *urlString = [NSString stringWithFormat:@"http://gm.mmstat.com/weex.1003?appname=%@", appName];
+ NSURL *URL = [NSURL URLWithString:urlString];
+ NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+
+ NSURLSession *session = [NSURLSession sharedSession];
+ NSURLSessionDataTask *task = [session dataTaskWithRequest:request
+ completionHandler:
+ ^(NSData *data, NSURLResponse *response, NSError *error) {
+ }];
+ [task resume];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.h b/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.h
new file mode 100644
index 0000000..2e90fe4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.h
@@ -0,0 +1,17 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WXWeakObjectWrapper : NSObject
+
+@property (nonatomic, weak, readonly) id weakObject;
+
+- (id)initWithWeakObject:(id)weakObject;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.m b/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.m
new file mode 100644
index 0000000..f807b00
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXWeakObjectWrapper.m
@@ -0,0 +1,22 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXWeakObjectWrapper.h"
+
+@implementation WXWeakObjectWrapper
+
+- (id)initWithWeakObject:(id)weakObject
+{
+ if (self = [super init]) {
+ _weakObject = weakObject;
+ }
+
+ return self;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.h b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.h
new file mode 100644
index 0000000..f1d436d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <WeexSDK/WeexSDK.h>
+
+@interface WXComponent (ViewManangement)
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.m b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.m
new file mode 100644
index 0000000..93df38b
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManangement.m
@@ -0,0 +1,254 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent+ViewManangement.h"
+#import "WXComponent_internal.h"
+#import "WXAssert.h"
+#import "WXView.h"
+#import "WXSDKInstance_private.h"
+#import "WXTransform.h"
+
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+
+@implementation WXComponent (ViewManangement)
+
+#pragma mark Public
+
+- (UIView *)loadView
+{
+ return [[WXView alloc] init];
+}
+
+- (BOOL)isViewLoaded
+{
+ return (_view != nil);
+}
+
+- (UIView *)view
+{
+ if ([self isViewLoaded]) {
+ return _view;
+ } else {
+ WXAssertMainThread();
+
+ // compositing child will be drew by its composited ancestor
+ if (_compositingChild) {
+ return nil;
+ }
+
+ [self viewWillLoad];
+
+ _view = [self loadView];
+
+ _layer = _view.layer;
+ _view.frame = _calculatedFrame;
+
+ _view.hidden = _visibility == WXVisibilityShow ? NO : YES;
+ _view.clipsToBounds = _clipToBounds;
+
+ if (![self _needsDrawBorder]) {
+ _layer.borderColor = _borderTopColor.CGColor;
+ _layer.borderWidth = _borderTopWidth;
+ _layer.cornerRadius = _borderTopLeftRadius;
+ _layer.opacity = _opacity;
+ _view.backgroundColor = _backgroundColor;
+ }
+
+ _view.wx_component = self;
+ _layer.wx_component = self;
+
+ [self _initEvents:self.events];
+
+ if (_positionType == WXPositionTypeSticky) {
+ [self.ancestorScroller addStickyComponent:self];
+ }
+
+ if (self.supercomponent && self.supercomponent->_async) {
+ self->_async = YES;
+ }
+
+ [self setNeedsDisplay];
+ [self viewDidLoad];
+
+ if (_lazyCreateView) {
+ if (self.supercomponent && !((WXComponent *)self.supercomponent)->_lazyCreateView) {
+ NSInteger index = [((WXComponent *)self.supercomponent).subcomponents indexOfObject:self];
+ if (index != NSNotFound) {
+ [((WXComponent *)self.supercomponent) insertSubview:self atIndex:index];
+ }
+ }
+ for (WXComponent *subcomponent in self.subcomponents) {
+ [self.view addSubview:subcomponent.view];
+ }
+ }
+
+ return _view;
+ }
+}
+
+- (CALayer *)layer
+{
+ return _layer;
+}
+
+- (void)insertSubview:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ WXAssertMainThread();
+
+ if (subcomponent->_positionType == WXPositionTypeFixed) {
+ [self.weexInstance.rootView addSubview:subcomponent.view];
+ return;
+ }
+
+ // use _lazyCreateView to forbid component like cell's view creating
+ if(_lazyCreateView) {
+ subcomponent->_lazyCreateView = YES;
+ }
+
+ if (!subcomponent->_lazyCreateView || (self->_lazyCreateView && [self isViewLoaded])) {
+ [self.view insertSubview:subcomponent.view atIndex:index];
+ }
+}
+
+- (void)removeFromSuperview
+{
+ WXAssertMainThread();
+
+ if ([self isViewLoaded]) {
+ [self.view removeFromSuperview];
+ }
+}
+
+- (void)moveToSuperview:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index
+{
+ [self removeFromSuperview];
+ [newSupercomponent insertSubview:self atIndex:index];
+}
+
+- (void)viewWillLoad
+{
+ WXAssertMainThread();
+}
+
+- (void)viewDidLoad
+{
+ WXAssertMainThread();
+}
+
+- (void)viewWillUnload
+{
+ WXAssertMainThread();
+}
+
+- (void)viewDidUnload
+{
+ WXAssertMainThread();
+}
+
+#pragma mark Private
+
+- (void)_initViewPropertyWithStyles:(NSDictionary *)styles
+{
+ _backgroundColor = styles[@"backgroundColor"] ? [WXConvert UIColor:styles[@"backgroundColor"]] : [UIColor clearColor];
+ _opacity = styles[@"opacity"] ? [WXConvert CGFloat:styles[@"opacity"]] : 1.0;
+ _clipToBounds = styles[@"overflow"] ? [WXConvert WXClipType:styles[@"overflow"]] : NO;
+ _visibility = styles[@"visibility"] ? [WXConvert WXVisibility:styles[@"visibility"]] : WXVisibilityShow;
+ _positionType = styles[@"position"] ? [WXConvert WXPositionType:styles[@"position"]] : WXPositionTypeRelative;
+ _transform = styles[@"transform"] ? [WXConvert NSString:styles[@"transform"]] : nil;
+ _transformOrigin = styles[@"transformOrigin"] ? [WXConvert NSString:styles[@"transformOrigin"]] : nil;
+}
+
+- (void)_updateViewStyles:(NSDictionary *)styles
+{
+ if (styles[@"backgroundColor"]) {
+ _backgroundColor = [WXConvert UIColor:styles[@"backgroundColor"]];
+ _layer.backgroundColor = _backgroundColor.CGColor;
+ [self setNeedsDisplay];
+ }
+
+ if (styles[@"opacity"]) {
+ _opacity = [WXConvert CGFloat:styles[@"opacity"]];
+ _layer.opacity = _opacity;
+ }
+
+ if (styles[@"overflow"]) {
+ _clipToBounds = [WXConvert WXClipType:styles[@"overflow"]];
+ _view.clipsToBounds = _clipToBounds;
+ }
+
+ if (styles[@"position"]) {
+ WXPositionType positionType = [WXConvert WXPositionType:styles[@"position"]];
+ if (positionType == WXPositionTypeSticky) {
+ [self.ancestorScroller addStickyComponent:self];
+ } else if (_positionType == WXPositionTypeSticky) {
+ [self.ancestorScroller removeStickyComponent:self];
+ }
+
+ if (positionType == WXPositionTypeFixed) {
+ [self.weexInstance.componentManager addFixedComponent:self];
+ _isNeedJoinLayoutSystem = NO;
+ } else if (_positionType == WXPositionTypeFixed) {
+ [self.weexInstance.componentManager removeFixedComponent:self];
+ _isNeedJoinLayoutSystem = YES;
+ }
+
+ _positionType = positionType;
+ }
+
+ if (styles[@"visibility"]) {
+ _visibility = [WXConvert WXVisibility:styles[@"visibility"]];
+ if (_visibility == WXVisibilityShow) {
+ self.view.hidden = NO;
+ }
+ else {
+ self.view.hidden = YES;
+ }
+ }
+
+ if (styles[@"transformOrigin"]) {
+ _transformOrigin = [WXConvert NSString:styles[@"transformOrigin"]];
+ }
+
+ if (styles[@"transform"]) {
+ if (!CGRectEqualToRect(self.calculatedFrame, CGRectZero)) {
+ _transform = [WXConvert NSString:styles[@"transform"]];
+ _layer.transform = [[WXTransform new] getTransform:_transform withView:_view withOrigin:_transformOrigin];
+ [_layer setNeedsDisplay];
+ }
+ }
+}
+
+- (void)_unloadView
+{
+ WXAssertMainThread();
+
+ [self viewWillUnload];
+
+ [_view removeFromSuperview];
+ [_layer removeFromSuperlayer];
+
+ _view.gestureRecognizers = nil;
+
+ [self _removeAllEvents];
+
+ if(self.ancestorScroller){
+ [self.ancestorScroller removeStickyComponent:self];
+ [self.ancestorScroller removeScrollToListener:self];
+ }
+
+ for (WXComponent *subcomponents in self.subcomponents) {
+ [subcomponents _unloadView];
+ }
+
+ _view = nil;
+ _layer = nil;
+
+ [self viewDidUnload];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/View/WXView.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXView.h b/ios/sdk/WeexSDK/Sources/View/WXView.h
new file mode 100644
index 0000000..c81c9f8
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/View/WXView.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+
+@interface WXView : UIView
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/View/WXView.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXView.m b/ios/sdk/WeexSDK/Sources/View/WXView.m
new file mode 100644
index 0000000..de848f9
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/View/WXView.m
@@ -0,0 +1,49 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXView.h"
+#import "WXComponent.h"
+#import "WXLayer.h"
+
+@implementation WXView
+
++ (Class)layerClass
+{
+ return [WXLayer class];
+}
+
+- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
+{
+ /**
+ * Capturing touches on a subview outside the frame of its superview
+ */
+
+ // hidden view should not be passed event
+ if (self.hidden) {
+ return nil;
+ }
+
+ UIView* result = [super hitTest:point withEvent:event];
+ if (result) {
+ return result;
+ }
+
+ for (UIView* subView in [self.subviews reverseObjectEnumerator]) {
+ if (subView.hidden) {
+ continue;
+ }
+ CGPoint subPoint = [self convertPoint:point toView:subView];
+ result = [subView hitTest:subPoint withEvent:event];
+ if (result) {
+ return result;
+ }
+ }
+
+ return nil;
+}
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/WeexSDK.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/WeexSDK.h b/ios/sdk/WeexSDK/Sources/WeexSDK.h
new file mode 100644
index 0000000..00cf605
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/WeexSDK.h
@@ -0,0 +1,31 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#ifdef __OBJC__
+
+#import "Layout.h"
+#import "WXAppConfiguration.h"
+#import "WXAppMonitorProtocol.h"
+#import "WXBaseViewController.h"
+#import "WXComponent.h"
+#import "WXConvert.h"
+#import "WXDebugTool.h"
+#import "WXDefine.h"
+#import "WXEventModuleProtocol.h"
+#import "WXImgLoaderProtocol.h"
+#import "WXLog.h"
+#import "WXModuleProtocol.h"
+#import "WXNavigationProtocol.h"
+#import "WXNetworkProtocol.h"
+#import "WXRootViewController.h"
+#import "WXSDKEngine.h"
+#import "WXSDKInstance.h"
+#import "WXType.h"
+#import "WXUtility.h"
+
+#endif /* __OBJC__ */
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/dependency/SRWebSocket.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/dependency/SRWebSocket.h b/ios/sdk/WeexSDK/dependency/SRWebSocket.h
new file mode 100644
index 0000000..5f8bca1
--- /dev/null
+++ b/ios/sdk/WeexSDK/dependency/SRWebSocket.h
@@ -0,0 +1,140 @@
+//
+// Copyright 2012 Square Inc.
+//
+// Licensed 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 <Foundation/Foundation.h>
+#import <Security/SecCertificate.h>
+
+typedef NS_ENUM(NSInteger, SRReadyState) {
+ SR_CONNECTING = 0,
+ SR_OPEN = 1,
+ SR_CLOSING = 2,
+ SR_CLOSED = 3,
+};
+
+typedef enum SRStatusCode : NSInteger {
+ SRStatusCodeNormal = 1000,
+ SRStatusCodeGoingAway = 1001,
+ SRStatusCodeProtocolError = 1002,
+ SRStatusCodeUnhandledType = 1003,
+ // 1004 reserved.
+ SRStatusNoStatusReceived = 1005,
+ // 1004-1006 reserved.
+ SRStatusCodeInvalidUTF8 = 1007,
+ SRStatusCodePolicyViolated = 1008,
+ SRStatusCodeMessageTooBig = 1009,
+} SRStatusCode;
+
+@class SRWebSocket;
+
+extern NSString *const SRWebSocketErrorDomain;
+extern NSString *const SRHTTPResponseErrorKey;
+
+#pragma mark - SRWebSocketDelegate
+
+@protocol SRWebSocketDelegate;
+
+#pragma mark - SRWebSocket
+
+@interface SRWebSocket : NSObject <NSStreamDelegate>
+
+@property (nonatomic, weak) id <SRWebSocketDelegate> delegate;
+
+@property (nonatomic, readonly) SRReadyState readyState;
+@property (nonatomic, readonly, retain) NSURL *url;
+
+
+@property (nonatomic, readonly) CFHTTPMessageRef receivedHTTPHeaders;
+
+// Optional array of cookies (NSHTTPCookie objects) to apply to the connections
+@property (nonatomic, readwrite) NSArray * requestCookies;
+
+// This returns the negotiated protocol.
+// It will be nil until after the handshake completes.
+@property (nonatomic, readonly, copy) NSString *protocol;
+
+// Protocols should be an array of strings that turn into Sec-WebSocket-Protocol.
+- (id)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols allowsUntrustedSSLCertificates:(BOOL)allowsUntrustedSSLCertificates;
+- (id)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols;
+- (id)initWithURLRequest:(NSURLRequest *)request;
+
+// Some helper constructors.
+- (id)initWithURL:(NSURL *)url protocols:(NSArray *)protocols allowsUntrustedSSLCertificates:(BOOL)allowsUntrustedSSLCertificates;
+- (id)initWithURL:(NSURL *)url protocols:(NSArray *)protocols;
+- (id)initWithURL:(NSURL *)url;
+
+// Delegate queue will be dispatch_main_queue by default.
+// You cannot set both OperationQueue and dispatch_queue.
+- (void)setDelegateOperationQueue:(NSOperationQueue*) queue;
+- (void)setDelegateDispatchQueue:(dispatch_queue_t) queue;
+
+// By default, it will schedule itself on +[NSRunLoop SR_networkRunLoop] using defaultModes.
+- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;
+- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;
+
+// SRWebSockets are intended for one-time-use only. Open should be called once and only once.
+- (void)open;
+
+- (void)close;
+- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;
+
+// Send a UTF8 String or Data.
+- (void)send:(id)data;
+
+// Send Data (can be nil) in a ping message.
+- (void)sendPing:(NSData *)data;
+
+@end
+
+#pragma mark - SRWebSocketDelegate
+
+@protocol SRWebSocketDelegate <NSObject>
+
+// message will either be an NSString if the server is using text
+// or NSData if the server is using binary.
+- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message;
+
+@optional
+
+- (void)webSocketDidOpen:(SRWebSocket *)webSocket;
+- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error;
+- (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean;
+- (void)webSocket:(SRWebSocket *)webSocket didReceivePong:(NSData *)pongPayload;
+
+@end
+
+#pragma mark - NSURLRequest (CertificateAdditions)
+
+@interface NSURLRequest (CertificateAdditions)
+
+@property (nonatomic, retain, readonly) NSArray *SR_SSLPinnedCertificates;
+
+@end
+
+#pragma mark - NSMutableURLRequest (CertificateAdditions)
+
+@interface NSMutableURLRequest (CertificateAdditions)
+
+@property (nonatomic, retain) NSArray *SR_SSLPinnedCertificates;
+
+@end
+
+#pragma mark - NSRunLoop (SRWebSocket)
+
+@interface NSRunLoop (SRWebSocket)
+
++ (NSRunLoop *)SR_networkRunLoop;
+
+@end
[39/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/scroller-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/scroller-demo.js b/ios/playground/bundlejs/component/scroller-demo.js
new file mode 100644
index 0000000..48dd6ee
--- /dev/null
+++ b/ios/playground/bundlejs/component/scroller-demo.js
@@ -0,0 +1,1317 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/bac99fb3b97adcec652c299dcd306bce", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ methods: {
+ },
+ data: function () {return {
+ sections: [
+ {
+ title: 'Header 1',
+ items: [
+ {id: 1},
+ {id: 2},
+ {id: 3},
+ {id: 4},
+ {id: 5}
+ ]
+ },
+ {
+ title: 'Header 2',
+ items: [
+ {id: 6},
+ {id: 7},
+ {id: 8},
+ {id: 9},
+ {id: 10},
+ {id: 11}
+ ]
+ },
+ {
+ title: 'Header 3',
+ items: [
+ {id: 12},
+ {id: 13},
+ {id: 14},
+ {id: 15},
+ {id: 16},
+ {id: 17},
+ {id: 18}
+ ]
+ },
+ {
+ title: 'Header 4',
+ items: [
+ {id: 19},
+ {id: 20},
+ {id: 21},
+ {id: 22}
+ ]
+ },
+ {
+ title: 'Header 5',
+ items: [
+ {id: 23},
+ {id: 24},
+ {id: 25},
+ {id: 26},
+ {id: 27}
+ ]
+ },
+ {
+ title: 'Header 6',
+ items: [
+ {id: 28},
+ {id: 29},
+ {id: 30},
+ {id: 31},
+ {id: 32}
+ ]
+ }
+ ]
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "classList": [
+ "list"
+ ],
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "section"
+ ],
+ "repeat": function () {return this.sections},
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "header"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "header-title"
+ ],
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "repeat": function () {return this.items},
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "item-title"
+ ],
+ "attr": {
+ "value": function () {return 'row ' + (this.id)}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "header": {
+ "backgroundColor": "#45b5f0",
+ "padding": 20,
+ "height": 88,
+ "justifyContent": "center"
+ },
+ "header-title": {
+ "color": "#FFFFFF",
+ "fontWeight": "bold"
+ },
+ "item": {
+ "justifyContent": "center",
+ "borderBottomWidth": 2,
+ "borderBottomColor": "#c0c0c0",
+ "height": 100,
+ "padding": 20
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/bac99fb3b97adcec652c299dcd306bce", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/slider/index.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/slider/index.js b/ios/playground/bundlejs/component/slider/index.js
new file mode 100644
index 0000000..bbd1cda
--- /dev/null
+++ b/ios/playground/bundlejs/component/slider/index.js
@@ -0,0 +1,1741 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/559cd2049da887ae8989e25df99c5cab", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(13);
+
+ ;
+ __webpack_require__(1);
+ var img0 = '//gw.alicdn.com/tps/i2/TB1DpsmMpXXXXabaXXX20ySQVXX-512-512.png_400x400.jpg';
+ var img1 = '//gw.alicdn.com/tps/i1/TB1M3sQMpXXXXakXXXXApNeJVXX-360-360.png';
+ __weex_module__.exports = {
+ data: function () {return {
+ eventCnt: 0,
+ togglePlayMsg: 'pause',
+ sliders: [
+ {
+ interval: 1000,
+ autoPlay: true,
+ sliderPages: [
+ {
+ items: [
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ },
+ {
+ items: [
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ },
+ {
+ items: [
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ interval: 3000,
+ autoPlay: true,
+ sliderPages: [
+ {
+ items: [
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ },
+ {
+ items: [
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ },
+ {
+ items: [
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ interval: 5000,
+ autoPlay: true,
+ sliderPages: [
+ {
+ items: [
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ },
+ {
+ items: [
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ },
+ {
+ items: [
+ {
+ image: img0,
+ link: '//h5.m.taobao.com/1'
+ },
+ {
+ image: img1,
+ link: '//h5.m.taobao.com/1'
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }},
+ methods: {
+ ready: function() {
+ },
+ togglePlay: function() {
+ var autoPlay = this.sliders[0].autoPlay
+ autoPlay = !autoPlay
+ this.sliders[0].autoPlay = autoPlay
+ this.togglePlayMsg = autoPlay ? 'pause' : 'play'
+ },
+ handleSliderChange: function() {
+ var nowCnt = this.eventCnt + 1
+ this.eventCnt = nowCnt
+ },
+ setInterval1: function() {
+ this.sliders[0].interval = 1000;
+ },
+ setInterval3: function() {
+ this.sliders[0].interval = 3000;
+ },
+ setInterval5: function() {
+ this.sliders[0].interval = 5000;
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "classList": [
+ "body"
+ ],
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "auto-play",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "auto-play = false",
+ "paddingBody": "0"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[1].interval},
+ "autoPlay": "false"
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "classList": [
+ "indicator"
+ ]
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[1].sliderPages}
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "auto-play = true",
+ "paddingBody": "0"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[0].interval},
+ "autoPlay": function () {return this.sliders[0].autoPlay}
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "classList": [
+ "indicator"
+ ]
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[0].sliderPages}
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": function () {return 'Event, ' + (this.eventCnt) + ' change'},
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[0].interval},
+ "autoPlay": function () {return this.sliders[0].autoPlay}
+ },
+ "events": {
+ "change": "handleSliderChange"
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "classList": [
+ "indicator"
+ ]
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[0].sliderPages}
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Indicator",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "default style",
+ "paddingBody": "0"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[0].interval},
+ "autoPlay": function () {return this.sliders[0].autoPlay}
+ },
+ "events": {
+ "change": "handleSliderChange"
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "classList": [
+ "indicator"
+ ]
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[0].sliderPages}
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "width & height",
+ "paddingBody": "0"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[0].interval},
+ "autoPlay": function () {return this.sliders[0].autoPlay}
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "style": {
+ "itemColor": "#dddddd",
+ "width": 714,
+ "height": 460
+ }
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[0].sliderPages}
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "left & top",
+ "paddingBody": "0"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[1].interval},
+ "autoPlay": function () {return this.sliders[1].autoPlay}
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "classList": [
+ "indicator"
+ ],
+ "style": {
+ "top": -140,
+ "left": -240
+ }
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[1].sliderPages}
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "itemColor & itemSelectedColor",
+ "paddingBody": "0"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[2].interval},
+ "autoPlay": function () {return this.sliders[2].autoPlay}
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "classList": [
+ "indicator"
+ ],
+ "style": {
+ "itemSelectedColor": "rgb(217, 83, 79)"
+ }
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[2].sliderPages}
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "itemSize",
+ "paddingBody": "0"
+ },
+ "children": [
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "append": "tree",
+ "attr": {
+ "interval": function () {return this.sliders[1].interval},
+ "autoPlay": function () {return this.sliders[1].autoPlay}
+ },
+ "children": [
+ {
+ "type": "indicator",
+ "style": {
+ "itemColor": "#dddddd",
+ "itemSize": 40,
+ "top": 140,
+ "left": 180,
+ "width": 700,
+ "height": 380
+ }
+ },
+ {
+ "type": "slider-page",
+ "repeat": function () {return this.sliders[1].sliderPages}
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "body": {
+ "backgroundColor": "#ffffff"
+ },
+ "slider": {
+ "flexDirection": "row",
+ "width": 690,
+ "height": 360
+ },
+ "indicator": {
+ "position": "absolute",
+ "width": 690,
+ "height": 420,
+ "top": 140,
+ "left": 240,
+ "itemColor": "#dddddd",
+ "itemSelectedColor": "rgb(40, 96, 144)"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/559cd2049da887ae8989e25df99c5cab", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ },
+/* 13 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/slider-page", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(14);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ items: [],
+ sliderItems: []
+ }},
+ methods: {
+ ready: function() {
+ this.sliderItems = this.getSliderItems()
+ },
+ getSliderItems: function() {
+ return this.items.map(function(item, index) {
+ return item;
+ }.bind(this));
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "slider-page"
+ ],
+ "children": [
+ {
+ "type": "slider-item",
+ "repeat": function () {return this.sliderItems}
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "slider-page": {
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "width": 714,
+ "height": 420
+ }
+ }
+ })
+
+/***/ },
+/* 14 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/slider-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ image: '',
+ link: '',
+ href: ''
+ }},
+ methods: {
+ ready: function() {
+ this.href = this.link;
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "classList": [
+ "slider-item"
+ ],
+ "attr": {
+ "src": function () {return this.image}
+ }
+ }
+ ;__weex_module__.exports.style={
+ "slider-item": {
+ "width": 348,
+ "height": 400
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/slider/slider-item.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/slider/slider-item.js b/ios/playground/bundlejs/component/slider/slider-item.js
new file mode 100644
index 0000000..9f479b0
--- /dev/null
+++ b/ios/playground/bundlejs/component/slider/slider-item.js
@@ -0,0 +1,84 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/ef1dc1be90047f8ba2262dbf1d8cf6e9", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ image: '',
+ link: '',
+ href: ''
+ }},
+ methods: {
+ ready: function() {
+ this.href = this.link;
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "classList": [
+ "slider-item"
+ ],
+ "attr": {
+ "src": function () {return this.image}
+ }
+ }
+ ;__weex_module__.exports.style={
+ "slider-item": {
+ "width": 348,
+ "height": 400
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/ef1dc1be90047f8ba2262dbf1d8cf6e9", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/slider/slider-page.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/slider/slider-page.js b/ios/playground/bundlejs/component/slider/slider-page.js
new file mode 100644
index 0000000..06fcec4
--- /dev/null
+++ b/ios/playground/bundlejs/component/slider/slider-page.js
@@ -0,0 +1,134 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/5ad7a924dc9da8e1fdbbc4b0828fdb93", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(14);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ items: [],
+ sliderItems: []
+ }},
+ methods: {
+ ready: function() {
+ this.sliderItems = this.getSliderItems()
+ },
+ getSliderItems: function() {
+ return this.items.map(function(item, index) {
+ return item;
+ }.bind(this));
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "slider-page"
+ ],
+ "children": [
+ {
+ "type": "slider-item",
+ "repeat": function () {return this.sliderItems}
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "slider-page": {
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "width": 714,
+ "height": 420
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/5ad7a924dc9da8e1fdbbc4b0828fdb93", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 14:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/slider-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ image: '',
+ link: '',
+ href: ''
+ }},
+ methods: {
+ ready: function() {
+ this.href = this.link;
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "classList": [
+ "slider-item"
+ ],
+ "attr": {
+ "src": function () {return this.image}
+ }
+ }
+ ;__weex_module__.exports.style={
+ "slider-item": {
+ "width": 348,
+ "height": 400
+ }
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
[02/50] [abbrv] incubator-weex git commit: [doc] update the summary
of gitbook
Posted by ji...@apache.org.
[doc] update the summary of gitbook
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ca86007c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ca86007c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ca86007c
Branch: refs/heads/master
Commit: ca86007cca57c641dd02f25ba2dc61c858138e7f
Parents: 5045295
Author: boboning <ni...@163.com>
Authored: Thu May 19 19:13:24 2016 +0800
Committer: boboning <ni...@163.com>
Committed: Thu May 19 19:13:24 2016 +0800
----------------------------------------------------------------------
doc/SUMMARY.md | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ca86007c/doc/SUMMARY.md
----------------------------------------------------------------------
diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md
index 5aa7055..4ce9983 100644
--- a/doc/SUMMARY.md
+++ b/doc/SUMMARY.md
@@ -46,12 +46,14 @@
* [a](/components/a.md)
* [web](/components/web.md)
* [wxc-tabbar](/components/wxc-tabbar.md)
+ * [wxc-navpage](/components/wxc-navpage.md)
* [Built-in Modules](/modules/README.md)
* [dom](/modules/dom.md)
* [steam](/modules/stream.md)
* [modal](/modules/modal.md)
* [animation](/modules/animation.md)
* [webview](/modules/webview.md)
+ * [navigator](/modules/navigator.md)
* Low-level Specs
* [JS Bundle Format](/specs/js-bundle-format.md)
* [JS Framework APIs](/specs/js-framework-apis.md)
[22/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload.png b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload.png
new file mode 100644
index 0000000..1fd4bac
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png
new file mode 100644
index 0000000..6e97235
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png
new file mode 100644
index 0000000..ab75ee7
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/Contents.json
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/Contents.json b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/Contents.json
new file mode 100644
index 0000000..798ba85
--- /dev/null
+++ b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "scan.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "scan@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "scan@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan.png b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan.png
new file mode 100644
index 0000000..6183105
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png
new file mode 100644
index 0000000..43cf01d
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png
new file mode 100644
index 0000000..76c7e0b
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Base.lproj/LaunchScreen.storyboard
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Base.lproj/LaunchScreen.storyboard b/ios/playground/WeexDemo/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..de7de6e
--- /dev/null
+++ b/ios/playground/WeexDemo/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="EHf-IW-A2E">
+ <objects>
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
+ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" red="0.27058823529411763" green="0.70980392156862748" blue="0.94117647058823528" alpha="1" colorSpace="calibratedRGB"/>
+ </view>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="53" y="375"/>
+ </scene>
+ </scenes>
+</document>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/DemoBaseViewController.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/DemoBaseViewController.h b/ios/playground/WeexDemo/DemoBaseViewController.h
new file mode 100644
index 0000000..2e09ece
--- /dev/null
+++ b/ios/playground/WeexDemo/DemoBaseViewController.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+
+@interface DemoBaseViewController : UIViewController
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/DemoBaseViewController.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/DemoBaseViewController.m b/ios/playground/WeexDemo/DemoBaseViewController.m
new file mode 100644
index 0000000..95524d0
--- /dev/null
+++ b/ios/playground/WeexDemo/DemoBaseViewController.m
@@ -0,0 +1,34 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "DemoBaseViewController.h"
+#import "UIViewController+WXDemoNaviBar.h"
+
+@interface DemoBaseViewController ()
+
+@end
+
+@implementation DemoBaseViewController
+
+- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ return [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+}
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ // Do any additional setup after loading the view.
+ [self setupNaviBar];
+}
+
+- (void)didReceiveMemoryWarning {
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/DemoDefine.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/DemoDefine.h b/ios/playground/WeexDemo/DemoDefine.h
new file mode 100644
index 0000000..67e4290
--- /dev/null
+++ b/ios/playground/WeexDemo/DemoDefine.h
@@ -0,0 +1,28 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+#define CURRENT_IP @"your computer device ip"
+
+#if TARGET_IPHONE_SIMULATOR
+ #define DEMO_HOST @"127.0.0.1"
+#else
+ #define DEMO_HOST CURRENT_IP
+#endif
+
+#define DEMO_URL(path) [NSString stringWithFormat:@"http://%@:12580/%s", DEMO_HOST, #path]
+
+#define HOME_URL [NSString stringWithFormat:@"http://%@:12580/examples/build/index.js", DEMO_HOST]
+
+#define BUNDLE_URL [NSString stringWithFormat:@"file://%@/bundlejs/index.js",[NSBundle mainBundle].bundlePath]
+
+#define UITEST_HOME_URL @"http://test?_wx_tpl=http://localhost:12580/test/build/TC__Home.js"
+
+#define QRSCAN @"com.taobao.WeexDemo.scan"
+#define WEEX_COLOR [UIColor colorWithRed:0.27 green:0.71 blue:0.94 alpha:1]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Info.plist
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Info.plist b/ios/playground/WeexDemo/Info.plist
new file mode 100644
index 0000000..738c6ed
--- /dev/null
+++ b/ios/playground/WeexDemo/Info.plist
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSAppTransportSecurity</key>
+ <dict>
+ <key>NSAllowsArbitraryLoads</key>
+ <true/>
+ </dict>
+ <key>UIApplicationShortcutItems</key>
+ <array>
+ <dict>
+ <key>UIApplicationShortcutItemIconFile</key>
+ <string>scan</string>
+ <key>UIApplicationShortcutItemSubtitle</key>
+ <string>scan your QR code</string>
+ <key>UIApplicationShortcutItemTitle</key>
+ <string>Scan QR</string>
+ <key>UIApplicationShortcutItemType</key>
+ <string>com.taobao.WeexDemo.scan</string>
+ </dict>
+ </array>
+ <key>UILaunchStoryboardName</key>
+ <string>LaunchScreen</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UIStatusBarStyle</key>
+ <string>UIStatusBarStyleLightContent</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UIViewControllerBasedStatusBarAppearance</key>
+ <false/>
+</dict>
+</plist>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Scanner/WXScannerVC.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Scanner/WXScannerVC.h b/ios/playground/WeexDemo/Scanner/WXScannerVC.h
new file mode 100644
index 0000000..fa0f56a
--- /dev/null
+++ b/ios/playground/WeexDemo/Scanner/WXScannerVC.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import <ZXingObjC/ZXingObjC.h>
+
+@interface WXScannerVC : UIViewController <ZXCaptureDelegate>
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Scanner/WXScannerVC.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Scanner/WXScannerVC.m b/ios/playground/WeexDemo/Scanner/WXScannerVC.m
new file mode 100644
index 0000000..24e6291
--- /dev/null
+++ b/ios/playground/WeexDemo/Scanner/WXScannerVC.m
@@ -0,0 +1,170 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXScannerVC.h"
+#import "AppDelegate.h"
+#import "UIViewController+WXDemoNaviBar.h"
+#import "WXDemoViewController.h"
+#import "WXDebugTool.h"
+#import <AudioToolbox/AudioToolbox.h>
+#import <WeexSDK/WXSDKEngine.h>
+
+@interface WXScannerVC ()
+
+@property (nonatomic, strong) ZXCapture *capture;
+
+@property (nonatomic) BOOL opened;
+
+@end
+
+@implementation WXScannerVC
+
+#pragma mark - lifeCircle
+
+- (void)dealloc {
+ [self.capture.layer removeFromSuperlayer];
+}
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ self.edgesForExtendedLayout = UIRectEdgeNone;
+
+ [self setupNaviBar];
+
+ self.capture = [[ZXCapture alloc] init];
+ self.capture.camera = self.capture.back;
+ self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
+ self.capture.rotation = 90.0f;
+
+ self.capture.layer.frame = self.view.bounds;
+ [self.view.layer addSublayer:self.capture.layer];
+
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+ [super viewWillAppear:animated];
+
+ [self.view.layer addSublayer:self.capture.layer];
+ [self.capture start];
+
+ self.capture.delegate = self;
+ self.capture.layer.frame = self.view.bounds;
+
+ CGAffineTransform captureSizeTransform = CGAffineTransformMakeScale(320 / self.view.frame.size.width, 480 / self.view.frame.size.height);
+ self.capture.scanRect = CGRectApplyAffineTransform(self.view.frame, captureSizeTransform);
+}
+
+- (void) viewDidDisappear:(BOOL)animated
+{
+ [super viewDidDisappear:animated];
+
+ [self.capture.layer removeFromSuperlayer];
+ [self.capture stop];
+}
+
+#pragma mark - ZXCaptureDelegate
+
+- (void)captureResult:(ZXCapture *)capture result:(ZXResult *)result {
+ if (!result) return;
+
+ [self.capture.layer removeFromSuperlayer];
+ [self.capture stop];
+
+ if (!_opened) {
+ //Vibrate
+ AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
+ _opened = YES;
+ __weak __typeof__(self) weakSelf = self;
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ weakSelf.opened = NO;
+ });
+
+ [self openURL:result.text];
+ }
+}
+
+- (void) openURL:(NSString*)URL
+{
+ NSURL *url = [NSURL URLWithString:URL];
+ [self remoteDebug:url];
+ [self jsReplace:url];
+ WXDemoViewController * controller = [[WXDemoViewController alloc] init];
+ controller.url = url;
+ controller.source = @"scan";
+
+ if ([url.port integerValue] == 8081) {
+ NSURL *socketURL = [NSURL URLWithString:[NSString stringWithFormat:@"ws://%@:8082", url.host]];
+ controller.hotReloadSocket = [[SRWebSocket alloc] initWithURL:socketURL protocols:@[@"echo-protocol"]];
+ controller.hotReloadSocket.delegate = controller;
+ [controller.hotReloadSocket open];
+ }
+
+ [[self navigationController] pushViewController:controller animated:YES];
+}
+
+#pragma mark - Replace JS
+- (void)jsReplace:(NSURL *)url
+{
+ if ([[url host] isEqualToString:@"weex-remote-debugger"]){
+ NSString* path = [url path];
+ if ([path isEqualToString:@"/dynamic/replace/bundle"]){
+ for (NSString * param in [[url query] componentsSeparatedByString:@"&"]) {
+ NSArray* elts = [param componentsSeparatedByString:@"="];
+ if ([elts count] < 2) {
+ continue;
+ }
+ if ([[elts firstObject] isEqualToString:@"bundle"]){
+ [WXDebugTool setReplacedBundleJS:[NSURL URLWithString:[elts lastObject]]];
+ }
+ }
+ }
+
+ if ([path isEqualToString:@"/dynamic/replace/framework"]){
+ for (NSString * param in [[url query] componentsSeparatedByString:@"&"]) {
+ NSArray* elts = [param componentsSeparatedByString:@"="];
+ if ([elts count] < 2) {
+ continue;
+ }
+ if ([[elts firstObject] isEqualToString:@"framework"]){
+ [WXDebugTool setReplacedJSFramework:[NSURL URLWithString:[elts lastObject]]];
+ }
+ }
+ }
+ }
+}
+
+#pragma mark Remote debug
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
+- (void)remoteDebug:(NSURL *)url
+{
+ if ([url.scheme isEqualToString:@"ws"]) {
+ [WXSDKEngine connectDebugServer:url.absoluteString];
+ [WXSDKEngine initSDKEnviroment];
+ }
+
+ NSString *query = url.query;
+ for (NSString *param in [query componentsSeparatedByString:@"&"]) {
+ NSArray *elts = [param componentsSeparatedByString:@"="];
+ if([elts count] < 2) continue;
+ if ([[elts firstObject] isEqualToString:@"_wx_debug"]) {
+ [WXDebugTool setDebug:YES];
+ [WXSDKEngine connectDebugServer:[[elts lastObject] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+ if ([[[self.navigationController viewControllers] objectAtIndex:0] isKindOfClass:NSClassFromString(@"WXDemoViewController")]) {
+ WXDemoViewController * vc = (WXDemoViewController*)[[self.navigationController viewControllers] objectAtIndex:0];
+ [vc performSelector:NSSelectorFromString(@"loadRefreshCtl")];
+ [self.navigationController popToViewController:vc animated:NO];
+ }
+ return;
+ }
+ }
+}
+#pragma clang diagnostic pop
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.h b/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.h
new file mode 100644
index 0000000..e123e48
--- /dev/null
+++ b/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.h
@@ -0,0 +1,23 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import "DemoDefine.h"
+
+@interface UIViewController (WXDemoNaviBar) <UIGestureRecognizerDelegate>
+
+/**
+ * back button click action
+ * @param sender responder
+ */
+- (void)backButtonClicked:(id)sender;
+
+- (void)setupNaviBar;
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m b/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m
new file mode 100644
index 0000000..7abefa6
--- /dev/null
+++ b/ios/playground/WeexDemo/UIViewController+WXDemoNaviBar.m
@@ -0,0 +1,103 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "UIViewController+WXDemoNaviBar.h"
+#import "WXScannerVC.h"
+#import <objc/runtime.h>
+
+@implementation UIViewController (WXDemoNaviBar)
+
+- (void)setupNaviBar {
+ UIScreenEdgePanGestureRecognizer *edgePanGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(edgePanGesture:)];
+ edgePanGestureRecognizer.delegate = self;
+ edgePanGestureRecognizer.edges = UIRectEdgeLeft;
+ [self.view addGestureRecognizer:edgePanGestureRecognizer];
+
+ NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
+ if ([[ver objectAtIndex:0] intValue] >= 7) {
+ // iOS 7.0 or later
+ 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 Demo";
+
+ if (self.navigationItem.leftBarButtonItem) return;
+
+ UIBarButtonItem *leftItem;
+ if(![[self.navigationController.viewControllers objectAtIndex:0] isEqual:self]) {
+ leftItem = [self backButtonItem];
+ } else {
+ leftItem = [self leftBarButtonItem];
+ }
+
+ self.navigationItem.leftBarButtonItems = @[leftItem];
+}
+
+- (void)edgePanGesture:(UIScreenEdgePanGestureRecognizer*)edgePanGestureRecognizer{
+ [self.navigationController popViewControllerAnimated:YES];
+}
+
+#pragma mark- UIGestureRecognizerDelegate
+- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
+ if (self.navigationController && [self.navigationController.viewControllers count] == 1) {
+ return NO;
+ }
+ return YES;
+}
+
+#pragma mark -
+#pragma mark - UIBarButtonItems
+
+- (UIBarButtonItem *)leftBarButtonItem {
+ UIBarButtonItem *leftItem = objc_getAssociatedObject(self, _cmd);
+
+ if (!leftItem) {
+ leftItem = [[UIBarButtonItem alloc]
+ initWithImage:[UIImage imageNamed:@"scan"]
+ style:UIBarButtonItemStyleBordered
+ target:self
+ action:@selector(scanQR:)];
+ leftItem.accessibilityHint = @"click to scan qr code";
+ leftItem.accessibilityValue = @"scan qr code";
+ objc_setAssociatedObject(self, _cmd, leftItem, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+ }
+ return leftItem;
+}
+
+- (UIBarButtonItem *)backButtonItem {
+ UIBarButtonItem *backButtonItem = objc_getAssociatedObject(self, _cmd);
+ if (!backButtonItem) {
+ backButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back"]
+ style:UIBarButtonItemStyleBordered
+ target:self
+ action:@selector(backButtonClicked:)];
+ objc_setAssociatedObject(self, _cmd, backButtonItem, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+ }
+ return backButtonItem;
+}
+
+#pragma mark -
+#pragma mark - UIBarButtonItem actions
+
+- (void)scanQR:(id)sender {
+ WXScannerVC * scanViewController = [[WXScannerVC alloc] init];
+ [self.navigationController pushViewController:scanViewController animated:NO];
+}
+
+- (void)backButtonClicked:(id)sender {
+ [self.navigationController popViewControllerAnimated:YES];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/WXDemoViewController.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/WXDemoViewController.h b/ios/playground/WeexDemo/WXDemoViewController.h
new file mode 100644
index 0000000..8ea2fd7
--- /dev/null
+++ b/ios/playground/WeexDemo/WXDemoViewController.h
@@ -0,0 +1,21 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import <SRWebSocket.h>
+
+@interface WXDemoViewController : UIViewController<SRWebSocketDelegate>
+
+@property (nonatomic, strong) NSString *script;
+@property (nonatomic, strong) NSURL *url;
+
+@property (nonatomic, strong) SRWebSocket *hotReloadSocket;
+@property (nonatomic, strong) NSString *source;
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/WXDemoViewController.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/WXDemoViewController.m b/ios/playground/WeexDemo/WXDemoViewController.m
new file mode 100644
index 0000000..1e6cd19
--- /dev/null
+++ b/ios/playground/WeexDemo/WXDemoViewController.m
@@ -0,0 +1,217 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXDemoViewController.h"
+#import <WeexSDK/WXSDKInstance.h>
+#import <WeexSDK/WXSDKEngine.h>
+#import <WeexSDK/WXUtility.h>
+#import <WeexSDK/WXDebugTool.h>
+#import "UIViewController+WXDemoNaviBar.h"
+#import "DemoDefine.h"
+
+
+@interface WXDemoViewController () <UIScrollViewDelegate, UIWebViewDelegate>
+@property (nonatomic, strong) WXSDKInstance *instance;
+@property (nonatomic, strong) UIView *weexView;
+
+@property (nonatomic, strong) NSArray *refreshList;
+@property (nonatomic, strong) NSArray *refreshList1;
+@property (nonatomic, strong) NSArray *refresh;
+@property (nonatomic) NSInteger count;
+
+@property (nonatomic, assign) CGFloat weexHeight;
+@property (nonatomic, weak) id<UIScrollViewDelegate> originalDelegate;
+
+@end
+
+@implementation WXDemoViewController
+
+- (instancetype)init
+{
+ if (self = [super init]) {
+ }
+
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ [self setupNaviBar];
+ [self setupRightBarItem];
+ self.view.backgroundColor = [UIColor whiteColor];
+
+ _weexHeight = self.view.frame.size.height - 64;
+
+ [self render];
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+ self.navigationController.navigationBarHidden = NO;
+}
+
+//TODO get height
+- (void)viewDidLayoutSubviews
+{
+ _weexHeight = self.view.frame.size.height;
+}
+
+- (void)didReceiveMemoryWarning {
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+- (void)dealloc
+{
+ [_instance destroyInstance];
+}
+
+- (void)render
+{
+ CGFloat width = self.view.frame.size.width;
+ [_instance destroyInstance];
+ _instance = [[WXSDKInstance alloc] init];
+ _instance.viewController = self;
+ _instance.frame = CGRectMake(self.view.frame.size.width-width, 0, width, _weexHeight);
+
+ __weak typeof(self) weakSelf = self;
+ _instance.onCreate = ^(UIView *view) {
+ [weakSelf.weexView removeFromSuperview];
+ weakSelf.weexView = view;
+ [weakSelf.view addSubview:weakSelf.weexView];
+ UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, weakSelf.weexView);
+ };
+ _instance.onFailed = ^(NSError *error) {
+ #ifdef UITEST
+ if ([[error domain] isEqualToString:@"1"]) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ NSMutableString *errMsg=[NSMutableString new];
+ [errMsg appendFormat:@"ErrorType:%@\n",[error domain]];
+ [errMsg appendFormat:@"ErrorCode:%ld\n",(long)[error code]];
+ [errMsg appendFormat:@"ErrorInfo:%@\n", [error userInfo]];
+
+ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"render failed" message:errMsg delegate:weakSelf cancelButtonTitle:nil otherButtonTitles:@"ok", nil];
+ [alertView show];
+ });
+ }
+ #endif
+ };
+
+ _instance.renderFinish = ^(UIView *view) {
+ NSLog(@"render finish");
+ };
+
+ _instance.updateFinish = ^(UIView *view) {
+ WXLogInfo(@"%@", @"Update Finish...");
+ };
+ if (!self.url) {
+ WXLogError(@"error: render url is nil");
+ return;
+ }
+ NSURL *URL = [self testURL: [self.url absoluteString]];
+ NSString *randomURL = [NSString stringWithFormat:@"%@?random=%d",URL.absoluteString,arc4random()];
+ if (!_source) {
+ [_instance renderWithURL:[NSURL URLWithString:randomURL] options:@{@"bundleUrl":URL.absoluteString} data:nil];
+ }else {
+ _source = nil;
+ [_instance renderWithURL:[NSURL URLWithString:randomURL] options:@{@"bundleUrl":URL.absoluteString} data:nil];
+ }
+}
+
+#pragma mark - refresh
+- (void)refreshWeex
+{
+ [self render];
+}
+
+#pragma mark - UIBarButtonItems
+
+- (void)setupRightBarItem
+{
+ if ([WXDebugTool isDebug]){
+ [self loadRefreshCtl];
+ }
+}
+
+- (void)loadRefreshCtl {
+ UIBarButtonItem *refreshButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reload"] style:UIBarButtonItemStylePlain target:self action:@selector(refreshWeex)];
+ refreshButtonItem.accessibilityHint = @"click to reload curent page";
+ self.navigationItem.rightBarButtonItem = refreshButtonItem;
+}
+
+#pragma mark - websocket
+- (void)webSocketDidOpen:(SRWebSocket *)webSocket
+{
+
+}
+
+- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message
+{
+ if ([@"refresh" isEqualToString:message]) {
+ [self render];
+ }
+}
+
+- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error
+{
+
+}
+
+#pragma mark - localBundle
+/*- (void)loadLocalBundle:(NSURL *)url
+{
+ NSURL * localPath = nil;
+ NSMutableArray * pathComponents = nil;
+ if (self.url) {
+ pathComponents =[NSMutableArray arrayWithArray:[url.absoluteString pathComponents]];
+ [pathComponents removeObjectsInRange:NSRangeFromString(@"0 3")];
+ [pathComponents replaceObjectAtIndex:0 withObject:@"bundlejs"];
+
+ NSString *filePath = [NSString stringWithFormat:@"%@/%@",[NSBundle mainBundle].bundlePath,[pathComponents componentsJoinedByString:@"/"]];
+ localPath = [NSURL fileURLWithPath:filePath];
+ }else {
+ NSString *filePath = [NSString stringWithFormat:@"%@/bundlejs/index.js",[NSBundle mainBundle].bundlePath];
+ localPath = [NSURL fileURLWithPath:filePath];
+ }
+
+ NSString *bundleUrl = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/bundlejs/",[NSBundle mainBundle].bundlePath]].absoluteString;
+ [_instance renderWithURL:localPath options:@{@"bundleUrl":bundleUrl} data:nil];
+}*/
+
+#pragma mark - load local device bundle
+- (NSURL*)testURL:(NSString*)url
+{
+ NSRange range = [url rangeOfString:@"_wx_tpl"];
+ if (range.location != NSNotFound) {
+ NSString *tmp = [url substringFromIndex:range.location];
+ NSUInteger start = [tmp rangeOfString:@"="].location;
+ NSUInteger end = [tmp rangeOfString:@"&"].location;
+ ++start;
+ if (end == NSNotFound) {
+ end = [tmp length] - start;
+ }
+ else {
+ end = end - start;
+ }
+ NSRange subRange;
+ subRange.location = start;
+ subRange.length = end;
+ url = [tmp substringWithRange:subRange];
+ }
+ return [NSURL URLWithString:url];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/debug/WXATLoggerPlugin.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/debug/WXATLoggerPlugin.h b/ios/playground/WeexDemo/debug/WXATLoggerPlugin.h
new file mode 100644
index 0000000..23dfceb
--- /dev/null
+++ b/ios/playground/WeexDemo/debug/WXATLoggerPlugin.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <ATSDK/ATPluginProtocol.h>
+
+@interface WXATLoggerPlugin : NSObject<ATPluginProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/debug/WXATLoggerPlugin.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/debug/WXATLoggerPlugin.m b/ios/playground/WeexDemo/debug/WXATLoggerPlugin.m
new file mode 100644
index 0000000..2591efc
--- /dev/null
+++ b/ios/playground/WeexDemo/debug/WXATLoggerPlugin.m
@@ -0,0 +1,54 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXATLoggerPlugin.h"
+#import <WeexSDK/WXSDKEngine.h>
+
+@implementation WXATLoggerPlugin
+
+- (void)pluginDidLoadWithArgs:(NSArray *)args
+{
+
+}
+
+- (void)pluginWillOpenInContainer:(UIViewController *)container withArg:(NSArray *)args
+{
+ NSURL *URL = [NSURL URLWithString:@"http://127.0.0.1:8687/launchDebugger"];
+ NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+
+ NSURLSession *session = [NSURLSession sharedSession];
+ NSURLSessionDataTask *task = [session dataTaskWithRequest:request
+ completionHandler:
+ ^(NSData *data, NSURLResponse *response, NSError *error) {
+ // ...
+ }];
+
+ [task resume];
+
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ [WXSDKEngine connectDebugServer:@"ws://127.0.0.1:8687/debugger/0/renderer"];
+ });
+}
+
+- (void)pluginWillClose
+{
+
+}
+
+- (void)pluginDidUnload
+{
+
+}
+
+- (CGRect)wantReactArea
+{
+ return CGRectZero;
+}
+
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.h b/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.h
new file mode 100644
index 0000000..ccc3523
--- /dev/null
+++ b/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+//#import <Foundation/Foundation.h>
+//#import <ATSDK/ATPluginProtocol.h>
+//
+//@interface WXATViewHierarchyPlugin : NSObject<ATPluginProtocol>
+//
+//@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.m b/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.m
new file mode 100644
index 0000000..fe3c29f
--- /dev/null
+++ b/ios/playground/WeexDemo/debug/WXATViewHierarchyPlugin.m
@@ -0,0 +1,43 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+//#import "WXATViewHierarchyPlugin.h"
+//#import <WeexSDK/WXViewHierarchy.h>
+//
+//@implementation WXATViewHierarchyPlugin
+//{
+// WXViewHierarchy *_hierarchy;
+//}
+//
+//- (void)pluginDidLoadWithArgs:(NSArray *)args
+//{
+// _hierarchy = [[WXViewHierarchy alloc] init];
+// _hierarchy.hidden = YES;
+//}
+//
+//- (void)pluginWillOpenInContainer:(UIViewController *)container withArg:(NSArray *)args
+//{
+// [_hierarchy show];
+//}
+//
+//- (void)pluginWillClose
+//{
+// [_hierarchy hide];
+//}
+//
+//- (void)pluginDidUnload
+//{
+// _hierarchy = nil;
+//}
+//
+//- (CGRect)wantReactArea
+//{
+// return CGRectZero;
+//}
+//
+//@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/extend/component/WXSelectComponent.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/extend/component/WXSelectComponent.h b/ios/playground/WeexDemo/extend/component/WXSelectComponent.h
new file mode 100644
index 0000000..7f8616c
--- /dev/null
+++ b/ios/playground/WeexDemo/extend/component/WXSelectComponent.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import <WeexSDK/WXComponent.h>
+
+@interface WXSelectComponent : WXComponent <UIPickerViewDataSource, UIPickerViewDelegate>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/extend/component/WXSelectComponent.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/extend/component/WXSelectComponent.m b/ios/playground/WeexDemo/extend/component/WXSelectComponent.m
new file mode 100644
index 0000000..9ec52e9
--- /dev/null
+++ b/ios/playground/WeexDemo/extend/component/WXSelectComponent.m
@@ -0,0 +1,138 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSelectComponent.h"
+#import "WXUtility.h"
+#import "WXComponent+Events.h"
+
+@interface WXSelectComponent()
+
+@property (nonatomic, strong) UITapGestureRecognizer *tap;
+@property (nonatomic, strong) UIPickerView *pickerView;
+@property (nonatomic, strong) NSArray *options;
+@property (nonatomic, assign) NSInteger selectIndex;
+@property (nonatomic, assign) BOOL disabled;
+
+@end
+
+@implementation WXSelectComponent
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ _tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(popupPicker)];
+ _tap.delegate = self;
+
+ if (attributes[@"options"]) {
+ _options = [attributes[@"options"] componentsSeparatedByString:@","];
+ }
+ if (attributes[@"selectIndex"]) {
+ _selectIndex = [attributes[@"selectIndex"] integerValue];
+ }
+ if (attributes[@"disabled"]) {
+ _disabled = [attributes[@"disabled"] boolValue];
+ }
+
+ if (styles[@""]) {
+ // setting style when init
+ }
+
+ UIWindow * window = [UIApplication sharedApplication].keyWindow;
+ CGSize windowSize = window.rootViewController.view.frame.size;
+ CGFloat pickerViewHeight = 200.0;
+ _pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 0, windowSize.width, pickerViewHeight)];
+ [_pickerView setBackgroundColor:[UIColor redColor]];
+ _pickerView.dataSource = self;
+ _pickerView.delegate = self;
+ }
+
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [_pickerView selectRow:_selectIndex inComponent:0 animated:YES];
+ // show selected item
+ _pickerView.showsSelectionIndicator=YES;
+}
+
+- (void)viewWillUnload
+{
+}
+
+- (UIView *)loadView {
+
+ return _pickerView;
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"options"]) {
+ _options = [attributes[@"options"] componentsSeparatedByString:@","];
+ }
+ if (attributes[@"selectIndex"]) {
+ _selectIndex = [attributes[@"selectIndex"] integerValue];
+ }
+ if (attributes[@"disabled"]) {
+ _disabled = [attributes[@"disabled"] boolValue];
+ }
+ [_pickerView reloadAllComponents];
+}
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+
+}
+
+#pragma mark - action
+- (void)popupPicker
+{
+ if (_disabled)
+ return;
+
+ [self fireEvent:@"focus" params:nil];
+}
+
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
+{
+ if (gestureRecognizer == _tap)
+ return YES;
+
+ if (otherGestureRecognizer == _tap)
+ return YES;
+
+ return [super gestureRecognizer:gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer];
+}
+
+#pragma mark - pickerView delegate
+- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
+ return 1;
+}
+
+
+- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
+ return [_options count];
+}
+
+- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
+
+ return self.calculatedFrame.size.width;
+}
+
+- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
+{
+ [self fireEvent:@"change" params:@{@"index":[NSNumber numberWithInteger:row],
+ @"value":[_options objectAtIndex:row]}];
+}
+
+-(NSString*)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
+{
+ return [_options objectAtIndex:row];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h
new file mode 100644
index 0000000..3d420d4
--- /dev/null
+++ b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXImgLoaderProtocol.h"
+
+@interface WXImgLoaderDefaultImpl : NSObject<WXImgLoaderProtocol, WXModuleProtocol>
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m
new file mode 100644
index 0000000..37c1ec3
--- /dev/null
+++ b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m
@@ -0,0 +1,52 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXImgLoaderDefaultImpl.h"
+#import <SDWebImage/UIImageView+WebCache.h>
+
+#define MIN_IMAGE_WIDTH 36
+#define MIN_IMAGE_HEIGHT 36
+
+#if OS_OBJECT_USE_OBJC
+#undef WXDispatchQueueRelease
+#undef WXDispatchQueueSetterSementics
+#define WXDispatchQueueRelease(q)
+#define WXDispatchQueueSetterSementics strong
+#else
+#undef WXDispatchQueueRelease
+#undef WXDispatchQueueSetterSementics
+#define WXDispatchQueueRelease(q) (dispatch_release(q))
+#define WXDispatchQueueSetterSementics assign
+#endif
+
+@interface WXImgLoaderDefaultImpl()
+
+@property (WXDispatchQueueSetterSementics, nonatomic) dispatch_queue_t ioQueue;
+
+@end
+
+@implementation WXImgLoaderDefaultImpl
+
+#pragma mark -
+#pragma mark WXImgLoaderProtocol
+
+- (id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo completed:(void(^)(UIImage *image, NSError *error, BOOL finished))completedBlock
+{
+ if ([url hasPrefix:@"//"]) {
+ url = [@"http:" stringByAppendingString:url];
+ }
+ return (id<WXImageOperationProtocol>)[[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) {
+
+ } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
+ if (completedBlock) {
+ completedBlock(image, error, finished);
+ }
+ }];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/extend/module/WXEventModule.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/extend/module/WXEventModule.h b/ios/playground/WeexDemo/extend/module/WXEventModule.h
new file mode 100644
index 0000000..790a187
--- /dev/null
+++ b/ios/playground/WeexDemo/extend/module/WXEventModule.h
@@ -0,0 +1,15 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WeexSDK/WXEventModuleProtocol.h>
+#import <WeexSDK/WXModuleProtocol.h>
+
+@interface WXEventModule : NSObject <WXEventModuleProtocol, WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/extend/module/WXEventModule.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/extend/module/WXEventModule.m b/ios/playground/WeexDemo/extend/module/WXEventModule.m
new file mode 100644
index 0000000..061ec5a
--- /dev/null
+++ b/ios/playground/WeexDemo/extend/module/WXEventModule.m
@@ -0,0 +1,36 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXEventModule.h"
+#import "WXDemoViewController.h"
+#import <WeexSDK/WXBaseViewController.h>
+
+@implementation WXEventModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(openURL:))
+
+- (void)openURL:(NSString *)url
+{
+ NSString *newURL = url;
+ if ([url hasPrefix:@"//"]) {
+ newURL = [NSString stringWithFormat:@"http:%@", url];
+ } else if (![url hasPrefix:@"http"]) {
+ // relative path
+ newURL = [NSURL URLWithString:url relativeToURL:weexInstance.scriptURL].absoluteString;
+ }
+
+ UIViewController *controller = [[WXDemoViewController alloc] init];
+ ((WXDemoViewController *)controller).url = [NSURL URLWithString:newURL];
+
+ [[weexInstance.viewController navigationController] pushViewController:controller animated:YES];
+}
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/main.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/main.m b/ios/playground/WeexDemo/main.m
new file mode 100644
index 0000000..6eb9b2a
--- /dev/null
+++ b/ios/playground/WeexDemo/main.m
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/weex-icon.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/weex-icon.png b/ios/playground/WeexDemo/weex-icon.png
new file mode 100644
index 0000000..396b78f
Binary files /dev/null and b/ios/playground/WeexDemo/weex-icon.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemoTests/Info.plist
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemoTests/Info.plist b/ios/playground/WeexDemoTests/Info.plist
new file mode 100644
index 0000000..ba72822
--- /dev/null
+++ b/ios/playground/WeexDemoTests/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemoTests/WeexDemoTests.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemoTests/WeexDemoTests.m b/ios/playground/WeexDemoTests/WeexDemoTests.m
new file mode 100644
index 0000000..0596cb1
--- /dev/null
+++ b/ios/playground/WeexDemoTests/WeexDemoTests.m
@@ -0,0 +1,39 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <XCTest/XCTest.h>
+
+@interface WeexDemoTests : XCTestCase
+
+@end
+
+@implementation WeexDemoTests
+
+- (void)setUp {
+ [super setUp];
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+}
+
+- (void)tearDown {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void)testExample {
+ // This is an example of a functional test case.
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
+}
+
+- (void)testPerformanceExample {
+ // This is an example of a performance test case.
+ [self measureBlock:^{
+ // Put the code you want to measure the time of here.
+ }];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexUITestDemo-Info.plist
----------------------------------------------------------------------
diff --git a/ios/playground/WeexUITestDemo-Info.plist b/ios/playground/WeexUITestDemo-Info.plist
new file mode 100644
index 0000000..a249bfe
--- /dev/null
+++ b/ios/playground/WeexUITestDemo-Info.plist
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSAppTransportSecurity</key>
+ <dict>
+ <key>NSAllowsArbitraryLoads</key>
+ <true/>
+ </dict>
+ <key>UILaunchStoryboardName</key>
+ <string>LaunchScreen</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UIStatusBarStyle</key>
+ <string>UIStatusBarStyleLightContent</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UIViewControllerBasedStatusBarAppearance</key>
+ <false/>
+</dict>
+</plist>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexUITestDemoUITests/Info.plist
----------------------------------------------------------------------
diff --git a/ios/playground/WeexUITestDemoUITests/Info.plist b/ios/playground/WeexUITestDemoUITests/Info.plist
new file mode 100644
index 0000000..ba72822
--- /dev/null
+++ b/ios/playground/WeexUITestDemoUITests/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexUITestDemoUITests/WeexUITestDemoUITests.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexUITestDemoUITests/WeexUITestDemoUITests.m b/ios/playground/WeexUITestDemoUITests/WeexUITestDemoUITests.m
new file mode 100644
index 0000000..e5be497
--- /dev/null
+++ b/ios/playground/WeexUITestDemoUITests/WeexUITestDemoUITests.m
@@ -0,0 +1,40 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <XCTest/XCTest.h>
+
+@interface WeexUITestDemoUITests : XCTestCase
+
+@end
+
+@implementation WeexUITestDemoUITests
+
+- (void)setUp {
+ [super setUp];
+
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+
+ // In UI tests it is usually best to stop immediately when a failure occurs.
+ self.continueAfterFailure = NO;
+ // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
+ [[[XCUIApplication alloc] init] launch];
+
+ // In UI tests it\u2019s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
+}
+
+- (void)tearDown {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void)testExample {
+ // Use recording to get started writing UI tests.
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/weex.png
----------------------------------------------------------------------
diff --git a/ios/playground/weex.png b/ios/playground/weex.png
new file mode 100644
index 0000000..e8f8e52
Binary files /dev/null and b/ios/playground/weex.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/weex@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/weex@2x.png b/ios/playground/weex@2x.png
new file mode 100644
index 0000000..0b7542f
Binary files /dev/null and b/ios/playground/weex@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/LICENSE
----------------------------------------------------------------------
diff --git a/ios/sdk/LICENSE b/ios/sdk/LICENSE
new file mode 100755
index 0000000..cfc27db
--- /dev/null
+++ b/ios/sdk/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2016 Alibaba Group
+
+ Licensed 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.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/NOTICE
----------------------------------------------------------------------
diff --git a/ios/sdk/NOTICE b/ios/sdk/NOTICE
new file mode 100755
index 0000000..8423281
--- /dev/null
+++ b/ios/sdk/NOTICE
@@ -0,0 +1,13 @@
+Weex Sdk iOS
+Copyright 2016 Alibaba Group
+
+This product includes software developed at Alibaba Group. (http://www.alibabagroup.com)
+
+This product contains software css-layout(https://github.com/facebook/css-layout) developed
+by Facebook Inc., licensed under the BSD License.
+
+This product contains software React Native(https://github.com/facebook/react-native) developed
+by Facebook Inc., licensed under the BSD License.
+
+This product contains software SRWebSocket (https://github.com/facebook/SocketRocket)by Facebook Inc., licensed under the Apache License, Version 2.0.
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/README.md
----------------------------------------------------------------------
diff --git a/ios/sdk/README.md b/ios/sdk/README.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK.podspec
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK.podspec b/ios/sdk/WeexSDK.podspec
new file mode 100644
index 0000000..4e53655
--- /dev/null
+++ b/ios/sdk/WeexSDK.podspec
@@ -0,0 +1,33 @@
+# coding: utf-8
+Pod::Spec.new do |s|
+
+
+ s.name = "WeexSDK"
+ s.version = "0.6.0"
+ s.summary = "WeexSDK Source ."
+
+ s.description = <<-DESC
+ WeexSDK Source description
+ DESC
+
+ s.homepage = "https://github.com/alibaba/weex"
+ s.license = {
+ :type => 'Copyright',
+ :text => <<-LICENSE
+ Alibaba-INC copyright
+ LICENSE
+ }
+
+ s.platform = :ios
+ s.ios.deployment_target = '7.0'
+ s.source = { :path => '.' }
+ s.source_files = 'WeexSDK/Sources/**/*.{h,m,mm,c}'
+ s.resources = 'WeexSDK/Resources/weex_config.plist', 'WeexSDK/Resources/main.js'
+
+ s.requires_arc = true
+ s.prefix_header_file = 'WeexSDK/Sources/Supporting Files/WeexSDK-Prefix.pch'
+
+# s.xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) DEBUG=1' }
+ s.frameworks = 'AVKit'
+ s.dependency 'SocketRocket'
+end
[23/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
+ [ios] iOS init.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/185fe55c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/185fe55c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/185fe55c
Branch: refs/heads/master
Commit: 185fe55c4af5688dbc7b498256c4f3509b944796
Parents: bb46720
Author: boboning <ni...@163.com>
Authored: Sun Jun 12 23:12:06 2016 +0800
Committer: boboning <ni...@163.com>
Committed: Sun Jun 12 23:12:06 2016 +0800
----------------------------------------------------------------------
README.md | 2 +-
ios/playground/CFNetwork.gcno | Bin 0 -> 12900 bytes
ios/playground/CoreGraphics.gcno | Bin 0 -> 2348 bytes
ios/playground/Foundation.gcno | Bin 0 -> 4020 bytes
ios/playground/ObjectiveC.gcno | Bin 0 -> 24364 bytes
ios/playground/Podfile | 11 +
ios/playground/QuartzCore.gcno | Bin 0 -> 13724 bytes
ios/playground/README.md | 0
.../WeexDemo.xcodeproj/project.pbxproj | 882 +++++++++
.../xcshareddata/xcschemes/WeexDemo.xcscheme | 111 ++
.../xcschemes/WeexUITestDemo.xcscheme | 91 +
ios/playground/WeexDemo/AppDelegate.h | 16 +
ios/playground/WeexDemo/AppDelegate.m | 192 ++
.../AppIcon.appiconset/Contents.json | 86 +
.../AppIcon.appiconset/Icon-40.png | Bin 0 -> 2169 bytes
.../AppIcon.appiconset/Icon-40@2x.png | Bin 0 -> 5276 bytes
.../AppIcon.appiconset/Icon-40@3x.png | Bin 0 -> 8588 bytes
.../AppIcon.appiconset/Icon-60@2x.png | Bin 0 -> 8588 bytes
.../AppIcon.appiconset/Icon-60@3x.png | Bin 0 -> 13818 bytes
.../AppIcon.appiconset/Icon-76.png | Bin 0 -> 4899 bytes
.../AppIcon.appiconset/Icon-76@2x.png | Bin 0 -> 11268 bytes
.../AppIcon.appiconset/Icon-83.5@2x.png | Bin 0 -> 12556 bytes
.../AppIcon.appiconset/Icon-Small.png | Bin 0 -> 1354 bytes
.../AppIcon.appiconset/Icon-Small@2x.png | Bin 0 -> 3552 bytes
.../AppIcon.appiconset/Icon-Small@3x.png | Bin 0 -> 5772 bytes
.../Brand Assets.launchimage/Contents.json | 36 +
.../WeexDemo/Assets.xcassets/Contents.json | 6 +
.../Assets.xcassets/back.imageset/Contents.json | 23 +
.../Assets.xcassets/back.imageset/back.png | Bin 0 -> 1244 bytes
.../Assets.xcassets/back.imageset/back@2x.png | Bin 0 -> 1646 bytes
.../Assets.xcassets/back.imageset/back@3x.png | Bin 0 -> 2179 bytes
.../reload.imageset/Contents.json | 23 +
.../Assets.xcassets/reload.imageset/reload.png | Bin 0 -> 542 bytes
.../reload.imageset/reload@2x.png | Bin 0 -> 1037 bytes
.../reload.imageset/reload@3x.png | Bin 0 -> 1516 bytes
.../Assets.xcassets/scan.imageset/Contents.json | 23 +
.../Assets.xcassets/scan.imageset/scan.png | Bin 0 -> 1344 bytes
.../Assets.xcassets/scan.imageset/scan@2x.png | Bin 0 -> 2458 bytes
.../Assets.xcassets/scan.imageset/scan@3x.png | Bin 0 -> 3723 bytes
.../WeexDemo/Base.lproj/LaunchScreen.storyboard | 26 +
.../WeexDemo/DemoBaseViewController.h | 13 +
.../WeexDemo/DemoBaseViewController.m | 34 +
ios/playground/WeexDemo/DemoDefine.h | 28 +
ios/playground/WeexDemo/Info.plist | 65 +
ios/playground/WeexDemo/Scanner/WXScannerVC.h | 14 +
ios/playground/WeexDemo/Scanner/WXScannerVC.m | 170 ++
.../WeexDemo/UIViewController+WXDemoNaviBar.h | 23 +
.../WeexDemo/UIViewController+WXDemoNaviBar.m | 103 +
ios/playground/WeexDemo/WXDemoViewController.h | 21 +
ios/playground/WeexDemo/WXDemoViewController.m | 217 +++
.../WeexDemo/debug/WXATLoggerPlugin.h | 14 +
.../WeexDemo/debug/WXATLoggerPlugin.m | 54 +
.../WeexDemo/debug/WXATViewHierarchyPlugin.h | 14 +
.../WeexDemo/debug/WXATViewHierarchyPlugin.m | 43 +
.../extend/component/WXSelectComponent.h | 14 +
.../extend/component/WXSelectComponent.m | 138 ++
.../extend/handler/WXImgLoaderDefaultImpl.h | 13 +
.../extend/handler/WXImgLoaderDefaultImpl.m | 52 +
.../WeexDemo/extend/module/WXEventModule.h | 15 +
.../WeexDemo/extend/module/WXEventModule.m | 36 +
ios/playground/WeexDemo/main.m | 16 +
ios/playground/WeexDemo/weex-icon.png | Bin 0 -> 53574 bytes
ios/playground/WeexDemoTests/Info.plist | 24 +
ios/playground/WeexDemoTests/WeexDemoTests.m | 39 +
ios/playground/WeexUITestDemo-Info.plist | 52 +
ios/playground/WeexUITestDemoUITests/Info.plist | 24 +
.../WeexUITestDemoUITests.m | 40 +
ios/playground/weex.png | Bin 0 -> 3187 bytes
ios/playground/weex@2x.png | Bin 0 -> 7294 bytes
ios/sdk/LICENSE | 202 ++
ios/sdk/NOTICE | 13 +
ios/sdk/README.md | 0
ios/sdk/WeexSDK.podspec | 33 +
ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 1400 ++++++++++++++
.../xcshareddata/xcschemes/WeexSDK.xcscheme | 99 +
.../xcschemes/WeexSDK_xcode7.xcscheme | 80 +
ios/sdk/WeexSDK/Info.plist | 26 +
ios/sdk/WeexSDK/Resources/main.js | 4 +
.../WeexSDK/Sources/Bridge/WXBridgeContext.h | 91 +
.../WeexSDK/Sources/Bridge/WXBridgeContext.m | 372 ++++
ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.h | 13 +
ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 133 ++
.../WeexSDK/Sources/Bridge/WXWebSocketBridge.h | 15 +
.../WeexSDK/Sources/Bridge/WXWebSocketBridge.m | 203 ++
.../WeexSDK/Sources/Component/WXAComponent.h | 13 +
.../WeexSDK/Sources/Component/WXAComponent.m | 75 +
.../WeexSDK/Sources/Component/WXCellComponent.h | 18 +
.../WeexSDK/Sources/Component/WXCellComponent.m | 93 +
.../Sources/Component/WXComponent_internal.h | 163 ++
.../WeexSDK/Sources/Component/WXDivComponent.h | 13 +
.../WeexSDK/Sources/Component/WXDivComponent.m | 16 +
.../Sources/Component/WXEmbedComponent.h | 15 +
.../Sources/Component/WXEmbedComponent.m | 175 ++
.../Sources/Component/WXImageComponent.h | 13 +
.../Sources/Component/WXImageComponent.m | 234 +++
.../Sources/Component/WXIndicatorComponent.h | 33 +
.../Sources/Component/WXIndicatorComponent.m | 186 ++
.../WeexSDK/Sources/Component/WXListComponent.h | 24 +
.../WeexSDK/Sources/Component/WXListComponent.m | 296 +++
.../Sources/Component/WXLoadingComponent.h | 17 +
.../Sources/Component/WXLoadingComponent.m | 137 ++
.../Sources/Component/WXLoadingIndicator.h | 17 +
.../Sources/Component/WXLoadingIndicator.m | 78 +
.../Sources/Component/WXRefreshComponent.h | 17 +
.../Sources/Component/WXRefreshComponent.m | 143 ++
.../Sources/Component/WXScrollerComponent.h | 25 +
.../Sources/Component/WXScrollerComponent.m | 579 ++++++
.../Sources/Component/WXSliderComponent.h | 18 +
.../Sources/Component/WXSliderComponent.m | 446 +++++
.../Sources/Component/WXSwitchComponent.h | 13 +
.../Sources/Component/WXSwitchComponent.m | 89 +
.../WeexSDK/Sources/Component/WXTextComponent.h | 13 +
.../WeexSDK/Sources/Component/WXTextComponent.m | 365 ++++
.../Sources/Component/WXTextInputComponent.h | 14 +
.../Sources/Component/WXTextInputComponent.m | 385 ++++
ios/sdk/WeexSDK/Sources/Component/WXTransform.h | 20 +
ios/sdk/WeexSDK/Sources/Component/WXTransform.m | 216 +++
.../Sources/Component/WXVideoComponent.h | 34 +
.../Sources/Component/WXVideoComponent.m | 293 +++
.../WeexSDK/Sources/Component/WXWebComponent.h | 21 +
.../WeexSDK/Sources/Component/WXWebComponent.m | 183 ++
.../Sources/Controller/WXBaseViewController.h | 35 +
.../Sources/Controller/WXBaseViewController.m | 186 ++
.../Sources/Controller/WXRootViewController.h | 33 +
.../Sources/Controller/WXRootViewController.m | 21 +
ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.h | 28 +
ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.m | 115 ++
.../Sources/Display/WXComponent+Display.h | 13 +
.../Sources/Display/WXComponent+Display.m | 463 +++++
.../WeexSDK/Sources/Display/WXDisplayQueue.h | 16 +
.../WeexSDK/Sources/Display/WXDisplayQueue.m | 45 +
ios/sdk/WeexSDK/Sources/Display/WXLayer.h | 13 +
ios/sdk/WeexSDK/Sources/Display/WXLayer.m | 21 +
ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h | 89 +
ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m | 186 ++
ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h | 45 +
ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m | 63 +
.../WeexSDK/Sources/Events/WXComponent+Events.h | 13 +
.../WeexSDK/Sources/Events/WXComponent+Events.m | 621 ++++++
.../Sources/Handler/WXNavigationDefaultImpl.h | 14 +
.../Sources/Handler/WXNavigationDefaultImpl.m | 353 ++++
.../Sources/Handler/WXNetworkDefaultImpl.h | 14 +
.../Sources/Handler/WXNetworkDefaultImpl.m | 105 +
ios/sdk/WeexSDK/Sources/Layout/Layout.c | 1324 +++++++++++++
ios/sdk/WeexSDK/Sources/Layout/Layout.h | 177 ++
.../WeexSDK/Sources/Layout/WXComponent+Layout.h | 13 +
.../WeexSDK/Sources/Layout/WXComponent+Layout.m | 296 +++
.../WeexSDK/Sources/Manager/WXBridgeManager.h | 119 ++
.../WeexSDK/Sources/Manager/WXBridgeManager.m | 239 +++
.../Sources/Manager/WXComponentFactory.h | 35 +
.../Sources/Manager/WXComponentFactory.m | 139 ++
.../Sources/Manager/WXComponentManager.h | 138 ++
.../Sources/Manager/WXComponentManager.m | 545 ++++++
.../WeexSDK/Sources/Manager/WXHandlerFactory.h | 29 +
.../WeexSDK/Sources/Manager/WXHandlerFactory.m | 49 +
.../WeexSDK/Sources/Manager/WXModuleFactory.h | 49 +
.../WeexSDK/Sources/Manager/WXModuleFactory.m | 225 +++
.../WeexSDK/Sources/Manager/WXModuleManager.h | 16 +
.../WeexSDK/Sources/Manager/WXModuleManager.m | 139 ++
ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.h | 41 +
ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.m | 73 +
ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.h | 24 +
ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.m | 41 +
.../Sources/Model/WXComponent+Navigation.h | 22 +
.../Sources/Model/WXComponent+Navigation.m | 178 ++
ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 310 +++
ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 288 +++
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 200 ++
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 314 +++
.../Sources/Model/WXSDKInstance_private.h | 22 +
.../WeexSDK/Sources/Module/WXAnimationModule.h | 14 +
.../WeexSDK/Sources/Module/WXAnimationModule.m | 75 +
ios/sdk/WeexSDK/Sources/Module/WXDomModule.h | 13 +
ios/sdk/WeexSDK/Sources/Module/WXDomModule.m | 148 ++
ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.h | 13 +
ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.m | 44 +
.../WeexSDK/Sources/Module/WXModalUIModule.h | 14 +
.../WeexSDK/Sources/Module/WXModalUIModule.m | 308 +++
.../WeexSDK/Sources/Module/WXNavigatorModule.h | 14 +
.../WeexSDK/Sources/Module/WXNavigatorModule.m | 156 ++
.../WeexSDK/Sources/Module/WXStorageModule.h | 14 +
.../WeexSDK/Sources/Module/WXStorageModule.m | 202 ++
ios/sdk/WeexSDK/Sources/Module/WXStreamModule.h | 14 +
ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m | 152 ++
ios/sdk/WeexSDK/Sources/Module/WXTimerModule.h | 14 +
ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m | 75 +
.../WeexSDK/Sources/Module/WXWebViewModule.h | 15 +
.../WeexSDK/Sources/Module/WXWebViewModule.m | 70 +
.../Sources/Protocol/WXAppMonitorProtocol.h | 26 +
.../WeexSDK/Sources/Protocol/WXBridgeProtocol.h | 25 +
.../Sources/Protocol/WXDestroyProtocol.h | 18 +
.../Sources/Protocol/WXEventModuleProtocol.h | 15 +
.../Sources/Protocol/WXImgLoaderProtocol.h | 36 +
.../WeexSDK/Sources/Protocol/WXModuleProtocol.h | 47 +
.../Sources/Protocol/WXNavigationProtocol.h | 143 ++
.../Sources/Protocol/WXNetworkProtocol.h | 32 +
.../Sources/Protocol/WXScrollerProtocol.h | 56 +
.../Sources/Protocol/WXTextComponentProtocol.h | 15 +
.../Sources/Supporting Files/WeexSDK-Prefix.pch | 11 +
ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.h | 23 +
ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.m | 37 +
ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.h | 17 +
ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.m | 32 +
.../Sources/Utility/WXAppConfiguration.h | 37 +
.../Sources/Utility/WXAppConfiguration.m | 72 +
ios/sdk/WeexSDK/Sources/Utility/WXAssert.h | 61 +
ios/sdk/WeexSDK/Sources/Utility/WXAssert.m | 21 +
ios/sdk/WeexSDK/Sources/Utility/WXConvert.h | 58 +
ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 622 ++++++
ios/sdk/WeexSDK/Sources/Utility/WXDefine.h | 118 ++
ios/sdk/WeexSDK/Sources/Utility/WXLog.h | 105 +
ios/sdk/WeexSDK/Sources/Utility/WXLog.m | 171 ++
.../Utility/WXSimulatorShortcutMananger.h | 16 +
.../Utility/WXSimulatorShortcutMananger.m | 118 ++
.../Sources/Utility/WXThreadSafeCounter.h | 20 +
.../Sources/Utility/WXThreadSafeCounter.m | 25 +
.../Sources/Utility/WXThreadSafeMutableArray.h | 16 +
.../Sources/Utility/WXThreadSafeMutableArray.m | 147 ++
.../Utility/WXThreadSafeMutableDictionary.h | 16 +
.../Utility/WXThreadSafeMutableDictionary.m | 121 ++
ios/sdk/WeexSDK/Sources/Utility/WXType.h | 65 +
ios/sdk/WeexSDK/Sources/Utility/WXUtility.h | 282 +++
ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 389 ++++
.../Sources/Utility/WXWeakObjectWrapper.h | 17 +
.../Sources/Utility/WXWeakObjectWrapper.m | 22 +
.../Sources/View/WXComponent+ViewManangement.h | 13 +
.../Sources/View/WXComponent+ViewManangement.m | 254 +++
ios/sdk/WeexSDK/Sources/View/WXView.h | 13 +
ios/sdk/WeexSDK/Sources/View/WXView.m | 49 +
ios/sdk/WeexSDK/Sources/WeexSDK.h | 31 +
ios/sdk/WeexSDK/dependency/SRWebSocket.h | 140 ++
ios/sdk/WeexSDK/dependency/SRWebSocket.m | 1812 ++++++++++++++++++
ios/sdk/WeexSDKTests/Info.plist | 24 +
ios/sdk/WeexSDKTests/WeexENVTests.m | 96 +
ios/sdk/WeexSDKTests/WeexSDKTests.m | 96 +
ios/sdk/WeexSDKTests/test.js | 24 +
ios/sdk/WeexSDKTests/weex-test.js | 15 +
ios/sdk/WeexSDK_MTL/WeexSDK_MTL.h | 13 +
ios/sdk/WeexSDK_MTL/WeexSDK_MTL.m | 13 +
ios/sdk/buildScripts.sh | 99 +
240 files changed, 24613 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 252ea36..3ec0351 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ We agree that you may discuss technical information about Weex, except that you
> A framework for building Mobile cross-platform UI.
-Support Android 4.1 (API 16) and iOS soon. See [Weex website](http://alibaba.github.io/weex/) for more information.
+Support Android 4.1 (API 16) and iOS 7.0+. See [Weex website](http://alibaba.github.io/weex/) for more information.
## For Windows
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/CFNetwork.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/CFNetwork.gcno b/ios/playground/CFNetwork.gcno
new file mode 100644
index 0000000..5b6ec63
Binary files /dev/null and b/ios/playground/CFNetwork.gcno differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/CoreGraphics.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/CoreGraphics.gcno b/ios/playground/CoreGraphics.gcno
new file mode 100644
index 0000000..cf63b22
Binary files /dev/null and b/ios/playground/CoreGraphics.gcno differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/Foundation.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/Foundation.gcno b/ios/playground/Foundation.gcno
new file mode 100644
index 0000000..e13f146
Binary files /dev/null and b/ios/playground/Foundation.gcno differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/ObjectiveC.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/ObjectiveC.gcno b/ios/playground/ObjectiveC.gcno
new file mode 100644
index 0000000..ae8b21c
Binary files /dev/null and b/ios/playground/ObjectiveC.gcno differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/Podfile
----------------------------------------------------------------------
diff --git a/ios/playground/Podfile b/ios/playground/Podfile
new file mode 100644
index 0000000..46ae78b
--- /dev/null
+++ b/ios/playground/Podfile
@@ -0,0 +1,11 @@
+platform :ios, '7.0'
+#inhibit_all_warnings!
+
+target 'WeexDemo' do
+ pod 'WeexSDK', :path=>'../sdk/'
+ pod 'SDWebImage', '3.7.5'
+ pod 'SocketRocket', '0.4.2'
+ pod 'ZXingObjC', '~> 3.0'
+ pod 'ATSDK-Weex', '0.0.1'
+end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/QuartzCore.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/QuartzCore.gcno b/ios/playground/QuartzCore.gcno
new file mode 100644
index 0000000..0113b7c
Binary files /dev/null and b/ios/playground/QuartzCore.gcno differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/README.md
----------------------------------------------------------------------
diff --git a/ios/playground/README.md b/ios/playground/README.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo.xcodeproj/project.pbxproj b/ios/playground/WeexDemo.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..f788f71
--- /dev/null
+++ b/ios/playground/WeexDemo.xcodeproj/project.pbxproj
@@ -0,0 +1,882 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 2AE88A2C1C8544E6003329DE /* WXScannerVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE88A2B1C8544E6003329DE /* WXScannerVC.m */; };
+ 74CC79EB1C2B9E4700829368 /* UIViewController+WXDemoNaviBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 74CC79EA1C2B9E4700829368 /* UIViewController+WXDemoNaviBar.m */; };
+ 775BEE801C1E8ECC008D1629 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 775BEE7F1C1E8ECC008D1629 /* main.m */; };
+ 775BEE831C1E8ECC008D1629 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 775BEE821C1E8ECC008D1629 /* AppDelegate.m */; };
+ 775BEE861C1E8ECC008D1629 /* WXDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 775BEE851C1E8ECC008D1629 /* WXDemoViewController.m */; };
+ 775BEE8B1C1E8ECC008D1629 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 775BEE8A1C1E8ECC008D1629 /* Assets.xcassets */; };
+ 775BEE8E1C1E8ECC008D1629 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 775BEE8C1C1E8ECC008D1629 /* LaunchScreen.storyboard */; };
+ 775BEE991C1E8ECC008D1629 /* WeexDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 775BEE981C1E8ECC008D1629 /* WeexDemoTests.m */; };
+ 84361D2F1CA10F8E00F43825 /* WXScannerVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE88A2B1C8544E6003329DE /* WXScannerVC.m */; };
+ 84361D331CA10F8E00F43825 /* WXDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 775BEE851C1E8ECC008D1629 /* WXDemoViewController.m */; };
+ 84361D371CA10F8E00F43825 /* UIViewController+WXDemoNaviBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 74CC79EA1C2B9E4700829368 /* UIViewController+WXDemoNaviBar.m */; };
+ 84361D381CA10F8E00F43825 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 775BEE821C1E8ECC008D1629 /* AppDelegate.m */; };
+ 84361D3B1CA10F8E00F43825 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 775BEE7F1C1E8ECC008D1629 /* main.m */; };
+ 84361D421CA10F8E00F43825 /* libPods-WeexDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7601607D735D7F8D88971230 /* libPods-WeexDemo.a */; };
+ 84361D581CA10F8E00F43825 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 775BEE8C1C1E8ECC008D1629 /* LaunchScreen.storyboard */; };
+ 84361D5B1CA10F8E00F43825 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 775BEE8A1C1E8ECC008D1629 /* Assets.xcassets */; };
+ 84D7CAC71CE3266C00D48D46 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 7475ACA01CD8444A0044E96C /* libsqlite3.0.tbd */; };
+ DC5E503E1D0D97130059F0EB /* weex.png in Resources */ = {isa = PBXBuildFile; fileRef = DC5E503C1D0D97130059F0EB /* weex.png */; };
+ DC5E503F1D0D97130059F0EB /* weex@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DC5E503D1D0D97130059F0EB /* weex@2x.png */; };
+ DC65C4FA1CEB032F00B2F84F /* bundlejs in Resources */ = {isa = PBXBuildFile; fileRef = DC65C4F91CEB032F00B2F84F /* bundlejs */; };
+ DC6DD9D21CFE9BC400549297 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 7475ACA01CD8444A0044E96C /* libsqlite3.0.tbd */; };
+ DCA812F91D0401420029BF62 /* WXSelectComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFFA1D029748001C8592 /* WXSelectComponent.m */; };
+ DCA812FA1D0401500029BF62 /* WXEventModule.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABB0001D02975E001C8592 /* WXEventModule.m */; };
+ DCA812FB1D0401570029BF62 /* WXImgLoaderDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFFD1D029753001C8592 /* WXImgLoaderDefaultImpl.m */; };
+ DCABAFF31D029685001C8592 /* WXATLoggerPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFF01D029685001C8592 /* WXATLoggerPlugin.m */; };
+ DCABAFF41D029685001C8592 /* WXATViewHierarchyPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFF21D029685001C8592 /* WXATViewHierarchyPlugin.m */; };
+ DCABAFFB1D029748001C8592 /* WXSelectComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFFA1D029748001C8592 /* WXSelectComponent.m */; };
+ DCABAFFE1D029753001C8592 /* WXImgLoaderDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABAFFD1D029753001C8592 /* WXImgLoaderDefaultImpl.m */; };
+ DCABB0011D02975E001C8592 /* WXEventModule.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABB0001D02975E001C8592 /* WXEventModule.m */; };
+ DCD286E01CF491AC00C601CA /* weex-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = DCD286DF1CF491AC00C601CA /* weex-icon.png */; };
+ EAEC716BE3E43DBC8494EC51 /* libPods-WeexDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7601607D735D7F8D88971230 /* libPods-WeexDemo.a */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 775BEE951C1E8ECC008D1629 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 775BEE731C1E8ECC008D1629 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 775BEE7A1C1E8ECC008D1629;
+ remoteInfo = WeexDemo;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 22E4D2883CC56188A2CA9C13 /* Pods-WeexDemo.uitest.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexDemo.uitest.xcconfig"; path = "Pods/Target Support Files/Pods-WeexDemo/Pods-WeexDemo.uitest.xcconfig"; sourceTree = "<group>"; };
+ 2AE88A2A1C8544E6003329DE /* WXScannerVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXScannerVC.h; path = Scanner/WXScannerVC.h; sourceTree = "<group>"; };
+ 2AE88A2B1C8544E6003329DE /* WXScannerVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXScannerVC.m; path = Scanner/WXScannerVC.m; sourceTree = "<group>"; };
+ 5AF8846546DAC65CAC038806 /* Pods-WeexDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WeexDemo/Pods-WeexDemo.debug.xcconfig"; sourceTree = "<group>"; };
+ 7453E3641C9FA971001EB427 /* DemoDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoDefine.h; sourceTree = "<group>"; };
+ 7475ACA01CD8444A0044E96C /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
+ 74CC79E91C2B9E4700829368 /* UIViewController+WXDemoNaviBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+WXDemoNaviBar.h"; sourceTree = "<group>"; };
+ 74CC79EA1C2B9E4700829368 /* UIViewController+WXDemoNaviBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+WXDemoNaviBar.m"; sourceTree = "<group>"; };
+ 7601607D735D7F8D88971230 /* libPods-WeexDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WeexDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 775BEE7B1C1E8ECC008D1629 /* WeexDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WeexDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 775BEE7F1C1E8ECC008D1629 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 775BEE811C1E8ECC008D1629 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 775BEE821C1E8ECC008D1629 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 775BEE841C1E8ECC008D1629 /* WXDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WXDemoViewController.h; sourceTree = "<group>"; };
+ 775BEE851C1E8ECC008D1629 /* WXDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WXDemoViewController.m; sourceTree = "<group>"; };
+ 775BEE8A1C1E8ECC008D1629 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+ 775BEE8D1C1E8ECC008D1629 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
+ 775BEE8F1C1E8ECC008D1629 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 775BEE941C1E8ECC008D1629 /* WeexDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WeexDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 775BEE981C1E8ECC008D1629 /* WeexDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WeexDemoTests.m; sourceTree = "<group>"; };
+ 775BEE9A1C1E8ECC008D1629 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 84361D751CA10F8E00F43825 /* WeexUITestDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WeexUITestDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 84361D761CA10F8F00F43825 /* WeexUITestDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "WeexUITestDemo-Info.plist"; path = "/Users/admin/Documents/03_project_git/01_Weex/weex-samples/ios/WeexUITestDemo-Info.plist"; sourceTree = "<absolute>"; };
+ 9420131417A731ED089B0814 /* Pods-WeexDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-WeexDemo/Pods-WeexDemo.release.xcconfig"; sourceTree = "<group>"; };
+ DC5E503C1D0D97130059F0EB /* weex.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = weex.png; sourceTree = "<group>"; };
+ DC5E503D1D0D97130059F0EB /* weex@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "weex@2x.png"; sourceTree = "<group>"; };
+ DC65C4F91CEB032F00B2F84F /* bundlejs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = bundlejs; sourceTree = "<group>"; };
+ DCABAFEF1D029685001C8592 /* WXATLoggerPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXATLoggerPlugin.h; path = debug/WXATLoggerPlugin.h; sourceTree = "<group>"; };
+ DCABAFF01D029685001C8592 /* WXATLoggerPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXATLoggerPlugin.m; path = debug/WXATLoggerPlugin.m; sourceTree = "<group>"; };
+ DCABAFF11D029685001C8592 /* WXATViewHierarchyPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXATViewHierarchyPlugin.h; path = debug/WXATViewHierarchyPlugin.h; sourceTree = "<group>"; };
+ DCABAFF21D029685001C8592 /* WXATViewHierarchyPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXATViewHierarchyPlugin.m; path = debug/WXATViewHierarchyPlugin.m; sourceTree = "<group>"; };
+ DCABAFF91D029748001C8592 /* WXSelectComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXSelectComponent.h; path = extend/component/WXSelectComponent.h; sourceTree = "<group>"; };
+ DCABAFFA1D029748001C8592 /* WXSelectComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXSelectComponent.m; path = extend/component/WXSelectComponent.m; sourceTree = "<group>"; };
+ DCABAFFC1D029753001C8592 /* WXImgLoaderDefaultImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXImgLoaderDefaultImpl.h; path = extend/handler/WXImgLoaderDefaultImpl.h; sourceTree = "<group>"; };
+ DCABAFFD1D029753001C8592 /* WXImgLoaderDefaultImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXImgLoaderDefaultImpl.m; path = extend/handler/WXImgLoaderDefaultImpl.m; sourceTree = "<group>"; };
+ DCABAFFF1D02975E001C8592 /* WXEventModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXEventModule.h; path = extend/module/WXEventModule.h; sourceTree = "<group>"; };
+ DCABB0001D02975E001C8592 /* WXEventModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXEventModule.m; path = extend/module/WXEventModule.m; sourceTree = "<group>"; };
+ DCD286DF1CF491AC00C601CA /* weex-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "weex-icon.png"; path = "WeexDemo/weex-icon.png"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 775BEE781C1E8ECC008D1629 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DC6DD9D21CFE9BC400549297 /* libsqlite3.0.tbd in Frameworks */,
+ EAEC716BE3E43DBC8494EC51 /* libPods-WeexDemo.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 775BEE911C1E8ECC008D1629 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 84361D3C1CA10F8E00F43825 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 84D7CAC71CE3266C00D48D46 /* libsqlite3.0.tbd in Frameworks */,
+ 84361D421CA10F8E00F43825 /* libPods-WeexDemo.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 2AE88A291C8544D7003329DE /* scanner */ = {
+ isa = PBXGroup;
+ children = (
+ 2AE88A2A1C8544E6003329DE /* WXScannerVC.h */,
+ 2AE88A2B1C8544E6003329DE /* WXScannerVC.m */,
+ );
+ name = scanner;
+ sourceTree = "<group>";
+ };
+ 327BB19797F63D5309FB91BF /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 7475ACA01CD8444A0044E96C /* libsqlite3.0.tbd */,
+ 7601607D735D7F8D88971230 /* libPods-WeexDemo.a */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 74CC79EC1C2B9FC600829368 /* Demo */ = {
+ isa = PBXGroup;
+ children = (
+ DCABAFF51D0296DB001C8592 /* extend */,
+ D5ADF0861C77133B00597CA6 /* Source */,
+ );
+ name = Demo;
+ sourceTree = "<group>";
+ };
+ 775BEE721C1E8ECC008D1629 = {
+ isa = PBXGroup;
+ children = (
+ 775BEE7D1C1E8ECC008D1629 /* WeexDemo */,
+ 775BEE971C1E8ECC008D1629 /* WeexDemoTests */,
+ 775BEE7C1C1E8ECC008D1629 /* Products */,
+ A9E45DD060512F73B9F51C03 /* Pods */,
+ 327BB19797F63D5309FB91BF /* Frameworks */,
+ DC65C4421CEB006C00B2F84F /* resource */,
+ 84361D761CA10F8F00F43825 /* WeexUITestDemo-Info.plist */,
+ );
+ sourceTree = "<group>";
+ };
+ 775BEE7C1C1E8ECC008D1629 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 775BEE7B1C1E8ECC008D1629 /* WeexDemo.app */,
+ 775BEE941C1E8ECC008D1629 /* WeexDemoTests.xctest */,
+ 84361D751CA10F8E00F43825 /* WeexUITestDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 775BEE7D1C1E8ECC008D1629 /* WeexDemo */ = {
+ isa = PBXGroup;
+ children = (
+ 74CC79EC1C2B9FC600829368 /* Demo */,
+ 775BEE8A1C1E8ECC008D1629 /* Assets.xcassets */,
+ 775BEE8C1C1E8ECC008D1629 /* LaunchScreen.storyboard */,
+ 775BEE8F1C1E8ECC008D1629 /* Info.plist */,
+ 775BEE7E1C1E8ECC008D1629 /* Supporting Files */,
+ );
+ path = WeexDemo;
+ sourceTree = "<group>";
+ };
+ 775BEE7E1C1E8ECC008D1629 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 775BEE7F1C1E8ECC008D1629 /* main.m */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 775BEE971C1E8ECC008D1629 /* WeexDemoTests */ = {
+ isa = PBXGroup;
+ children = (
+ 775BEE981C1E8ECC008D1629 /* WeexDemoTests.m */,
+ 775BEE9A1C1E8ECC008D1629 /* Info.plist */,
+ );
+ path = WeexDemoTests;
+ sourceTree = "<group>";
+ };
+ A9E45DD060512F73B9F51C03 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 5AF8846546DAC65CAC038806 /* Pods-WeexDemo.debug.xcconfig */,
+ 9420131417A731ED089B0814 /* Pods-WeexDemo.release.xcconfig */,
+ 22E4D2883CC56188A2CA9C13 /* Pods-WeexDemo.uitest.xcconfig */,
+ );
+ name = Pods;
+ sourceTree = "<group>";
+ };
+ D5ADF0861C77133B00597CA6 /* Source */ = {
+ isa = PBXGroup;
+ children = (
+ 2AE88A291C8544D7003329DE /* scanner */,
+ DCABAFED1D029642001C8592 /* debug */,
+ 74CC79E91C2B9E4700829368 /* UIViewController+WXDemoNaviBar.h */,
+ 74CC79EA1C2B9E4700829368 /* UIViewController+WXDemoNaviBar.m */,
+ 775BEE811C1E8ECC008D1629 /* AppDelegate.h */,
+ 775BEE821C1E8ECC008D1629 /* AppDelegate.m */,
+ 775BEE841C1E8ECC008D1629 /* WXDemoViewController.h */,
+ 775BEE851C1E8ECC008D1629 /* WXDemoViewController.m */,
+ 7453E3641C9FA971001EB427 /* DemoDefine.h */,
+ );
+ name = Source;
+ sourceTree = "<group>";
+ };
+ DC65C4421CEB006C00B2F84F /* resource */ = {
+ isa = PBXGroup;
+ children = (
+ DCD286DF1CF491AC00C601CA /* weex-icon.png */,
+ DC5E503C1D0D97130059F0EB /* weex.png */,
+ DC5E503D1D0D97130059F0EB /* weex@2x.png */,
+ DC65C4F91CEB032F00B2F84F /* bundlejs */,
+ );
+ name = resource;
+ sourceTree = "<group>";
+ };
+ DCABAFED1D029642001C8592 /* debug */ = {
+ isa = PBXGroup;
+ children = (
+ DCABAFEF1D029685001C8592 /* WXATLoggerPlugin.h */,
+ DCABAFF01D029685001C8592 /* WXATLoggerPlugin.m */,
+ DCABAFF11D029685001C8592 /* WXATViewHierarchyPlugin.h */,
+ DCABAFF21D029685001C8592 /* WXATViewHierarchyPlugin.m */,
+ );
+ name = debug;
+ sourceTree = "<group>";
+ };
+ DCABAFF51D0296DB001C8592 /* extend */ = {
+ isa = PBXGroup;
+ children = (
+ DCABAFF81D029716001C8592 /* component */,
+ DCABAFF71D0296E8001C8592 /* handler */,
+ DCABAFF61D0296E2001C8592 /* module */,
+ );
+ name = extend;
+ sourceTree = "<group>";
+ };
+ DCABAFF61D0296E2001C8592 /* module */ = {
+ isa = PBXGroup;
+ children = (
+ DCABAFFF1D02975E001C8592 /* WXEventModule.h */,
+ DCABB0001D02975E001C8592 /* WXEventModule.m */,
+ );
+ name = module;
+ sourceTree = "<group>";
+ };
+ DCABAFF71D0296E8001C8592 /* handler */ = {
+ isa = PBXGroup;
+ children = (
+ DCABAFFC1D029753001C8592 /* WXImgLoaderDefaultImpl.h */,
+ DCABAFFD1D029753001C8592 /* WXImgLoaderDefaultImpl.m */,
+ );
+ name = handler;
+ sourceTree = "<group>";
+ };
+ DCABAFF81D029716001C8592 /* component */ = {
+ isa = PBXGroup;
+ children = (
+ DCABAFF91D029748001C8592 /* WXSelectComponent.h */,
+ DCABAFFA1D029748001C8592 /* WXSelectComponent.m */,
+ );
+ name = component;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 775BEE7A1C1E8ECC008D1629 /* WeexDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 775BEEA81C1E8ECC008D1629 /* Build configuration list for PBXNativeTarget "WeexDemo" */;
+ buildPhases = (
+ 359BEE13DD78032A2CB791E8 /* Check Pods Manifest.lock */,
+ 74CC7A221C2C13BF00829368 /* Start Samples */,
+ 775BEE771C1E8ECC008D1629 /* Sources */,
+ 775BEE781C1E8ECC008D1629 /* Frameworks */,
+ 775BEE791C1E8ECC008D1629 /* Resources */,
+ 0B3B6C05EE2F8A3B30DE551F /* Copy Pods Resources */,
+ 5ED24D6A09B32268BB031206 /* Embed Pods Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = WeexDemo;
+ productName = WeexDemo;
+ productReference = 775BEE7B1C1E8ECC008D1629 /* WeexDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 775BEE931C1E8ECC008D1629 /* WeexDemoTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 775BEEAB1C1E8ECC008D1629 /* Build configuration list for PBXNativeTarget "WeexDemoTests" */;
+ buildPhases = (
+ 775BEE901C1E8ECC008D1629 /* Sources */,
+ 775BEE911C1E8ECC008D1629 /* Frameworks */,
+ 775BEE921C1E8ECC008D1629 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 775BEE961C1E8ECC008D1629 /* PBXTargetDependency */,
+ );
+ name = WeexDemoTests;
+ productName = WeexDemoTests;
+ productReference = 775BEE941C1E8ECC008D1629 /* WeexDemoTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 84361D261CA10F8E00F43825 /* WeexUITestDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 84361D711CA10F8E00F43825 /* Build configuration list for PBXNativeTarget "WeexUITestDemo" */;
+ buildPhases = (
+ 84361D271CA10F8E00F43825 /* Check Pods Manifest.lock */,
+ 84361D291CA10F8E00F43825 /* Sources */,
+ 84361D3C1CA10F8E00F43825 /* Frameworks */,
+ 84361D431CA10F8E00F43825 /* Resources */,
+ 84361D6F1CA10F8E00F43825 /* Copy Pods Resources */,
+ 84361D701CA10F8E00F43825 /* Embed Pods Frameworks */,
+ 567369891CE436EB000A646C /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = WeexUITestDemo;
+ productName = WeexDemo;
+ productReference = 84361D751CA10F8E00F43825 /* WeexUITestDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 775BEE731C1E8ECC008D1629 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0710;
+ ORGANIZATIONNAME = taobao;
+ TargetAttributes = {
+ 775BEE7A1C1E8ECC008D1629 = {
+ CreatedOnToolsVersion = 7.1.1;
+ DevelopmentTeam = E9NTP5L2G2;
+ };
+ 775BEE931C1E8ECC008D1629 = {
+ CreatedOnToolsVersion = 7.1.1;
+ DevelopmentTeam = 445VCMGQD2;
+ TestTargetID = 775BEE7A1C1E8ECC008D1629;
+ };
+ };
+ };
+ buildConfigurationList = 775BEE761C1E8ECC008D1629 /* Build configuration list for PBXProject "WeexDemo" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 775BEE721C1E8ECC008D1629;
+ productRefGroup = 775BEE7C1C1E8ECC008D1629 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 775BEE7A1C1E8ECC008D1629 /* WeexDemo */,
+ 775BEE931C1E8ECC008D1629 /* WeexDemoTests */,
+ 84361D261CA10F8E00F43825 /* WeexUITestDemo */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 775BEE791C1E8ECC008D1629 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DC5E503E1D0D97130059F0EB /* weex.png in Resources */,
+ DC5E503F1D0D97130059F0EB /* weex@2x.png in Resources */,
+ DCD286E01CF491AC00C601CA /* weex-icon.png in Resources */,
+ DC65C4FA1CEB032F00B2F84F /* bundlejs in Resources */,
+ 775BEE8E1C1E8ECC008D1629 /* LaunchScreen.storyboard in Resources */,
+ 775BEE8B1C1E8ECC008D1629 /* Assets.xcassets in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 775BEE921C1E8ECC008D1629 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 84361D431CA10F8E00F43825 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 84361D581CA10F8E00F43825 /* LaunchScreen.storyboard in Resources */,
+ 84361D5B1CA10F8E00F43825 /* Assets.xcassets in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 0B3B6C05EE2F8A3B30DE551F /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WeexDemo/Pods-WeexDemo-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 359BEE13DD78032A2CB791E8 /* Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Check Pods Manifest.lock";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ 567369891CE436EB000A646C /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "myFile=\"XcodeCoverage/exportenv.sh\"\n\nif [ -f \"$myFile\" ]; then\nXcodeCoverage/exportenv.sh\nfi";
+ };
+ 5ED24D6A09B32268BB031206 /* Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Embed Pods Frameworks";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "
+";
+ showEnvVarsInLog = 0;
+ };
+ 74CC7A221C2C13BF00829368 /* Start Samples */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Start Samples";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "set -x\n\nif nc -w 5 -z localhost 12580 ; then\n echo \"Port 12580 already in use, server is running\"\nelse\n open \"$SRCROOT/../../start\"\nfi\n\n";
+ };
+ 84361D271CA10F8E00F43825 /* Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Check Pods Manifest.lock";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ 84361D6F1CA10F8E00F43825 /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WeexDemo/Pods-WeexDemo-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 84361D701CA10F8E00F43825 /* Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Embed Pods Frameworks";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "
+";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 775BEE771C1E8ECC008D1629 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DCABAFFB1D029748001C8592 /* WXSelectComponent.m in Sources */,
+ DCABAFF31D029685001C8592 /* WXATLoggerPlugin.m in Sources */,
+ 2AE88A2C1C8544E6003329DE /* WXScannerVC.m in Sources */,
+ 775BEE861C1E8ECC008D1629 /* WXDemoViewController.m in Sources */,
+ 74CC79EB1C2B9E4700829368 /* UIViewController+WXDemoNaviBar.m in Sources */,
+ DCABB0011D02975E001C8592 /* WXEventModule.m in Sources */,
+ 775BEE831C1E8ECC008D1629 /* AppDelegate.m in Sources */,
+ DCABAFF41D029685001C8592 /* WXATViewHierarchyPlugin.m in Sources */,
+ 775BEE801C1E8ECC008D1629 /* main.m in Sources */,
+ DCABAFFE1D029753001C8592 /* WXImgLoaderDefaultImpl.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 775BEE901C1E8ECC008D1629 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 775BEE991C1E8ECC008D1629 /* WeexDemoTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 84361D291CA10F8E00F43825 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DCA812FB1D0401570029BF62 /* WXImgLoaderDefaultImpl.m in Sources */,
+ DCA812FA1D0401500029BF62 /* WXEventModule.m in Sources */,
+ DCA812F91D0401420029BF62 /* WXSelectComponent.m in Sources */,
+ 84361D2F1CA10F8E00F43825 /* WXScannerVC.m in Sources */,
+ 84361D331CA10F8E00F43825 /* WXDemoViewController.m in Sources */,
+ 84361D371CA10F8E00F43825 /* UIViewController+WXDemoNaviBar.m in Sources */,
+ 84361D381CA10F8E00F43825 /* AppDelegate.m in Sources */,
+ 84361D3B1CA10F8E00F43825 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 775BEE961C1E8ECC008D1629 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 775BEE7A1C1E8ECC008D1629 /* WeexDemo */;
+ targetProxy = 775BEE951C1E8ECC008D1629 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 775BEE8C1C1E8ECC008D1629 /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 775BEE8D1C1E8ECC008D1629 /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 775BEEA61C1E8ECC008D1629 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.1;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 775BEEA71C1E8ECC008D1629 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.1;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 775BEEA91C1E8ECC008D1629 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 5AF8846546DAC65CAC038806 /* Pods-WeexDemo.debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/WeexDemo",
+ "$(PROJECT_DIR)",
+ );
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ INFOPLIST_FILE = WeexDemo/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-licucore",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemo;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 775BEEAA1C1E8ECC008D1629 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9420131417A731ED089B0814 /* Pods-WeexDemo.release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/WeexDemo",
+ "$(PROJECT_DIR)",
+ );
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ INFOPLIST_FILE = WeexDemo/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-licucore",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemo;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
+ 775BEEAC1C1E8ECC008D1629 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ INFOPLIST_FILE = WeexDemoTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemoTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WeexDemo.app/WeexDemo";
+ };
+ name = Debug;
+ };
+ 775BEEAD1C1E8ECC008D1629 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ INFOPLIST_FILE = WeexDemoTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemoTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WeexDemo.app/WeexDemo";
+ };
+ name = Release;
+ };
+ 84361D721CA10F8E00F43825 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 5AF8846546DAC65CAC038806 /* Pods-WeexDemo.debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/WeexDemo",
+ "$(PROJECT_DIR)",
+ );
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ "COCOAPODS=1",
+ "UITEST=1",
+ );
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ INFOPLIST_FILE = "WeexUITestDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MODULE_NAME = NO;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-licucore",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemo;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ };
+ name = Debug;
+ };
+ 84361D741CA10F8E00F43825 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9420131417A731ED089B0814 /* Pods-WeexDemo.release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/WeexDemo",
+ "$(PROJECT_DIR)",
+ );
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ INFOPLIST_FILE = "WeexUITestDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MODULE_NAME = NO;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-licucore",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemo;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 775BEE761C1E8ECC008D1629 /* Build configuration list for PBXProject "WeexDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 775BEEA61C1E8ECC008D1629 /* Debug */,
+ 775BEEA71C1E8ECC008D1629 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 775BEEA81C1E8ECC008D1629 /* Build configuration list for PBXNativeTarget "WeexDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 775BEEA91C1E8ECC008D1629 /* Debug */,
+ 775BEEAA1C1E8ECC008D1629 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 775BEEAB1C1E8ECC008D1629 /* Build configuration list for PBXNativeTarget "WeexDemoTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 775BEEAC1C1E8ECC008D1629 /* Debug */,
+ 775BEEAD1C1E8ECC008D1629 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 84361D711CA10F8E00F43825 /* Build configuration list for PBXNativeTarget "WeexUITestDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 84361D721CA10F8E00F43825 /* Debug */,
+ 84361D741CA10F8E00F43825 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 775BEE731C1E8ECC008D1629 /* Project object */;
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexDemo.xcscheme
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexDemo.xcscheme b/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexDemo.xcscheme
new file mode 100644
index 0000000..ba80275
--- /dev/null
+++ b/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexDemo.xcscheme
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0710"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "775BEE7A1C1E8ECC008D1629"
+ BuildableName = "WeexDemo.app"
+ BlueprintName = "WeexDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "775BEE931C1E8ECC008D1629"
+ BuildableName = "WeexDemoTests.xctest"
+ BlueprintName = "WeexDemoTests"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "775BEE9E1C1E8ECC008D1629"
+ BuildableName = "WeexDemoUITests.xctest"
+ BlueprintName = "WeexDemoUITests"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "775BEE7A1C1E8ECC008D1629"
+ BuildableName = "WeexDemo.app"
+ BlueprintName = "WeexDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "775BEE7A1C1E8ECC008D1629"
+ BuildableName = "WeexDemo.app"
+ BlueprintName = "WeexDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "775BEE7A1C1E8ECC008D1629"
+ BuildableName = "WeexDemo.app"
+ BlueprintName = "WeexDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexUITestDemo.xcscheme
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexUITestDemo.xcscheme b/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexUITestDemo.xcscheme
new file mode 100644
index 0000000..6a68091
--- /dev/null
+++ b/ios/playground/WeexDemo.xcodeproj/xcshareddata/xcschemes/WeexUITestDemo.xcscheme
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0720"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "84361D261CA10F8E00F43825"
+ BuildableName = "WeexUITestDemo.app"
+ BlueprintName = "WeexUITestDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "84361D261CA10F8E00F43825"
+ BuildableName = "WeexUITestDemo.app"
+ BlueprintName = "WeexUITestDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "84361D261CA10F8E00F43825"
+ BuildableName = "WeexUITestDemo.app"
+ BlueprintName = "WeexUITestDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "84361D261CA10F8E00F43825"
+ BuildableName = "WeexUITestDemo.app"
+ BlueprintName = "WeexUITestDemo"
+ ReferencedContainer = "container:WeexDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/AppDelegate.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/AppDelegate.h b/ios/playground/WeexDemo/AppDelegate.h
new file mode 100644
index 0000000..210c5ac
--- /dev/null
+++ b/ios/playground/WeexDemo/AppDelegate.h
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/AppDelegate.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/AppDelegate.m b/ios/playground/WeexDemo/AppDelegate.m
new file mode 100644
index 0000000..5295055
--- /dev/null
+++ b/ios/playground/WeexDemo/AppDelegate.m
@@ -0,0 +1,192 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "AppDelegate.h"
+#import "WXDemoViewController.h"
+#import "UIViewController+WXDemoNaviBar.h"
+#import "WXStreamModule.h"
+#import "WXSelectComponent.h"
+#import "WXEventModule.h"
+#import "WXNavigationDefaultImpl.h"
+#import "WXImgLoaderDefaultImpl.h"
+#import "DemoDefine.h"
+#import "WXScannerVC.h"
+#import <WeexSDK/WXSDKEngine.h>
+#import <WeexSDK/WXLog.h>
+#import <WeexSDK/WXDebugTool.h>
+#import <WeexSDK/WXAppConfiguration.h>
+#import <AVFoundation/AVFoundation.h>
+#import <ATSDK/ATManager.h>
+
+@interface AppDelegate ()
+@end
+
+@implementation AppDelegate
+
+#pragma mark
+#pragma mark application
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
+ self.window.backgroundColor = [UIColor whiteColor];
+
+ [self initWeexSDK];
+
+ self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[self demoController]];
+ [self.window makeKeyAndVisible];
+
+ // Override point for customization after application launch.
+ [self startSplashScreen];
+
+ return YES;
+}
+
+-(void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
+{
+ if ([shortcutItem.type isEqualToString:QRSCAN]) {
+ WXScannerVC * scanViewController = [[WXScannerVC alloc] init];
+ [(UINavigationController*)self.window.rootViewController pushViewController:scanViewController animated:YES];
+ }
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+
+#ifdef UITEST
+#if !TARGET_IPHONE_SIMULATOR
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+ setenv("GCOV_PREFIX", [documentsDirectory cStringUsingEncoding:NSUTF8StringEncoding], 1);
+ setenv("GCOV_PREFIX_STRIP", "6", 1);
+#endif
+ extern void __gcov_flush(void);
+ __gcov_flush();
+#endif
+}
+
+#pragma mark weex
+- (void)initWeexSDK
+{
+ [WXAppConfiguration setAppGroup:@"AliApp"];
+ [WXAppConfiguration setAppName:@"WeexDemo"];
+ [WXAppConfiguration setAppVersion:@"1.8.3"];
+ [WXAppConfiguration setExternalUserAgent:@"ExternalUA"];
+
+ [WXSDKEngine initSDKEnviroment];
+
+ [WXSDKEngine registerHandler:[WXImgLoaderDefaultImpl new] withProtocol:@protocol(WXImgLoaderProtocol)];
+ [WXSDKEngine registerHandler:[WXEventModule new] withProtocol:@protocol(WXEventModuleProtocol)];
+
+ [WXSDKEngine registerComponent:@"select" withClass:[WXSelectComponent class]];
+ [WXSDKEngine registerModule:@"event" withClass:[WXEventModule class]];
+ [self atAddPlugin];
+
+#ifdef DEBUG
+ [WXDebugTool setDebug:YES];
+ [WXLog setLogLevel:WXLogLevelVerbose];
+#else
+ [WXDebugTool setDebug:NO];
+#endif
+
+#ifndef UITEST
+ [[ATManager shareInstance] show];
+#else
+ [WXDebugTool setDebug:NO];
+ [WXLog setLogLevel:WXLogLevelError];
+#endif
+
+}
+
+-(UIViewController *)demoController
+{
+
+ UIViewController *demo = [[WXDemoViewController alloc] init];
+
+#if DEBUG
+ //If you are debugging in device , please change the host to current IP of your computer.
+ ((WXDemoViewController *)demo).url = [NSURL URLWithString:HOME_URL];
+#else
+ ((WXDemoViewController *)demo).url = [NSURL URLWithString:BUNDLE_URL];
+#endif
+
+#ifdef UITEST
+ ((WXDemoViewController *)demo).url = [NSURL URLWithString:UITEST_HOME_URL];
+#endif
+
+ return demo;
+}
+
+#pragma mark
+#pragma mark animation when startup
+
+- (void)startSplashScreen
+{
+ UIView* splashView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ splashView.backgroundColor = WEEX_COLOR;
+
+ UIImageView *iconImageView = [UIImageView new];
+ UIImage *icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"weex-icon" ofType:@"png"]];
+ if ([icon respondsToSelector:@selector(imageWithRenderingMode:)]) {
+ iconImageView.image = [icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
+ iconImageView.tintColor = [UIColor whiteColor];
+ } else {
+ iconImageView.image = icon;
+ }
+ iconImageView.frame = CGRectMake(0, 0, 320, 320);
+ iconImageView.contentMode = UIViewContentModeScaleAspectFit;
+ iconImageView.center = splashView.center;
+ [splashView addSubview:iconImageView];
+
+ [self.window addSubview:splashView];
+
+ float animationDuration = 1.4;
+ CGFloat shrinkDuration = animationDuration * 0.3;
+ CGFloat growDuration = animationDuration * 0.7;
+
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
+ [UIView animateWithDuration:shrinkDuration delay:1.0 usingSpringWithDamping:0.7f initialSpringVelocity:10 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ CGAffineTransform scaleTransform = CGAffineTransformMakeScale(0.75, 0.75);
+ iconImageView.transform = scaleTransform;
+ } completion:^(BOOL finished) {
+ [UIView animateWithDuration:growDuration animations:^{
+ CGAffineTransform scaleTransform = CGAffineTransformMakeScale(20, 20);
+ iconImageView.transform = scaleTransform;
+ splashView.alpha = 0;
+ } completion:^(BOOL finished) {
+ [splashView removeFromSuperview];
+ }];
+ }];
+ } else {
+ [UIView animateWithDuration:shrinkDuration delay:1.0 options:0 animations:^{
+ CGAffineTransform scaleTransform = CGAffineTransformMakeScale(0.75, 0.75);
+ iconImageView.transform = scaleTransform;
+ } completion:^(BOOL finished) {
+ [UIView animateWithDuration:growDuration animations:^{
+ CGAffineTransform scaleTransform = CGAffineTransformMakeScale(20, 20);
+ iconImageView.transform = scaleTransform;
+ splashView.alpha = 0;
+ } completion:^(BOOL finished) {
+ [splashView removeFromSuperview];
+ }];
+ }];
+ }
+}
+
+#pragma mark
+
+- (void)atAddPlugin {
+
+ [[ATManager shareInstance] addPluginWithId:@"weex" andName:@"weex" andIconName:@"weex" andEntry:@"" andArgs:@[@""]];
+ [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"logger" andName:@"logger" andIconName:@"log" andEntry:@"WXATLoggerPlugin" andArgs:@[@""]];
+// [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"viewHierarchy" andName:@"hierarchy" andIconName:@"log" andEntry:@"WXATViewHierarchyPlugin" andArgs:@[@""]];
+ [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"test2" andName:@"test" andIconName:@"at_arr_refresh" andEntry:@"" andArgs:@[]];
+ [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"test3" andName:@"test" andIconName:@"at_arr_refresh" andEntry:@"" andArgs:@[]];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..c64ff0d
--- /dev/null
+++ b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,86 @@
+{
+ "images" : [
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-Small@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-Small@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-40@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-60@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-60@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-Small.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-Small@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-40.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-76.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-76@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "Icon-83.5@2x.png",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png
new file mode 100755
index 0000000..82122bb
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png
new file mode 100755
index 0000000..6948740
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png
new file mode 100755
index 0000000..7fcd869
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png
new file mode 100755
index 0000000..7fcd869
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png
new file mode 100755
index 0000000..a990667
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png
new file mode 100755
index 0000000..acf7b94
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png
new file mode 100755
index 0000000..57b1a83
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png
new file mode 100755
index 0000000..efd2a4c
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small.png
new file mode 100755
index 0000000..5d402b3
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
new file mode 100644
index 0000000..8d8860b
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png
new file mode 100755
index 0000000..4efd255
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/Brand Assets.launchimage/Contents.json
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/Brand Assets.launchimage/Contents.json b/ios/playground/WeexDemo/Assets.xcassets/Brand Assets.launchimage/Contents.json
new file mode 100644
index 0000000..a0ad363
--- /dev/null
+++ b/ios/playground/WeexDemo/Assets.xcassets/Brand Assets.launchimage/Contents.json
@@ -0,0 +1,36 @@
+{
+ "images" : [
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/Contents.json
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/Contents.json b/ios/playground/WeexDemo/Assets.xcassets/Contents.json
new file mode 100644
index 0000000..da4a164
--- /dev/null
+++ b/ios/playground/WeexDemo/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/back.imageset/Contents.json
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/back.imageset/Contents.json b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/Contents.json
new file mode 100644
index 0000000..3bad3d0
--- /dev/null
+++ b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "back.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "back@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "back@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back.png b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back.png
new file mode 100644
index 0000000..1f3e073
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@2x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@2x.png b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@2x.png
new file mode 100644
index 0000000..76d0bf8
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@3x.png
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@3x.png b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@3x.png
new file mode 100644
index 0000000..8180558
Binary files /dev/null and b/ios/playground/WeexDemo/Assets.xcassets/back.imageset/back@3x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/Contents.json
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/Contents.json b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/Contents.json
new file mode 100644
index 0000000..e2cd5af
--- /dev/null
+++ b/ios/playground/WeexDemo/Assets.xcassets/reload.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "reload.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "reload@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "reload@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
[47/50] [abbrv] incubator-weex git commit: * [ios] remove ZXing
Posted by ji...@apache.org.
* [ios] remove ZXing
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/82a79d1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/82a79d1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/82a79d1a
Branch: refs/heads/master
Commit: 82a79d1ab6d0ec5ed330aa55eaac6c1011149fed
Parents: 6bd1255
Author: acton393 <zh...@gmail.com>
Authored: Mon Jun 13 13:53:31 2016 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jun 13 13:53:31 2016 +0800
----------------------------------------------------------------------
ios/playground/Podfile | 3 +-
ios/playground/WeexDemo/Scanner/WXScannerVC.h | 4 +-
ios/playground/WeexDemo/Scanner/WXScannerVC.m | 67 ++++++++++------------
3 files changed, 33 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/82a79d1a/ios/playground/Podfile
----------------------------------------------------------------------
diff --git a/ios/playground/Podfile b/ios/playground/Podfile
index ed6e27f..f46aeeb 100644
--- a/ios/playground/Podfile
+++ b/ios/playground/Podfile
@@ -1,4 +1,4 @@
-source 'git@github.com:CocoaPods/Specs.git'
+source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
#inhibit_all_warnings!
@@ -6,7 +6,6 @@ target 'WeexDemo' do
pod 'WeexSDK', :path=>'../sdk/'
pod 'SDWebImage', '3.7.5'
pod 'SocketRocket', '0.4.2'
- pod 'ZXingObjC', '~> 3.0'
pod 'ATSDK-Weex', '0.0.1'
end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/82a79d1a/ios/playground/WeexDemo/Scanner/WXScannerVC.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Scanner/WXScannerVC.h b/ios/playground/WeexDemo/Scanner/WXScannerVC.h
index fa0f56a..3618d35 100644
--- a/ios/playground/WeexDemo/Scanner/WXScannerVC.h
+++ b/ios/playground/WeexDemo/Scanner/WXScannerVC.h
@@ -7,8 +7,8 @@
*/
#import <UIKit/UIKit.h>
-#import <ZXingObjC/ZXingObjC.h>
+#import <AVFoundation/AVFoundation.h>
-@interface WXScannerVC : UIViewController <ZXCaptureDelegate>
+@interface WXScannerVC : UIViewController <AVCaptureMetadataOutputObjectsDelegate>
@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/82a79d1a/ios/playground/WeexDemo/Scanner/WXScannerVC.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Scanner/WXScannerVC.m b/ios/playground/WeexDemo/Scanner/WXScannerVC.m
index 24e6291..fcf5e60 100644
--- a/ios/playground/WeexDemo/Scanner/WXScannerVC.m
+++ b/ios/playground/WeexDemo/Scanner/WXScannerVC.m
@@ -16,7 +16,9 @@
@interface WXScannerVC ()
-@property (nonatomic, strong) ZXCapture *capture;
+@property (nonatomic, strong) AVCaptureSession * session;
+@property (nonatomic, strong) AVCaptureVideoPreviewLayer *captureLayer;
+@property (nonatomic, strong) UIView *sanFrameView;
@property (nonatomic) BOOL opened;
@@ -27,69 +29,60 @@
#pragma mark - lifeCircle
- (void)dealloc {
- [self.capture.layer removeFromSuperlayer];
+ [_captureLayer removeFromSuperlayer];
}
- (void)viewDidLoad {
[super viewDidLoad];
-
self.edgesForExtendedLayout = UIRectEdgeNone;
-
[self setupNaviBar];
- self.capture = [[ZXCapture alloc] init];
- self.capture.camera = self.capture.back;
- self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
- self.capture.rotation = 90.0f;
+ self.session = [[AVCaptureSession alloc]init];
+ [_session setSessionPreset:AVCaptureSessionPresetHigh];
+ AVCaptureDevice * device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
+ AVCaptureDeviceInput * input = [AVCaptureDeviceInput deviceInputWithDevice:device error:nil];
+ AVCaptureMetadataOutput * output = [[AVCaptureMetadataOutput alloc]init];
+ [output setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
+ [_session addInput:input];
+ [_session addOutput:output];
- self.capture.layer.frame = self.view.bounds;
- [self.view.layer addSublayer:self.capture.layer];
-
+ output.metadataObjectTypes=@[AVMetadataObjectTypeQRCode,AVMetadataObjectTypeEAN13Code, AVMetadataObjectTypeEAN8Code, AVMetadataObjectTypeCode128Code];
+
+ _captureLayer = [AVCaptureVideoPreviewLayer layerWithSession:_session];
+ _captureLayer.videoGravity=AVLayerVideoGravityResizeAspectFill;
+ _captureLayer.frame=self.view.layer.bounds;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
- [self.view.layer addSublayer:self.capture.layer];
- [self.capture start];
-
- self.capture.delegate = self;
- self.capture.layer.frame = self.view.bounds;
-
- CGAffineTransform captureSizeTransform = CGAffineTransformMakeScale(320 / self.view.frame.size.width, 480 / self.view.frame.size.height);
- self.capture.scanRect = CGRectApplyAffineTransform(self.view.frame, captureSizeTransform);
+ [self.view.layer addSublayer:_captureLayer];
+ [_session startRunning];
}
- (void) viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
- [self.capture.layer removeFromSuperlayer];
- [self.capture stop];
+ [_captureLayer removeFromSuperlayer];
+ [_session stopRunning];
}
-#pragma mark - ZXCaptureDelegate
-
-- (void)captureResult:(ZXCapture *)capture result:(ZXResult *)result {
- if (!result) return;
-
- [self.capture.layer removeFromSuperlayer];
- [self.capture stop];
-
+- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection
+{
+ [_captureLayer removeFromSuperlayer];
+ [_session stopRunning];
if (!_opened) {
- //Vibrate
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
_opened = YES;
- __weak __typeof__(self) weakSelf = self;
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- weakSelf.opened = NO;
- });
-
- [self openURL:result.text];
+ if (metadataObjects.count > 0) {
+ AVMetadataMachineReadableCodeObject * metadataObject = [metadataObjects objectAtIndex : 0 ];
+ [self openURL:metadataObject.stringValue];
+ }
}
}
-- (void) openURL:(NSString*)URL
+- (void)openURL:(NSString*)URL
{
NSURL *url = [NSURL URLWithString:URL];
[self remoteDebug:url];
[27/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/template.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/template.js b/ios/playground/bundlejs/template.js
new file mode 100644
index 0000000..36754cc
--- /dev/null
+++ b/ios/playground/bundlejs/template.js
@@ -0,0 +1,1292 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/34cb65d2cb8795f5c54511b4cc1a203b", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ img: '//gw.alicdn.com/tps/i2/TB1DpsmMpXXXXabaXXX20ySQVXX-512-512.png_400x400.jpg'
+ }},
+ methods: {
+ toast: function() {
+ this.$call('modal', 'toast', {'message': 'a toast', 'duration': 2});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Dialog",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-tip",
+ "attr": {
+ "type": "success",
+ "value": "It's a weex example template."
+ },
+ "style": {
+ "marginBottom": 20
+ }
+ },
+ {
+ "type": "wxc-hn",
+ "attr": {
+ "level": "1",
+ "value": "H1"
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "primary",
+ "value": "Toast"
+ },
+ "events": {
+ "click": "toast"
+ }
+ },
+ {
+ "type": "wxc-hn",
+ "attr": {
+ "level": "2",
+ "value": "H3"
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "warning",
+ "value": "Toast"
+ },
+ "events": {
+ "click": "toast"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Image",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-tip",
+ "attr": {
+ "type": "warning",
+ "value": "Weex screen width is 750"
+ },
+ "style": {
+ "marginBottom": 20
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "img"
+ ],
+ "style": {
+ "width": 400,
+ "height": 400
+ },
+ "attr": {
+ "src": function () {return this.img}
+ }
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Image",
+ "type": "default"
+ },
+ "children": [
+ {
+ "type": "text",
+ "attr": {
+ "value": "sub info"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={}
+ })
+ ;__weex_bootstrap__("@weex-component/34cb65d2cb8795f5c54511b4cc1a203b", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[03/50] [abbrv] incubator-weex git commit: [example] :bug fix (issue#329) (#332)
Posted by ji...@apache.org.
[example] \uff1abug fix (issue#329) (#332)
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9de56956
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9de56956
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9de56956
Branch: refs/heads/master
Commit: 9de5695620e39fa55a5748dd91364fb18e90f610
Parents: ef88ed2
Author: boboning <ni...@163.com>
Authored: Mon May 23 19:37:07 2016 +0800
Committer: luics <lu...@gmail.com>
Committed: Mon May 23 19:37:07 2016 +0800
----------------------------------------------------------------------
src/components/src/wxc-navbar.we | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9de56956/src/components/src/wxc-navbar.we
----------------------------------------------------------------------
diff --git a/src/components/src/wxc-navbar.we b/src/components/src/wxc-navbar.we
index c820b80..d903385 100644
--- a/src/components/src/wxc-navbar.we
+++ b/src/components/src/wxc-navbar.we
@@ -1,7 +1,7 @@
<template>
<div class="container" style="height:{{height}}; background-color:{{backgroundColor}};" data-role={{dataRole}}>
<text class="right-text" style="color:{{rightItemColor}};" navi-item-position="right" if={{!rightItemSrc}} onclick = "onclickrigthitem">{{rightItemTitle}}</text>
- <image class="left-image" navi-item-position="right" src={{rightItemSrc}} if={{rightItemSrc}} onclick="onclickrightitem"></image>
+ <image class="right-image" navi-item-position="right" src={{rightItemSrc}} if={{rightItemSrc}} onclick="onclickrightitem"></image>
<text class="left-text" style="color:{{leftItemColor}};" navi-item-position="left" if={{!leftItemSrc}} onclick= "onclickleftitem">{{leftItemTitle}}</text>
<image class="left-image" navi-item-position="left" src={{leftItemSrc}} if={{leftItemSrc}} onclick="onclickleftitem"></image>
<text class="center-text" style="color:{{titleColor}};" navi-item-position="center">{{title}}</text>
@@ -45,14 +45,14 @@
.left-image {
position: absolute;
bottom: 20;
- right: 28;
+ left: 28;
width: 50;
height: 50;
}
.right-image {
position: absolute;
bottom: 20;
- left: 28;
+ right: 28;
width: 50;
height: 50;
}
[17/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m
new file mode 100644
index 0000000..030b5d5
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m
@@ -0,0 +1,143 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXRefreshComponent.h"
+#import "WXScrollerComponent.h"
+#import "WXLoadingIndicator.h"
+#import "WXComponent_internal.h"
+#import "WXLog.h"
+
+@interface WXRefreshComponent()
+
+@property (nonatomic) BOOL displayState;
+@property (nonatomic) BOOL initFinished;
+@property (nonatomic) BOOL refreshEvent;
+
+@property (nonatomic, weak) WXLoadingIndicator *indicator;
+
+@end
+
+@implementation WXRefreshComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ if (attributes[@"display"]) {
+ if ([attributes[@"display"] isEqualToString:@"show"]) {
+ _displayState = YES;
+ } else if ([attributes[@"display"] isEqualToString:@"hide"]){
+ _displayState = NO;
+ } else {
+ WXLogError(@"");
+ }
+ }
+
+ self.cssNode->style.position_type = CSS_POSITION_ABSOLUTE;
+ }
+ return self;
+}
+
+- (void)layoutDidFinish
+{
+ if ([self isViewLoaded]) {
+
+ [self.view setFrame: (CGRect){
+ .size = self.calculatedFrame.size,
+ .origin.x = self.calculatedFrame.origin.x,
+ .origin.y = self.view.frame.origin.y - CGRectGetHeight(self.calculatedFrame)
+ }];
+ }
+}
+
+- (void)viewDidLoad
+{
+ _initFinished = YES;
+ [self.view setFrame: (CGRect){
+ .size = self.calculatedFrame.size,
+ .origin.x = self.calculatedFrame.origin.x,
+ .origin.y = self.view.frame.origin.y - CGRectGetHeight(self.calculatedFrame)
+ }];
+}
+
+- (void)viewWillUnload
+{
+ _displayState = NO;
+ _refreshEvent = NO;
+ _initFinished = NO;
+}
+
+- (void)refresh
+{
+ if (!_refreshEvent) return;
+ [self fireEvent:@"refresh" params:nil];
+}
+
+- (void)_insertSubcomponent:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ if (subcomponent) {
+ [super _insertSubcomponent:subcomponent atIndex:index];
+ if ([subcomponent isKindOfClass:[WXLoadingIndicator class]]) {
+ _indicator = (WXLoadingIndicator*)subcomponent;
+ }
+ }
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"display"]) {
+ if ([attributes[@"display"] isEqualToString:@"show"]) {
+ _displayState = YES;
+ } else if ([attributes[@"display"] isEqualToString:@"hide"]){
+ _displayState = NO;
+ } else {
+ WXLogError(@"");
+ }
+ [self setDisplay];
+ }
+}
+
+- (void)addEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"refresh"]) {
+ _refreshEvent = YES;
+ }
+}
+
+- (void)removeEvent:(NSString *)evetName
+{
+ if ([evetName isEqualToString:@"refresh"]) {
+ _refreshEvent = NO;
+ }
+}
+
+- (void)setDisplay
+{
+ id<WXScrollerProtocol> scrollerProtocol = self.ancestorScroller;
+ if (scrollerProtocol == nil || !_initFinished)
+ return;
+
+ CGPoint offset = [scrollerProtocol contentOffset];
+ if (_displayState) {
+ offset.y = -self.calculatedFrame.size.height;
+ [_indicator start];
+ }
+ else {
+ offset.y = 0;
+ [_indicator stop];
+ }
+ [scrollerProtocol setContentOffset:offset animated:YES];
+}
+
+- (void)setFrame:(CGRect)frame
+{
+ CGRect rect = frame;
+ rect.origin.y = 0 - frame.size.height;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.h
new file mode 100644
index 0000000..d256567
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.h
@@ -0,0 +1,25 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXScrollerProtocol.h"
+#import "WXComponent.h"
+
+@interface WXScrollerComponent : WXComponent <WXScrollerProtocol, UIScrollViewDelegate>
+
+@property (nonatomic, copy) void (^onScroll)(UIScrollView *);
+
+@property (nonatomic, assign) NSUInteger loadmoreretry;
+
+@property (nonatomic, assign) CGSize contentSize;
+
+@property (nonatomic, readonly, assign) css_node_t *scrollerCSSNode;
+
+- (NSUInteger)childrenCountForScrollerLayout;
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
new file mode 100644
index 0000000..7ebf492
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -0,0 +1,579 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXScrollerComponent.h"
+#import "WXComponent_internal.h"
+#import "WXComponent.h"
+#import "WXDefine.h"
+#import "WXConvert.h"
+#import "WXSDKInstance.h"
+#import "WXUtility.h"
+#import "WXLoadingComponent.h"
+#import "WXRefreshComponent.h"
+
+@interface WXScrollToTarget : NSObject
+
+@property (nonatomic, weak) WXComponent *target;
+@property (nonatomic, assign) BOOL hasAppear;
+
+@end
+
+@implementation WXScrollToTarget
+
+@end
+
+@interface WXScrollView_new : UIScrollView
+@end
+@implementation WXScrollView_new
+@end
+
+@interface WXScrollerComponent()
+
+@property (nonatomic, strong) NSMutableArray * stickyArray;
+
+@property (nonatomic, strong) NSMutableArray * listenerArray;
+
+@property (nonatomic, weak) WXRefreshComponent *refreshComponent;
+@property (nonatomic, weak) WXLoadingComponent *loadingComponent;
+
+@end
+
+@implementation WXScrollerComponent
+{
+ CGSize _contentSize;
+ BOOL _listenLoadMore;
+ CGFloat _loadMoreOffset;
+ CGFloat _previousLoadMoreContentHeight;
+ CGPoint _lastContentOffset;
+
+ // vertical & horizontal
+ WXScrollDirection _scrollDirection;
+ // left & right & up & down
+ NSString *_direction;
+ BOOL _showScrollBar;
+
+ css_node_t *_scrollerCSSNode;
+}
+
+-(instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+
+ _stickyArray = [NSMutableArray array];
+ _listenerArray = [NSMutableArray array];
+
+ _scrollDirection = attributes[@"scrollDirection"] ? [WXConvert WXScrollDirection:attributes[@"scrollDirection"]] : WXScrollDirectionVertical;
+ _showScrollBar = attributes[@"showScrollbar"] ? [WXConvert BOOL:attributes[@"showScrollbar"]] : YES;
+ _loadMoreOffset = attributes[@"loadmoreoffset"] ? [WXConvert CGFloat:attributes[@"loadmoreoffset"]] : 0;
+ _loadmoreretry = attributes[@"loadmoreretry"] ? [WXConvert NSUInteger:attributes[@"loadmoreretry"]] : 0;
+ _listenLoadMore = [events containsObject:@"loadmore"];
+
+
+ _scrollerCSSNode = new_css_node();
+ }
+
+ return self;
+}
+
+- (void)viewWillUnload
+{
+ ((UIScrollView *)(self.view)).delegate = nil;
+}
+
+- (void)dealloc
+{
+ [self.stickyArray removeAllObjects];
+ [self.listenerArray removeAllObjects];
+
+ free(_scrollerCSSNode);
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"showScrollbar"]) {
+ _showScrollBar = [WXConvert BOOL:attributes[@"showScrollbar"]];
+ ((UIScrollView *)self.view).showsHorizontalScrollIndicator = _showScrollBar;
+ ((UIScrollView *)self.view).showsVerticalScrollIndicator = _showScrollBar;
+ }
+
+ if (attributes[@"loadmoreoffset"]) {
+ _loadMoreOffset = [WXConvert CGFloat:attributes[@"loadmoreoffset"]];
+ }
+
+ if (attributes[@"loadmoreretry"]) {
+ NSUInteger loadmoreretry = [WXConvert NSUInteger:attributes[@"loadmoreretry"]];
+ if (loadmoreretry != _loadmoreretry) {
+ _previousLoadMoreContentHeight = 0;
+ }
+ _loadmoreretry = loadmoreretry;
+ }
+}
+
+- (void)addEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"loadmore"]) {
+ _listenLoadMore = YES;
+ }
+}
+
+- (void)removeEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"loadmore"]) {
+ _listenLoadMore = NO;
+ }
+}
+
+- (void)addStickyComponent:(WXComponent *)sticky
+{
+ if(![self.stickyArray containsObject:sticky]){
+ [self.stickyArray addObject:sticky];
+ [self adjustSticky];
+ }
+}
+
+- (void)removeStickyComponent:(WXComponent *)sticky
+{
+ if([self.stickyArray containsObject:sticky]){
+ [self.stickyArray removeObject:sticky];
+ [self adjustSticky];
+ }
+}
+
+- (css_node_t *)scrollerCSSNode
+{
+ return _scrollerCSSNode;
+}
+
+- (void)setContentSize:(CGSize)size
+{
+ UIScrollView *scrollView = (UIScrollView *)self.view;
+ scrollView.contentSize = size;
+}
+
+- (CGSize)contentSize
+{
+ return ((UIScrollView *)self.view).contentSize;
+}
+
+/**
+ * add response to scrollTo
+ **/
+- (void)addScrollToListener:(WXComponent *)target
+{
+ BOOL has = NO;
+ for (WXScrollToTarget *targetData in self.listenerArray) {
+ if (targetData.target == target) {
+ has = YES;
+ break;
+ }
+ }
+ if (!has){
+ WXScrollToTarget *scrollTarget = [[WXScrollToTarget alloc] init];
+ scrollTarget.target = target;
+ scrollTarget.hasAppear = NO;
+ [self.listenerArray addObject:scrollTarget];
+ }
+}
+
+/**
+ * remove response to scrollTo
+ **/
+- (void)removeScrollToListener:(WXComponent *)target
+{
+ WXScrollToTarget *targetData = nil;
+ for (WXScrollToTarget *targetData in self.listenerArray) {
+ if (targetData.target == target) {
+ break;
+ }
+ }
+ if(targetData){
+ [self.listenerArray removeObject:targetData];
+ }
+}
+
+- (UIView *)loadView
+{
+ return [[UIScrollView alloc] init];
+}
+
+- (void)viewDidLoad
+{
+ [self setContentSize:_contentSize];
+ UIScrollView* scrollView = (UIScrollView *)self.view;
+ scrollView.scrollEnabled = YES;
+ scrollView.delegate = self;
+ scrollView.exclusiveTouch = YES;
+ scrollView.autoresizesSubviews = NO;
+ scrollView.clipsToBounds = YES;
+ scrollView.showsVerticalScrollIndicator = _showScrollBar;
+ scrollView.showsHorizontalScrollIndicator = _showScrollBar;
+
+ if (self.ancestorScroller) {
+ scrollView.scrollsToTop = NO;
+ } else {
+ scrollView.scrollsToTop = YES;
+ }
+}
+
+- (void)scrollToTarget:(WXScrollToTarget *)target scrollRect:(CGRect)rect
+{
+ WXComponent *component = target.target;
+ CGFloat ctop = component.absolutePosition.y - self.absolutePosition.y;
+ CGFloat cbottom = ctop + CGRectGetHeight(component.calculatedFrame);
+ CGFloat cleft = component.absolutePosition.x - self.absolutePosition.x;
+ CGFloat cright = cleft + CGRectGetWidth(component.calculatedFrame);
+
+ CGFloat vtop = CGRectGetMinY(rect), vbottom = CGRectGetMaxY(rect), vleft = CGRectGetMinX(rect), vright = CGRectGetMaxX(rect);
+
+ if(cbottom > vtop && ctop <= vbottom && cleft <= vright && cright > vleft){
+ if(!target.hasAppear && component){
+ target.hasAppear = YES;
+ if (component->_appearEvent) {
+ [component fireEvent:@"appear" params:_direction ? @{@"direction":_direction} : nil];
+
+ }
+ }
+ } else {
+ if(target.hasAppear && component){
+ target.hasAppear = NO;
+ if(component->_disappearEvent){
+ [component fireEvent:@"disappear" params:_direction ? @{@"direction":_direction} : nil];
+ }
+
+ }
+ }
+}
+#pragma mark -
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView
+{
+ //apply block which are registered
+ WXSDKInstance *instance = self.weexInstance;
+ if ([self.ref isEqualToString:WX_SDK_ROOT_REF] &&
+ [self isKindOfClass:[WXScrollerComponent class]]) {
+ if (instance.onScroll) {
+ instance.onScroll(scrollView.contentOffset);
+ }
+ }
+
+ if (_lastContentOffset.x > scrollView.contentOffset.x){
+ _direction = @"right";
+ } else if (_lastContentOffset.x < scrollView.contentOffset.x){
+ _direction = @"left";
+ } else if(_lastContentOffset.y > scrollView.contentOffset.y){
+ _direction = @"down";
+ } else if(_lastContentOffset.y < scrollView.contentOffset.y) {
+ _direction = @"up";
+ }
+
+ _lastContentOffset = scrollView.contentOffset;
+
+ // chekck sticky
+ [self adjustSticky];
+ [self handleLoadMore];
+
+ CGFloat vx = scrollView.contentInset.left + scrollView.contentOffset.x;
+ CGFloat vy = scrollView.contentInset.top + scrollView.contentOffset.y;
+ CGFloat vw = scrollView.frame.size.width - scrollView.contentInset.left - scrollView.contentInset.right;
+ CGFloat vh = scrollView.frame.size.height - scrollView.contentInset.top - scrollView.contentInset.bottom;
+ CGRect scrollRect = CGRectMake(vx, vy, vw, vh);;
+
+ // notify action for appear
+ for(WXScrollToTarget *target in self.listenerArray){
+ [self scrollToTarget:target scrollRect:scrollRect];
+ }
+
+ if (self.onScroll) {
+ self.onScroll(scrollView);
+ }
+}
+
+- (void)layoutDidFinish
+{
+ if ([self isViewLoaded]) {
+ [self setContentSize:_contentSize];
+ }
+ [self adjustSticky];
+ [self handleAppear];
+ [_loadingComponent resizeFrame];
+}
+
+- (void)handleAppear
+{
+ UIScrollView *scrollView = (UIScrollView *)self.view;
+ CGFloat vx = scrollView.contentInset.left + scrollView.contentOffset.x;
+ CGFloat vy = scrollView.contentInset.top + scrollView.contentOffset.y;
+ CGFloat vw = scrollView.frame.size.width - scrollView.contentInset.left - scrollView.contentInset.right;
+ CGFloat vh = scrollView.frame.size.height - scrollView.contentInset.top - scrollView.contentInset.bottom;
+ CGRect scrollRect = CGRectMake(vx, vy, vw, vh);;
+
+ // notify action for appear
+ for(WXScrollToTarget *target in self.listenerArray){
+ [self scrollToTarget:target scrollRect:scrollRect];
+ }
+}
+
+- (void)adjustSticky
+{
+ CGFloat scrollOffset = ((UIScrollView *)self.view).contentOffset.y;
+ for(WXComponent *component in self.stickyArray) {
+ if (isnan(component.absolutePosition.y)) {
+ continue;
+ }
+
+ if(component.supercomponent != self && component.view.superview != self.view) {
+ [component.view removeFromSuperview];
+ [self.view addSubview:component.view];
+ } else {
+ [self.view bringSubviewToFront:component.view];
+ }
+
+ CGFloat componentY = component.absolutePosition.y - self.absolutePosition.y;
+ BOOL needSticky = NO;
+
+ if (scrollOffset >= componentY) {
+ needSticky = YES;
+ } else {
+ // important: reset views' frame
+ component.view.frame = CGRectMake(component.absolutePosition.x - self.absolutePosition.x, componentY, component.calculatedFrame.size.width, component.calculatedFrame.size.height);
+ }
+
+ if (!needSticky) {
+ continue;
+ }
+
+ // The minimum Y sticky view can reach is its original position
+ CGFloat minY = component.absolutePosition.y - self.absolutePosition.y;
+ WXComponent *superComponent = (WXComponent *)(component.supercomponent);
+ CGFloat maxY = superComponent.absolutePosition.y - self.absolutePosition.y + superComponent.calculatedFrame.size.height - component.calculatedFrame.size.height;
+
+ CGFloat stickyY = scrollOffset;
+ if (stickyY < minY) {
+ stickyY = minY;
+ } else if (stickyY > maxY && ![superComponent conformsToProtocol:@protocol(WXScrollerProtocol)]) {
+ // Sticky component can not go beyond its parent's bounds when its parent is not scroller;
+ stickyY = maxY;
+ }
+
+ UIView *stickyView = component.view;
+ CGPoint origin = stickyView.frame.origin;
+ origin.y = stickyY;
+ stickyView.frame = (CGRect){origin,stickyView.frame.size};
+ }
+}
+
+- (void)addLoadMoreEvent
+{
+ _listenLoadMore = YES;
+}
+
+- (void)removeLoadMoreEvent
+{
+ _listenLoadMore = NO;
+}
+
+- (BOOL)isNeedLoadMore
+{
+ if (_loadMoreOffset >= 0.0) {
+ return _previousLoadMoreContentHeight != ((UIScrollView *)self.view).contentSize.height && ((UIScrollView *)self.view).contentSize.height - ((UIScrollView *)self.view).contentOffset.y - self.view.frame.size.height <= _loadMoreOffset;
+ }
+
+ return NO;
+}
+
+- (void)loadMore
+{
+ [self fireEvent:@"loadmore" params:nil];
+ _previousLoadMoreContentHeight = ((UIScrollView *)self.view).contentSize.height;
+}
+
+- (void)handleLoadMore
+{
+ if (_listenLoadMore && [self isNeedLoadMore]) {
+ [self loadMore];
+ }
+}
+
+- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset
+{
+ UIScrollView *scrollView = (UIScrollView *)self.view;
+ CGPoint contentOffset = scrollView.contentOffset;
+
+ if (_scrollDirection == WXScrollDirectionHorizontal) {
+ CGFloat contentOffetX = component.absolutePosition.x - self.absolutePosition.x;
+ contentOffetX += offset * WXScreenResizeRadio();
+
+ if (contentOffetX > scrollView.contentSize.width - scrollView.frame.size.width) {
+ contentOffset.x = scrollView.contentSize.width - scrollView.frame.size.width;
+ } else {
+ contentOffset.x = contentOffetX;
+ }
+ } else {
+ CGFloat contentOffetY = component.absolutePosition.y - self.absolutePosition.y;
+ contentOffetY += offset * WXScreenResizeRadio();
+
+ if (contentOffetY > scrollView.contentSize.height - scrollView.frame.size.height) {
+ contentOffset.y = scrollView.contentSize.height - scrollView.frame.size.height;
+ } else {
+ contentOffset.y = contentOffetY;
+ }
+ }
+
+ [scrollView setContentOffset:contentOffset animated:YES];
+}
+
+#pragma mark -
+#pragma mark refresh
+
+- (void)_insertSubcomponent:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ [super _insertSubcomponent:subcomponent atIndex:index];
+ if ([subcomponent isKindOfClass:[WXRefreshComponent class]]) {
+ _refreshComponent = (WXRefreshComponent*)subcomponent;
+ }
+ else if ([subcomponent isKindOfClass:[WXLoadingComponent class]]) {
+ _loadingComponent = (WXLoadingComponent*)subcomponent;
+ }
+}
+
+- (void) scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
+{
+ //refresh
+ if (_refreshComponent && scrollView.contentOffset.y < _refreshComponent.calculatedFrame.origin.y) {
+
+ [_refreshComponent refresh];
+ }
+
+ //loading
+ if (_loadingComponent &&
+ scrollView.contentOffset.y + scrollView.frame.size.height > _loadingComponent.view.frame.origin.y + _loadingComponent.calculatedFrame.size.height) {
+
+ [_loadingComponent loading];
+ }
+}
+
+- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated
+{
+ UIScrollView *scrollView = (UIScrollView *)self.view;
+ [scrollView setContentOffset:contentOffset animated:animated];
+}
+
+- (CGPoint)contentOffset
+{
+ CGPoint rtv = CGPointZero;
+ UIScrollView *scrollView = (UIScrollView *)self.view;
+ if (scrollView) {
+ rtv = scrollView.contentOffset;
+ }
+ return rtv;
+}
+
+- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
+{
+ UIEdgeInsets inset = [scrollView contentInset];
+ if ([_refreshComponent displayState]) {
+ inset.top = _refreshComponent.calculatedFrame.size.height;
+ }
+ else {
+ inset.top = 0;
+ }
+ if ([_loadingComponent displayState]) {
+ inset.bottom = _loadingComponent.calculatedFrame.size.height;
+ }
+ else {
+ inset.bottom = 0;
+ }
+
+ [scrollView setContentInset:inset];
+}
+
+- (UIEdgeInsets)contentInset
+{
+ UIEdgeInsets rtv = UIEdgeInsetsZero;
+ UIScrollView *scrollView = (UIScrollView *)self.view;
+ if (scrollView) {
+ rtv = scrollView.contentInset;
+ }
+ return rtv;
+}
+
+- (void)setContentInset:(UIEdgeInsets)contentInset
+{
+ UIScrollView *scrollView = (UIScrollView *)self.view;
+ [scrollView setContentInset:contentInset];
+}
+
+#pragma mark Layout
+
+- (NSUInteger)_childrenCountForLayout;
+{
+ return 0;
+}
+
+- (NSUInteger)childrenCountForScrollerLayout
+{
+ return [super _childrenCountForLayout];
+}
+
+- (void)_calculateFrameWithSuperAbsolutePosition:(CGPoint)superAbsolutePosition
+ gatherDirtyComponents:(NSMutableSet<WXComponent *> *)dirtyComponents
+{
+ /**
+ * Pretty hacky way
+ * layout from root to scroller to get scroller's frame,
+ * layout from children to scroller to get scroller's contentSize
+ */
+ if ([self needsLayout]) {
+ memcpy(_scrollerCSSNode, self.cssNode, sizeof(css_node_t));
+ _scrollerCSSNode->children_count = (int)[self childrenCountForScrollerLayout];
+
+ _scrollerCSSNode->style.position[CSS_LEFT] = 0;
+ _scrollerCSSNode->style.position[CSS_TOP] = 0;
+
+ if (_scrollDirection == WXScrollDirectionVertical) {
+ _scrollerCSSNode->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN;
+ _scrollerCSSNode->style.dimensions[CSS_WIDTH] = _cssNode->layout.dimensions[CSS_WIDTH];
+ _scrollerCSSNode->style.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+ } else {
+ _scrollerCSSNode->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
+ _scrollerCSSNode->style.dimensions[CSS_HEIGHT] = _cssNode->layout.dimensions[CSS_HEIGHT];
+ _scrollerCSSNode->style.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ }
+
+ _scrollerCSSNode->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ _scrollerCSSNode->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+
+ layoutNode(_scrollerCSSNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT);
+// print_css_node(_scrollerCSSNode, CSS_PRINT_LAYOUT | CSS_PRINT_STYLE | CSS_PRINT_CHILDREN);
+ CGSize size = {
+ WXRoundPixelValue(_scrollerCSSNode->layout.dimensions[CSS_WIDTH]),
+ WXRoundPixelValue(_scrollerCSSNode->layout.dimensions[CSS_HEIGHT])
+ };
+
+// if (_scrollDirection == WXScrollDirectionVertical && size.height > self.cssNode->layout.dimensions[CSS_HEIGHT] && superAbsolutePosition.y + size.height <= self.weexInstance.rootView.frame.size.height) {
+// // vertical frame
+// self.cssNode->layout.dimensions[CSS_HEIGHT] = size.height;
+// } else if (_scrollDirection == WXScrollDirectionHorizontal && size.width > self.cssNode->layout.dimensions[CSS_WIDTH] && superAbsolutePosition.x + size.width <= self.weexInstance.rootView.frame.size.width) {
+// // horizontal frame
+// self.cssNode->layout.dimensions[CSS_WIDTH] = size.width;
+// } else
+ if (!CGSizeEqualToSize(size, _contentSize)) {
+ // content size
+ _contentSize = size;
+ [dirtyComponents addObject:self];
+ }
+
+ _scrollerCSSNode->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ _scrollerCSSNode->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+ }
+
+ [super _calculateFrameWithSuperAbsolutePosition:superAbsolutePosition gatherDirtyComponents:dirtyComponents];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.h
new file mode 100644
index 0000000..6a223e3
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.h
@@ -0,0 +1,18 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXComponent.h"
+
+@class WXIndicatorView;
+
+@interface WXSliderComponent : WXComponent
+
+- (void)setIndicatorView:(WXIndicatorView *)indicatorView;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.m
new file mode 100644
index 0000000..b81f099
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.m
@@ -0,0 +1,446 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSliderComponent.h"
+#import "WXIndicatorComponent.h"
+#import "NSTimer+Weex.h"
+#import "WXSDKManager.h"
+#import "WXUtility.h"
+
+@class WXSliderView;
+@class WXIndicatorView;
+
+@protocol WXSliderViewDelegate <UIScrollViewDelegate>
+
+- (void)sliderView:(WXSliderView *)sliderView didScrollToItemAtIndex:(NSInteger)index;
+
+@end
+
+@interface WXSliderView : UIView <UIScrollViewDelegate>
+
+@property (nonatomic, strong) WXIndicatorView *indicator;
+@property (nonatomic, weak) id<WXSliderViewDelegate> delegate;
+
+@property (nonatomic, strong) UIScrollView *scrollView;
+@property (nonatomic, strong) NSMutableArray *itemViews;
+@property (nonatomic, assign) NSInteger currentIndex;
+
+- (UIScrollView *)scrollView;
+- (void)insertItemView:(UIView *)view atIndex:(NSInteger)index;
+- (void)removeItemView:(UIView *)view;
+- (void)scroll2ItemView:(NSInteger)index animated:(BOOL)animated;
+- (void)loadData;
+
+@end
+
+@implementation WXSliderView
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ UIView *tempBackGround = [[UIView alloc] init];
+ tempBackGround.backgroundColor = [UIColor clearColor];
+ [self addSubview:tempBackGround];
+
+ _scrollView = [[UIScrollView alloc] init];
+ _scrollView.backgroundColor = [UIColor clearColor];
+ _scrollView.delegate = self;
+ _scrollView.showsHorizontalScrollIndicator = NO;
+ _scrollView.showsVerticalScrollIndicator = NO;
+ _scrollView.scrollsToTop = NO;
+ [self addSubview:_scrollView];
+
+ _itemViews = [NSMutableArray array];
+ }
+ return self;
+}
+
+- (void)setIndicator:(WXIndicatorView *)indicator
+{
+ _indicator = indicator;
+ [_indicator setPointCount:self.itemViews.count];
+ [_indicator setCurrentPoint:_currentIndex];
+}
+
+- (void)setCurrentIndex:(NSInteger)currentIndex
+{
+ if (_currentIndex == currentIndex) return;
+
+ _currentIndex = currentIndex;
+ [self.indicator setCurrentPoint:_currentIndex];
+
+ [self _resortItemViews];
+ [self _resetItemFrames];
+ [self _scroll2Center];
+ [self setNeedsLayout];
+
+ if (self.delegate && [self.delegate respondsToSelector:@selector(sliderView:didScrollToItemAtIndex:)]) {
+ [self.delegate sliderView:self didScrollToItemAtIndex:_currentIndex];
+ }
+}
+
+- (void)layoutSubviews
+{
+ [super layoutSubviews];
+
+ self.scrollView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
+ self.scrollView.contentSize = CGSizeMake(self.itemViews.count * self.frame.size.width, self.frame.size.height);
+}
+
+#pragma mark Public Methods
+
+- (void)insertItemView:(UIView *)view atIndex:(NSInteger)index
+{
+ if (![self.itemViews containsObject:view]) {
+ view.tag = self.itemViews.count;
+ if (index < 0) {
+ [self.itemViews addObject:view];
+ } else {
+ [self.itemViews insertObject:view atIndex:index];
+ }
+ }
+
+ if (![self.scrollView.subviews containsObject:view]) {
+ if (index < 0) {
+ [self.scrollView addSubview:view];
+ } else {
+ [self.scrollView insertSubview:view atIndex:index];
+ }
+ }
+
+ [self.indicator setPointCount:self.itemViews.count];
+ [self setNeedsLayout];
+}
+
+- (void)removeItemView:(UIView *)view
+{
+ if ([self.itemViews containsObject:view]) {
+ [self.itemViews removeObject:view];
+ }
+
+ if ([self.scrollView.subviews containsObject:view]) {
+ [view removeFromSuperview];
+ }
+
+ [self.indicator setPointCount:self.itemViews.count];
+ [self setNeedsLayout];
+}
+
+- (void)scroll2ItemView:(NSInteger)index animated:(BOOL)animated
+{
+ UIView *itemView = nil;
+ for (itemView in self.itemViews) {
+ if (itemView.tag == index){
+ break;
+ }
+ }
+
+ if (itemView) {
+ [self.scrollView setContentOffset:itemView.frame.origin animated:YES];
+ }
+}
+
+- (void)loadData
+{
+ self.scrollView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
+ self.scrollView.contentSize = CGSizeMake(self.itemViews.count * self.frame.size.width, self.frame.size.height);
+
+ [self _resortItemViews];
+ [self _scroll2Center];
+ [self setNeedsLayout];
+}
+
+#pragma mark Private Methods
+
+- (void)_resortItemViews
+{
+ if (self.itemViews.count <= 2) return;
+
+ NSInteger center = [self _centerItemIndex];
+ NSInteger index = 0;
+ if (self.currentIndex > center) {
+ index = self.currentIndex - center;
+ } else {
+ index = self.currentIndex + self.itemViews.count - center;
+ }
+
+ __weak typeof(self) weakSelf = self;
+ [self.itemViews sortUsingComparator:^NSComparisonResult(UIView *obj1, UIView *obj2) {
+ NSInteger tag1 = obj1.tag >= index ? obj1.tag - index : obj1.tag + weakSelf.itemViews.count - index;
+ NSInteger tag2 = obj2.tag >= index ? obj2.tag - index : obj2.tag + weakSelf.itemViews.count - index;
+
+ if (tag1 > tag2) {
+ return 1;
+ } else if (tag1 < tag2) {
+ return -1;
+ } else {
+ return 0;
+ }
+ }];
+}
+
+- (void)_resetItemFrames
+{
+ CGFloat xOffset = 0; CGRect frame = CGRectZero;
+ for(UIView *itemView in self.itemViews){
+ frame = itemView.frame;
+ frame.origin.x = xOffset;
+ frame.size.width = self.frame.size.width;
+ itemView.frame = frame;
+ xOffset += frame.size.width;
+ }
+}
+
+- (NSInteger)_centerItemIndex
+{
+ if (self.itemViews.count > 2) {
+ return self.itemViews.count % 2 ? self.itemViews.count / 2 : self.itemViews.count / 2 - 1;
+ }
+ return 0;
+}
+
+- (void)_scroll2Center
+{
+ if (self.itemViews.count > 2) {
+ UIView *itemView = [self.itemViews objectAtIndex:[self _centerItemIndex]];
+ [self.scrollView scrollRectToVisible:itemView.frame animated:NO];
+ }
+}
+
+- (BOOL)_isItemViewVisiable:(UIView *)itemView
+{
+ CGRect itemFrame = itemView.frame;
+
+ CGFloat vx = self.scrollView.contentInset.left + self.scrollView.contentOffset.x;
+ CGFloat vy = self.scrollView.contentInset.top + self.scrollView.contentOffset.y;
+ CGFloat vw = self.scrollView.frame.size.width - self.scrollView.contentInset.left - self.scrollView.contentInset.right;
+ CGFloat vh = self.scrollView.frame.size.height - self.scrollView.contentInset.top - self.scrollView.contentInset.bottom;
+ CGRect visiableRect = CGRectMake(vx - 2, vy, vw + 4, vh);
+
+ CGRect intersection = CGRectIntersection(visiableRect, itemFrame);
+ if (intersection.size.width > visiableRect.size.width - 10) {
+ return YES;
+ } else {
+ return NO;
+ }
+}
+
+#pragma mark ScrollView Delegate
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView
+{
+ UIView *itemView = nil;
+ for (itemView in self.itemViews) {
+ if ([self _isItemViewVisiable:itemView]) {
+ break;
+ }
+ }
+
+ if (itemView) {
+ self.currentIndex = itemView.tag;
+ }
+}
+
+- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
+{
+ if (self.delegate && [self.delegate respondsToSelector:@selector(scrollViewWillBeginDragging:)]) {
+ [self.delegate scrollViewWillBeginDragging:self.scrollView];
+ }
+}
+
+- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
+{
+ if (self.delegate && [self.delegate respondsToSelector:@selector(scrollViewDidEndDragging: willDecelerate:)]) {
+ [self.delegate scrollViewDidEndDragging:self.scrollView willDecelerate:decelerate];
+ }
+}
+
+@end
+
+@interface WXSliderComponent ()<WXSliderViewDelegate>
+
+@property (nonatomic, strong) WXSliderView *sliderView;
+@property (nonatomic, strong) NSTimer *autoTimer;
+@property (nonatomic, assign) NSInteger currentIndex;
+@property (nonatomic, assign) BOOL autoPlay;
+@property (nonatomic, assign) BOOL sliderChangeEvent;
+@property (nonatomic, strong) NSMutableArray *childrenView;
+
+@end
+
+@implementation WXSliderComponent
+
+- (void) dealloc
+{
+ [self _stopAutoPlayTimer];
+}
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
+ _sliderChangeEvent = NO;
+ _childrenView = [NSMutableArray new];
+
+ if (attributes[@"autoPlay"]) {
+ _autoPlay = [attributes[@"autoPlay"] boolValue];
+ }
+
+ self.cssNode->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
+ }
+ return self;
+}
+
+- (UIView *)loadView
+{
+ return [[WXSliderView alloc] init];
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ _sliderView = (WXSliderView *)self.view;
+ _sliderView.delegate = self;
+ _sliderView.scrollView.pagingEnabled = YES;
+ _sliderView.exclusiveTouch = YES;
+
+ if (_autoPlay) {
+ [self _startAutoPlayTimer];
+ } else {
+ [self _stopAutoPlayTimer];
+ }
+}
+
+- (void)viewDidUnload
+{
+ [_childrenView removeAllObjects];
+}
+
+- (void)insertSubview:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ UIView *view = subcomponent.view;
+
+ if(index < 0) {
+ [self.childrenView addObject:view];
+ }
+ else {
+ [self.childrenView insertObject:view atIndex:index];
+ }
+
+ WXSliderView *sliderView = (WXSliderView *)self.view;
+ if ([view isKindOfClass:[WXIndicatorView class]]) {
+ [sliderView addSubview:view];
+ return;
+ }
+
+ if (index == -1) {
+ [sliderView insertItemView:view atIndex:index];
+ } else {
+ NSInteger offset = 0;
+ for (int i = 0; i < [self.childrenView count]; ++i) {
+ if (index == i) break;
+
+ if ([self.childrenView[i] isKindOfClass:[WXIndicatorView class]]) {
+ offset++;
+ }
+ }
+ [sliderView insertItemView:view atIndex:index - offset];
+ }
+ [sliderView loadData];
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"autoPlay"]) {
+ _autoPlay = [attributes[@"autoPlay"] boolValue];
+ if (_autoPlay) {
+ [self _startAutoPlayTimer];
+ } else {
+ [self _stopAutoPlayTimer];
+ }
+ }
+}
+
+- (void)addEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"change"]) {
+ _sliderChangeEvent = YES;
+ }
+}
+
+- (void)removeEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"change"]) {
+ _sliderChangeEvent = NO;
+ }
+}
+
+#pragma mark Public Methods
+
+-(void)setIndicatorView:(WXIndicatorView *)indicatorView
+{
+ NSAssert(_sliderView, @"");
+ [_sliderView setIndicator:indicatorView];
+}
+
+#pragma mark Private Methods
+
+- (void)_startAutoPlayTimer
+{
+ if (!self.autoTimer || ![self.autoTimer isValid]) {
+ __weak __typeof__(self) weakSelf = self;
+ self.autoTimer = [NSTimer wx_scheduledTimerWithTimeInterval:3 block:^() {
+ [weakSelf _autoPlayOnTimer];
+ } repeats:YES];
+ [[NSRunLoop currentRunLoop] addTimer:self.autoTimer forMode:NSRunLoopCommonModes];
+ }
+}
+
+- (void)_stopAutoPlayTimer
+{
+ if (self.autoTimer && [self.autoTimer isValid]) {
+ [self.autoTimer invalidate];
+ self.autoTimer = nil;
+ }
+}
+
+- (void)_autoPlayOnTimer
+{
+ WXSliderView *sliderView = (WXSliderView *)self.view;
+ if (self.currentIndex < self.childrenView.count - 1) {
+ self.currentIndex ++;
+ [sliderView scroll2ItemView:self.currentIndex animated:YES];
+ } else {
+ self.currentIndex = 0;
+ [sliderView scroll2ItemView:self.currentIndex animated:YES];
+ }
+}
+
+- (void)sliderView:(WXSliderView *)sliderView didScrollToItemAtIndex:(NSInteger)index
+{
+ self.currentIndex = index;
+
+ if (_sliderChangeEvent) {
+ [self fireEvent:@"change" params:@{@"index":@(index)}];
+ }
+}
+
+- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
+{
+ [self _stopAutoPlayTimer];
+}
+
+- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
+{
+ if (_autoPlay) {
+ [self _startAutoPlayTimer];
+ }
+}
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.h
new file mode 100644
index 0000000..f3f0634
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXSwitchComponent : WXComponent
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.m
new file mode 100644
index 0000000..e874a13
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.m
@@ -0,0 +1,89 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSwitchComponent.h"
+#import "WXConvert.h"
+
+@interface WXSwitchView : UISwitch
+
+@end
+
+@implementation WXSwitchView
+
+@end
+
+@interface WXSwitchComponent()
+
+@property (nonatomic, strong) WXSwitchView *switchView;
+@property (nonatomic, assign) BOOL changeEvent;
+@property (nonatomic, assign) BOOL checked;
+@property (nonatomic, assign) BOOL disabled;
+
+@end
+
+@implementation WXSwitchComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
+ _checked = attributes[@"checked"] ? [WXConvert BOOL:attributes[@"checked"]] : NO;
+ _disabled = attributes[@"disabled"] ? [WXConvert BOOL:attributes[@"disabled"]] : NO;
+
+ self.cssNode->style.dimensions[CSS_WIDTH] = 51;
+ self.cssNode->style.dimensions[CSS_HEIGHT] = 31;
+ }
+ return self;
+}
+
+- (UIView *)loadView
+{
+ return [[WXSwitchView alloc] init];
+}
+
+- (void)viewDidLoad
+{
+ _switchView = (WXSwitchView *)self.view;
+ [_switchView setOn:_checked animated:YES];
+ [_switchView setEnabled:!_disabled];
+ [_switchView addTarget:self action:@selector(checkChanged) forControlEvents:UIControlEventValueChanged];
+}
+
+- (void)addEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"change"]) {
+ _changeEvent = YES;
+ }
+}
+
+- (void)removeEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"change"]) {
+ _changeEvent = NO;
+ }
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"checked"]) {
+ _checked = [WXConvert BOOL:attributes[@"checked"]];
+ [_switchView setOn:_checked animated:YES];
+ }
+ else if (attributes[@"disabled"]) {
+ _disabled = [WXConvert BOOL:attributes[@"disabled"]];
+ [_switchView setEnabled:!_disabled];
+ }
+}
+
+- (void)checkChanged
+{
+ if (_changeEvent) {
+ [self fireEvent:@"change" params:@{@"value":@([_switchView isOn])}];
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h
new file mode 100644
index 0000000..72dd3ab
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXTextComponent : WXComponent
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
new file mode 100644
index 0000000..5417bac
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
@@ -0,0 +1,365 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXTextComponent.h"
+#import "WXComponent_internal.h"
+#import "WXLayer.h"
+#import "WXUtility.h"
+#import "WXConvert.h"
+
+@interface WXText : UIView
+
+@property (nonatomic, strong) NSTextStorage *textStorage;
+
+@end
+
+@implementation WXText
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ if ((self = [super initWithFrame:frame])) {
+ self.isAccessibilityElement = YES;
+ self.accessibilityTraits |= UIAccessibilityTraitStaticText;
+
+ self.opaque = NO;
+ self.contentMode = UIViewContentModeRedraw;
+ }
+ return self;
+}
+
++ (Class)layerClass
+{
+ return [WXLayer class];
+}
+
+- (UIImage *)drawTextWithBounds:(CGRect)bounds padding:(UIEdgeInsets)padding
+{
+ if (bounds.size.width <=0 || bounds.size.height <= 0) {
+ return nil;
+ }
+ UIGraphicsBeginImageContextWithOptions(bounds.size, self.layer.opaque, WXScreenScale());
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ if ([self.wx_component _needsDrawBorder]) {
+ [self.wx_component _drawBorderWithContext:context size:bounds.size];
+ }
+
+ NSLayoutManager *layoutManager = _textStorage.layoutManagers.firstObject;
+ NSTextContainer *textContainer = layoutManager.textContainers.firstObject;
+
+ CGRect textFrame = UIEdgeInsetsInsetRect(bounds, padding);
+ NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer];
+
+ [layoutManager drawBackgroundForGlyphRange:glyphRange atPoint:textFrame.origin];
+ [layoutManager drawGlyphsForGlyphRange:glyphRange atPoint:textFrame.origin];
+
+ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+
+ UIGraphicsEndImageContext();
+
+ return image;
+}
+
+- (NSString *)description
+{
+ NSString *superDescription = super.description;
+ NSRange semicolonRange = [superDescription rangeOfString:@";"];
+ NSString *replacement = [NSString stringWithFormat:@"; text: %@; frame:%f,%f,%f,%f", _textStorage.string, self.frame.origin.x, self.frame.origin.y, self.frame.size.width, self.frame.size.height];
+ return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
+}
+
+- (NSString *)accessibilityValue
+{
+ return _textStorage.string;
+}
+
+@end
+
+@implementation WXTextComponent
+{
+ UIEdgeInsets _border;
+ UIEdgeInsets _padding;
+ NSTextStorage *_textStorage;
+ CGFloat _textStorageWidth;
+
+ NSString *_text;
+ UIColor *_color;
+ NSString *_fontFamily;
+ CGFloat _fontSize;
+ WXTextWeight _fontWeight;
+ WXTextStyle _fontStyle;
+ NSUInteger _lines;
+ NSTextAlignment _textAlign;
+ WXTextDecoration _textDecoration;
+ NSString *_textOverflow;
+}
+
+- (instancetype)initWithRef:(NSString *)ref
+ type:(NSString *)type
+ styles:(NSDictionary *)styles
+ attributes:(NSDictionary *)attributes
+ events:(NSArray *)events
+ weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ [self fillCSSStyles:styles];
+ [self fillAttributes:attributes];
+ }
+
+ return self;
+}
+
+#define WX_STYLE_FILL_TEXT(key, prop, type, needLayout)\
+do {\
+ id value = styles[@#key];\
+ if (value) {\
+ _##prop = [WXConvert type:value];\
+ [self setNeedsRepaint];\
+ if (needLayout) {\
+ [self setNeedsLayout];\
+ }\
+ }\
+} while(0);
+
+- (void)fillCSSStyles:(NSDictionary *)styles
+{
+ WX_STYLE_FILL_TEXT(color, color, UIColor, NO)
+ WX_STYLE_FILL_TEXT(fontFamily, fontFamily, NSString, YES)
+ WX_STYLE_FILL_TEXT(fontSize, fontSize, WXPixelType, YES)
+ WX_STYLE_FILL_TEXT(fontWeight, fontWeight, WXTextWeight, YES)
+ WX_STYLE_FILL_TEXT(fontStyle, fontStyle, WXTextStyle, YES)
+ WX_STYLE_FILL_TEXT(lines, lines, NSUInteger, YES)
+ WX_STYLE_FILL_TEXT(textAlign, textAlign, NSTextAlignment, NO)
+ WX_STYLE_FILL_TEXT(textDecoration, textDecoration, WXTextDecoration, YES)
+ WX_STYLE_FILL_TEXT(textOverflow, textOverflow, NSString, NO)
+
+ UIEdgeInsets padding = UIEdgeInsetsMake(self.cssNode->style.padding[CSS_TOP] + self.cssNode->style.border[CSS_TOP], self.cssNode->style.padding[CSS_LEFT] + self.cssNode->style.border[CSS_LEFT], self.cssNode->style.padding[CSS_BOTTOM] + self.cssNode->style.border[CSS_BOTTOM], self.cssNode->style.padding[CSS_RIGHT] + self.cssNode->style.border[CSS_RIGHT]);
+ if (!UIEdgeInsetsEqualToEdgeInsets(padding, _padding)) {
+ _padding = padding;
+ [self setNeedsRepaint];
+ }
+}
+
+- (void)fillAttributes:(NSDictionary *)attributes
+{
+ id text = attributes[@"value"];
+ if (text) {
+ _text = [WXConvert NSString:text];
+ [self setNeedsRepaint];
+ [self setNeedsLayout];
+ }
+}
+
+- (void)setNeedsRepaint
+{
+ _textStorage = nil;
+}
+
+#pragma mark - Subclass
+
+- (void)setNeedsLayout
+{
+ [super setNeedsLayout];
+}
+
+- (void)layoutDidFinish
+{
+ if ([self isViewLoaded]) {
+ ((WXText *)self.view).textStorage = _textStorage;
+ [self setNeedsDisplay];
+ }
+}
+
+- (void)viewDidLoad
+{
+ ((WXText *)self.view).textStorage = _textStorage;
+ [self setNeedsDisplay];
+}
+
+- (UIView *)loadView
+{
+ return [[WXText alloc] init];
+}
+
+- (WXDisplayBlock)displayBlock
+{
+ WXText *textView = ((WXText *)self.view);
+ return ^UIImage *(CGRect bounds, BOOL(^isCancelled)(void)) {
+ if (isCancelled()) {
+ return nil;
+ }
+ return [textView drawTextWithBounds:bounds padding:_padding];
+ };
+}
+
+- (CGSize (^)(CGSize))measureBlock
+{
+ __weak typeof(self) weakSelf = self;
+ return ^CGSize (CGSize constrainedSize) {
+ NSTextStorage *textStorage = [weakSelf textStorageWithWidth:constrainedSize.width];
+
+ NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;
+ NSTextContainer *textContainer = layoutManager.textContainers.firstObject;
+ CGSize computedSize = [layoutManager usedRectForTextContainer:textContainer].size;
+
+ //TODO:more elegant way to use max and min constrained size
+ if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_WIDTH])) {
+ computedSize.width = MAX(computedSize.width, weakSelf.cssNode->style.minDimensions[CSS_WIDTH]);
+ }
+
+ if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_WIDTH])) {
+ computedSize.width = MIN(computedSize.width, weakSelf.cssNode->style.maxDimensions[CSS_WIDTH]);
+ }
+
+ if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_HEIGHT])) {
+ computedSize.width = MAX(computedSize.height, weakSelf.cssNode->style.minDimensions[CSS_HEIGHT]);
+ }
+
+ if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT])) {
+ computedSize.width = MIN(computedSize.height, weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT]);
+ }
+
+ return (CGSize) {
+ WXCeilPixelValue(computedSize.width),
+ WXCeilPixelValue(computedSize.height)
+ };
+ };
+}
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+ if (((WXText *)(self.view)).textStorage != _textStorage) {
+ ((WXText *)(self.view)).textStorage = _textStorage;
+ [self setNeedsDisplay];
+ }
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (((WXText *)(self.view)).textStorage != _textStorage) {
+ ((WXText *)(self.view)).textStorage = _textStorage;
+ [self setNeedsDisplay];
+ }
+}
+
+#pragma mark Text Building
+- (NSString *)text
+{
+ return _text;
+}
+
+- (NSAttributedString *)buildAttributeString
+{
+ NSString *string = [self text] ?: @"";
+
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
+
+ // set textColor
+ if(_color){
+ [attributedString addAttribute:NSForegroundColorAttributeName value:_color range:NSMakeRange(0, string.length)];
+ }
+
+ // set font
+ UIFont *font = [WXUtility fontWithSize:_fontSize textWeight:_fontWeight textStyle:_fontStyle fontFamily:_fontFamily];
+ [attributedString addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, string.length)];
+
+ if(_textDecoration == WXTextDecorationUnderline){
+ [attributedString addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(0, string.length)];
+ } else if(_textDecoration == WXTextDecorationLineThrough){
+ [attributedString addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(0, string.length)];
+ }
+ if (_textAlign) {
+
+ NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
+ paragraphStyle.alignment = _textAlign;
+ [attributedString addAttribute:NSParagraphStyleAttributeName
+ value:paragraphStyle
+ range:(NSRange){0, attributedString.length}];
+
+ }
+
+ return attributedString;
+}
+
+- (NSTextStorage *)textStorageWithWidth:(CGFloat)width
+{
+ if (_textStorage && width == _textStorageWidth) {
+ return _textStorage;
+ }
+
+ NSLayoutManager *layoutManager = [NSLayoutManager new];
+
+ // build AttributeString
+ NSAttributedString *attributedString = [self buildAttributeString];
+
+ NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:attributedString];
+ [textStorage addLayoutManager:layoutManager];
+
+ NSTextContainer *textContainer = [NSTextContainer new];
+ textContainer.lineFragmentPadding = 0.0;
+
+ textContainer.lineBreakMode = NSLineBreakByClipping;
+ if (_textOverflow && [_textOverflow length] > 0) {
+ if ([_textOverflow isEqualToString:@"ellipsis"])
+ textContainer.lineBreakMode = NSLineBreakByTruncatingTail;
+ }
+
+ textContainer.maximumNumberOfLines = _lines > 0 ? _lines : 0;
+ textContainer.size = (CGSize){isnan(width) ? CGFLOAT_MAX : width, CGFLOAT_MAX};
+
+ [layoutManager addTextContainer:textContainer];
+ [layoutManager ensureLayoutForTextContainer:textContainer];
+
+ _textStorageWidth = width;
+ _textStorage = textStorage;
+
+ return textStorage;
+}
+
+- (void)_calculatedFrameDidChange
+{
+ [super _calculatedFrameDidChange];
+
+ CGFloat width = self.calculatedFrame.size.width - (_padding.left + _padding.right);
+ _textStorage = [self textStorageWithWidth:width];
+}
+
+- (void)_updateStylesOnComponentThread:(NSDictionary *)styles
+{
+ [super _updateStylesOnComponentThread:styles];
+
+ [self fillCSSStyles:styles];
+
+ if (!_textStorage) {
+ CGFloat width = self.calculatedFrame.size.width - (_padding.left + _padding.right);
+ _textStorage = [self textStorageWithWidth:width];
+ }
+}
+
+- (void)_updateAttributesOnComponentThread:(NSDictionary *)attributes
+{
+ [super _updateAttributesOnComponentThread:attributes];
+
+ [self fillAttributes:attributes];
+
+ if (!_textStorage) {
+ CGFloat width = self.calculatedFrame.size.width - (_padding.left + _padding.right);
+ _textStorage = [self textStorageWithWidth:width];
+ }
+}
+
+#ifdef UITEST
+- (NSString *)description
+{
+ return super.description;
+}
+#endif
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.h
new file mode 100644
index 0000000..2371426
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+#import "WXTextComponentProtocol.h"
+
+@interface WXTextInputComponent : WXComponent<WXTextComponentProtocol, UITextFieldDelegate>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m
new file mode 100644
index 0000000..c78af61
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m
@@ -0,0 +1,385 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXTextInputComponent.h"
+#import "WXConvert.h"
+#import "WXUtility.h"
+
+@interface WXTextInputView : UITextField
+@property (nonatomic, assign) UIEdgeInsets border;
+@property (nonatomic, assign) UIEdgeInsets padding;
+@end
+
+@implementation WXTextInputView
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ _padding = UIEdgeInsetsZero;
+ _border = UIEdgeInsetsZero;
+ }
+ return self;
+}
+
+- (CGRect)textRectForBounds:(CGRect)bounds
+{
+ bounds.size.width -= self.padding.left + self.border.left;
+ bounds.origin.x += self.padding.left + self.border.left;
+
+ bounds.size.height -= self.padding.top + self.border.top;
+ bounds.origin.y += self.padding.top + self.border.top;
+
+ bounds.size.width -= self.padding.right + self.border.right;
+
+ bounds.size.height -= self.padding.bottom + self.border.bottom;
+
+ return bounds;
+}
+
+- (CGRect)editingRectForBounds:(CGRect)bounds
+{
+ return [self textRectForBounds:bounds];
+}
+@end
+
+@interface WXTextInputComponent()
+
+@property (nonatomic, strong) WXTextInputView *inputView;
+//attribute
+@property (nonatomic, strong) UIColor *placeholderColor;
+@property (nonatomic, strong) NSString *placeholder;
+//style
+@property (nonatomic) WXPixelType fontSize;
+@property (nonatomic) WXTextStyle fontStyle;
+@property (nonatomic) WXTextWeight fontWeight;
+@property (nonatomic, strong) NSString *fontFamily;
+//event
+@property (nonatomic) BOOL inputEvent;
+@property (nonatomic) BOOL focusEvent;
+@property (nonatomic) BOOL blurEvent;
+@property (nonatomic) BOOL changeEvent;
+@property (nonatomic, strong) NSString *changeEventString;
+
+@end
+
+@implementation WXTextInputComponent
+{
+ UIEdgeInsets _border;
+ UIEdgeInsets _padding;
+ NSTextStorage* _textStorage;
+}
+
+@synthesize border = _border;
+@synthesize padding = _padding;
+@synthesize textStorage = _textStorage;
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ _inputEvent = NO;
+ _focusEvent = NO;
+ _blurEvent = NO;
+ _changeEvent = NO;
+
+ _inputView = [[WXTextInputView alloc] init];
+ if (attributes[@"type"]) {
+ [self setType: attributes[@"type"]];
+ }
+
+ if (attributes[@"autofocus"]) {
+ [self setAutofocus:[attributes[@"autofocus"] boolValue]];
+ }
+ if (attributes[@"disabled"]) {
+ [_inputView setEnabled:[attributes[@"disabled"] boolValue]];
+ }
+ if (attributes[@"placeholder"]) {
+ _placeholder = attributes[@"placeholder"];
+ _inputView.placeholder = _placeholder;
+ } else {
+ _placeholder = @"";
+ }
+ if (attributes[@"value"]) {
+ _inputView.text = attributes[@"value"];
+ }
+
+ if (styles[@"color"]) {
+ [_inputView setTextColor:[WXConvert UIColor:styles[@"color"]]];
+ }
+ if (styles[@"fontSize"]) {
+ _fontSize = [WXConvert WXPixelType:styles[@"fontSize"]];
+ }
+ if (styles[@"fontWeight"]) {
+ _fontWeight = [WXConvert WXTextWeight:styles[@"fontWeight"]];
+ }
+ if (styles[@"fontStyle"]) {
+ _fontStyle = [WXConvert WXTextStyle:styles[@"fontStyle"]];
+ }
+ if (styles[@"fontFamily"]) {
+ _fontFamily = styles[@"fontFamily"];
+ }
+ if (styles[@"textAlign"]) {
+ [_inputView setTextAlignment:[WXConvert NSTextAlignment:styles[@"textAlign"]]] ;
+ }
+
+ if (styles[@"placeholderColor"]) {
+ _placeholderColor = [WXConvert UIColor:styles[@"placeholderColor"]];
+ }else {
+ _placeholderColor = [UIColor colorWithRed:0x99/255.0 green:0x99/255.0 blue:0x99/255.0 alpha:1.0];
+ }
+ [self setPlaceholderAttributedString];
+ [self setTextFont];
+
+ UIEdgeInsets padding = UIEdgeInsetsMake(self.cssNode->style.padding[CSS_TOP], self.cssNode->style.padding[CSS_LEFT], self.cssNode->style.padding[CSS_BOTTOM], self.cssNode->style.padding[CSS_RIGHT]);
+ if (!UIEdgeInsetsEqualToEdgeInsets(padding, _padding)) {
+ [self setPadding:padding];
+ }
+ UIEdgeInsets border = UIEdgeInsetsMake(self.cssNode->style.border[CSS_TOP], self.cssNode->style.border[CSS_LEFT], self.cssNode->style.border[CSS_BOTTOM], self.cssNode->style.border[CSS_RIGHT]);
+ if (!UIEdgeInsetsEqualToEdgeInsets(border, _border)) {
+ [self setBorder:border];
+ }
+ }
+
+ return self;
+}
+
+-(UIView *)loadView
+{
+ return _inputView;
+}
+
+#pragma mark - lifeCircle
+
+- (void)viewDidLoad
+{
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFiledEditChanged:)
+ name:UITextFieldTextDidChangeNotification
+ object:_inputView];
+ _padding = UIEdgeInsetsZero;
+ _border = UIEdgeInsetsZero;
+ _inputView.delegate = self;
+
+ UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(closeKeyboard)];
+ UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
+ UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 0, 44)];
+ toolbar.items = [NSArray arrayWithObjects:space, barButton, nil];
+
+ _inputView.inputAccessoryView = toolbar;
+}
+
+- (void)viewWillUnload
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextFieldTextDidChangeNotification object:_inputView];
+}
+
+#pragma mark - Add Event
+- (void)addEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"input"]) {
+ _inputEvent = YES;
+ }
+ if ([eventName isEqualToString:@"focus"]) {
+ _focusEvent = YES;
+ }
+ if ([eventName isEqualToString:@"blur"]) {
+ _blurEvent = YES;
+ }
+ if ([eventName isEqualToString:@"change"]) {
+ _changeEvent = YES;
+ }
+}
+
+#pragma Remove Event
+
+-(void)removeEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"input"]) {
+ _inputEvent = NO;
+ }
+ if ([eventName isEqualToString:@"focus"]) {
+ _focusEvent = NO;
+ }
+ if ([eventName isEqualToString:@"blur"]) {
+ _blurEvent = NO;
+ }
+ if ([eventName isEqualToString:@"change"]) {
+ _changeEvent = NO;
+ }
+}
+
+#pragma mark - upate attributes
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"type"]) {
+ [self setType: attributes[@"type"]];
+ }
+ if (attributes[@"autofocus"]) {
+ [self setAutofocus:[attributes[@"autofocus"] boolValue]];
+ }
+ if (attributes[@"disabled"]) {
+ [_inputView setEnabled:[attributes[@"disabled"] boolValue]];
+ }
+ if (attributes[@"placeholder"]) {
+ _placeholder = attributes[@"placeholder"];
+ _inputView.placeholder = _placeholder;
+ }
+ if (attributes[@"value"]) {
+ _inputView.text = attributes[@"value"];
+ }
+
+ [self setPlaceholderAttributedString];
+}
+
+#pragma mark - upate styles
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+ if (styles[@"color"]) {
+ [_inputView setTextColor:[WXConvert UIColor:styles[@"color"]]];
+ }
+ if (styles[@"fontSize"]) {
+ _fontSize = [WXConvert WXPixelType:styles[@"fontSize"]];
+ }
+ if (styles[@"fontWeight"]) {
+ _fontWeight = [WXConvert WXTextWeight:styles[@"fontWeight"]];
+ }
+ if (styles[@"fontStyle"]) {
+ _fontStyle = [WXConvert WXTextStyle:styles[@"fontStyle"]];
+ }
+ if (styles[@"fontFamily"]) {
+ _fontFamily = styles[@"fontFamily"];
+ }
+ if (styles[@"textAlign"]) {
+ [_inputView setTextAlignment:[WXConvert NSTextAlignment:styles[@"textAlign"]]] ;
+ }
+ if (styles[@"placeholderColor"]) {
+ _placeholderColor = [WXConvert UIColor:styles[@"placeholderColor"]];
+ }else {
+ _placeholderColor = [UIColor colorWithRed:0x99/255.0 green:0x99/255.0 blue:0x99/255.0 alpha:1.0];
+ }
+ [self setPlaceholderAttributedString];
+
+ UIEdgeInsets padding = UIEdgeInsetsMake(self.cssNode->style.padding[CSS_TOP], self.cssNode->style.padding[CSS_LEFT], self.cssNode->style.padding[CSS_BOTTOM], self.cssNode->style.padding[CSS_RIGHT]);
+ if (!UIEdgeInsetsEqualToEdgeInsets(padding, _padding)) {
+ [self setPadding:padding];
+ }
+
+ UIEdgeInsets border = UIEdgeInsetsMake(self.cssNode->style.border[CSS_TOP], self.cssNode->style.border[CSS_LEFT], self.cssNode->style.border[CSS_BOTTOM], self.cssNode->style.border[CSS_RIGHT]);
+ if (!UIEdgeInsetsEqualToEdgeInsets(border, _border)) {
+ [self setBorder:border];
+ }
+}
+
+#pragma mark -
+#pragma mark UITextFieldDelegate
+
+- (void)textFieldDidBeginEditing:(UITextField *)textField
+{
+ _changeEventString = [textField text];
+ if (_focusEvent) {
+ [self fireEvent:@"focus" params:nil];
+ }
+}
+
+- (void)textFieldDidEndEditing:(UITextField *)textField
+{
+ if (_changeEvent) {
+ if (![[textField text] isEqualToString:_changeEventString]) {
+ [self fireEvent:@"change" params:@{@"value":[textField text]}];
+ }
+ }
+ if (_blurEvent) {
+ [self fireEvent:@"blur" params:nil];
+ }
+}
+
+- (void)textFiledEditChanged:(NSNotification *)notifi{
+ if (_inputEvent) {
+ UITextField *textField = (UITextField *)notifi.object;
+ [self fireEvent:@"input" params:@{@"value":textField.text}];
+ }
+}
+
+#pragma mark
+
+- (void)setPlaceholderAttributedString
+{
+ if (_placeholderColor) {
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:_placeholder];
+ [attributedString addAttribute:NSForegroundColorAttributeName value:_placeholderColor range:NSMakeRange(0, _placeholder.length)];
+ [_inputView setAttributedPlaceholder:attributedString];
+ }
+}
+
+- (void)setTextFont
+{
+ UIFont *font = [WXUtility fontWithSize:_fontSize textWeight:_fontWeight textStyle:_fontStyle fontFamily:_fontFamily];
+ [_inputView setFont:font];
+}
+
+- (void)setAutofocus:(BOOL)b
+{
+ if (b) {
+ [_inputView becomeFirstResponder];
+ }
+ else {
+ [_inputView resignFirstResponder];
+ }
+}
+
+- (void)setType:(NSString*)type
+{
+ [_inputView setKeyboardType:UIKeyboardTypeDefault];
+ [_inputView setSecureTextEntry:NO];
+
+ if ([type isEqualToString:@"text"]) {
+ [_inputView setKeyboardType:UIKeyboardTypeDefault];
+ }
+ else if ([type isEqualToString:@"password"]) {
+ [_inputView setSecureTextEntry:YES];
+ }
+ else if ([type isEqualToString:@"tel"]) {
+ [_inputView setKeyboardType:UIKeyboardTypePhonePad];
+ }
+ else if ([type isEqualToString:@"email"]) {
+ [_inputView setKeyboardType:UIKeyboardTypeEmailAddress];
+ }
+ else if ([type isEqualToString:@"url"]) {
+ [_inputView setKeyboardType:UIKeyboardTypeURL];
+ }
+ else if ([type isEqualToString:@"date"]) {
+ [_inputView setKeyboardType:UIKeyboardTypeNumberPad];
+ }
+ else if ([type isEqualToString:@"time"]) {
+ [_inputView setKeyboardType:UIKeyboardTypeNumberPad];
+ }
+ else if ([type isEqualToString:@"datetime"]) {
+ [_inputView setKeyboardType:UIKeyboardTypeNumberPad];
+ }
+}
+
+- (void)setPadding:(UIEdgeInsets)padding
+{
+ _padding = padding;
+ [_inputView setPadding:padding];
+}
+
+- (void)setBorder:(UIEdgeInsets)border
+{
+ _border = border;
+ [_inputView setBorder:border];
+}
+
+- (void)closeKeyboard
+{
+ [_inputView resignFirstResponder];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXTransform.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTransform.h b/ios/sdk/WeexSDK/Sources/Component/WXTransform.h
new file mode 100644
index 0000000..b83f4ef
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTransform.h
@@ -0,0 +1,20 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@interface WXTransform : NSObject
+
+@property CGAffineTransform transform;
+
+- (CATransform3D)getTransform:(NSString *)cssValue;
+- (CATransform3D)getTransform:(NSString *)cssValue withView:(UIView *)view;
+- (CATransform3D)getTransform:(NSString *)cssValue withView:(UIView *)view withOrigin:(NSString *)origin;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXTransform.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTransform.m b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m
new file mode 100644
index 0000000..debae37
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m
@@ -0,0 +1,216 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXTransform.h"
+#import "math.h"
+#import "WXUtility.h"
+
+@interface WXTransform()
+
+@property (nonatomic, weak) UIView *view;
+
+@end
+
+@implementation WXTransform
+
+- (CATransform3D)getTransform:(NSString *)cssValue
+{
+ _transform = CGAffineTransformIdentity;
+
+ if (!cssValue || cssValue.length == 0 || [cssValue isEqualToString:@"none"]) {
+ return CATransform3DMakeAffineTransform(_transform);
+ }
+ NSError *error = NULL;
+ NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(\\w+)\\((.+?)\\)"
+ options:NSRegularExpressionCaseInsensitive
+ error:&error];
+
+ NSArray *matches = [regex matchesInString:cssValue options:0 range:NSMakeRange(0, cssValue.length)];
+
+ for (NSTextCheckingResult *match in matches) {
+ NSString *name = [cssValue substringWithRange:[match rangeAtIndex:1]];
+ NSArray *value = [[cssValue substringWithRange:[match rangeAtIndex:2]] componentsSeparatedByString:@","];
+
+ SEL method = NSSelectorFromString([NSString stringWithFormat:@"do%@:", [name capitalizedString]]);
+ if ([self respondsToSelector:method]) {
+ @try {
+ [self performSelectorOnMainThread:method withObject:value waitUntilDone:YES];
+ }
+ @catch (NSException *exception) {
+ WXLogError(@"WXTransform exception:%@", [exception reason]);
+ }
+ }
+ }
+
+ return CATransform3DMakeAffineTransform(_transform);
+}
+
+- (CATransform3D)getTransform:(NSString *)cssValue withView:(UIView *)view
+{
+ _view = view;
+ CATransform3D transform = [self getTransform:cssValue];
+ _view = nil;
+ return transform;
+}
+
+- (CATransform3D)getTransform:(NSString *)cssValue withView:(UIView *)view withOrigin:(NSString *)origin
+{
+ if (origin && origin.length > 0 && ![origin isEqualToString:@"none"]) {
+ CGPoint originPoint = [self getTransformOrigin:origin withView:view];
+ if (originPoint.x != 0 || originPoint.y != 0) {
+ cssValue = [NSString stringWithFormat:@"translate(%f,%f) %@ translate(%f,%f)", originPoint.x, originPoint.y, cssValue, -originPoint.x, -originPoint.y];
+ }
+ }
+
+ return [self getTransform:cssValue withView:view];
+}
+
+- (CGPoint)getTransformOrigin:(NSString *)cssValue withView:(UIView *)view
+{
+ NSArray *values = [cssValue componentsSeparatedByString:@" "];
+ double width = view.bounds.size.width;
+ double height = view.bounds.size.height;
+ double x = width / 2;
+ double y = height / 2;
+
+ for (NSInteger i = 0; i < values.count; i++) {
+ NSString *value = values[i];
+ if ([value isEqualToString:@"left"]) {
+ x = 0;
+ } else if ([value isEqualToString:@"right"]) {
+ x = width;
+ } else if ([value isEqualToString:@"top"]) {
+ y = 0;
+ } else if ([value isEqualToString:@"bottom"]) {
+ y = height;
+ } else if ([value isEqualToString:@"center"]) {
+ if (i == 0) {
+ x = width / 2;
+ } else {
+ y = height / 2;
+ }
+ } else {
+ double val = [value doubleValue];
+ if (i == 0) {
+ if ([value hasSuffix:@"%"]) {
+ val *= width / 100;
+ } else {
+ val = WXPixelResize(val);
+ }
+ x = val;
+ } else {
+ if ([value hasSuffix:@"%"]) {
+ val *= height / 100;
+ } else {
+ val = WXPixelResize(val);
+ }
+ y = val;
+ }
+ }
+ }
+ x -= width / 2.0;
+ y -= height / 2.0;
+ return CGPointMake(round(x / WXScreenResizeRadio()), round(y / WXScreenResizeRadio()));
+}
+
+// Angle in radians
+- (double)getAngle:(NSString *)value
+{
+ double angle = [value doubleValue];
+ if ([value hasSuffix:@"deg"]) {
+ angle *= M_PI / 180;
+ }
+ return angle;
+}
+
+// css transfrom
+- (void)doTranslate:(NSArray *)value
+{
+ double x = [value[0] doubleValue];
+ if ([value[0] hasSuffix:@"%"] && _view) {
+ x *= _view.bounds.size.width / 100;
+ } else {
+ x = WXPixelResize(x);
+ }
+
+ double y = 0;
+
+ if (value.count > 1) {
+ y = [value[1] doubleValue];
+ if ([value[0] hasSuffix:@"%"] && _view) {
+ y *= _view.bounds.size.height / 100;
+ } else {
+ y = WXPixelResize(y);
+ }
+ }
+ _transform = CGAffineTransformTranslate(_transform, x, y);
+}
+
+- (void)doTranslatex:(NSArray *)value
+{
+ [self doTranslate:@[value[0], @"0"]];
+}
+
+- (void)doTranslatey:(NSArray *)value
+{
+ [self doTranslate:@[@"0", value[0]]];
+}
+
+- (void)doRotate:(NSArray *)value
+{
+ _transform = CGAffineTransformRotate(_transform, [self getAngle:value[0]]);
+}
+
+- (void)doScale:(NSArray *)value
+{
+ double x = [value[0] doubleValue];
+ double y = x;
+ if (value.count == 2) {
+ y = [value[1] doubleValue];
+ }
+ _transform = CGAffineTransformScale(_transform, x, y);
+}
+
+- (void)doScalex:(NSArray *)value
+{
+ [self doScale:@[value[0], @1]];
+}
+
+- (void)doScaley:(NSArray *)value
+{
+ [self doScale:@[@1, value[0]]];
+}
+
+- (void)doSkew:(NSArray *)value
+{
+ CGAffineTransform skew = CGAffineTransformIdentity;
+ skew.c = tan([self getAngle:value[0]]);
+ if (value.count == 2) {
+ skew.b = tan([self getAngle:value[1]]);
+ }
+ _transform = CGAffineTransformConcat(skew, _transform);
+}
+
+- (void)doSkewx:(NSArray *)value
+{
+ [self doSkew:@[value[0], @0]];
+}
+
+- (void)doSkewy:(NSArray *)value
+{
+ [self doSkew:@[@0, value[0]]];
+}
+
+- (void)doMatrix:(NSArray *) value
+{
+ if (value.count < 6) return;
+
+ _transform = CGAffineTransformConcat(CGAffineTransformMake([value[0] doubleValue], [value[1] doubleValue], [value[2] doubleValue], [value[3] doubleValue], [value[4] doubleValue], [value[5] doubleValue]), _transform);
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.h
new file mode 100644
index 0000000..3f61da8
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.h
@@ -0,0 +1,34 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+typedef NS_ENUM(NSInteger, WXPlaybackState) {
+ WXPlaybackStatePlaying,
+ WXPlaybackStatePaused,
+ // WXPlaybackStateStopped,
+ WXPlaybackStatePlayFinish,
+ WXPlaybackStateFailed,
+};
+
+@interface WXVideoView : UIView
+
+@property (nonatomic, copy) void (^playbackStateChanged)(WXPlaybackState state);
+
+- (void) setURL:(NSURL*)URL;
+
+- (void) play;
+- (void) pause;
+
+@end
+
+@interface WXVideoComponent : WXComponent
+
+@end
+
+
[48/50] [abbrv] incubator-weex git commit: * [ios] fix scan qrcode
after back from scan result failed
Posted by ji...@apache.org.
* [ios] fix scan qrcode after back from scan result failed
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0b308aab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0b308aab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0b308aab
Branch: refs/heads/master
Commit: 0b308aabe80d65b6fc41ed4e0be6161672527b29
Parents: 82a79d1
Author: acton393 <zh...@gmail.com>
Authored: Mon Jun 13 16:21:13 2016 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jun 13 16:21:13 2016 +0800
----------------------------------------------------------------------
ios/playground/WeexDemo/Scanner/WXScannerVC.m | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0b308aab/ios/playground/WeexDemo/Scanner/WXScannerVC.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Scanner/WXScannerVC.m b/ios/playground/WeexDemo/Scanner/WXScannerVC.m
index fcf5e60..a29e1b7 100644
--- a/ios/playground/WeexDemo/Scanner/WXScannerVC.m
+++ b/ios/playground/WeexDemo/Scanner/WXScannerVC.m
@@ -72,13 +72,10 @@
{
[_captureLayer removeFromSuperlayer];
[_session stopRunning];
- if (!_opened) {
- AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
- _opened = YES;
- if (metadataObjects.count > 0) {
- AVMetadataMachineReadableCodeObject * metadataObject = [metadataObjects objectAtIndex : 0 ];
- [self openURL:metadataObject.stringValue];
- }
+ AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
+ if (metadataObjects.count > 0) {
+ AVMetadataMachineReadableCodeObject * metadataObject = [metadataObjects objectAtIndex : 0 ];
+ [self openURL:metadataObject.stringValue];
}
}
[38/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/tabbar/tabbar-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/tabbar/tabbar-demo.js b/ios/playground/bundlejs/component/tabbar/tabbar-demo.js
new file mode 100644
index 0000000..b4712ad
--- /dev/null
+++ b/ios/playground/bundlejs/component/tabbar/tabbar-demo.js
@@ -0,0 +1,1273 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/8171da60761d834e0f458ec0bbd001b6", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ dir: 'examples',
+ tabItems: [
+ {
+ index: 0,
+ title: 'tab1',
+ titleColor: '#000000',
+ icon: '',
+ image: 'http://gtms01.alicdn.com/tps/i1/TB1qw.hMpXXXXagXXXX9t7RGVXX-46-46.png',
+ selectedImage: 'http://gtms04.alicdn.com/tps/i4/TB16jjPMpXXXXazXVXX9t7RGVXX-46-46.png',
+ src: 'component/tabbar/tabbar-item.js?itemId=tab1',
+ visibility: 'visible',
+ },
+ {
+ index: 1,
+ title: 'tab2',
+ titleColor: '#000000',
+ icon: '',
+ image: 'http://gtms03.alicdn.com/tps/i3/TB1LEn9MpXXXXaUXpXX9t7RGVXX-46-46.png',
+ selectedImage: 'http://gtms02.alicdn.com/tps/i2/TB1qysbMpXXXXcnXXXX9t7RGVXX-46-46.png',
+ src: 'component/tabbar/tabbar-item.js?itemId=tab2',
+ visibility: 'hidden',
+ },
+ {
+ index: 2,
+ title: 'tab3',
+ titleColor: '#000000',
+ icon: '',
+ image: 'http://gtms01.alicdn.com/tps/i1/TB1B0v5MpXXXXcvXpXX9t7RGVXX-46-46.png',
+ selectedImage: 'http://gtms04.alicdn.com/tps/i4/TB1NxY5MpXXXXcrXpXX9t7RGVXX-46-46.png',
+ src: 'component/tabbar/tabbar-item.js?itemId=tab3',
+ visibility: 'hidden',
+ }
+ ],
+ }},
+ created: function() {
+ var bundleUrl = this.$getConfig().bundleUrl;
+ console.log('hit', bundleUrl);
+ var nativeBase;
+ var isAndroidAssets = bundleUrl.indexOf('file://assets/') >= 0;
+ var isiOSAssets = bundleUrl.indexOf('file:///') >= 0 && bundleUrl.indexOf('.app') > 0;
+ if (isAndroidAssets) {
+ nativeBase = 'file://assets/';
+ }
+ else if (isiOSAssets) {
+ // file:///var/mobile/Containers/Bundle/Application/{id}/WeexDemo.app/
+ // file:///Users/{user}/Library/Developer/CoreSimulator/Devices/{id}/data/Containers/Bundle/Application/{id}/WeexDemo.app/
+ nativeBase = bundleUrl.substring(0, bundleUrl.indexOf('.app') + 4) + '/bundlejs/'
+ }
+ else {
+ var host = 'localhost:12580';
+ var matches = /\/\/([^\/]+?)\//.exec(this.$getConfig().bundleUrl);
+ if (matches && matches.length >= 2) {
+ host = matches[1];
+ }
+ nativeBase = 'http://' + host + '/' + this.dir + '/build/';
+ }
+ var h5Base = './' + this.dir + '/build/';
+ // in Native
+ var base = nativeBase;
+ if (typeof window === 'object') {
+ // in Browser or WebView
+ base = h5Base;
+ }
+
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ tabItem.src = base + tabItem.src;
+ }
+ // see log in Android Logcat
+ //if (this.items.length) console.log('hit', this.items[0].url);
+ },
+ methods: {
+ ready: function (e) {
+ var vm = this;
+ vm.$on('tabBar.onClick',function(e){
+ var detail= e.detail;
+ nativeLog('tabBar.onClick ' + detail.index);
+ });
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "flexDirection": "column"
+ },
+ "children": [
+ {
+ "type": "wxc-tabbar",
+ "attr": {
+ "tabItems": function () {return this.tabItems}
+ }
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/8171da60761d834e0f458ec0bbd001b6", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/tabbar/tabbar-item.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/tabbar/tabbar-item.js b/ios/playground/bundlejs/component/tabbar/tabbar-item.js
new file mode 100644
index 0000000..172ab89
--- /dev/null
+++ b/ios/playground/bundlejs/component/tabbar/tabbar-item.js
@@ -0,0 +1,117 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/9cd4432e3a919041a45a2f5ff1c34dd8", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ color: '#ff0000',
+ text: '',
+ }},
+ created: function() {
+ var bundleUrl = this.$getConfig().bundleUrl;
+ nativeLog('bundleUrl = ' + bundleUrl);
+
+ if (bundleUrl.indexOf("tab1") > 0){
+ this.color = '#ff0000';
+ this.text = 'This is Tab 1 Test.';
+ }
+ else if (bundleUrl.indexOf("tab2") > 0){
+ this.color = '#00ff00';
+ this.text = 'This is Tab 2 Test.';
+ }
+ else if (bundleUrl.indexOf("tab3") > 0){
+ this.color = '#0000ff';
+ this.text = 'This is Tab 3 Test.';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "text"
+ ],
+ "style": {
+ "color": function () {return this.color}
+ },
+ "attr": {
+ "value": function () {return this.text}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center"
+ },
+ "text": {
+ "fontSize": 60,
+ "fontWeight": "bold",
+ "fontFamily": "\"Open Sans\", sans-serif"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/9cd4432e3a919041a45a2f5ff1c34dd8", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/text-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/text-demo.js b/ios/playground/bundlejs/component/text-demo.js
new file mode 100644
index 0000000..d3d432a
--- /dev/null
+++ b/ios/playground/bundlejs/component/text-demo.js
@@ -0,0 +1,1515 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/acbcc49ffd4d5464fd2f1890ceb0b99a", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "color",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "attr": {
+ "value": "default is black"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "color": "#286090"
+ },
+ "attr": {
+ "value": "#286090"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "color": "#00ff00"
+ },
+ "attr": {
+ "value": "#0f0"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "color": "#FF0000"
+ },
+ "attr": {
+ "value": "keyword"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "color": "rgb(238,162,54)"
+ },
+ "attr": {
+ "value": "rgb(238, 162, 54)"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "color": "rgba(238,162,54,0.5)"
+ },
+ "attr": {
+ "value": "rgba(238, 162, 54, 0.5)"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "font-size",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "fontSize": 32
+ },
+ "attr": {
+ "value": "32"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "fontSize": 64
+ },
+ "attr": {
+ "value": "64"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "fontSize": 100
+ },
+ "attr": {
+ "value": "100"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "font-style",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "fontStyle": "normal"
+ },
+ "attr": {
+ "value": "normal"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "fontStyle": "italic"
+ },
+ "attr": {
+ "value": "italic"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "font-weight",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "fontWeight": "normal"
+ },
+ "attr": {
+ "value": "normal"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "fontWeight": "bold"
+ },
+ "attr": {
+ "value": "bold"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "text-decoration",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textDecoration": "none"
+ },
+ "attr": {
+ "value": "none"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textDecoration": "underline"
+ },
+ "attr": {
+ "value": "underline"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textDecoration": "line-through"
+ },
+ "attr": {
+ "value": "line-through"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "text-align",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textAlign": "left"
+ },
+ "attr": {
+ "value": "left"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textAlign": "center"
+ },
+ "attr": {
+ "value": "center"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textAlign": "right"
+ },
+ "attr": {
+ "value": "right"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "text-overflow",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "lines": 1
+ },
+ "attr": {
+ "value": "no text-overflow, no text-overflow"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textOverflow": "clip",
+ "width": 450,
+ "lines": 1
+ },
+ "attr": {
+ "value": "text-overflow: clip, text-overflow: clip"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "txt"
+ ],
+ "style": {
+ "textOverflow": "ellipsis",
+ "width": 450,
+ "lines": 1
+ },
+ "attr": {
+ "value": "text-overflow: ellipsis, text-overflow: ellipsis"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "txt": {
+ "marginBottom": 12,
+ "fontSize": 40
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/acbcc49ffd4d5464fd2f1890ceb0b99a", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[37/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/video-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/video-demo.js b/ios/playground/bundlejs/component/video-demo.js
new file mode 100644
index 0000000..4113a22
--- /dev/null
+++ b/ios/playground/bundlejs/component/video-demo.js
@@ -0,0 +1,1261 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/53c26ab98d93d19a8f5b6caa2ead1bf1", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ playStatus: 'play'
+ }},
+ methods: {
+ pause: function() {
+ this.playStatus = 'pause'
+ },
+ play: function() {
+ this.playStatus = 'play'
+ },
+ onpause: function() {
+ this.$call('modal', 'toast', {'message': 'video pause'});
+ },
+ onstart: function() {
+ this.$call('modal', 'toast', {'message': 'video start'});
+ },
+ onfinish: function() {
+ this.$call('modal', 'toast', {'message': 'video finish'});
+ },
+ onfail: function() {
+ this.$call('modal', 'toast', {'message': 'video fail'});
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "video",
+ "classList": [
+ "video"
+ ],
+ "events": {
+ "pause": "onpause",
+ "start": "onstart",
+ "finish": "onfinish",
+ "fail": "onfail"
+ },
+ "attr": {
+ "src": "http://g.tbcdn.cn/ali-wireless-h5/res/0.0.6/toy.mp4",
+ "autoPlay": "true",
+ "playStatus": function () {return this.playStatus}
+ }
+ },
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row",
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "Pause"
+ },
+ "events": {
+ "click": "pause"
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "Play",
+ "type": "primary"
+ },
+ "events": {
+ "click": "play"
+ },
+ "style": {
+ "marginLeft": 20
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "video": {
+ "width": 750,
+ "height": 460,
+ "marginBottom": 80
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/53c26ab98d93d19a8f5b6caa2ead1bf1", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/web-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/web-demo.js b/ios/playground/bundlejs/component/web-demo.js
new file mode 100644
index 0000000..7fcc01a
--- /dev/null
+++ b/ios/playground/bundlejs/component/web-demo.js
@@ -0,0 +1,1315 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/b6520c67a801a11e5d9e14eb14d02ec8", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+
+ __weex_module__.exports = {
+ methods: {
+ goback: function() {
+ var $webview = __weex_require__('@weex-module/webview');
+ var webElement = this.$el('webview');
+ $webview.goBack(webElement.ref);
+ },
+ goforward: function() {
+ var $webview = __weex_require__('@weex-module/webview');
+ var webElement = this.$el('webview');
+ $webview.goForward(webElement.ref);
+ },
+ refresh: function() {
+ var $webview = __weex_require__('@weex-module/webview');
+ var webElement = this.$el('webview');
+ $webview.reload(webElement.ref);
+ },
+ startload: function(e) {
+
+ },
+ finishload: function(e) {
+
+ },
+ failload: function(e) {
+
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "toolbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "primary",
+ "size": "small",
+ "value": "back"
+ },
+ "events": {
+ "click": "goback"
+ },
+ "style": {
+ "marginLeft": 30,
+ "width": 210,
+ "marginTop": 5,
+ "marginBottom": 5
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "primary",
+ "size": "small",
+ "value": "forward"
+ },
+ "events": {
+ "click": "goforward"
+ },
+ "style": {
+ "marginLeft": 30,
+ "width": 210,
+ "marginTop": 5,
+ "marginBottom": 5
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "primary",
+ "size": "small",
+ "value": "refresh"
+ },
+ "events": {
+ "click": "refresh"
+ },
+ "style": {
+ "marginLeft": 30,
+ "width": 210,
+ "marginTop": 5,
+ "marginBottom": 5
+ }
+ }
+ ]
+ },
+ {
+ "type": "web",
+ "classList": [
+ "content"
+ ],
+ "id": "webview",
+ "attr": {
+ "src": "https://m.taobao.com/?spm=0.0.0.0&v=0#index"
+ },
+ "events": {
+ "pagestart": "startload",
+ "pagefinish": "finishload",
+ "error": "failload"
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 70
+ },
+ "toolbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 70
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/b6520c67a801a11e5d9e14eb14d02ec8", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/hello.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/hello.js b/ios/playground/bundlejs/hello.js
new file mode 100644
index 0000000..60f1ab0
--- /dev/null
+++ b/ios/playground/bundlejs/hello.js
@@ -0,0 +1,69 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/fbf11910b018341d4b4a270e96ff1a0b", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 100
+ },
+ "attr": {
+ "value": "Hello World."
+ }
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/fbf11910b018341d4b4a270e96ff1a0b", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[19/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Resources/main.js
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Resources/main.js b/ios/sdk/WeexSDK/Resources/main.js
new file mode 100644
index 0000000..c831d73
--- /dev/null
+++ b/ios/sdk/WeexSDK/Resources/main.js
@@ -0,0 +1,4 @@
+ (this.nativeLog||function(s){console.log(s)})("START JS FRAMEWORK: 0.13.10 Build 20160602");(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.p="";return __webpack_require__(0)})([function(module,exports,__webpack_require__){(function(global){"use strict";__webpack_require__(1);var methods=__webpack_require__(70);var _global=global;var registerMethods=_global.registerMethods;registerMethods(methods)}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){(function(global){"use strict";__webpack_require__(2);var _framework=__webpack_require__(44);var framework=_intero
pRequireWildcard(_framework);var _package=__webpack_require__(68);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}var _loop=function _loop(methodName){global[methodName]=function(){var ret=framework[methodName].apply(framework,arguments);if(ret instanceof Error){console.error(ret.toString())}else if(ret instanceof Array){ret.forEach(function(r){if(r instanceof Error){console.error(r.toString())}})}return ret}};for(var methodName in framework){_loop(methodName)}Object.assign(global,{frameworkVersion:_package.version,needTransformerVersion:_package.optionalDependencies["weex-transformer"]});var methods=__webpack_require__(69);var _global=global;var registerMethods=_global.registerMethods;registerMethods(methods)}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){"use s
trict";__webpack_require__(3);__webpack_require__(41);__webpack_require__(42);__webpack_require__(43)},function(module,exports,__webpack_require__){"use strict";__webpack_require__(4)},function(module,exports,__webpack_require__){"use strict";__webpack_require__(5);module.exports=__webpack_require__(8).Object.assign},function(module,exports,__webpack_require__){"use strict";var $export=__webpack_require__(6);$export($export.S+$export.F,"Object",{assign:__webpack_require__(24)})},function(module,exports,__webpack_require__){"use strict";var global=__webpack_require__(7),core=__webpack_require__(8),hide=__webpack_require__(9),redefine=__webpack_require__(19),ctx=__webpack_require__(22),PROTOTYPE="prototype";var $export=function $export(type,name,source){var IS_FORCED=type&$export.F,IS_GLOBAL=type&$export.G,IS_STATIC=type&$export.S,IS_PROTO=type&$export.P,IS_BIND=type&$export.B,target=IS_GLOBAL?global:IS_STATIC?global[name]||(global[name]={}):(global[name]||{})[PROTOTYPE],exports=IS_GL
OBAL?core:core[name]||(core[name]={}),expProto=exports[PROTOTYPE]||(exports[PROTOTYPE]={}),key,own,out,exp;if(IS_GLOBAL)source=name;for(key in source){own=!IS_FORCED&&target&&target[key]!==undefined;out=(own?target:source)[key];exp=IS_BIND&&own?ctx(out,global):IS_PROTO&&typeof out=="function"?ctx(Function.call,out):out;if(target)redefine(target,key,out,type&$export.U);if(exports[key]!=out)hide(exports,key,exp);if(IS_PROTO&&expProto[key]!=out)expProto[key]=out}};global.core=core;$export.F=1;$export.G=2;$export.S=4;$export.P=8;$export.B=16;$export.W=32;$export.U=64;$export.R=128;module.exports=$export},function(module,exports){"use strict";var global=module.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();if(typeof __g=="number")__g=global},function(module,exports){"use strict";var core=module.exports={version:"2.1.5"};if(typeof __e=="number")__e=core},function(module,exports,__webpack_require__){"use
strict";var dP=__webpack_require__(10),createDesc=__webpack_require__(18);module.exports=__webpack_require__(14)?function(object,key,value){return dP.f(object,key,createDesc(1,value))}:function(object,key,value){object[key]=value;return object}},function(module,exports,__webpack_require__){"use strict";var anObject=__webpack_require__(11),IE8_DOM_DEFINE=__webpack_require__(13),toPrimitive=__webpack_require__(17),dP=Object.defineProperty;exports.f=__webpack_require__(14)?Object.defineProperty:function defineProperty(O,P,Attributes){anObject(O);P=toPrimitive(P,true);anObject(Attributes);if(IE8_DOM_DEFINE)try{return dP(O,P,Attributes)}catch(e){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported!");if("value"in Attributes)O[P]=Attributes.value;return O}},function(module,exports,__webpack_require__){"use strict";var isObject=__webpack_require__(12);module.exports=function(it){if(!isObject(it))throw TypeError(it+" is not an object!");return it}},function(m
odule,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};module.exports=function(it){return(typeof it==="undefined"?"undefined":_typeof(it))==="object"?it!==null:typeof it==="function"}},function(module,exports,__webpack_require__){"use strict";module.exports=!__webpack_require__(14)&&!__webpack_require__(15)(function(){return Object.defineProperty(__webpack_require__(16)("div"),"a",{get:function get(){return 7}}).a!=7})},function(module,exports,__webpack_require__){"use strict";module.exports=!__webpack_require__(15)(function(){return Object.defineProperty({},"a",{get:function get(){return 7}}).a!=7})},function(module,exports){"use strict";module.exports=function(exec){try{return!!exec()}catch(e){return true}}},function(module,exports,__webpack_require__){"use strict";var isObject=__webpack_require__(12),do
cument=__webpack_require__(7).document,is=isObject(document)&&isObject(document.createElement);module.exports=function(it){return is?document.createElement(it):{}}},function(module,exports,__webpack_require__){"use strict";var isObject=__webpack_require__(12);module.exports=function(it,S){if(!isObject(it))return it;var fn,val;if(S&&typeof(fn=it.toString)=="function"&&!isObject(val=fn.call(it)))return val;if(typeof(fn=it.valueOf)=="function"&&!isObject(val=fn.call(it)))return val;if(!S&&typeof(fn=it.toString)=="function"&&!isObject(val=fn.call(it)))return val;throw TypeError("Can't convert object to primitive value")}},function(module,exports){"use strict";module.exports=function(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}},function(module,exports,__webpack_require__){"use strict";var global=__webpack_require__(7),hide=__webpack_require__(9),has=__webpack_require__(20),SRC=__webpack_require__(21)("src"),TO_STRING="toString",
$toString=Function[TO_STRING],TPL=(""+$toString).split(TO_STRING);__webpack_require__(8).inspectSource=function(it){return $toString.call(it)};(module.exports=function(O,key,val,safe){var isFunction=typeof val=="function";if(isFunction)has(val,"name")||hide(val,"name",key);if(O[key]===val)return;if(isFunction)has(val,SRC)||hide(val,SRC,O[key]?""+O[key]:TPL.join(String(key)));if(O===global){O[key]=val}else{if(!safe){delete O[key];hide(O,key,val)}else{if(O[key])O[key]=val;else hide(O,key,val)}}})(Function.prototype,TO_STRING,function toString(){return typeof this=="function"&&this[SRC]||$toString.call(this)})},function(module,exports){"use strict";var hasOwnProperty={}.hasOwnProperty;module.exports=function(it,key){return hasOwnProperty.call(it,key)}},function(module,exports){"use strict";var id=0,px=Math.random();module.exports=function(key){return"Symbol(".concat(key===undefined?"":key,")_",(++id+px).toString(36))}},function(module,exports,__webpack_require__){"use strict";var aFunc
tion=__webpack_require__(23);module.exports=function(fn,that,length){aFunction(fn);if(that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},function(module,exports){"use strict";module.exports=function(it){if(typeof it!="function")throw TypeError(it+" is not a function!");return it}},function(module,exports,__webpack_require__){"use strict";var getKeys=__webpack_require__(25),gOPS=__webpack_require__(38),pIE=__webpack_require__(39),toObject=__webpack_require__(40),IObject=__webpack_require__(28),$assign=Object.assign;module.exports=!$assign||__webpack_require__(15)(function(){var A={},B={},S=Symbol(),K="abcdefghijklmnopqrst";A[S]=7;K.split("").forEach(function(k){B[k]=k});return $assign({},A)[S]!=7||Object.keys($assign({},B)).join("")!=K})?function assign(target,source){var T=toObjec
t(target),aLen=arguments.length,index=1,getSymbols=gOPS.f,isEnum=pIE.f;while(aLen>index){var S=IObject(arguments[index++]),keys=getSymbols?getKeys(S).concat(getSymbols(S)):getKeys(S),length=keys.length,j=0,key;while(length>j){if(isEnum.call(S,key=keys[j++]))T[key]=S[key]}}return T}:$assign},function(module,exports,__webpack_require__){"use strict";var $keys=__webpack_require__(26),enumBugKeys=__webpack_require__(37);module.exports=Object.keys||function keys(O){return $keys(O,enumBugKeys)}},function(module,exports,__webpack_require__){"use strict";var has=__webpack_require__(20),toIObject=__webpack_require__(27),arrayIndexOf=__webpack_require__(31)(false),IE_PROTO=__webpack_require__(35)("IE_PROTO");module.exports=function(object,names){var O=toIObject(object),i=0,result=[],key;for(key in O){if(key!=IE_PROTO)has(O,key)&&result.push(key)}while(names.length>i){if(has(O,key=names[i++])){~arrayIndexOf(result,key)||result.push(key)}}return result}},function(module,exports,__webpack_requir
e__){"use strict";var IObject=__webpack_require__(28),defined=__webpack_require__(30);module.exports=function(it){return IObject(defined(it))}},function(module,exports,__webpack_require__){"use strict";var cof=__webpack_require__(29);module.exports=Object("z").propertyIsEnumerable(0)?Object:function(it){return cof(it)=="String"?it.split(""):Object(it)}},function(module,exports){"use strict";var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},function(module,exports){"use strict";module.exports=function(it){if(it==undefined)throw TypeError("Can't call method on "+it);return it}},function(module,exports,__webpack_require__){"use strict";var toIObject=__webpack_require__(27),toLength=__webpack_require__(32),toIndex=__webpack_require__(34);module.exports=function(IS_INCLUDES){return function($this,el,fromIndex){var O=toIObject($this),length=toLength(O.length),index=toIndex(fromIndex,length),value;if(IS_INCLUDES&&el!=el)while(length>index){value=O
[index++];if(value!=value)return true}else for(;length>index;index++){if(IS_INCLUDES||index in O){if(O[index]===el)return IS_INCLUDES||index}}return!IS_INCLUDES&&-1}}},function(module,exports,__webpack_require__){"use strict";var toInteger=__webpack_require__(33),min=Math.min;module.exports=function(it){return it>0?min(toInteger(it),9007199254740991):0}},function(module,exports){"use strict";var ceil=Math.ceil,floor=Math.floor;module.exports=function(it){return isNaN(it=+it)?0:(it>0?floor:ceil)(it)}},function(module,exports,__webpack_require__){"use strict";var toInteger=__webpack_require__(33),max=Math.max,min=Math.min;module.exports=function(index,length){index=toInteger(index);return index<0?max(index+length,0):min(index,length)}},function(module,exports,__webpack_require__){"use strict";var shared=__webpack_require__(36)("keys"),uid=__webpack_require__(21);module.exports=function(key){return shared[key]||(shared[key]=uid(key))}},function(module,exports,__webpack_require__){"use
strict";var global=__webpack_require__(7),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(key){return store[key]||(store[key]={})}},function(module,exports){"use strict";module.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(module,exports){"use strict";exports.f=Object.getOwnPropertySymbols},function(module,exports){"use strict";exports.f={}.propertyIsEnumerable},function(module,exports,__webpack_require__){"use strict";var defined=__webpack_require__(30);module.exports=function(it){return Object(defined(it))}},function(module,exports){(function(global){"use strict";var _global=global;var setTimeout=_global.setTimeout;var setTimeoutNative=_global.setTimeoutNative;if(typeof setTimeout==="undefined"&&typeof setTimeoutNative==="function"){(function(){var timeoutMap={};var timeoutId=0;global.setTimeout=function(cb,time){timeoutMap[++timeoutId]=cb;setTimeoutNative(t
imeoutId.toString(),time)};global.setTimeoutCallback=function(id){if(typeof timeoutMap[id]==="function"){timeoutMap[id]();delete timeoutMap[id]}}})()}}).call(exports,function(){return this}())},function(module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.printlog=printlog;function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}else{return Array.from(arr)}}var _global=global;var console=_global.console;var logLevel=void 0;var LEVEL_MAP={__ERROR:"error",__WARN:"warn",__INFO:"info",__DEBUG:"debug",__VERBOSE:"verbose"};var LEVELS=["error","warn","info","debug","verbose","all"];function normalize(v){var type=Object.prototype.toString.call(v);if(type.toLowerCase()==="[object object]"){v=JSON.stringify(v)}else{v=String(v)}return v}function printlog(){var _global2=global;var WXEnvironment=_global2.WXEnvironment;var nativeLog=_global2.nativeLog;logLevel=
WXEnvironment&&WXEnvironment.logLevel||"info";if(typeof nativeLog==="function"){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var level=args.pop();if(LEVELS.indexOf(LEVEL_MAP[level])<=LEVELS.indexOf(logLevel)){nativeLog.apply(undefined,_toConsumableArray(args.map(function(v){return normalize(v)})).concat([level]))}}}if(typeof console==="undefined"||Object.keys(console).length===0){global.console={log:function log(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}printlog.apply(undefined,args.concat(["__VERBOSE"]))},debug:function debug(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3]}printlog.apply(undefined,args.concat(["__DEBUG"]))},info:function info(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}printlog.apply(undefined,args.concat(["__INFO"]))},war
n:function warn(){for(var _len5=arguments.length,args=Array(_len5),_key5=0;_key5<_len5;_key5++){args[_key5]=arguments[_key5]}printlog.apply(undefined,args.concat(["__WARN"]))},error:function error(){for(var _len6=arguments.length,args=Array(_len6),_key6=0;_key6<_len6;_key6++){args[_key6]=arguments[_key6]}printlog.apply(undefined,args.concat(["__ERROR"]))}}}}).call(exports,function(){return this}())},function(module,exports){(function(global){"use strict";var MSG='Using "Promise" is unexpected';var UnexpectedPromise=function UnexpectedPromise(){console.warn(MSG);this.then=function(){console.warn(MSG)}};UnexpectedPromise.all=UnexpectedPromise.race=UnexpectedPromise.resolve=UnexpectedPromise.reject=function(){console.warn(MSG)};global.Promise=UnexpectedPromise}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbo
l"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};exports.createInstance=createInstance;exports.refreshInstance=refreshInstance;exports.destroyInstance=destroyInstance;exports.registerComponents=registerComponents;exports.registerModules=registerModules;exports.registerMethods=registerMethods;exports.getRoot=getRoot;exports.callJS=callJS;var _config=__webpack_require__(45);var config=_interopRequireWildcard(_config);var _app=__webpack_require__(46);var _app2=_interopRequireDefault(_app);var _vm=__webpack_require__(51);var _vm2=_interopRequireDefault(_vm);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function _toConsumableArray(arr){if
(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}else{return Array.from(arr)}}var nativeComponentMap=config.nativeComponentMap;var instanceMap={};function createInstance(instanceId,code,options,data){var instance=instanceMap[instanceId];options=options||{};config.debug=options.debug;var result;if(!instance){instance=new _app2.default(instanceId,options);instanceMap[instanceId]=instance;result=instance.init(code,data)}else{result=new Error('invalid instance id "'+instanceId+'"')}return result}function refreshInstance(instanceId,data){var instance=instanceMap[instanceId];var result;if(instance){result=instance.refreshData(data)}else{result=new Error('invalid instance id "'+instanceId+'"')}return result}function destroyInstance(instanceId){var instance=instanceMap[instanceId];if(!instance){return new Error('invalid instance id "'+instanceId+'"')}instance.destroy();delete instanceMap[instanceId];return instanceMap}function registerComp
onents(components){if(Array.isArray(components)){components.forEach(function register(name){if(!name){return}if(typeof name==="string"){nativeComponentMap[name]=true}else if((typeof name==="undefined"?"undefined":_typeof(name))==="object"&&typeof name.type==="string"){nativeComponentMap[name.type]=name}})}}function registerModules(modules){if((typeof modules==="undefined"?"undefined":_typeof(modules))==="object"){_vm2.default.registerModules(modules)}}function registerMethods(apis){if((typeof apis==="undefined"?"undefined":_typeof(apis))==="object"){_vm2.default.registerMethods(apis)}}function getRoot(instanceId){var instance=instanceMap[instanceId];var result;if(instance){result=instance.getRootElement()}else{result=new Error('invalid instance id "'+instanceId+'"')}return result}var jsHandlers={fireEvent:function fireEvent(instanceId,ref,type,data,domChanges){var instance=instanceMap[instanceId];var result;result=instance.fireEvent(ref,type,data,domChanges);return result},callback:
function callback(instanceId,funcId,data,ifLast){var instance=instanceMap[instanceId];var result;result=instance.callback(funcId,data,ifLast);return result}};function callJS(instanceId,tasks){var instance=instanceMap[instanceId];var results=[];if(instance&&Array.isArray(tasks)){tasks.forEach(function(task){var handler=jsHandlers[task.method];var args=[].concat(_toConsumableArray(task.args));if(typeof handler==="function"){args.unshift(instanceId);results.push(handler.apply(undefined,_toConsumableArray(args)))}})}else{results.push(new Error('invalid instance id "'+instanceId+'" or tasks'))}return results}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var nativeComponentMap=exports.nativeComponentMap={text:true,image:true,container:true,slider:{type:"slider",append:"tree"},cell:{type:"cell",append:"tree"}};var customComponentMap=exports.customComponentMap={};var debug=exports.debug=false},function(module,exports,__webpack_require__){"u
se strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=AppInstance;var _util=__webpack_require__(47);var _bundle=__webpack_require__(48);var bundle=_interopRequireWildcard(_bundle);var _ctrl=__webpack_require__(63);var ctrl=_interopRequireWildcard(_ctrl);var _differ=__webpack_require__(65);var _differ2=_interopRequireDefault(_differ);var _event=__webpack_require__(66);var _event2=_interopRequireDefault(_event);var _domListener=__webpack_require__(64);var _domListener2=_interopRequireDefault(_domListener);var _dom=__webpack_require__(67);var _register=__webpack_require__(61);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function AppInstance(instanceId,options){var _this=this;this.id=instance
Id;this.options=options||{};this.vm=null;this.doc=new _dom.Document(instanceId,this.options.bundleUrl);this.customComponentMap={};this.callbacks={};this.differ=new _differ2.default(instanceId);this.uid=0;this.rendered=false;this.eventManager=new _event2.default;this.listener=new _domListener2.default(this.id,function(tasks){_this.callTasks(tasks)});this.doc.setEventManager(this.eventManager);this.doc.setListener(this.listener)}function normalize(app,v){var type=(0,_util.typof)(v);switch(type){case"undefined":case"null":return"";case"regexp":return v.toString();case"date":return v.toISOString();case"number":case"string":case"boolean":case"array":case"object":if(v instanceof _dom.Node){return v.ref}return v;case"function":app.callbacks[++app.uid]=v;return app.uid.toString();default:return JSON.stringify(v)}}AppInstance.prototype.callTasks=function(tasks){var _this2=this;if((0,_util.typof)(tasks)!=="array"){tasks=[tasks]}tasks.forEach(function(task){task.args=task.args.map(function(arg
){return normalize(_this2,arg)})});callNative(this.id,tasks,"-1")};(0,_util.extend)(AppInstance.prototype,bundle,ctrl,{registerComponent:_register.registerComponent,requireComponent:_register.requireComponent,requireModule:_register.requireModule})},function(module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};exports.isReserved=isReserved;exports.def=def;exports.remove=remove;exports.hasOwn=hasOwn;exports.cached=cached;exports.bind=bind;exports.toArray=toArray;exports.extend=extend;exports.isObject=isObject;exports.isPlainObject=isPlainObject;exports.stringify=stringify;exports.typof=typof;exports.normalize=normalize;exports.error=error;exports.warn=warn;exports.info=info;exports.debug=debug;exports.log=log;function isReserved(s
tr){var c=(str+"").charCodeAt(0);return c===36||c===95}function def(obj,key,val,enumerable){Object.defineProperty(obj,key,{value:val,enumerable:!!enumerable,writable:true,configurable:true})}var hasProto=exports.hasProto="__proto__"in{};var inBrowser=exports.inBrowser=typeof window!=="undefined"&&Object.prototype.toString.call(window)!=="[object Object]";var devtools=exports.devtools=inBrowser&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;var UA=inBrowser&&window.navigator.userAgent.toLowerCase();var isIos=UA&&/(iphone|ipad|ipod|ios)/i.test(UA);var isWechat=UA&&UA.indexOf("micromessenger")>0;var nextTick=exports.nextTick=function(){var callbacks=[];var pending=false;var timerFunc=void 0;function nextTickHandler(){pending=false;var copies=callbacks.slice(0);callbacks=[];for(var i=0;i<copies.length;i++){copies[i]()}}if(typeof MutationObserver!=="undefined"&&!(isWechat&&isIos)){(function(){var counter=1;var observer=new MutationObserver(nextTickHandler);var textNode=document.createTextNode(coun
ter);observer.observe(textNode,{characterData:true});timerFunc=function timerFunc(){counter=(counter+1)%2;textNode.data=counter}})()}else{var context=inBrowser?window:typeof global!=="undefined"?global:{};timerFunc=context.setImmediate||setTimeout}return function(cb,ctx){var func=ctx?function(){cb.call(ctx)}:cb;callbacks.push(func);if(pending)return;pending=true;timerFunc(nextTickHandler,0)}}();var _Set=void 0;if(typeof Set!=="undefined"&&Set.toString().match(/native code/)){exports._Set=_Set=Set}else{exports._Set=_Set=function _Set(){this.set=Object.create(null)};_Set.prototype.has=function(key){return this.set[key]!==undefined};_Set.prototype.add=function(key){this.set[key]=1};_Set.prototype.clear=function(){this.set=Object.create(null)}}exports._Set=_Set;function remove(arr,item){if(arr.length){var index=arr.indexOf(item);if(index>-1){return arr.splice(index,1)}}}var hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key){return hasOwnProperty.call(obj,key)}functi
on cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str))}}var camelizeRE=/-(\w)/g;var camelize=exports.camelize=cached(function(str){return str.replace(camelizeRE,toUpper)});function toUpper(_,c){return c?c.toUpperCase():""}var hyphenateRE=/([a-z\d])([A-Z])/g;var hyphenate=exports.hyphenate=cached(function(str){return str.replace(hyphenateRE,"$1-$2").toLowerCase()});function bind(fn,ctx){return function(a){var l=arguments.length;return l?l>1?fn.apply(ctx,arguments):fn.call(ctx,a):fn.call(ctx)}}function toArray(list,start){start=start||0;var i=list.length-start;var ret=new Array(i);while(i--){ret[i]=list[i+start]}return ret}function extend(target){for(var _len=arguments.length,src=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){src[_key-1]=arguments[_key]}if(typeof Object.assign==="function"){Object.assign.apply(Object,[target].concat(src))}else{var first=src.shift();for(var key in first){target[key]=first[key]}if(s
rc.length){extend.apply(undefined,[target].concat(src))}}return target}function isObject(obj){return obj!==null&&(typeof obj==="undefined"?"undefined":_typeof(obj))==="object"}var toString=Object.prototype.toString;var OBJECT_STRING="[object Object]";function isPlainObject(obj){return toString.call(obj)===OBJECT_STRING}var isArray=exports.isArray=Array.isArray;function stringify(x){return typeof x==="undefined"||x===null||typeof x==="function"?"":(typeof x==="undefined"?"undefined":_typeof(x))==="object"?x instanceof RegExp?x.toString():x instanceof Date?JSON.parse(JSON.stringify(x)):JSON.stringify(x):x.toString()}function typof(v){var s=Object.prototype.toString.call(v);return s.substring(8,s.length-1).toLowerCase()}function normalize(v){var type=typof(v);switch(type){case"undefined":case"null":return"";case"regexp":return v.toString();case"date":return v.toISOString();case"number":case"string":case"boolean":case"array":case"object":case"function":return v}}var enableLog=typeof con
sole!=="undefined"&&global.IS_PRODUCT!==true;function error(){var _console;for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}enableLog&&console.error&&(_console=console).error.apply(_console,["[JS Framework]"].concat(args))}function warn(){var _console2;for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3]}enableLog&&console.warn&&(_console2=console).warn.apply(_console2,["[JS Framework]"].concat(args))}function info(){var _console3;for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}enableLog&&console.info&&(_console3=console).info.apply(_console3,["[JS Framework]"].concat(args))}function debug(){var _console4;for(var _len5=arguments.length,args=Array(_len5),_key5=0;_key5<_len5;_key5++){args[_key5]=arguments[_key5]}enableLog&&console.debug&&(_console4=console).debug.apply(_console4,["[JS Framework]"].concat(args))}funct
ion log(){var _console5;for(var _len6=arguments.length,args=Array(_len6),_key6=0;_key6<_len6;_key6++){args[_key6]=arguments[_key6]}enableLog&&console.log&&(_console5=console).log.apply(_console5,["[JS Framework]"].concat(args))}}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.require=exports.define=undefined;exports.clearCommonModules=clearCommonModules;exports.bootstrap=bootstrap;exports.register=register;exports.render=render;var _semver=__webpack_require__(49);var _semver2=_interopRequireDefault(_semver);var _util=__webpack_require__(47);var _=_interopRequireWildcard(_util);var _config=__webpack_require__(45);var config=_interopRequireWildcard(_config);var _vm=__webpack_require__(51);var _vm2=_interopRequireDefault(_vm);var _downgrade=__webpack_require__(62);var downgrade=_interopRequireWildcard(_downgrade);function _interopRequireWildcard(obj){i
f(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}var WEEX_COMPONENT_REG=/^\@weex-component\//;var WEEX_MODULE_REG=/^\@weex-module\//;var NORMAL_MODULE_REG=/^\.{1,2}\//;var JS_SURFIX_REG=/\.js$/;var isWeexComponent=function isWeexComponent(name){return!!name.match(WEEX_COMPONENT_REG)};var isWeexModule=function isWeexModule(name){return!!name.match(WEEX_MODULE_REG)};var isNormalModule=function isNormalModule(name){return!!name.match(NORMAL_MODULE_REG)};var isNpmModule=function isNpmModule(name){return!isWeexComponent(name)&&!isWeexModule(name)&&!isNormalModule(name)};function removeWeex
Prefix(str){return str.replace(WEEX_COMPONENT_REG,"").replace(WEEX_MODULE_REG,"")}function removeJSSurfix(str){return str.replace(JS_SURFIX_REG,"")}var commonModules={};function clearCommonModules(){commonModules={}}var define=exports.define=function define(name,deps,factory){var _this=this;_.debug("define a component",name);if(_.typof(deps)==="function"){factory=deps;deps=[]}var _require=function _require(name){var cleanName=void 0;if(isWeexComponent(name)){cleanName=removeWeexPrefix(name);return _this.requireComponent(cleanName)}if(isWeexModule(name)){cleanName=removeWeexPrefix(name);return _this.requireModule(cleanName)}if(isNormalModule(name)){cleanName=removeJSSurfix(name);return commonModules[name]}if(isNpmModule(name)){cleanName=removeJSSurfix(name);return commonModules[name]}};var _module={exports:{}};var cleanName=void 0;if(isWeexComponent(name)){cleanName=removeWeexPrefix(name);factory(_require,_module.exports,_module);this.registerComponent(cleanName,_module.exports)}else
if(isWeexModule(name)){cleanName=removeWeexPrefix(name);factory(_require,_module.exports,_module);_vm2.default.registerModules(_defineProperty({},cleanName,_module.exports))}else if(isNormalModule(name)){cleanName=removeJSSurfix(name);factory(_require,_module.exports,_module);commonModules[cleanName]=_module.exports}else if(isNpmModule(name)){cleanName=removeJSSurfix(name);factory(_require,_module.exports,_module);var exports=_module.exports;if(exports.template||exports.style||exports.methods){this.registerComponent(cleanName,exports)}else{commonModules[cleanName]=_module.exports}}};function bootstrap(name,config,data){_.debug("bootstrap for "+name);var cleanName=void 0;if(isWeexComponent(name)){cleanName=removeWeexPrefix(name)}else if(isNpmModule(name)){cleanName=removeJSSurfix(name);if(!this.customComponentMap[cleanName]){return new Error("It's not a component: "+name)}}else{return new Error("Wrong component name: "+name)}config=_.isPlainObject(config)?config:{};if(typeof config.
transformerVersion==="string"&&typeof global.needTransformerVersion==="string"&&!_semver2.default.satisfies(config.transformerVersion,global.needTransformerVersion)){
+
return new Error("JS Bundle version: "+config.transformerVersion+" "+("not compatible with "+global.needTransformerVersion))}var _checkDowngrade=downgrade.check(config.downgrade);if(_checkDowngrade.isDowngrade){this.callTasks([{module:"instanceWrap",method:"error",args:[_checkDowngrade.errorType,_checkDowngrade.code,_checkDowngrade.errorMessage]}]);return new Error("Downgrade: "+config.downgrade)}this.vm=new _vm2.default(cleanName,null,{_app:this},null,data)}function register(type,options){_.warn("Register is deprecated, please install lastest transformer.");this.registerComponent(type,options)}function render(type,data){_.warn("Render is deprecated, please install laste
st transformer.");return this.bootstrap(type,{},data)}function _require2(type){var _this2=this;_.warn("Require is deprecated, please install lastest transformer.");return function(data){return _this2.bootstrap(type,{},data)}}exports.require=_require2}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){(function(process){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};exports=module.exports=SemVer;var debug;if((typeof process==="undefined"?"undefined":_typeof(process))==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG))debug=function debug(){var args=Array.prototype.slice.call(arguments,0);args.unshift("SEMVER");console.log.apply(console,args)};else debug=function debug(){};exports.SEMVER_SPEC_VERSION="2.0.0";var MAX_LENGTH=256;var MAX_SAF
E_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;var re=exports.re=[];var src=exports.src=[];var R=0;var NUMERICIDENTIFIER=R++;src[NUMERICIDENTIFIER]="0|[1-9]\\d*";var NUMERICIDENTIFIERLOOSE=R++;src[NUMERICIDENTIFIERLOOSE]="[0-9]+";var NONNUMERICIDENTIFIER=R++;src[NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var MAINVERSION=R++;src[MAINVERSION]="("+src[NUMERICIDENTIFIER]+")\\."+"("+src[NUMERICIDENTIFIER]+")\\."+"("+src[NUMERICIDENTIFIER]+")";var MAINVERSIONLOOSE=R++;src[MAINVERSIONLOOSE]="("+src[NUMERICIDENTIFIERLOOSE]+")\\."+"("+src[NUMERICIDENTIFIERLOOSE]+")\\."+"("+src[NUMERICIDENTIFIERLOOSE]+")";var PRERELEASEIDENTIFIER=R++;src[PRERELEASEIDENTIFIER]="(?:"+src[NUMERICIDENTIFIER]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASEIDENTIFIERLOOSE=R++;src[PRERELEASEIDENTIFIERLOOSE]="(?:"+src[NUMERICIDENTIFIERLOOSE]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASE=R++;src[PRERELEASE]="(?:-("+src[PRERELEASEIDENTIFIER]+"(?:\\."+src[PRERELEASEIDENTIFIER]+")*))";var PRERELEASELOOSE
=R++;src[PRERELEASELOOSE]="(?:-?("+src[PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+src[PRERELEASEIDENTIFIERLOOSE]+")*))";var BUILDIDENTIFIER=R++;src[BUILDIDENTIFIER]="[0-9A-Za-z-]+";var BUILD=R++;src[BUILD]="(?:\\+("+src[BUILDIDENTIFIER]+"(?:\\."+src[BUILDIDENTIFIER]+")*))";var FULL=R++;var FULLPLAIN="v?"+src[MAINVERSION]+src[PRERELEASE]+"?"+src[BUILD]+"?";src[FULL]="^"+FULLPLAIN+"$";var LOOSEPLAIN="[v=\\s]*"+src[MAINVERSIONLOOSE]+src[PRERELEASELOOSE]+"?"+src[BUILD]+"?";var LOOSE=R++;src[LOOSE]="^"+LOOSEPLAIN+"$";var GTLT=R++;src[GTLT]="((?:<|>)?=?)";var XRANGEIDENTIFIERLOOSE=R++;src[XRANGEIDENTIFIERLOOSE]=src[NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";var XRANGEIDENTIFIER=R++;src[XRANGEIDENTIFIER]=src[NUMERICIDENTIFIER]+"|x|X|\\*";var XRANGEPLAIN=R++;src[XRANGEPLAIN]="[v=\\s]*("+src[XRANGEIDENTIFIER]+")"+"(?:\\.("+src[XRANGEIDENTIFIER]+")"+"(?:\\.("+src[XRANGEIDENTIFIER]+")"+"(?:"+src[PRERELEASE]+")?"+src[BUILD]+"?"+")?)?";var XRANGEPLAINLOOSE=R++;src[XRANGEPLAINLOOSE]="[v=\\s]*("+src[XRANGEIDENTI
FIERLOOSE]+")"+"(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")"+"(?:"+src[PRERELEASELOOSE]+")?"+src[BUILD]+"?"+")?)?";var XRANGE=R++;src[XRANGE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAIN]+"$";var XRANGELOOSE=R++;src[XRANGELOOSE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAINLOOSE]+"$";var LONETILDE=R++;src[LONETILDE]="(?:~>?)";var TILDETRIM=R++;src[TILDETRIM]="(\\s*)"+src[LONETILDE]+"\\s+";re[TILDETRIM]=new RegExp(src[TILDETRIM],"g");var tildeTrimReplace="$1~";var TILDE=R++;src[TILDE]="^"+src[LONETILDE]+src[XRANGEPLAIN]+"$";var TILDELOOSE=R++;src[TILDELOOSE]="^"+src[LONETILDE]+src[XRANGEPLAINLOOSE]+"$";var LONECARET=R++;src[LONECARET]="(?:\\^)";var CARETTRIM=R++;src[CARETTRIM]="(\\s*)"+src[LONECARET]+"\\s+";re[CARETTRIM]=new RegExp(src[CARETTRIM],"g");var caretTrimReplace="$1^";var CARET=R++;src[CARET]="^"+src[LONECARET]+src[XRANGEPLAIN]+"$";var CARETLOOSE=R++;src[CARETLOOSE]="^"+src[LONECARET]+src[XRANGEPLAINLOOSE]+"$";var COMPARATORLOOSE=R++;src[COMPARATORLOOSE]=
"^"+src[GTLT]+"\\s*("+LOOSEPLAIN+")$|^$";var COMPARATOR=R++;src[COMPARATOR]="^"+src[GTLT]+"\\s*("+FULLPLAIN+")$|^$";var COMPARATORTRIM=R++;src[COMPARATORTRIM]="(\\s*)"+src[GTLT]+"\\s*("+LOOSEPLAIN+"|"+src[XRANGEPLAIN]+")";re[COMPARATORTRIM]=new RegExp(src[COMPARATORTRIM],"g");var comparatorTrimReplace="$1$2$3";var HYPHENRANGE=R++;src[HYPHENRANGE]="^\\s*("+src[XRANGEPLAIN]+")"+"\\s+-\\s+"+"("+src[XRANGEPLAIN]+")"+"\\s*$";var HYPHENRANGELOOSE=R++;src[HYPHENRANGELOOSE]="^\\s*("+src[XRANGEPLAINLOOSE]+")"+"\\s+-\\s+"+"("+src[XRANGEPLAINLOOSE]+")"+"\\s*$";var STAR=R++;src[STAR]="(<|>)?=?\\s*\\*";for(var i=0;i<R;i++){debug(i,src[i]);if(!re[i])re[i]=new RegExp(src[i])}exports.parse=parse;function parse(version,loose){if(version instanceof SemVer)return version;if(typeof version!=="string")return null;if(version.length>MAX_LENGTH)return null;var r=loose?re[LOOSE]:re[FULL];if(!r.test(version))return null;try{return new SemVer(version,loose)}catch(er){return null}}exports.valid=valid;function
valid(version,loose){var v=parse(version,loose);return v?v.version:null}exports.clean=clean;function clean(version,loose){var s=parse(version.trim().replace(/^[=v]+/,""),loose);return s?s.version:null}exports.SemVer=SemVer;function SemVer(version,loose){if(version instanceof SemVer){if(version.loose===loose)return version;else version=version.version}else if(typeof version!=="string"){throw new TypeError("Invalid Version: "+version)}if(version.length>MAX_LENGTH)throw new TypeError("version is longer than "+MAX_LENGTH+" characters");if(!(this instanceof SemVer))return new SemVer(version,loose);debug("SemVer",version,loose);this.loose=loose;var m=version.trim().match(loose?re[LOOSE]:re[FULL]);if(!m)throw new TypeError("Invalid Version: "+version);this.raw=version;this.major=+m[1];this.minor=+m[2];this.patch=+m[3];if(this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor vers
ion");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");if(!m[4])this.prerelease=[];else this.prerelease=m[4].split(".").map(function(id){if(/^[0-9]+$/.test(id)){var num=+id;if(num>=0&&num<MAX_SAFE_INTEGER)return num}return id});this.build=m[5]?m[5].split("."):[];this.format()}SemVer.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};SemVer.prototype.toString=function(){return this.version};SemVer.prototype.compare=function(other){debug("SemVer.compare",this.version,this.loose,other);if(!(other instanceof SemVer))other=new SemVer(other,this.loose);return this.compareMain(other)||this.comparePre(other)};SemVer.prototype.compareMain=function(other){if(!(other instanceof SemVer))other=new SemVer(other,this.loose);return compareIdentifiers(this.major,other.major)||compareIdentifiers(this.minor,other.minor)||compareIdentifiers(t
his.patch,other.patch)};SemVer.prototype.comparePre=function(other){if(!(other instanceof SemVer))other=new SemVer(other,this.loose);if(this.prerelease.length&&!other.prerelease.length)return-1;else if(!this.prerelease.length&&other.prerelease.length)return 1;else if(!this.prerelease.length&&!other.prerelease.length)return 0;var i=0;do{var a=this.prerelease[i];var b=other.prerelease[i];debug("prerelease compare",i,a,b);if(a===undefined&&b===undefined)return 0;else if(b===undefined)return 1;else if(a===undefined)return-1;else if(a===b)continue;else return compareIdentifiers(a,b)}while(++i)};SemVer.prototype.inc=function(release,identifier){switch(release){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",identifier);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",identifier);break;case"prepatch":this.prerelease.length=0;this.inc("patch",identifier);this.inc("pre",identifier);break;case"prerelease":if(t
his.prerelease.length===0)this.inc("patch",identifier);this.inc("pre",identifier);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var i=this.prerelease.length;while(--i>=0){if(typeof this.prerelease[i]==="number"){this.prerelease[i]++;i=-2}}if(i===-1)this.prerelease.push(0)}if(identifier){if(this.prerelease[0]===identifier){if(isNaN(this.prerelease[1]))this.prerelease=[identifier,0]}else this.prerelease=[identifier,0]}break;default:throw new Error("invalid increment argument: "+release)}this.format();this.raw=this.version;return this};exports.inc=inc;function inc(version,release,loose,identifier){if(typeof loose==="string"){identifier=loos
e;loose=undefined}try{return new SemVer(version,loose).inc(release,identifier).version}catch(er){return null}}exports.diff=diff;function diff(version1,version2){if(eq(version1,version2)){return null}else{var v1=parse(version1);var v2=parse(version2);if(v1.prerelease.length||v2.prerelease.length){for(var key in v1){if(key==="major"||key==="minor"||key==="patch"){if(v1[key]!==v2[key]){return"pre"+key}}}return"prerelease"}for(var key in v1){if(key==="major"||key==="minor"||key==="patch"){if(v1[key]!==v2[key]){return key}}}}}exports.compareIdentifiers=compareIdentifiers;var numeric=/^[0-9]+$/;function compareIdentifiers(a,b){var anum=numeric.test(a);var bnum=numeric.test(b);if(anum&&bnum){a=+a;b=+b}return anum&&!bnum?-1:bnum&&!anum?1:a<b?-1:a>b?1:0}exports.rcompareIdentifiers=rcompareIdentifiers;function rcompareIdentifiers(a,b){return compareIdentifiers(b,a)}exports.major=major;function major(a,loose){return new SemVer(a,loose).major}exports.minor=minor;function minor(a,loose){return n
ew SemVer(a,loose).minor}exports.patch=patch;function patch(a,loose){return new SemVer(a,loose).patch}exports.compare=compare;function compare(a,b,loose){return new SemVer(a,loose).compare(b)}exports.compareLoose=compareLoose;function compareLoose(a,b){return compare(a,b,true)}exports.rcompare=rcompare;function rcompare(a,b,loose){return compare(b,a,loose)}exports.sort=sort;function sort(list,loose){return list.sort(function(a,b){return exports.compare(a,b,loose)})}exports.rsort=rsort;function rsort(list,loose){return list.sort(function(a,b){return exports.rcompare(a,b,loose)})}exports.gt=gt;function gt(a,b,loose){return compare(a,b,loose)>0}exports.lt=lt;function lt(a,b,loose){return compare(a,b,loose)<0}exports.eq=eq;function eq(a,b,loose){return compare(a,b,loose)===0}exports.neq=neq;function neq(a,b,loose){return compare(a,b,loose)!==0}exports.gte=gte;function gte(a,b,loose){return compare(a,b,loose)>=0}exports.lte=lte;function lte(a,b,loose){return compare(a,b,loose)<=0}exports
.cmp=cmp;function cmp(a,op,b,loose){var ret;switch(op){case"===":if((typeof a==="undefined"?"undefined":_typeof(a))==="object")a=a.version;if((typeof b==="undefined"?"undefined":_typeof(b))==="object")b=b.version;ret=a===b;break;case"!==":if((typeof a==="undefined"?"undefined":_typeof(a))==="object")a=a.version;if((typeof b==="undefined"?"undefined":_typeof(b))==="object")b=b.version;ret=a!==b;break;case"":case"=":case"==":ret=eq(a,b,loose);break;case"!=":ret=neq(a,b,loose);break;case">":ret=gt(a,b,loose);break;case">=":ret=gte(a,b,loose);break;case"<":ret=lt(a,b,loose);break;case"<=":ret=lte(a,b,loose);break;default:throw new TypeError("Invalid operator: "+op)}return ret}exports.Comparator=Comparator;function Comparator(comp,loose){if(comp instanceof Comparator){if(comp.loose===loose)return comp;else comp=comp.value}if(!(this instanceof Comparator))return new Comparator(comp,loose);debug("comparator",comp,loose);this.loose=loose;this.parse(comp);if(this.semver===ANY)this.value="";e
lse this.value=this.operator+this.semver.version;debug("comp",this)}var ANY={};Comparator.prototype.parse=function(comp){var r=this.loose?re[COMPARATORLOOSE]:re[COMPARATOR];var m=comp.match(r);if(!m)throw new TypeError("Invalid comparator: "+comp);this.operator=m[1];if(this.operator==="=")this.operator="";if(!m[2])this.semver=ANY;else this.semver=new SemVer(m[2],this.loose)};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(version){debug("Comparator.test",version,this.loose);if(this.semver===ANY)return true;if(typeof version==="string")version=new SemVer(version,this.loose);return cmp(version,this.operator,this.semver,this.loose)};exports.Range=Range;function Range(range,loose){if(range instanceof Range&&range.loose===loose)return range;if(!(this instanceof Range))return new Range(range,loose);this.loose=loose;this.raw=range;this.set=range.split(/\s*\|\|\s*/).map(function(range){return this.parseRange(range.trim())},this).filter(function
(c){return c.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+range)}this.format()}Range.prototype.format=function(){this.range=this.set.map(function(comps){return comps.join(" ").trim()}).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(range){var loose=this.loose;range=range.trim();debug("range",range,loose);var hr=loose?re[HYPHENRANGELOOSE]:re[HYPHENRANGE];range=range.replace(hr,hyphenReplace);debug("hyphen replace",range);range=range.replace(re[COMPARATORTRIM],comparatorTrimReplace);debug("comparator trim",range,re[COMPARATORTRIM]);range=range.replace(re[TILDETRIM],tildeTrimReplace);range=range.replace(re[CARETTRIM],caretTrimReplace);range=range.split(/\s+/).join(" ");var compRe=loose?re[COMPARATORLOOSE]:re[COMPARATOR];var set=range.split(" ").map(function(comp){return parseComparator(comp,loose)}).join(" ").split(/\s+/);if(this.loose){set=set.filter(function(comp){return!!co
mp.match(compRe)})}set=set.map(function(comp){return new Comparator(comp,loose)});return set};exports.toComparators=toComparators;function toComparators(range,loose){return new Range(range,loose).set.map(function(comp){return comp.map(function(c){return c.value}).join(" ").trim().split(" ")})}function parseComparator(comp,loose){debug("comp",comp);comp=replaceCarets(comp,loose);debug("caret",comp);comp=replaceTildes(comp,loose);debug("tildes",comp);comp=replaceXRanges(comp,loose);debug("xrange",comp);comp=replaceStars(comp,loose);debug("stars",comp);return comp}function isX(id){return!id||id.toLowerCase()==="x"||id==="*"}function replaceTildes(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceTilde(comp,loose)}).join(" ")}function replaceTilde(comp,loose){var r=loose?re[TILDELOOSE]:re[TILDE];return comp.replace(r,function(_,M,m,p,pr){debug("tilde",comp,_,M,m,p,pr);var ret;if(isX(M))ret="";else if(isX(m))ret=">="+M+".0.0 <"+(+M+1)+".0.0";else if(isX(p))ret=
">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0";else if(pr){debug("replaceTilde pr",pr);if(pr.charAt(0)!=="-")pr="-"+pr;ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0"}else ret=">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0";debug("tilde return",ret);return ret})}function replaceCarets(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceCaret(comp,loose)}).join(" ")}function replaceCaret(comp,loose){debug("caret",comp,loose);var r=loose?re[CARETLOOSE]:re[CARET];return comp.replace(r,function(_,M,m,p,pr){debug("caret",comp,_,M,m,p,pr);var ret;if(isX(M))ret="";else if(isX(m))ret=">="+M+".0.0 <"+(+M+1)+".0.0";else if(isX(p)){if(M==="0")ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0";else ret=">="+M+"."+m+".0 <"+(+M+1)+".0.0"}else if(pr){debug("replaceCaret pr",pr);if(pr.charAt(0)!=="-")pr="-"+pr;if(M==="0"){if(m==="0")ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+m+"."+(+p+1);else ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0"}else ret=">="+M+"."+m+"."+p+pr+" <"+(+M+1)+".0.0"}else{debug("
no pr");if(M==="0"){if(m==="0")ret=">="+M+"."+m+"."+p+" <"+M+"."+m+"."+(+p+1);else ret=">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0"}else ret=">="+M+"."+m+"."+p+" <"+(+M+1)+".0.0"}debug("caret return",ret);return ret})}function replaceXRanges(comp,loose){debug("replaceXRanges",comp,loose);return comp.split(/\s+/).map(function(comp){return replaceXRange(comp,loose)}).join(" ")}function replaceXRange(comp,loose){comp=comp.trim();var r=loose?re[XRANGELOOSE]:re[XRANGE];return comp.replace(r,function(ret,gtlt,M,m,p,pr){debug("xRange",comp,ret,gtlt,M,m,p,pr);var xM=isX(M);var xm=xM||isX(m);var xp=xm||isX(p);var anyX=xp;if(gtlt==="="&&anyX)gtlt="";if(xM){if(gtlt===">"||gtlt==="<"){ret="<0.0.0"}else{ret="*"}}else if(gtlt&&anyX){if(xm)m=0;if(xp)p=0;if(gtlt===">"){gtlt=">=";if(xm){M=+M+1;m=0;p=0}else if(xp){m=+m+1;p=0}}else if(gtlt==="<="){gtlt="<";if(xm)M=+M+1;else m=+m+1}ret=gtlt+M+"."+m+"."+p}else if(xm){ret=">="+M+".0.0 <"+(+M+1)+".0.0"}else if(xp){ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0"}de
bug("xRange return",ret);return ret})}function replaceStars(comp,loose){debug("replaceStars",comp,loose);return comp.trim().replace(re[STAR],"")}function hyphenReplace($0,from,fM,fm,fp,fpr,fb,to,tM,tm,tp,tpr,tb){if(isX(fM))from="";else if(isX(fm))from=">="+fM+".0.0";else if(isX(fp))from=">="+fM+"."+fm+".0";else from=">="+from;if(isX(tM))to="";else if(isX(tm))to="<"+(+tM+1)+".0.0";else if(isX(tp))to="<"+tM+"."+(+tm+1)+".0";else if(tpr)to="<="+tM+"."+tm+"."+tp+"-"+tpr;else to="<="+to;return(from+" "+to).trim()}Range.prototype.test=function(version){if(!version)return false;if(typeof version==="string")version=new SemVer(version,this.loose);for(var i=0;i<this.set.length;i++){if(testSet(this.set[i],version))return true}return false};function testSet(set,version){for(var i=0;i<set.length;i++){if(!set[i].test(version))return false}if(version.prerelease.length){for(var i=0;i<set.length;i++){debug(set[i].semver);if(set[i].semver===ANY)continue;if(set[i].semver.prerelease.length>0){var allow
ed=set[i].semver;if(allowed.major===version.major&&allowed.minor===version.minor&&allowed.patch===version.patch)return true}}return false}return true}exports.satisfies=satisfies;function satisfies(version,range,loose){try{range=new Range(range,loose)}catch(er){return false}return range.test(version)}exports.maxSatisfying=maxSatisfying;function maxSatisfying(versions,range,loose){return versions.filter(function(version){return satisfies(version,range,loose)}).sort(function(a,b){return rcompare(a,b,loose)})[0]||null}exports.validRange=validRange;function validRange(range,loose){try{return new Range(range,loose).range||"*"}catch(er){return null}}exports.ltr=ltr;function ltr(version,range,loose){return outside(version,range,"<",loose)}exports.gtr=gtr;function gtr(version,range,loose){return outside(version,range,">",loose)}exports.outside=outside;function outside(version,range,hilo,loose){version=new SemVer(version,loose);range=new Range(range,loose);var gtfn,ltefn,ltfn,comp,ecomp;switc
h(hilo){case">":gtfn=gt;ltefn=lte;ltfn=lt;comp=">";ecomp=">=";break;case"<":gtfn=lt;ltefn=gte;ltfn=gt;comp="<";ecomp="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(version,range,loose)){return false}for(var i=0;i<range.set.length;++i){var comparators=range.set[i];var high=null;var low=null;comparators.forEach(function(comparator){if(comparator.semver===ANY){comparator=new Comparator(">=0.0.0")}high=high||comparator;low=low||comparator;if(gtfn(comparator.semver,high.semver,loose)){high=comparator}else if(ltfn(comparator.semver,low.semver,loose)){low=comparator}});if(high.operator===comp||high.operator===ecomp){return false}if((!low.operator||low.operator===comp)&<efn(version,low.semver)){return false}else if(low.operator===ecomp&<fn(version,low.semver)){return false}}return true}}).call(exports,__webpack_require__(50))},function(module,exports){"use strict";var process=module.exports={};var queue=[];var draining=false;var currentQueue
;var queueIndex=-1;function cleanUpNextTick(){draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=setTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;clearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){setTimeout(drainQueue,0)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;proce
ss.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=Vm;var _index=__webpack_require__(47);var _=_interopRequireWildcard(_index);var _state=__webpack_require__(52);var state=_interopRequireWildcard(_state);var _compiler=__webpack_require__(57);var compiler=_interopRequireWildcard(_compiler);var _directive=__webpack_require__(58);var directive=_interopRequireWildcard(_directive);var _domHelper=__webpack_require__(59);var domHelper=_interopRequireWildcard(_domHelper);var _events=__webpack_require__(60);var events=_interopRequireWildcard(_events);var
_register=__webpack_require__(61);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function callOldReadyEntry(vm,component){if(component.methods&&component.methods.ready){_.warn('"exports.methods.ready" is deprecated, '+'please use "exports.created" instead');component.methods.ready.call(vm)}}function Vm(type,options,parentVm,parentEl,mergedData,externalEvents){this._parent=parentVm._realParent?parentVm._realParent:parentVm;this._app=parentVm._app;parentVm._childrenVms&&parentVm._childrenVms.push(this);if(!options){options=this._app.customComponentMap[type]||{}}var data=options.data||{};this._options=options;this._methods=options.methods||{};this._computed=options.computed||{};this._css=options.style||{};this._ids={};this._vmEvents={};this._childrenVms=[];this._type=type;this._initEvents(externalEvents)
;_.debug('"init" lifecycle in Vm('+this._type+")");this.$emit("hook:init");this._inited=true;this._data=typeof data==="function"?data():data;if(mergedData){_.extend(this._data,mergedData)}this._initState();_.debug('"created" lifecycle in Vm('+this._type+")");this.$emit("hook:created");this._created=true;callOldReadyEntry(this,options);this._parentEl=parentEl||this._app.doc.documentElement;this._build()}_.extend(Vm.prototype,state,compiler,directive,domHelper,events);_.extend(Vm,{registerModules:_register.registerModules,registerMethods:_register.registerMethods})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports._initState=_initState;exports._initData=_initData;exports._initComputed=_initComputed;exports._initMethods=_initMethods;var _watcher=__webpack_require__(53);var _watcher2=_interopRequireDefault(_watcher);var _dep=__webpack_require__(54);var _dep2=_interopRequireDefault(_dep);var _observer=__webpack_req
uire__(55);var _index=__webpack_require__(47);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _initState(){var vm=this;vm._watchers=[];vm._initData();vm._initComputed();vm._initMethods()}function _initData(){var vm=this;var data=vm._data;if(!(0,_index.isPlainObject)(data)){data={}}var keys=Object.keys(data);var i=keys.length;while(i--){(0,_observer.proxy)(vm,keys[i])}(0,_observer.observe)(data,vm)}function noop(){}function _initComputed(){var vm=this;var computed=vm._computed;if(computed){for(var key in computed){var userDef=computed[key];var def={enumerable:true,configurable:true};if(typeof userDef==="function"){def.get=makeComputedGetter(userDef,vm);def.set=noop}else{def.get=userDef.get?userDef.cache!==false?makeComputedGetter(userDef.get,vm):(0,_index.bind)(userDef.get,vm):noop;def.set=userDef.set?(0,_index.bind)(userDef.set,vm):noop}Object.defineProperty(vm,key,def)}}}function makeComputedGetter(getter,owner){var watcher=new _watcher2
.default(owner,getter,null,{lazy:true});return function computedGetter(){if(watcher.dirty){watcher.evaluate()}if(_dep2.default.target){watcher.depend()}return watcher.value}}function _initMethods(){var vm=this;var methods=vm._methods;if(methods){for(var key in methods){vm[key]=(0,_index.bind)(methods[key],vm)}}}},function(module,exports,__webpack_require__){(function(process){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=Watcher;var _dep=__webpack_require__(54);var _dep2=_interopRequireDefault(_dep);var _index=__webpack_require__(47);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var uid=0;var prevTarget=void 0;function Watcher(vm,expOrFn,cb,options){if(options){(0,_index.extend)(this,options)}var isFn=typeof expOrFn==="function";this.vm=vm;vm._watchers.push(this);this.expression=expOrFn;this.cb=cb;this.id=++uid;this.active=true;this.dirty=this.lazy;this.deps=[];this.newDeps=[];this.depIds=new _index._Set;t
his.newDepIds=new _index._Set;if(isFn){this.getter=expOrFn}else{this.getter=(0,_index.parsePath)(expOrFn);if(!this.getter){this.getter=function(){};process.env.NODE_ENV!=="production"&&(0,_index.warn)("Failed watching path: "+expOrFn+"Watcher only accepts simple dot-delimited paths. "+"For full control, use a function instead.",vm)}}this.value=this.lazy?undefined:this.get();this.queued=this.shallow=false}Watcher.prototype.get=function(){this.beforeGet();var value=this.getter.call(this.vm,this.vm);if(this.deep){traverse(value)}this.afterGet();return value};Watcher.prototype.beforeGet=function(){prevTarget=_dep2.default.target;_dep2.default.target=this};Watcher.prototype.addDep=function(dep){var id=dep.id;if(!this.newDepIds.has(id)){this.newDepIds.add(id);this.newDeps.push(dep);if(!this.depIds.has(id)){dep.addSub(this)}}};Watcher.prototype.afterGet=function(){_dep2.default.target=prevTarget;var i=this.deps.length;while(i--){var dep=this.deps[i];if(!this.newDepIds.has(dep.id)){dep.remo
veSub(this)}}var tmp=this.depIds;this.depIds=this.newDepIds;this.newDepIds=tmp;this.newDepIds.clear();tmp=this.deps;this.deps=this.newDeps;this.newDeps=tmp;this.newDeps.length=0};Watcher.prototype.update=function(shallow){if(this.lazy){this.dirty=true}else{this.run()}};Watcher.prototype.run=function(){if(this.active){var value=this.get();if(value!==this.value||((0,_index.isObject)(value)||this.deep)&&!this.shallow){var oldValue=this.value;this.value=value;this.cb.call(this.vm,value,oldValue)}this.queued=this.shallow=false}};Watcher.prototype.evaluate=function(){var current=_dep2.default.target;this.value=this.get();this.dirty=false;_dep2.default.target=current};Watcher.prototype.depend=function(){var i=this.deps.length;while(i--){this.deps[i].depend()}};Watcher.prototype.teardown=function(){if(this.active){if(!this.vm._isBeingDestroyed&&!this.vm._vForRemoving){(0,_index.remove)(this.vm._watchers,this)}var i=this.deps.length;while(i--){this.deps[i].removeSub(this)}this.active=false;t
his.vm=this.cb=this.value=null}};var seenObjects=new _index._Set;function traverse(val,seen){var i=void 0,keys=void 0,isA=void 0,isO=void 0;if(!seen){seen=seenObjects;seen.clear()}isA=(0,_index.isArray)(val);isO=(0,_
<TRUNCATED>
[41/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/list/list-basic.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/list/list-basic.js b/ios/playground/bundlejs/component/list/list-basic.js
new file mode 100644
index 0000000..ab50a73
--- /dev/null
+++ b/ios/playground/bundlejs/component/list/list-basic.js
@@ -0,0 +1,1370 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/166b7ca130b38d87497f545e4cad1936", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ methods: {
+ onrefresh: function(e) {
+ var self = this;
+ self.refresh_display = 'show';
+ // self.$call('timer', 'setTimeout', function() {
+ // self.refresh_display = 'hide';
+ // },3000);
+ self.refresh_display = 'hide';
+ },
+ onappear: function (e) {
+ var appearId = this.rows[e.target.attr.index].id;
+ nativeLog('+++++', appearId);
+ var appearIds = this.appearIds;
+ appearIds.push(appearId);
+ this.getMinAndMaxIds(appearIds);
+ },
+ ondisappear:function (e) {
+ var disAppearId = this.rows[e.target.attr.index].id;
+ nativeLog('+++++', disAppearId);
+ var appearIds = this.appearIds;
+ var index = appearIds.indexOf(disAppearId);
+ if (index > -1) {
+ appearIds.splice(index, 1);
+ }
+ this.getMinAndMaxIds(appearIds);
+ },
+ getMinAndMaxIds:function (appearIds) {
+ appearIds.sort(function(a, b) {
+ return a - b;
+ });
+ this.appearIds = appearIds;
+ this.appearMax = appearIds[appearIds.length - 1];
+ this.appearMin = appearIds[0];
+ }
+ },
+ data: function () {return {
+ refresh_display : 'hide',
+ loading_display : 'hide',
+ appearMin:1,
+ appearMax:1,
+ appearIds:[],
+ rows:[
+ {id: 1},
+ {id: 2},
+ {id: 3},
+ {id: 4},
+ {id: 5},
+ {id: 6},
+ {id: 7},
+ {id: 8},
+ {id: 9},
+ {id: 10},
+ {id: 11},
+ {id: 12},
+ {id: 13},
+ {id: 14},
+ {id: 15},
+ {id: 16},
+ {id: 17},
+ {id: 18},
+ {id: 19},
+ {id: 20},
+ {id: 21},
+ {id: 22},
+ {id: 23},
+ {id: 24},
+ {id: 25},
+ {id: 26},
+ {id: 27},
+ {id: 28},
+ {id: 29}
+ ]
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "list",
+ "classList": [
+ "list"
+ ],
+ "children": [
+ {
+ "type": "refresh",
+ "classList": [
+ "refresh-view"
+ ],
+ "attr": {
+ "display": function () {return this.refresh_display}
+ },
+ "events": {
+ "refresh": "onrefresh"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "refresh-arrow"
+ ],
+ "shown": function () {return (this.refresh_display==='hide')},
+ "attr": {
+ "value": "\u2193 Pull To Refresh"
+ }
+ },
+ {
+ "type": "loading-indicator"
+ }
+ ]
+ },
+ {
+ "type": "cell",
+ "append": "tree",
+ "events": {
+ "appear": "onappear",
+ "disappear": "ondisappear"
+ },
+ "classList": [
+ "row"
+ ],
+ "repeat": function () {return this.rows},
+ "attr": {
+ "index": function () {return this.$index}
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "item-title"
+ ],
+ "attr": {
+ "value": function () {return 'row ' + (this.id)}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "text",
+ "classList": [
+ "count"
+ ],
+ "attr": {
+ "value": function () {return 'Appear items:' + (this.appearMin) + ' - ' + (this.appearMax)}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "list": {
+ "height": 810,
+ "borderWidth": 10,
+ "borderColor": "#FFA500"
+ },
+ "count": {
+ "fontSize": 48,
+ "margin": 10
+ },
+ "refresh-view": {
+ "height": 80,
+ "width": 750,
+ "justifyContent": "center",
+ "alignItems": "center"
+ },
+ "refresh-arrow": {
+ "fontSize": 30,
+ "color": "#45b5f0"
+ },
+ "indicator": {
+ "height": 40,
+ "width": 40,
+ "color": "#45b5f0"
+ },
+ "row": {
+ "width": 750
+ },
+ "item": {
+ "justifyContent": "center",
+ "borderBottomWidth": 2,
+ "borderBottomColor": "#c0c0c0",
+ "height": 100,
+ "padding": 20
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/166b7ca130b38d87497f545e4cad1936", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/list/list-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/list/list-demo.js b/ios/playground/bundlejs/component/list/list-demo.js
new file mode 100644
index 0000000..0a289e9
--- /dev/null
+++ b/ios/playground/bundlejs/component/list/list-demo.js
@@ -0,0 +1,1156 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/27404869ac7d04c3c768257387390d1b", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ backgroundColor: 'red',
+ composite: 'false',
+ shopList: [
+ {
+ id: 1,
+ scopeValue: 1,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Mendeleyev',
+ PersonVisitTime: 'today',
+ shopDesc: 'Genius only means hard-working all one\'s life',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1rtOnHpXXXXXLaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB15KrfFVXXXXXJXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1t5YBGVXXXXXcaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 2,
+ scopeValue: 2,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Napoleon',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'The man who has made up his mind to win will never say "impossible "',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/2655929383/TB2.qITjpXXXXcIXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/imgextra/i3/2655929383/TB2eWwZjpXXXXbHXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2655929383/TB2tgQWjpXXXXbZXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 3,
+ scopeValue: 3,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Balzac',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'There is no such thing as a great talent without great will - power',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/TB1AFz9LXXXXXbrXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2557954751/TB2is2njXXXXXatXpXXXXXXXXXX_!!2557954751.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2557954751/TB2PNYGjXXXXXbXXXXXXXXXXXXX_!!2557954751.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 4,
+ scopeValue: 4,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Thomas Carlyle',
+ PersonVisitTime: '3 day ago',
+ shopDesc: 'Cease to struggle and you cease to live',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2zbwdfXXXXXa4XpXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2L7ZAfXXXXXXOXXXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2p9wufXXXXXbiXXXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 5,
+ scopeValue: 5,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Addison',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'A strong man will struggle with the storms of fate',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/bao/uploaded/i3/TB1MQ8_KVXXXXaLXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/53218032/TB2bGSqiXXXXXXyXpXXXXXXXXXX_!!53218032.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1kP2zKFXXXXbIXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 6,
+ scopeValue: 1,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Ruskin',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'Living without an aim is like sailing without a compass',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB11yFnHXXXXXakaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/32720628/TB2CRJUcXXXXXXwXpXXXXXXXXXX_!!32720628.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB17LUzHXXXXXcEaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 7,
+ scopeValue: 2,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Yiming',
+ PersonVisitTime: 'today',
+ shopDesc: 'Live a noble and honest life. Reviving past times in your old age will help you to enjoy your life again',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB1hvNoJXXXXXaMaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/2058567235/TB2V8iygFXXXXaRXpXXXXXXXXXX_!!2058567235.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2058567235/TB2im1QgFXXXXX8XXXXXXXXXXXX_!!2058567235.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 8,
+ scopeValue: 3,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Brown',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'Behind every successful man there\'s a lot u unsuccessful years',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/bao/uploaded/i1/TB18BZ2KFXXXXb8XFXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/2775383848/TB2r012jVXXXXXHXpXXXXXXXXXX_!!2775383848.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/imgextra/i3/2775383848/TB2iI9VjVXXXXaoXpXXXXXXXXXX_!!2775383848.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 9,
+ scopeValue: 4,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'YIMING',
+ PersonVisitTime: 'today',
+ shopDesc: 'Enrich your life today,. yesterday is history.tomorrow is mystery',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/bao/uploaded/i1/TB1JB.rLpXXXXXLXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/2702739128/TB2JdvmjVXXXXXjXXXXXXXXXXXX_!!2702739128.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2702739128/TB2A.e6jVXXXXXGXpXXXXXXXXXX_!!2702739128.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+
+ },
+ {
+ id: 10,
+ scopeValue: 5,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'YIMING',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'The secret of success is constancy to purpose',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/bao/uploaded/i3/TB17zXOGXXXXXbEXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/2265445951/TB22ACTbFXXXXXBXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/imgextra/i3/2265445951/TB2oXqUbFXXXXXIXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+ }
+ ],
+ }},
+ methods: {
+ loadmore: function(e) {
+ this.$call('modal', 'toast', {
+ 'message': 'loadmore',
+ 'duration': 2.0
+ });
+ },
+ oncellclick: function(e) {
+ this.$call('modal', 'toast', {
+ 'message': 'row ' + e.target.attr.rownumber + ' clicked',
+ 'duration': 2.0
+ });
+ },
+ onfixedclick: function(e) {
+ if (e.target.style.backgroundColor == 'red') {
+ this.backgroundColor = 'green';
+ this.composite = true;
+ }
+ else {
+ this.backgroundColor = 'red';
+ this.composite = false;
+ }
+ }
+ }
+
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "list",
+ "classList": [
+ "list"
+ ],
+ "events": {
+ "loadmore": "loadmore"
+ },
+ "attr": {
+ "loadmoreoffset": "2000"
+ },
+ "children": [
+ {
+ "type": "cell",
+ "append": "tree",
+ "classList": [
+ "cell"
+ ],
+ "events": {
+ "click": "oncellclick"
+ },
+ "attr": {
+ "rownumber": function () {return this.id},
+ "scope": function () {return this.scopeValue},
+ "composite": function () {return this.composite}
+ },
+ "repeat": function () {return this.shopList},
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "shopDiv"
+ ],
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "shopHeader"
+ ],
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flex": 2,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 60,
+ "height": 60
+ },
+ "attr": {
+ "src": function () {return this.PersonPhoto}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "column",
+ "marginLeft": 5
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "marginTop": 5
+ },
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": function () {return this.PersonName}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginTop": 5
+ },
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20,
+ "color": "#cccccc"
+ },
+ "attr": {
+ "value": function () {return this.PersonVisitTime}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "flex": 5,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row",
+ "marginLeft": 10,
+ "marginTop": 10
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://img.alicdn.com/tps/i4/TB1zkDeIFXXXXXrXVXX07tlTXXX-200-200.png_88x88xz.jpg"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": "Hope"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "position": "absolute",
+ "left": 90,
+ "top": 10,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://img.alicdn.com/tps/i2/TB1hRb1IXXXXXX3XVXXXQaP.pXX-87-87.jpeg"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": "Mem"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "position": "absolute",
+ "left": 170,
+ "top": 10,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://img.alicdn.com/tps/i3/TB1DGkJJFXXXXaZXFXX07tlTXXX-200-200.png"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": "auth"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "position": "absolute",
+ "left": 250,
+ "top": 10,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://img.alicdn.com/tps/i1/TB1nFvPIXXXXXbUXXXXUAkPJpXX-87-87.png"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": "Friend"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "position": "absolute",
+ "left": 330,
+ "top": 10,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://img.alicdn.com/tps/i2/TB1CpD7IXXXXXbSXXXXUAkPJpXX-87-87.png"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": "issue"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "position": "absolute",
+ "left": 410,
+ "top": 10,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://gtms02.alicdn.com/tps/i2/TB11ZZfIVXXXXbMXFXXEDhGGXXX-32-32.png"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": "super"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "shopBody"
+ ],
+ "style": {
+ "flexDirection": "column"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "descDiv"
+ ],
+ "style": {
+ "marginTop": 10,
+ "marginLeft": 10
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "shopDesc"
+ ],
+ "style": {
+ "fontSize": 25
+ },
+ "attr": {
+ "value": function () {return this.shopDesc}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "imgDiv"
+ ],
+ "style": {
+ "flex": 1,
+ "flexDirection": "column",
+ "margin": 10
+ },
+ "repeat": function () {return this.shopImgList},
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "shopImg"
+ ],
+ "style": {
+ "width": function () {return this.shopImgWidth},
+ "height": function () {return this.shopImgHeight}
+ },
+ "attr": {
+ "src": function () {return this.shopImg}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "flex": 1,
+ "marginTop": 10,
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flex": 1,
+ "justifyContent": "center",
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://img.alicdn.com/tps/i1/TB1nFvPIXXXXXbUXXXXUAkPJpXX-87-87.png"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginLeft": 5
+ },
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20,
+ "textAlign": "center"
+ },
+ "attr": {
+ "value": "Up"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "flex": 1,
+ "justifyContent": "center",
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "image",
+ "style": {
+ "width": 20,
+ "height": 20
+ },
+ "attr": {
+ "src": "https://img.alicdn.com/tps/i2/TB1CpD7IXXXXXbSXXXXUAkPJpXX-87-87.png"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginLeft": 5
+ },
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "fontSize": 20,
+ "textAlign": "center"
+ },
+ "attr": {
+ "value": "down"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "shopFooter"
+ ],
+ "style": {
+ "flexDirection": "row",
+ "marginTop": 10,
+ "marginLeft": 10,
+ "justifyContent": "flex-end"
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 5
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "shopLikeImg",
+ "smallImg"
+ ],
+ "attr": {
+ "src": function () {return this.shopLikeImg}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 15
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "shopLikeText"
+ ],
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": function () {return this.shopLikeText}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 5
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "shopCommentImg",
+ "smallImg"
+ ],
+ "attr": {
+ "src": function () {return this.shopCommentImg}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 15
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "shopCommentText"
+ ],
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": function () {return this.shopCommentText}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 5
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "shopLookImg",
+ "smallImg"
+ ],
+ "attr": {
+ "src": function () {return this.shopLookImg}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 15
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "shopLookText"
+ ],
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": function () {return this.shopLookText}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 5
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "shareImg",
+ "smallImg"
+ ],
+ "attr": {
+ "src": function () {return this.shareImg}
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "style": {
+ "marginRight": 20
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "shareText"
+ ],
+ "style": {
+ "fontSize": 20
+ },
+ "attr": {
+ "value": function () {return this.shareText}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "flexRow": {
+ "flexDirection": "row"
+ },
+ "flexColumn": {
+ "flexDirection": "column"
+ },
+ "fixed": {
+ "position": "fixed",
+ "bottom": 50,
+ "left": 50,
+ "width": 300,
+ "height": 50,
+ "alignItems": "center",
+ "justifyContent": "center"
+ },
+ "shopImg": {
+ "width": 220,
+ "height": 220
+ },
+ "list": {
+ "flexDirection": "column",
+ "overflow": "hidden",
+ "width": 750,
+ "height": 1200,
+ "backgroundColor": "#dddddd"
+ },
+ "cell": {
+ "backgroundColor": "#dddddd",
+ "flexDirection": "column",
+ "width": 750
+ },
+ "shopDiv": {
+ "flexDirection": "column",
+ "backgroundColor": "#ffffff",
+ "margin": 5,
+ "padding": 10,
+ "borderWidth": 1,
+ "borderColor": "#cccccc",
+ "overflow": "visible"
+ },
+ "shopRowList": {
+ "flexDirection": "column",
+ "borderWidth": 1,
+ "borderColor": "#cccccc",
+ "overflow": "visible",
+ "margin": 5,
+ "padding": 10,
+ "backgroundColor": "#ffffff"
+ },
+ "shopHeader": {
+ "flexDirection": "row",
+ "width": 720
+ },
+ "shopFooter": {
+ "flexDirection": "row",
+ "width": 720
+ },
+ "smallImg": {
+ "width": 20,
+ "height": 20
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/27404869ac7d04c3c768257387390d1b", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[15/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
new file mode 100644
index 0000000..105eccc
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
@@ -0,0 +1,621 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent+Events.h"
+#import "WXComponent.h"
+#import "WXComponent_internal.h"
+#import "WXSDKInstance.h"
+#import "WXAssert.h"
+#import "WXUtility.h"
+#import "WXSDKManager.h"
+#import <objc/runtime.h>
+#import <UIKit/UIGestureRecognizerSubclass.h>
+
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+
+@interface UITouch (WXTouchGestureRecognizer)
+
+@property (nonatomic, strong) NSNumber *wx_identifier;
+
+@end
+
+@implementation UITouch (WXTouchGestureRecognizer)
+
+- (NSNumber *)wx_identifier
+{
+ return objc_getAssociatedObject(self, _cmd);
+}
+
+- (void)setWx_identifier:(NSNumber *)wx_identifier
+{
+ objc_setAssociatedObject(self, @selector(wx_identifier), wx_identifier, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+@interface UIGestureRecognizer (WXGesture)
+
+@property (nonatomic, strong) NSNumber *wx_identifier;
+
+@end
+
+@implementation UIGestureRecognizer (WXGesture)
+
+- (NSNumber *)wx_identifier
+{
+ NSNumber *identifier = objc_getAssociatedObject(self, _cmd);
+ if (!identifier) {
+ static NSUInteger _gestureIdentifier;
+ identifier = @(_gestureIdentifier++);
+ self.wx_identifier = identifier;
+ }
+
+ return identifier;
+}
+
+- (void)setWx_identifier:(NSNumber *)wx_identifier
+{
+ objc_setAssociatedObject(self, @selector(wx_identifier), wx_identifier, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+@interface WXTouchGestureRecognizer : UIGestureRecognizer
+
+@property (nonatomic, assign) BOOL listenTouchStart;
+@property (nonatomic, assign) BOOL listenTouchMove;
+@property (nonatomic, assign) BOOL listenTouchEnd;
+@property (nonatomic, assign) BOOL listenTouchCancel;
+
+- (instancetype)initWithComponent:(WXComponent *)component NS_DESIGNATED_INITIALIZER;
+
+@end
+
+@implementation WXComponent (Events)
+
+#pragma mark Public
+
+- (void)fireEvent:(NSString *)eventName params:(NSDictionary *)params
+{
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+ NSTimeInterval timeSp = [[NSDate date] timeIntervalSince1970] * 1000;
+ [dict setObject:@(timeSp) forKey:@"timestamp"];
+ if (params) {
+ [dict addEntriesFromDictionary:params];
+ }
+
+ [[WXSDKManager bridgeMgr] fireEvent:self.weexInstance.instanceId ref:self.ref type:eventName params:dict];
+}
+
+- (void)addEvent:(NSString *)addEventName
+{
+ WXAssertMainThread();
+}
+
+- (void)removeEvent:(NSString *)removeEventName
+{
+ WXAssertMainThread();
+}
+
+#pragma mark Add & Remove Event
+
+
+#define WX_ADD_EVENT(eventName, addSelector) \
+if ([addEventName isEqualToString:@#eventName]) {\
+ [self addSelector];\
+}
+
+#define WX_REMOVE_EVENT(eventName, removeSelector) \
+if ([removeEventName isEqualToString:@#eventName]) {\
+ [self removeSelector];\
+}
+
+- (void)_initEvents:(NSArray *)events
+{
+ for (NSString *addEventName in events) {
+ [self _addEventOnMainThread:addEventName];
+ }
+}
+
+- (void)_addEventOnMainThread:(NSString *)addEventName
+{
+ WX_ADD_EVENT(appear, addAppearEvent)
+ WX_ADD_EVENT(disappear, addDisappearEvent)
+
+ WX_ADD_EVENT(click, addClickEvent)
+ WX_ADD_EVENT(swipe, addSwipeEvent)
+ WX_ADD_EVENT(longpress, addLongPressEvent)
+
+ WX_ADD_EVENT(panstart, addPanStartEvent)
+ WX_ADD_EVENT(panmove, addPanMoveEvent)
+ WX_ADD_EVENT(panend, addPanEndEvent)
+
+ WX_ADD_EVENT(touchstart, addTouchStartEvent)
+ WX_ADD_EVENT(touchmove, addTouchMoveEvent)
+ WX_ADD_EVENT(touchend, addTouchEndEvent)
+ WX_ADD_EVENT(touchcancel, addTouchCancelEvent)
+
+ [self addEvent:addEventName];
+}
+
+- (void)_removeEventOnMainThread:(NSString *)removeEventName
+{
+ WX_REMOVE_EVENT(appear, removeAppearEvent)
+ WX_REMOVE_EVENT(disappear, removeDisappearEvent)
+
+ WX_REMOVE_EVENT(click, removeClickEvent)
+ WX_REMOVE_EVENT(swipe, removeSwipeEvent)
+ WX_REMOVE_EVENT(longpress, removeLongPressEvent)
+
+ WX_REMOVE_EVENT(panstart, removePanStartEvent)
+ WX_REMOVE_EVENT(panmove, removePanMoveEvent)
+ WX_REMOVE_EVENT(panend, removePanEndEvent)
+
+ WX_REMOVE_EVENT(touchstart, removeTouchStartEvent)
+ WX_REMOVE_EVENT(touchmove, removeTouchMoveEvent)
+ WX_REMOVE_EVENT(touchend, removeTouchEndEvent)
+ WX_REMOVE_EVENT(touchcancel, removeTouchCancelEvent)
+
+ [self removeEvent:removeEventName];
+}
+
+- (void)_removeAllEvents
+{
+ [self removeClickEvent];
+ [self removeLongPressEvent];
+ [self removePanStartEvent];
+ [self removePanMoveEvent];
+ [self removePanEndEvent];
+ [self removeTouchStartEvent];
+ [self removeTouchMoveEvent];
+ [self removeTouchEndEvent];
+ [self removeTouchCancelEvent];
+ [self removeSwipeEvent];
+}
+
+#pragma mark - Appear & Disappear
+
+- (void)addAppearEvent
+{
+ _appearEvent = YES;
+ [self.ancestorScroller addScrollToListener:self];
+}
+
+- (void)addDisappearEvent
+{
+ _disappearEvent = YES;
+ [self.ancestorScroller addScrollToListener:self];
+}
+
+- (void)removeAppearEvent
+{
+ _appearEvent = NO;
+ [self.ancestorScroller removeScrollToListener:self];
+}
+
+- (void)removeDisappearEvent
+{
+ _disappearEvent = NO;
+ [self.ancestorScroller removeScrollToListener:self];
+}
+
+#pragma mark - Click Event
+
+- (void)addClickEvent
+{
+ if (!_tapGesture) {
+ _tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClick:)];
+ _tapGesture.delegate = self;
+ [self.view addGestureRecognizer:_tapGesture];
+ }
+}
+
+- (void)removeClickEvent
+{
+ if (_tapGesture) {
+ [self.view removeGestureRecognizer:_tapGesture];
+ _tapGesture.delegate = nil;
+ _tapGesture = nil;
+ }
+}
+
+- (void)onClick:(__unused UITapGestureRecognizer *)recognizer
+{
+ [self fireEvent:@"click" params:nil];
+}
+
+#pragma mark - Swipe event
+
+- (void)addSwipeEvent
+{
+ if (_swipeGestures) {
+ return;
+ }
+
+ _swipeGestures = [NSMutableArray arrayWithCapacity:4];
+
+ // It's a little weird because the UISwipeGestureRecognizer.direction property is an options-style bit mask, but each recognizer can only handle one direction
+ SEL selector = @selector(onSwipe:);
+ UISwipeGestureRecognizer *upSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
+ action:selector];
+ upSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionUp;
+ upSwipeRecognizer.delegate = self;
+ [_swipeGestures addObject:upSwipeRecognizer];
+ [self.view addGestureRecognizer:upSwipeRecognizer];
+
+ UISwipeGestureRecognizer *downSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
+ action:selector];
+ downSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionDown;
+ downSwipeRecognizer.delegate = self;
+ [_swipeGestures addObject:downSwipeRecognizer];
+ [self.view addGestureRecognizer:downSwipeRecognizer];
+
+ UISwipeGestureRecognizer *rightSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
+ action:selector];
+ rightSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
+ rightSwipeRecognizer.delegate = self;
+ [_swipeGestures addObject:rightSwipeRecognizer];
+ [self.view addGestureRecognizer:rightSwipeRecognizer];
+
+ UISwipeGestureRecognizer *leftSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
+ action:selector];
+ leftSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
+ leftSwipeRecognizer.delegate = self;
+ [_swipeGestures addObject:leftSwipeRecognizer];
+ [self.view addGestureRecognizer:leftSwipeRecognizer];
+}
+
+- (void)removeSwipeEvent
+{
+ if (_swipeGestures == nil) {
+ return;
+ }
+
+ for (UISwipeGestureRecognizer *recognizer in _swipeGestures) {
+ recognizer.delegate = nil;
+ [self.view removeGestureRecognizer:recognizer];
+ }
+
+ _swipeGestures = nil;
+}
+
+- (void)onSwipe:(UISwipeGestureRecognizer *)gesture
+{
+ UISwipeGestureRecognizerDirection direction = gesture.direction;
+
+ NSString *directionString;
+ switch(direction) {
+ case UISwipeGestureRecognizerDirectionLeft:
+ directionString = @"left";
+ break;
+ case UISwipeGestureRecognizerDirectionRight:
+ directionString = @"right";
+ break;
+ case UISwipeGestureRecognizerDirectionUp:
+ directionString = @"up";
+ break;
+ case UISwipeGestureRecognizerDirectionDown:
+ directionString = @"down";
+ break;
+ default:
+ directionString = @"unknown";
+ }
+
+ CGPoint screenLocation = [gesture locationInView:self.view.window];
+ CGPoint pageLoacation = [gesture locationInView:self.weexInstance.rootView];
+ NSDictionary *resultTouch = [self touchResultWithScreenLocation:screenLocation pageLocation:pageLoacation identifier:gesture.wx_identifier];
+ [self fireEvent:@"swipe" params:@{@"direction":directionString, @"changedTouches":resultTouch ? @[resultTouch] : @[]}];
+}
+
+#pragma mark - Long Press
+
+- (void)addLongPressEvent
+{
+ if (!_longPressGesture) {
+ _longPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onLongPress:)];
+ _longPressGesture.delegate = self;
+ [self.view addGestureRecognizer:_longPressGesture];
+ }
+}
+
+- (void)removeLongPressEvent
+{
+ if (_longPressGesture) {
+ [self.view removeGestureRecognizer:_longPressGesture];
+ _longPressGesture.delegate = nil;
+ _longPressGesture = nil;
+ }
+}
+
+- (void)onLongPress:(UILongPressGestureRecognizer *)gesture
+{
+ if (gesture.state == UIGestureRecognizerStateBegan) {
+ CGPoint screenLocation = [gesture locationInView:self.view.window];
+ CGPoint pageLoacation = [gesture locationInView:self.weexInstance.rootView];
+ NSDictionary *resultTouch = [self touchResultWithScreenLocation:screenLocation pageLocation:pageLoacation identifier:gesture.wx_identifier];
+ [self fireEvent:@"longpress" params:@{@"changedTouches":resultTouch ? @[resultTouch] : @[]}];
+ } else if (gesture.state == UIGestureRecognizerStateEnded) {
+ gesture.wx_identifier = nil;
+ }
+}
+
+#pragma makr - Pan
+
+- (void)addPanGesture
+{
+ if (!_panGesture) {
+ _panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onPan:)];
+ _panGesture.delegate = self;
+ [self.view addGestureRecognizer:_panGesture];
+ }
+}
+
+- (void)addPanStartEvent
+{
+ _listenPanStart = YES;
+ [self addPanGesture];
+}
+
+- (void)addPanMoveEvent
+{
+ _listenPanMove = YES;
+ [self addPanGesture];
+}
+
+- (void)addPanEndEvent
+{
+ _listenPanEnd = YES;
+ [self addPanGesture];
+}
+
+- (void)onPan:(UIPanGestureRecognizer *)gesture
+{
+ CGPoint screenLocation = [gesture locationInView:self.view.window];
+ CGPoint pageLoacation = [gesture locationInView:self.weexInstance.rootView];
+ NSString *eventName;
+ NSDictionary *resultTouch = [self touchResultWithScreenLocation:screenLocation pageLocation:pageLoacation identifier:gesture.wx_identifier];
+
+ if (gesture.state == UIGestureRecognizerStateBegan) {
+ eventName = @"panstart";
+ } else if (gesture.state == UIGestureRecognizerStateEnded) {
+ eventName = @"panend";
+ gesture.wx_identifier = nil;
+ } else if (gesture.state == UIGestureRecognizerStateChanged) {
+ eventName = @"panmove";
+ }
+
+ if (eventName) {
+ [self fireEvent:eventName params:@{@"changedTouches":resultTouch ? @[resultTouch] : @[]}];
+ }
+}
+
+- (void)removePanStartEvent
+{
+ _listenPanStart = NO;
+ [self checkRemovePanGesture];
+}
+
+- (void)removePanMoveEvent
+{
+ _listenPanMove = NO;
+ [self checkRemovePanGesture];
+}
+
+- (void)removePanEndEvent
+{
+ _listenPanEnd = NO;
+ [self checkRemovePanGesture];
+}
+
+- (void)checkRemovePanGesture
+{
+ if (_panGesture && !_listenPanStart && !_listenPanMove && !_listenPanEnd) {
+ [self.view removeGestureRecognizer:_panGesture];
+ _panGesture.delegate = nil;
+ _panGesture = nil;
+ }
+}
+
+#pragma mark - Touch Event
+
+- (WXTouchGestureRecognizer *)touchGesture
+{
+ if (!_touchGesture) {
+ _touchGesture = [[WXTouchGestureRecognizer alloc] initWithComponent:self];
+ _touchGesture.delegate = self;
+ [self.view addGestureRecognizer:_touchGesture];
+ }
+
+ return _touchGesture;
+}
+
+- (void)addTouchStartEvent
+{
+ self.touchGesture.listenTouchStart = YES;
+}
+
+- (void)addTouchMoveEvent
+{
+ self.touchGesture.listenTouchMove = YES;
+}
+
+- (void)addTouchEndEvent
+{
+ self.touchGesture.listenTouchEnd = YES;
+}
+
+- (void)addTouchCancelEvent
+{
+ self.touchGesture.listenTouchCancel = YES;
+}
+
+- (void)removeTouchStartEvent
+{
+ _touchGesture.listenTouchStart = NO;
+ [self checkRemoveTouchGesture];
+}
+
+- (void)removeTouchMoveEvent
+{
+ _touchGesture.listenTouchMove = NO;
+ [self checkRemoveTouchGesture];
+}
+
+- (void)removeTouchEndEvent
+{
+ _touchGesture.listenTouchEnd = NO;
+ [self checkRemoveTouchGesture];
+}
+
+- (void)removeTouchCancelEvent
+{
+ _touchGesture.listenTouchCancel = NO;
+ [self checkRemoveTouchGesture];
+}
+
+- (void)checkRemoveTouchGesture
+{
+ if (_touchGesture && !_touchGesture.listenTouchStart && !_touchGesture.listenTouchMove && !_touchGesture.listenTouchEnd && !_touchGesture.listenTouchCancel) {
+ [self.view removeGestureRecognizer:_touchGesture];
+ _touchGesture.delegate = nil;
+ _touchGesture = nil;
+ }
+}
+
+#pragma mark - UIGestureRecognizerDelegate
+
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
+{
+ return YES;
+}
+
+- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
+{
+ return YES;
+}
+
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
+{
+ // trigger touches
+ if ([gestureRecognizer isKindOfClass:[WXTouchGestureRecognizer class]]) {
+ return YES;
+ }
+
+//#ifdef DEBUG
+// if ([gestureRecognizer isKindOfClass:[WXDebugLongPressGestureRecognizer class]]
+// || [otherGestureRecognizer isKindOfClass:[WXDebugLongPressGestureRecognizer class]]) {
+// return YES;
+// }
+//#endif
+
+ return NO;
+}
+
+#pragma mark - Utils
+
+- (NSDictionary *)touchResultWithScreenLocation:(CGPoint)screenLocation pageLocation:(CGPoint)pageLocation identifier:(NSNumber *)identifier
+{
+ NSMutableDictionary *resultTouch = [[NSMutableDictionary alloc] initWithCapacity:5];
+ resultTouch[@"screenX"] = @(screenLocation.x/WXScreenResizeRadio());
+ resultTouch[@"screenY"] = @(screenLocation.y/WXScreenResizeRadio());
+ resultTouch[@"pageX"] = @(pageLocation.x/WXScreenResizeRadio());
+ resultTouch[@"pageY"] = @(pageLocation.y/WXScreenResizeRadio());
+ resultTouch[@"identifier"] = identifier;
+
+ return resultTouch;
+}
+
+@end
+
+@implementation WXTouchGestureRecognizer
+{
+ __weak WXComponent *_component;
+ NSUInteger _touchIdentifier;
+}
+
+- (instancetype)initWithTarget:(id)target action:(SEL)action
+{
+ return [self initWithComponent:nil];;
+}
+
+- (instancetype)initWithComponent:(WXComponent *)component
+{
+ if (self = [super initWithTarget:self action:@selector(touchResponse:)]) {
+ _component = component;
+
+ _listenTouchStart = NO;
+ _listenTouchEnd = NO;
+ _listenTouchMove = NO;
+ _listenTouchCancel = NO;
+
+ self.cancelsTouchesInView = NO;
+ }
+
+ return self;
+}
+
+- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
+{
+ [super touchesBegan:touches withEvent:event];
+
+ if (_listenTouchStart) {
+ [self fireTouchEvent:@"touchstart" withTouches:touches];
+ }
+}
+
+- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
+{
+ [super touchesMoved:touches withEvent:event];
+
+ if (_listenTouchMove) {
+ [self fireTouchEvent:@"touchmove" withTouches:touches];
+ }
+}
+
+- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
+{
+
+ [super touchesEnded:touches withEvent:event];
+
+ if (_listenTouchEnd) {
+ [self fireTouchEvent:@"touchend" withTouches:touches];
+ }
+}
+
+- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
+{
+ [super touchesCancelled:touches withEvent:event];
+
+ if (_listenTouchCancel) {
+ [self fireTouchEvent:@"touchcancel" withTouches:touches];
+ }
+}
+
+- (void)fireTouchEvent:(NSString *)eventName withTouches:(NSSet<UITouch *> *)touches
+{
+ NSMutableArray *resultTouches = [NSMutableArray new];
+
+ for (UITouch *touch in touches) {
+ CGPoint screenLocation = [touch locationInView:touch.window];
+ CGPoint pageLocation = [touch locationInView:_component.weexInstance.rootView];
+ if (!touch.wx_identifier) {
+ touch.wx_identifier = @(_touchIdentifier++);
+ }
+ NSDictionary *resultTouch = [_component touchResultWithScreenLocation:screenLocation pageLocation:pageLocation identifier:touch.wx_identifier];
+ [resultTouches addObject:resultTouch];
+ }
+
+ [_component fireEvent:eventName params:@{@"changedTouches":resultTouches ?: @[]}];
+}
+
+- (void)touchResponse:(UIGestureRecognizer *)gesture
+{
+
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.h b/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.h
new file mode 100644
index 0000000..8fb1370
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXNavigationProtocol.h"
+
+@interface WXNavigationDefaultImpl : NSObject <WXNavigationProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.m b/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.m
new file mode 100644
index 0000000..47d647d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.m
@@ -0,0 +1,353 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXNavigationDefaultImpl.h"
+#import "WXBaseViewController.h"
+#import "WXSDKManager.h"
+#import "WXComponent.h"
+#import "WXImgLoaderProtocol.h"
+#import "WXHandlerFactory.h"
+#import "WXConvert.h"
+
+@interface WXBarButton :UIButton
+
+@property (nonatomic, strong) NSString *instanceId;
+@property (nonatomic, strong) NSString *nodeRef;
+@property (nonatomic) WXNavigationItemPosition position;
+
+@end
+
+@implementation WXBarButton
+
+@end
+
+@implementation WXNavigationDefaultImpl
+
+#pragma mark -
+#pragma mark WXNavigationProtocol
+
+- (id<WXImgLoaderProtocol>)imageLoader
+{
+ static id<WXImgLoaderProtocol> imageLoader;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ imageLoader = [WXHandlerFactory handlerForProtocol:@protocol(WXImgLoaderProtocol)];
+ });
+ return imageLoader;
+}
+
+- (id)navigationControllerOfContainer:(UIViewController *)container{
+ return container.navigationController;
+}
+
+- (void)pushViewControllerWithParam:(NSDictionary *)param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ if (0 == [param count] || !param[@"url"] || !container) {
+ [self callback:block code:MSG_PARAM_ERR data:nil];
+ return;
+ }
+
+ BOOL animated = YES;
+ NSString *obj = [[param objectForKey:@"animated"] uppercaseString];
+ if (obj && [obj isEqualToString:@"false"]) {
+ animated = NO;
+ }
+
+ WXBaseViewController *vc = [[WXBaseViewController alloc]initWithSourceURL:[NSURL URLWithString:param[@"url"]]];
+ vc.hidesBottomBarWhenPushed = YES;
+ [container.navigationController pushViewController:vc animated:animated];
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (void)popViewControllerWithParam:(NSDictionary *)param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ BOOL animated = YES;
+ NSString *obj = [[param objectForKey:@"animated"] uppercaseString];
+ if (obj && [obj isEqualToString:@"false"]) {
+ animated = NO;
+ }
+
+ [container.navigationController popViewControllerAnimated:animated];
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (void)popToRootViewControllerWithParam:(NSDictionary *)param
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ BOOL animated = YES;
+ NSString *obj = [[param objectForKey:@"animated"] uppercaseString];
+ if (obj && [obj isEqualToString:@"false"]) {
+ animated = NO;
+ }
+
+ [container.navigationController popToRootViewControllerAnimated:animated];
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated
+ withContainer:(UIViewController *)container
+{
+ //If weex launchs in the WXBaseViewController, the navigationBar is hidden according to our design.
+ if (![container isKindOfClass:[WXBaseViewController class]]) {
+ return;
+ }
+
+ container.navigationController.navigationBarHidden = hidden;
+}
+
+- (void)setNavigationBackgroundColor:(UIColor *)backgroundColor
+ withContainer:(UIViewController *)container
+{
+ if (backgroundColor) {
+ container.navigationController.navigationBar.barTintColor = backgroundColor;
+ }
+}
+
+- (void)setNavigationItemWithParam:(NSDictionary *)param
+ position:(WXNavigationItemPosition)position
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ switch (position) {
+ case WXNavigationItemPositionLeft:
+ [self setNaviBarLeftItem:param completion:block withContainer:container];
+ break;
+ case WXNavigationItemPositionRight:
+ [self setNaviBarRightItem:param completion:block withContainer:container];
+ break;
+ case WXNavigationItemPositionMore:
+ break;
+ case WXNavigationItemPositionCenter:
+ [self setNaviBarTitle:param completion:block withContainer:container];
+ break;
+ default:
+ break;
+ }
+}
+
+- (void)clearNavigationItemWithParam:(NSDictionary *)param
+ position:(WXNavigationItemPosition)position
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ switch (position) {
+ case WXNavigationItemPositionLeft:
+ [self clearNaviBarLeftItem:param completion:block withContainer:container];
+ break;
+ case WXNavigationItemPositionRight:
+ [self clearNaviBarRightItem:param completion:block withContainer:container];
+ break;
+ case WXNavigationItemPositionMore:
+ break;
+ case WXNavigationItemPositionCenter:
+ [self clearNaviBarTitle:param completion:block withContainer:container];
+ break;
+ default:
+ break;
+ }
+}
+
+- (void)setNaviBarLeftItem:(NSDictionary *)param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ if (0 == [param count]) {
+ [self callback:block code:MSG_PARAM_ERR data:nil];
+ return;
+ }
+
+ UIView *view = [self barButton:param position:WXNavigationItemPositionLeft withContainer:container];
+
+ if (!view) {
+ [self callback:block code:MSG_FAILED data:nil];
+ return;
+ }
+
+ container.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:view];
+
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (void)clearNaviBarLeftItem:(NSDictionary *) param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ container.navigationItem.leftBarButtonItem = nil;
+
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (void)setNaviBarRightItem:(NSDictionary *)param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ if (0 == [param count]) {
+ [self callback:block code:MSG_PARAM_ERR data:nil];
+ return;
+ }
+
+ UIView *view = [self barButton:param position:WXNavigationItemPositionRight withContainer:container];
+
+ if (!view) {
+ [self callback:block code:MSG_FAILED data:nil];
+ return;
+ }
+
+ container.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:view];
+
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (void)clearNaviBarRightItem:(NSDictionary *) param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ container.navigationItem.rightBarButtonItem = nil;
+
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (void)setNaviBarTitle:(NSDictionary *)param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ if (0 == [param count]) {
+ [self callback:block code:MSG_PARAM_ERR data:nil];
+ return;
+ }
+
+ container.navigationItem.title = param[@"title"];
+
+ [self callback:block code:MSG_SUCCESS data:nil];;
+}
+
+- (void)clearNaviBarTitle:(NSDictionary *)param completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container
+{
+ container.navigationItem.title = @"";
+
+ [self callback:block code:MSG_SUCCESS data:nil];
+}
+
+- (UIView *)barButton:(NSDictionary *)param position:(WXNavigationItemPosition)position
+ withContainer:(UIViewController *)container
+{
+ if (param[@"title"]) {
+ NSString *title = param[@"title"];
+
+ NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:18]};
+ CGSize size = [title boundingRectWithSize:CGSizeMake(70.0f, 18.0f) options: NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:attribute context:nil].size;
+
+ WXBarButton *button = [WXBarButton buttonWithType:UIButtonTypeRoundedRect];
+ button.frame = CGRectMake(0, 0, size.width, size.height);
+ button.titleLabel.font = [UIFont systemFontOfSize:16];
+ [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+ [button setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
+ [button setTitle:title forState:UIControlStateNormal];
+ [button setTitle:title forState:UIControlStateHighlighted];
+ [button addTarget:self action:@selector(onClickBarButton:) forControlEvents:UIControlEventTouchUpInside];
+
+ button.instanceId = param[@"instanceId"];
+ button.nodeRef = param[@"nodeRef"];
+ button.position = position;
+
+ NSString *color = param[@"titleColor"];
+ if (color) {
+ [button setTitleColor:[WXConvert UIColor:color] forState:UIControlStateNormal];
+ [button setTitleColor:[WXConvert UIColor:color] forState:UIControlStateHighlighted];
+ }
+
+ return button;
+ }
+ else if (param[@"icon"]) {
+ NSString *icon = param[@"icon"];
+
+ if (icon) {
+ WXBarButton *button = [WXBarButton buttonWithType:UIButtonTypeRoundedRect];
+ button.frame = CGRectMake(0, 0, 25, 25);
+ button.instanceId = param[@"instanceId"];
+ button.nodeRef = param[@"nodeRef"];
+ button.position = position;
+ [button addTarget:self action:@selector(onClickBarButton:) forControlEvents:UIControlEventTouchUpInside];
+
+ [[self imageLoader] downloadImageWithURL:icon imageFrame:CGRectMake(0, 0, 25, 25) userInfo:nil completed:^(UIImage *image, NSError *error, BOOL finished) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [button setBackgroundImage:image forState:UIControlStateNormal];
+ [button setBackgroundImage:image forState:UIControlStateHighlighted];
+ });
+ }];
+
+ return button;
+ }
+ }
+
+ return nil;
+}
+
+- (UIView *)titleView:(NSDictionary *)param
+{
+ UIView *titleView = nil;
+
+ if (param[@"title"]) {
+ UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 20.0f)];
+ label.backgroundColor = [UIColor clearColor];
+ label.textAlignment = NSTextAlignmentCenter;
+ label.lineBreakMode = NSLineBreakByTruncatingTail;
+ label.textColor = [UIColor whiteColor];
+ label.font = [UIFont systemFontOfSize:18.0f];
+ label.text = param[@"title"];
+
+ UIColor *titleColor = param[@"titleColor"];
+ if (titleColor) {
+ label.textColor = [WXConvert UIColor:titleColor];
+ }
+ else {
+ label.textColor = [UIColor blueColor];
+ }
+ titleView = label;
+ }
+
+ return titleView;
+}
+
+- (void)onClickBarButton:(id)sender
+{
+ WXBarButton *button = (WXBarButton *)sender;
+ if (button.instanceId) {
+ if (button.nodeRef)
+ {
+ [[WXSDKManager bridgeMgr] fireEvent:button.instanceId ref:button.nodeRef type:@"click" params:nil];
+ }
+ else
+ {
+ NSString *eventType;
+ switch (button.position) {
+ case WXNavigationItemPositionLeft:
+ eventType = @"clickleftitem";
+ break;
+ case WXNavigationItemPositionRight:
+ eventType = @"clickrightitem";
+ break;
+ case WXNavigationItemPositionMore:
+ eventType = @"clickmoreitem";
+ break;
+ default:
+ break;
+ }
+
+ [[WXSDKManager bridgeMgr] fireEvent:button.instanceId ref:WX_SDK_ROOT_REF type:eventType params:nil];
+ }
+ }
+}
+
+- (void)callback:(WXNavigationResultBlock)block code:(NSString *)code data:(NSDictionary *)reposonData
+{
+ if (block) {
+ block(code, reposonData);
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.h b/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.h
new file mode 100644
index 0000000..3578dd5
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXNetworkProtocol.h"
+
+@interface WXNetworkDefaultImpl : NSObject <WXNetworkProtocol, NSURLSessionDelegate>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.m b/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.m
new file mode 100644
index 0000000..72a0ed3
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Handler/WXNetworkDefaultImpl.m
@@ -0,0 +1,105 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXNetworkDefaultImpl.h"
+
+@interface WXNetworkCallbackInfo : NSObject
+
+@property (nonatomic, copy) void(^sendDataCallback)(int64_t, int64_t);
+@property (nonatomic, copy) void(^responseCallback)(NSURLResponse *);
+@property (nonatomic, copy) void(^receiveDataCallback)(NSData *);
+@property (nonatomic, strong) NSMutableData *data;
+@property (nonatomic, copy) void(^compeletionCallback)(NSData *, NSError *);
+
+@end
+
+@implementation WXNetworkCallbackInfo
+
+@end
+
+@implementation WXNetworkDefaultImpl
+{
+ NSMutableDictionary *_callbacks;
+ NSURLSession *_session;
+}
+
+- (id)sendRequest:(NSURLRequest *)request withSendingData:(void (^)(int64_t, int64_t))sendDataCallback
+ withResponse:(void (^)(NSURLResponse *))responseCallback
+ withReceiveData:(void (^)(NSData *))receiveDataCallback
+ withCompeletion:(void (^)(NSData *, NSError *))compeletionCallback
+{
+ WXNetworkCallbackInfo *info = [WXNetworkCallbackInfo new];
+ info.sendDataCallback = sendDataCallback;
+ info.responseCallback = responseCallback;
+ info.receiveDataCallback = receiveDataCallback;
+ info.compeletionCallback = compeletionCallback;
+
+ if (!_session) {
+ _session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]
+ delegate:self
+ delegateQueue:[NSOperationQueue mainQueue]];
+ }
+
+ NSURLSessionDataTask *task = [_session dataTaskWithRequest:request];
+ if (!_callbacks) {
+ _callbacks = [NSMutableDictionary dictionary];
+ }
+ [_callbacks setObject:info forKey:task];
+ [task resume];
+
+ return task;
+}
+
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
+ didSendBodyData:(int64_t)bytesSent
+ totalBytesSent:(int64_t)totalBytesSent
+ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
+{
+ WXNetworkCallbackInfo *info = [_callbacks objectForKey:task];
+ if (info.sendDataCallback) {
+ info.sendDataCallback(totalBytesSent, totalBytesExpectedToSend);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)task
+ didReceiveResponse:(NSURLResponse *)response
+ completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler
+{
+ WXNetworkCallbackInfo *info = [_callbacks objectForKey:task];
+ if (info.responseCallback) {
+ info.responseCallback(response);
+ }
+ completionHandler(NSURLSessionResponseAllow);
+}
+
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)task didReceiveData:(NSData *)data
+{
+ WXNetworkCallbackInfo *info = [_callbacks objectForKey:task];
+ if (info.receiveDataCallback) {
+ info.receiveDataCallback(data);
+ }
+
+ NSMutableData *mutableData = info.data;
+ if (!mutableData) {
+ mutableData = [NSMutableData new];
+ info.data = mutableData;
+ }
+
+ [mutableData appendData:data];
+}
+
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
+{
+ WXNetworkCallbackInfo *info = [_callbacks objectForKey:task];
+ if (info.compeletionCallback) {
+ info.compeletionCallback(info.data, error);
+ }
+ [_callbacks removeObjectForKey:task];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Layout/Layout.c
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/Layout.c b/ios/sdk/WeexSDK/Sources/Layout/Layout.c
new file mode 100644
index 0000000..44d4d60
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Layout/Layout.c
@@ -0,0 +1,1324 @@
+
+/**
+ * Copyright (c) 2014, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+// in concatenated header, don't include Layout.h it's already at the top
+#ifndef CSS_LAYOUT_IMPLEMENTATION
+#include "Layout.h"
+#endif
+
+#ifdef _MSC_VER
+#include <float.h>
+#define isnan _isnan
+
+/* define fmaxf if < VC12 */
+#if _MSC_VER < 1800
+__forceinline const float fmaxf(const float a, const float b) {
+ return (a > b) ? a : b;
+}
+#endif
+#endif
+
+bool isUndefined(float value) {
+ return isnan(value);
+}
+
+static bool eq(float a, float b) {
+ if (isUndefined(a)) {
+ return isUndefined(b);
+ }
+ return fabs(a - b) < 0.0001;
+}
+
+void init_css_node(css_node_t *node) {
+ node->style.align_items = CSS_ALIGN_STRETCH;
+ node->style.align_content = CSS_ALIGN_FLEX_START;
+
+ node->style.direction = CSS_DIRECTION_INHERIT;
+ node->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN;
+
+ // Some of the fields default to undefined and not 0
+ node->style.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ node->style.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+
+ node->style.minDimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ node->style.minDimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+
+ node->style.maxDimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ node->style.maxDimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+
+ node->style.position[CSS_LEFT] = CSS_UNDEFINED;
+ node->style.position[CSS_TOP] = CSS_UNDEFINED;
+ node->style.position[CSS_RIGHT] = CSS_UNDEFINED;
+ node->style.position[CSS_BOTTOM] = CSS_UNDEFINED;
+
+ node->style.margin[CSS_START] = CSS_UNDEFINED;
+ node->style.margin[CSS_END] = CSS_UNDEFINED;
+ node->style.padding[CSS_START] = CSS_UNDEFINED;
+ node->style.padding[CSS_END] = CSS_UNDEFINED;
+ node->style.border[CSS_START] = CSS_UNDEFINED;
+ node->style.border[CSS_END] = CSS_UNDEFINED;
+
+ node->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ node->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+
+ // Such that the comparison is always going to be false
+ node->layout.last_requested_dimensions[CSS_WIDTH] = -1;
+ node->layout.last_requested_dimensions[CSS_HEIGHT] = -1;
+ node->layout.last_parent_max_width = -1;
+ node->layout.last_parent_max_height = -1;
+ node->layout.last_direction = (css_direction_t)-1;
+ node->layout.should_update = true;
+}
+
+css_node_t *new_css_node() {
+ css_node_t *node = (css_node_t *)calloc(1, sizeof(*node));
+ init_css_node(node);
+ return node;
+}
+
+void free_css_node(css_node_t *node) {
+ free(node);
+}
+
+static void indent(int n) {
+ for (int i = 0; i < n; ++i) {
+ printf(" ");
+ }
+}
+
+static void print_number_0(const char *str, float number) {
+ if (!eq(number, 0)) {
+ printf("%s: %g, ", str, number);
+ }
+}
+
+static void print_number_nan(const char *str, float number) {
+ if (!isnan(number)) {
+ printf("%s: %g, ", str, number);
+ }
+}
+
+static bool four_equal(float four[4]) {
+ return
+ eq(four[0], four[1]) &&
+ eq(four[0], four[2]) &&
+ eq(four[0], four[3]);
+}
+
+
+static void print_css_node_rec(
+ css_node_t *node,
+ css_print_options_t options,
+ int level
+) {
+ indent(level);
+ printf("{");
+
+ if (node->print) {
+ node->print(node->context);
+ }
+
+ if (options & CSS_PRINT_LAYOUT) {
+ printf("layout: {");
+ printf("width: %g, ", node->layout.dimensions[CSS_WIDTH]);
+ printf("height: %g, ", node->layout.dimensions[CSS_HEIGHT]);
+ printf("top: %g, ", node->layout.position[CSS_TOP]);
+ printf("left: %g", node->layout.position[CSS_LEFT]);
+ printf("}, ");
+ }
+
+ if (options & CSS_PRINT_STYLE) {
+ if (node->style.flex_direction == CSS_FLEX_DIRECTION_COLUMN) {
+ printf("flexDirection: 'column', ");
+ } else if (node->style.flex_direction == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
+ printf("flexDirection: 'columnReverse', ");
+ } else if (node->style.flex_direction == CSS_FLEX_DIRECTION_ROW) {
+ printf("flexDirection: 'row', ");
+ } else if (node->style.flex_direction == CSS_FLEX_DIRECTION_ROW_REVERSE) {
+ printf("flexDirection: 'rowReverse', ");
+ }
+
+ if (node->style.justify_content == CSS_JUSTIFY_CENTER) {
+ printf("justifyContent: 'center', ");
+ } else if (node->style.justify_content == CSS_JUSTIFY_FLEX_END) {
+ printf("justifyContent: 'flex-end', ");
+ } else if (node->style.justify_content == CSS_JUSTIFY_SPACE_AROUND) {
+ printf("justifyContent: 'space-around', ");
+ } else if (node->style.justify_content == CSS_JUSTIFY_SPACE_BETWEEN) {
+ printf("justifyContent: 'space-between', ");
+ }
+
+ if (node->style.align_items == CSS_ALIGN_CENTER) {
+ printf("alignItems: 'center', ");
+ } else if (node->style.align_items == CSS_ALIGN_FLEX_END) {
+ printf("alignItems: 'flex-end', ");
+ } else if (node->style.align_items == CSS_ALIGN_STRETCH) {
+ printf("alignItems: 'stretch', ");
+ }
+
+ if (node->style.align_content == CSS_ALIGN_CENTER) {
+ printf("alignContent: 'center', ");
+ } else if (node->style.align_content == CSS_ALIGN_FLEX_END) {
+ printf("alignContent: 'flex-end', ");
+ } else if (node->style.align_content == CSS_ALIGN_STRETCH) {
+ printf("alignContent: 'stretch', ");
+ }
+
+ if (node->style.align_self == CSS_ALIGN_FLEX_START) {
+ printf("alignSelf: 'flex-start', ");
+ } else if (node->style.align_self == CSS_ALIGN_CENTER) {
+ printf("alignSelf: 'center', ");
+ } else if (node->style.align_self == CSS_ALIGN_FLEX_END) {
+ printf("alignSelf: 'flex-end', ");
+ } else if (node->style.align_self == CSS_ALIGN_STRETCH) {
+ printf("alignSelf: 'stretch', ");
+ }
+
+ print_number_nan("flex", node->style.flex);
+
+ if (four_equal(node->style.margin)) {
+ print_number_0("margin", node->style.margin[CSS_LEFT]);
+ } else {
+ print_number_0("marginLeft", node->style.margin[CSS_LEFT]);
+ print_number_0("marginRight", node->style.margin[CSS_RIGHT]);
+ print_number_0("marginTop", node->style.margin[CSS_TOP]);
+ print_number_0("marginBottom", node->style.margin[CSS_BOTTOM]);
+ print_number_0("marginStart", node->style.margin[CSS_START]);
+ print_number_0("marginEnd", node->style.margin[CSS_END]);
+ }
+
+ if (four_equal(node->style.padding)) {
+ print_number_0("padding", node->style.margin[CSS_LEFT]);
+ } else {
+ print_number_0("paddingLeft", node->style.padding[CSS_LEFT]);
+ print_number_0("paddingRight", node->style.padding[CSS_RIGHT]);
+ print_number_0("paddingTop", node->style.padding[CSS_TOP]);
+ print_number_0("paddingBottom", node->style.padding[CSS_BOTTOM]);
+ print_number_0("paddingStart", node->style.padding[CSS_START]);
+ print_number_0("paddingEnd", node->style.padding[CSS_END]);
+ }
+
+ if (four_equal(node->style.border)) {
+ print_number_0("borderWidth", node->style.border[CSS_LEFT]);
+ } else {
+ print_number_0("borderLeftWidth", node->style.border[CSS_LEFT]);
+ print_number_0("borderRightWidth", node->style.border[CSS_RIGHT]);
+ print_number_0("borderTopWidth", node->style.border[CSS_TOP]);
+ print_number_0("borderBottomWidth", node->style.border[CSS_BOTTOM]);
+ print_number_0("borderStartWidth", node->style.border[CSS_START]);
+ print_number_0("borderEndWidth", node->style.border[CSS_END]);
+ }
+
+ print_number_nan("width", node->style.dimensions[CSS_WIDTH]);
+ print_number_nan("height", node->style.dimensions[CSS_HEIGHT]);
+
+ if (node->style.position_type == CSS_POSITION_ABSOLUTE) {
+ printf("position: 'absolute', ");
+ }
+
+ print_number_nan("left", node->style.position[CSS_LEFT]);
+ print_number_nan("right", node->style.position[CSS_RIGHT]);
+ print_number_nan("top", node->style.position[CSS_TOP]);
+ print_number_nan("bottom", node->style.position[CSS_BOTTOM]);
+ }
+
+ if (options & CSS_PRINT_CHILDREN && node->children_count > 0) {
+ printf("children: [\n");
+ for (int i = 0; i < node->children_count; ++i) {
+ print_css_node_rec(node->get_child(node->context, i), options, level + 1);
+ }
+ indent(level);
+ printf("]},\n");
+ } else {
+ printf("},\n");
+ }
+}
+
+void print_css_node(css_node_t *node, css_print_options_t options) {
+ print_css_node_rec(node, options, 0);
+}
+
+
+static css_position_t leading[4] = {
+ /* CSS_FLEX_DIRECTION_COLUMN = */ CSS_TOP,
+ /* CSS_FLEX_DIRECTION_COLUMN_REVERSE = */ CSS_BOTTOM,
+ /* CSS_FLEX_DIRECTION_ROW = */ CSS_LEFT,
+ /* CSS_FLEX_DIRECTION_ROW_REVERSE = */ CSS_RIGHT
+};
+static css_position_t trailing[4] = {
+ /* CSS_FLEX_DIRECTION_COLUMN = */ CSS_BOTTOM,
+ /* CSS_FLEX_DIRECTION_COLUMN_REVERSE = */ CSS_TOP,
+ /* CSS_FLEX_DIRECTION_ROW = */ CSS_RIGHT,
+ /* CSS_FLEX_DIRECTION_ROW_REVERSE = */ CSS_LEFT
+};
+static css_position_t pos[4] = {
+ /* CSS_FLEX_DIRECTION_COLUMN = */ CSS_TOP,
+ /* CSS_FLEX_DIRECTION_COLUMN_REVERSE = */ CSS_BOTTOM,
+ /* CSS_FLEX_DIRECTION_ROW = */ CSS_LEFT,
+ /* CSS_FLEX_DIRECTION_ROW_REVERSE = */ CSS_RIGHT
+};
+static css_dimension_t dim[4] = {
+ /* CSS_FLEX_DIRECTION_COLUMN = */ CSS_HEIGHT,
+ /* CSS_FLEX_DIRECTION_COLUMN_REVERSE = */ CSS_HEIGHT,
+ /* CSS_FLEX_DIRECTION_ROW = */ CSS_WIDTH,
+ /* CSS_FLEX_DIRECTION_ROW_REVERSE = */ CSS_WIDTH
+};
+
+static bool isRowDirection(css_flex_direction_t flex_direction) {
+ return flex_direction == CSS_FLEX_DIRECTION_ROW ||
+ flex_direction == CSS_FLEX_DIRECTION_ROW_REVERSE;
+}
+
+static bool isColumnDirection(css_flex_direction_t flex_direction) {
+ return flex_direction == CSS_FLEX_DIRECTION_COLUMN ||
+ flex_direction == CSS_FLEX_DIRECTION_COLUMN_REVERSE;
+}
+
+static float getLeadingMargin(css_node_t *node, css_flex_direction_t axis) {
+ if (isRowDirection(axis) && !isUndefined(node->style.margin[CSS_START])) {
+ return node->style.margin[CSS_START];
+ }
+
+ return node->style.margin[leading[axis]];
+}
+
+static float getTrailingMargin(css_node_t *node, css_flex_direction_t axis) {
+ if (isRowDirection(axis) && !isUndefined(node->style.margin[CSS_END])) {
+ return node->style.margin[CSS_END];
+ }
+
+ return node->style.margin[trailing[axis]];
+}
+
+static float getLeadingPadding(css_node_t *node, css_flex_direction_t axis) {
+ if (isRowDirection(axis) &&
+ !isUndefined(node->style.padding[CSS_START]) &&
+ node->style.padding[CSS_START] >= 0) {
+ return node->style.padding[CSS_START];
+ }
+
+ if (node->style.padding[leading[axis]] >= 0) {
+ return node->style.padding[leading[axis]];
+ }
+
+ return 0;
+}
+
+static float getTrailingPadding(css_node_t *node, css_flex_direction_t axis) {
+ if (isRowDirection(axis) &&
+ !isUndefined(node->style.padding[CSS_END]) &&
+ node->style.padding[CSS_END] >= 0) {
+ return node->style.padding[CSS_END];
+ }
+
+ if (node->style.padding[trailing[axis]] >= 0) {
+ return node->style.padding[trailing[axis]];
+ }
+
+ return 0;
+}
+
+static float getLeadingBorder(css_node_t *node, css_flex_direction_t axis) {
+ if (isRowDirection(axis) &&
+ !isUndefined(node->style.border[CSS_START]) &&
+ node->style.border[CSS_START] >= 0) {
+ return node->style.border[CSS_START];
+ }
+
+ if (node->style.border[leading[axis]] >= 0) {
+ return node->style.border[leading[axis]];
+ }
+
+ return 0;
+}
+
+static float getTrailingBorder(css_node_t *node, css_flex_direction_t axis) {
+ if (isRowDirection(axis) &&
+ !isUndefined(node->style.border[CSS_END]) &&
+ node->style.border[CSS_END] >= 0) {
+ return node->style.border[CSS_END];
+ }
+
+ if (node->style.border[trailing[axis]] >= 0) {
+ return node->style.border[trailing[axis]];
+ }
+
+ return 0;
+}
+
+static float getLeadingPaddingAndBorder(css_node_t *node, css_flex_direction_t axis) {
+ return getLeadingPadding(node, axis) + getLeadingBorder(node, axis);
+}
+
+static float getTrailingPaddingAndBorder(css_node_t *node, css_flex_direction_t axis) {
+ return getTrailingPadding(node, axis) + getTrailingBorder(node, axis);
+}
+
+static float getBorderAxis(css_node_t *node, css_flex_direction_t axis) {
+ return getLeadingBorder(node, axis) + getTrailingBorder(node, axis);
+}
+
+static float getMarginAxis(css_node_t *node, css_flex_direction_t axis) {
+ return getLeadingMargin(node, axis) + getTrailingMargin(node, axis);
+}
+
+static float getPaddingAndBorderAxis(css_node_t *node, css_flex_direction_t axis) {
+ return getLeadingPaddingAndBorder(node, axis) + getTrailingPaddingAndBorder(node, axis);
+}
+
+static css_align_t getAlignItem(css_node_t *node, css_node_t *child) {
+ if (child->style.align_self != CSS_ALIGN_AUTO) {
+ return child->style.align_self;
+ }
+ return node->style.align_items;
+}
+
+static css_direction_t resolveDirection(css_node_t *node, css_direction_t parentDirection) {
+ css_direction_t direction = node->style.direction;
+
+ if (direction == CSS_DIRECTION_INHERIT) {
+ direction = parentDirection > CSS_DIRECTION_INHERIT ? parentDirection : CSS_DIRECTION_LTR;
+ }
+
+ return direction;
+}
+
+static css_flex_direction_t getFlexDirection(css_node_t *node) {
+ return node->style.flex_direction;
+}
+
+static css_flex_direction_t resolveAxis(css_flex_direction_t flex_direction, css_direction_t direction) {
+ if (direction == CSS_DIRECTION_RTL) {
+ if (flex_direction == CSS_FLEX_DIRECTION_ROW) {
+ return CSS_FLEX_DIRECTION_ROW_REVERSE;
+ } else if (flex_direction == CSS_FLEX_DIRECTION_ROW_REVERSE) {
+ return CSS_FLEX_DIRECTION_ROW;
+ }
+ }
+
+ return flex_direction;
+}
+
+static css_flex_direction_t getCrossFlexDirection(css_flex_direction_t flex_direction, css_direction_t direction) {
+ if (isColumnDirection(flex_direction)) {
+ return resolveAxis(CSS_FLEX_DIRECTION_ROW, direction);
+ } else {
+ return CSS_FLEX_DIRECTION_COLUMN;
+ }
+}
+
+static float getFlex(css_node_t *node) {
+ return node->style.flex;
+}
+
+static bool isFlex(css_node_t *node) {
+ return (
+ node->style.position_type == CSS_POSITION_RELATIVE &&
+ getFlex(node) > 0
+ );
+}
+
+static bool isFlexWrap(css_node_t *node) {
+ return node->style.flex_wrap == CSS_WRAP;
+}
+
+static float getDimWithMargin(css_node_t *node, css_flex_direction_t axis) {
+ return node->layout.dimensions[dim[axis]] +
+ getLeadingMargin(node, axis) +
+ getTrailingMargin(node, axis);
+}
+
+static bool isStyleDimDefined(css_node_t *node, css_flex_direction_t axis) {
+ float value = node->style.dimensions[dim[axis]];
+ return !isUndefined(value) && value >= 0.0;
+}
+
+static bool isLayoutDimDefined(css_node_t *node, css_flex_direction_t axis) {
+ float value = node->layout.dimensions[dim[axis]];
+ return !isUndefined(value) && value >= 0.0;
+}
+
+static bool isPosDefined(css_node_t *node, css_position_t position) {
+ return !isUndefined(node->style.position[position]);
+}
+
+static bool isMeasureDefined(css_node_t *node) {
+ return node->measure;
+}
+
+static float getPosition(css_node_t *node, css_position_t position) {
+ float result = node->style.position[position];
+ if (!isUndefined(result)) {
+ return result;
+ }
+ return 0;
+}
+
+static float boundAxis(css_node_t *node, css_flex_direction_t axis, float value) {
+ float min = CSS_UNDEFINED;
+ float max = CSS_UNDEFINED;
+
+ if (isColumnDirection(axis)) {
+ min = node->style.minDimensions[CSS_HEIGHT];
+ max = node->style.maxDimensions[CSS_HEIGHT];
+ } else if (isRowDirection(axis)) {
+ min = node->style.minDimensions[CSS_WIDTH];
+ max = node->style.maxDimensions[CSS_WIDTH];
+ }
+
+ float boundValue = value;
+
+ if (!isUndefined(max) && max >= 0.0 && boundValue > max) {
+ boundValue = max;
+ }
+ if (!isUndefined(min) && min >= 0.0 && boundValue < min) {
+ boundValue = min;
+ }
+
+ return boundValue;
+}
+
+// When the user specifically sets a value for width or height
+static void setDimensionFromStyle(css_node_t *node, css_flex_direction_t axis) {
+ // The parent already computed us a width or height. We just skip it
+ if (isLayoutDimDefined(node, axis)) {
+ return;
+ }
+ // We only run if there's a width or height defined
+ if (!isStyleDimDefined(node, axis)) {
+ return;
+ }
+
+ // The dimensions can never be smaller than the padding and border
+ node->layout.dimensions[dim[axis]] = fmaxf(
+ boundAxis(node, axis, node->style.dimensions[dim[axis]]),
+ getPaddingAndBorderAxis(node, axis)
+ );
+}
+
+static void setTrailingPosition(css_node_t *node, css_node_t *child, css_flex_direction_t axis) {
+ child->layout.position[trailing[axis]] = node->layout.dimensions[dim[axis]] -
+ child->layout.dimensions[dim[axis]] - child->layout.position[pos[axis]];
+ }
+
+// If both left and right are defined, then use left. Otherwise return
+// +left or -right depending on which is defined.
+static float getRelativePosition(css_node_t *node, css_flex_direction_t axis) {
+ float lead = node->style.position[leading[axis]];
+ if (!isUndefined(lead)) {
+ return lead;
+ }
+ return -getPosition(node, trailing[axis]);
+}
+
+static void layoutNodeImpl(css_node_t *node, float parentMaxWidth, float parentMaxHeight, css_direction_t parentDirection) {
+ /** START_GENERATED **/
+ css_direction_t direction = resolveDirection(node, parentDirection);
+ css_flex_direction_t mainAxis = resolveAxis(getFlexDirection(node), direction);
+ css_flex_direction_t crossAxis = getCrossFlexDirection(mainAxis, direction);
+ css_flex_direction_t resolvedRowAxis = resolveAxis(CSS_FLEX_DIRECTION_ROW, direction);
+
+ // Handle width and height style attributes
+ setDimensionFromStyle(node, mainAxis);
+ setDimensionFromStyle(node, crossAxis);
+
+ // Set the resolved resolution in the node's layout
+ node->layout.direction = direction;
+
+ // The position is set by the parent, but we need to complete it with a
+ // delta composed of the margin and left/top/right/bottom
+ node->layout.position[leading[mainAxis]] += getLeadingMargin(node, mainAxis) +
+ getRelativePosition(node, mainAxis);
+ node->layout.position[trailing[mainAxis]] += getTrailingMargin(node, mainAxis) +
+ getRelativePosition(node, mainAxis);
+ node->layout.position[leading[crossAxis]] += getLeadingMargin(node, crossAxis) +
+ getRelativePosition(node, crossAxis);
+ node->layout.position[trailing[crossAxis]] += getTrailingMargin(node, crossAxis) +
+ getRelativePosition(node, crossAxis);
+
+ // Inline immutable values from the target node to avoid excessive method
+ // invocations during the layout calculation.
+ int childCount = node->children_count;
+ float paddingAndBorderAxisResolvedRow = getPaddingAndBorderAxis(node, resolvedRowAxis);
+ float paddingAndBorderAxisColumn = getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_COLUMN);
+
+ if (isMeasureDefined(node)) {
+ bool isResolvedRowDimDefined = isLayoutDimDefined(node, resolvedRowAxis);
+
+ float width = CSS_UNDEFINED;
+ css_measure_mode_t widthMode = CSS_MEASURE_MODE_UNDEFINED;
+ if (isStyleDimDefined(node, resolvedRowAxis)) {
+ width = node->style.dimensions[CSS_WIDTH];
+ widthMode = CSS_MEASURE_MODE_EXACTLY;
+ } else if (isResolvedRowDimDefined) {
+ width = node->layout.dimensions[dim[resolvedRowAxis]];
+ widthMode = CSS_MEASURE_MODE_EXACTLY;
+ } else {
+ width = parentMaxWidth -
+ getMarginAxis(node, resolvedRowAxis);
+ widthMode = CSS_MEASURE_MODE_AT_MOST;
+ }
+ width -= paddingAndBorderAxisResolvedRow;
+ if (isUndefined(width)) {
+ widthMode = CSS_MEASURE_MODE_UNDEFINED;
+ }
+
+ float height = CSS_UNDEFINED;
+ css_measure_mode_t heightMode = CSS_MEASURE_MODE_UNDEFINED;
+ if (isStyleDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
+ height = node->style.dimensions[CSS_HEIGHT];
+ heightMode = CSS_MEASURE_MODE_EXACTLY;
+ } else if (isLayoutDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
+ height = node->layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]];
+ heightMode = CSS_MEASURE_MODE_EXACTLY;
+ } else {
+ height = parentMaxHeight -
+ getMarginAxis(node, resolvedRowAxis);
+ heightMode = CSS_MEASURE_MODE_AT_MOST;
+ }
+ height -= getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_COLUMN);
+ if (isUndefined(height)) {
+ heightMode = CSS_MEASURE_MODE_UNDEFINED;
+ }
+
+ // We only need to give a dimension for the text if we haven't got any
+ // for it computed yet. It can either be from the style attribute or because
+ // the element is flexible.
+ bool isRowUndefined = !isStyleDimDefined(node, resolvedRowAxis) && !isResolvedRowDimDefined;
+ bool isColumnUndefined = !isStyleDimDefined(node, CSS_FLEX_DIRECTION_COLUMN) &&
+ isUndefined(node->layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]);
+
+ // Let's not measure the text if we already know both dimensions
+ if (isRowUndefined || isColumnUndefined) {
+ css_dim_t measureDim = node->measure(
+ node->context,
+
+ width,
+ widthMode,
+ height,
+ heightMode
+ );
+ if (isRowUndefined) {
+ node->layout.dimensions[CSS_WIDTH] = measureDim.dimensions[CSS_WIDTH] +
+ paddingAndBorderAxisResolvedRow;
+ }
+ if (isColumnUndefined) {
+ node->layout.dimensions[CSS_HEIGHT] = measureDim.dimensions[CSS_HEIGHT] +
+ paddingAndBorderAxisColumn;
+ }
+ }
+ if (childCount == 0) {
+ return;
+ }
+ }
+
+ bool isNodeFlexWrap = isFlexWrap(node);
+
+ css_justify_t justifyContent = node->style.justify_content;
+
+ float leadingPaddingAndBorderMain = getLeadingPaddingAndBorder(node, mainAxis);
+ float leadingPaddingAndBorderCross = getLeadingPaddingAndBorder(node, crossAxis);
+ float paddingAndBorderAxisMain = getPaddingAndBorderAxis(node, mainAxis);
+ float paddingAndBorderAxisCross = getPaddingAndBorderAxis(node, crossAxis);
+
+ bool isMainDimDefined = isLayoutDimDefined(node, mainAxis);
+ bool isCrossDimDefined = isLayoutDimDefined(node, crossAxis);
+ bool isMainRowDirection = isRowDirection(mainAxis);
+
+ int i;
+ int ii;
+ css_node_t* child;
+ css_flex_direction_t axis;
+
+ css_node_t* firstAbsoluteChild = NULL;
+ css_node_t* currentAbsoluteChild = NULL;
+
+ float definedMainDim = CSS_UNDEFINED;
+ if (isMainDimDefined) {
+ definedMainDim = node->layout.dimensions[dim[mainAxis]] - paddingAndBorderAxisMain;
+ }
+
+ // We want to execute the next two loops one per line with flex-wrap
+ int startLine = 0;
+ int endLine = 0;
+ // int nextOffset = 0;
+ int alreadyComputedNextLayout = 0;
+ // We aggregate the total dimensions of the container in those two variables
+ float linesCrossDim = 0;
+ float linesMainDim = 0;
+ int linesCount = 0;
+ while (endLine < childCount) {
+ // <Loop A> Layout non flexible children and count children by type
+
+ // mainContentDim is accumulation of the dimensions and margin of all the
+ // non flexible children. This will be used in order to either set the
+ // dimensions of the node if none already exist, or to compute the
+ // remaining space left for the flexible children.
+ float mainContentDim = 0;
+
+ // There are three kind of children, non flexible, flexible and absolute.
+ // We need to know how many there are in order to distribute the space.
+ int flexibleChildrenCount = 0;
+ float totalFlexible = 0;
+ int nonFlexibleChildrenCount = 0;
+
+ // Use the line loop to position children in the main axis for as long
+ // as they are using a simple stacking behaviour. Children that are
+ // immediately stacked in the initial loop will not be touched again
+ // in <Loop C>.
+ bool isSimpleStackMain =
+ (isMainDimDefined && justifyContent == CSS_JUSTIFY_FLEX_START) ||
+ (!isMainDimDefined && justifyContent != CSS_JUSTIFY_CENTER);
+ int firstComplexMain = (isSimpleStackMain ? childCount : startLine);
+
+ // Use the initial line loop to position children in the cross axis for
+ // as long as they are relatively positioned with alignment STRETCH or
+ // FLEX_START. Children that are immediately stacked in the initial loop
+ // will not be touched again in <Loop D>.
+ bool isSimpleStackCross = true;
+ int firstComplexCross = childCount;
+
+ css_node_t* firstFlexChild = NULL;
+ css_node_t* currentFlexChild = NULL;
+
+ float mainDim = leadingPaddingAndBorderMain;
+ float crossDim = 0;
+
+ float maxWidth = CSS_UNDEFINED;
+ float maxHeight = CSS_UNDEFINED;
+ for (i = startLine; i < childCount; ++i) {
+ child = node->get_child(node->context, i);
+ child->line_index = linesCount;
+
+ child->next_absolute_child = NULL;
+ child->next_flex_child = NULL;
+
+ css_align_t alignItem = getAlignItem(node, child);
+
+ // Pre-fill cross axis dimensions when the child is using stretch before
+ // we call the recursive layout pass
+ if (alignItem == CSS_ALIGN_STRETCH &&
+ child->style.position_type == CSS_POSITION_RELATIVE &&
+ isCrossDimDefined &&
+ !isStyleDimDefined(child, crossAxis)) {
+ child->layout.dimensions[dim[crossAxis]] = fmaxf(
+ boundAxis(child, crossAxis, node->layout.dimensions[dim[crossAxis]] -
+ paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)),
+ // You never want to go smaller than padding
+ getPaddingAndBorderAxis(child, crossAxis)
+ );
+ } else if (child->style.position_type == CSS_POSITION_ABSOLUTE) {
+ // Store a private linked list of absolutely positioned children
+ // so that we can efficiently traverse them later.
+ if (firstAbsoluteChild == NULL) {
+ firstAbsoluteChild = child;
+ }
+ if (currentAbsoluteChild != NULL) {
+ currentAbsoluteChild->next_absolute_child = child;
+ }
+ currentAbsoluteChild = child;
+
+ // Pre-fill dimensions when using absolute position and both offsets for the axis are defined (either both
+ // left and right or top and bottom).
+ for (ii = 0; ii < 2; ii++) {
+ axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
+ if (isLayoutDimDefined(node, axis) &&
+ !isStyleDimDefined(child, axis) &&
+ isPosDefined(child, leading[axis]) &&
+ isPosDefined(child, trailing[axis])) {
+ child->layout.dimensions[dim[axis]] = fmaxf(
+ boundAxis(child, axis, node->layout.dimensions[dim[axis]] -
+ getPaddingAndBorderAxis(node, axis) -
+ getMarginAxis(child, axis) -
+ getPosition(child, leading[axis]) -
+ getPosition(child, trailing[axis])),
+ // You never want to go smaller than padding
+ getPaddingAndBorderAxis(child, axis)
+ );
+ }
+ }
+ }
+
+ float nextContentDim = 0;
+
+ // It only makes sense to consider a child flexible if we have a computed
+ // dimension for the node->
+ if (isMainDimDefined && isFlex(child)) {
+ flexibleChildrenCount++;
+ totalFlexible += child->style.flex;
+
+ // Store a private linked list of flexible children so that we can
+ // efficiently traverse them later.
+ if (firstFlexChild == NULL) {
+ firstFlexChild = child;
+ }
+ if (currentFlexChild != NULL) {
+ currentFlexChild->next_flex_child = child;
+ }
+ currentFlexChild = child;
+
+ // Even if we don't know its exact size yet, we already know the padding,
+ // border and margin. We'll use this partial information, which represents
+ // the smallest possible size for the child, to compute the remaining
+ // available space.
+ nextContentDim = getPaddingAndBorderAxis(child, mainAxis) +
+ getMarginAxis(child, mainAxis);
+
+ } else {
+ maxWidth = CSS_UNDEFINED;
+ maxHeight = CSS_UNDEFINED;
+
+ if (!isMainRowDirection) {
+ if (isLayoutDimDefined(node, resolvedRowAxis)) {
+ maxWidth = node->layout.dimensions[dim[resolvedRowAxis]] -
+ paddingAndBorderAxisResolvedRow;
+ } else {
+ maxWidth = parentMaxWidth -
+ getMarginAxis(node, resolvedRowAxis) -
+ paddingAndBorderAxisResolvedRow;
+ }
+ } else {
+ if (isLayoutDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
+ maxHeight = node->layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] -
+ paddingAndBorderAxisColumn;
+ } else {
+ maxHeight = parentMaxHeight -
+ getMarginAxis(node, CSS_FLEX_DIRECTION_COLUMN) -
+ paddingAndBorderAxisColumn;
+ }
+ }
+
+ // This is the main recursive call. We layout non flexible children.
+ if (alreadyComputedNextLayout == 0) {
+ layoutNode(child, maxWidth, maxHeight, direction);
+ }
+
+ // Absolute positioned elements do not take part of the layout, so we
+ // don't use them to compute mainContentDim
+ if (child->style.position_type == CSS_POSITION_RELATIVE) {
+ nonFlexibleChildrenCount++;
+ // At this point we know the final size and margin of the element.
+ nextContentDim = getDimWithMargin(child, mainAxis);
+ }
+ }
+
+ // The element we are about to add would make us go to the next line
+ if (isNodeFlexWrap &&
+ isMainDimDefined &&
+ mainContentDim + nextContentDim > definedMainDim &&
+ // If there's only one element, then it's bigger than the content
+ // and needs its own line
+ i != startLine) {
+ nonFlexibleChildrenCount--;
+ alreadyComputedNextLayout = 1;
+ break;
+ }
+
+ // Disable simple stacking in the main axis for the current line as
+ // we found a non-trivial child-> The remaining children will be laid out
+ // in <Loop C>.
+ if (isSimpleStackMain &&
+ (child->style.position_type != CSS_POSITION_RELATIVE || isFlex(child))) {
+ isSimpleStackMain = false;
+ firstComplexMain = i;
+ }
+
+ // Disable simple stacking in the cross axis for the current line as
+ // we found a non-trivial child-> The remaining children will be laid out
+ // in <Loop D>.
+ if (isSimpleStackCross &&
+ (child->style.position_type != CSS_POSITION_RELATIVE ||
+ (alignItem != CSS_ALIGN_STRETCH && alignItem != CSS_ALIGN_FLEX_START) ||
+ (alignItem == CSS_ALIGN_STRETCH && !isCrossDimDefined))) {
+ isSimpleStackCross = false;
+ firstComplexCross = i;
+ }
+
+ if (isSimpleStackMain) {
+ child->layout.position[pos[mainAxis]] += mainDim;
+ if (isMainDimDefined) {
+ setTrailingPosition(node, child, mainAxis);
+ }
+
+ mainDim += getDimWithMargin(child, mainAxis);
+ crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
+ }
+
+ if (isSimpleStackCross) {
+ child->layout.position[pos[crossAxis]] += linesCrossDim + leadingPaddingAndBorderCross;
+ if (isCrossDimDefined) {
+ setTrailingPosition(node, child, crossAxis);
+ }
+ }
+
+ alreadyComputedNextLayout = 0;
+ mainContentDim += nextContentDim;
+ endLine = i + 1;
+ }
+
+ // <Loop B> Layout flexible children and allocate empty space
+
+ // In order to position the elements in the main axis, we have two
+ // controls. The space between the beginning and the first element
+ // and the space between each two elements.
+ float leadingMainDim = 0;
+ float betweenMainDim = 0;
+
+ // The remaining available space that needs to be allocated
+ float remainingMainDim = 0;
+ if (isMainDimDefined) {
+ remainingMainDim = definedMainDim - mainContentDim;
+ } else {
+ remainingMainDim = fmaxf(mainContentDim, 0) - mainContentDim;
+ }
+
+ // If there are flexible children in the mix, they are going to fill the
+ // remaining space
+ if (flexibleChildrenCount != 0) {
+ float flexibleMainDim = remainingMainDim / totalFlexible;
+ float baseMainDim;
+ float boundMainDim;
+
+ // If the flex share of remaining space doesn't meet min/max bounds,
+ // remove this child from flex calculations.
+ currentFlexChild = firstFlexChild;
+ while (currentFlexChild != NULL) {
+ baseMainDim = flexibleMainDim * currentFlexChild->style.flex +
+ getPaddingAndBorderAxis(currentFlexChild, mainAxis);
+ boundMainDim = boundAxis(currentFlexChild, mainAxis, baseMainDim);
+
+ if (baseMainDim != boundMainDim) {
+ remainingMainDim -= boundMainDim;
+ totalFlexible -= currentFlexChild->style.flex;
+ }
+
+ currentFlexChild = currentFlexChild->next_flex_child;
+ }
+ flexibleMainDim = remainingMainDim / totalFlexible;
+
+ // The non flexible children can overflow the container, in this case
+ // we should just assume that there is no space available.
+ if (flexibleMainDim < 0) {
+ flexibleMainDim = 0;
+ }
+
+ currentFlexChild = firstFlexChild;
+ while (currentFlexChild != NULL) {
+ // At this point we know the final size of the element in the main
+ // dimension
+ currentFlexChild->layout.dimensions[dim[mainAxis]] = boundAxis(currentFlexChild, mainAxis,
+ flexibleMainDim * currentFlexChild->style.flex +
+ getPaddingAndBorderAxis(currentFlexChild, mainAxis)
+ );
+
+ maxWidth = CSS_UNDEFINED;
+ if (isLayoutDimDefined(node, resolvedRowAxis)) {
+ maxWidth = node->layout.dimensions[dim[resolvedRowAxis]] -
+ paddingAndBorderAxisResolvedRow;
+ } else if (!isMainRowDirection) {
+ maxWidth = parentMaxWidth -
+ getMarginAxis(node, resolvedRowAxis) -
+ paddingAndBorderAxisResolvedRow;
+ }
+ maxHeight = CSS_UNDEFINED;
+ if (isLayoutDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
+ maxHeight = node->layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] -
+ paddingAndBorderAxisColumn;
+ } else if (isMainRowDirection) {
+ maxHeight = parentMaxHeight -
+ getMarginAxis(node, CSS_FLEX_DIRECTION_COLUMN) -
+ paddingAndBorderAxisColumn;
+ }
+
+ // And we recursively call the layout algorithm for this child
+ layoutNode(currentFlexChild, maxWidth, maxHeight, direction);
+
+ child = currentFlexChild;
+ currentFlexChild = currentFlexChild->next_flex_child;
+ child->next_flex_child = NULL;
+ }
+
+ // We use justifyContent to figure out how to allocate the remaining
+ // space available
+ } else if (justifyContent != CSS_JUSTIFY_FLEX_START) {
+ if (justifyContent == CSS_JUSTIFY_CENTER) {
+ leadingMainDim = remainingMainDim / 2;
+ } else if (justifyContent == CSS_JUSTIFY_FLEX_END) {
+ leadingMainDim = remainingMainDim;
+ } else if (justifyContent == CSS_JUSTIFY_SPACE_BETWEEN) {
+ remainingMainDim = fmaxf(remainingMainDim, 0);
+ if (flexibleChildrenCount + nonFlexibleChildrenCount - 1 != 0) {
+ betweenMainDim = remainingMainDim /
+ (flexibleChildrenCount + nonFlexibleChildrenCount - 1);
+ } else {
+ betweenMainDim = 0;
+ }
+ } else if (justifyContent == CSS_JUSTIFY_SPACE_AROUND) {
+ // Space on the edges is half of the space between elements
+ betweenMainDim = remainingMainDim /
+ (flexibleChildrenCount + nonFlexibleChildrenCount);
+ leadingMainDim = betweenMainDim / 2;
+ }
+ }
+
+ // <Loop C> Position elements in the main axis and compute dimensions
+
+ // At this point, all the children have their dimensions set. We need to
+ // find their position. In order to do that, we accumulate data in
+ // variables that are also useful to compute the total dimensions of the
+ // container!
+ mainDim += leadingMainDim;
+
+ for (i = firstComplexMain; i < endLine; ++i) {
+ child = node->get_child(node->context, i);
+
+ if (child->style.position_type == CSS_POSITION_ABSOLUTE &&
+ isPosDefined(child, leading[mainAxis])) {
+ // In case the child is position absolute and has left/top being
+ // defined, we override the position to whatever the user said
+ // (and margin/border).
+ child->layout.position[pos[mainAxis]] = getPosition(child, leading[mainAxis]) +
+ getLeadingBorder(node, mainAxis) +
+ getLeadingMargin(child, mainAxis);
+ } else {
+ // If the child is position absolute (without top/left) or relative,
+ // we put it at the current accumulated offset.
+ child->layout.position[pos[mainAxis]] += mainDim;
+
+ // Define the trailing position accordingly.
+ if (isMainDimDefined) {
+ setTrailingPosition(node, child, mainAxis);
+ }
+
+ // Now that we placed the element, we need to update the variables
+ // We only need to do that for relative elements. Absolute elements
+ // do not take part in that phase.
+ if (child->style.position_type == CSS_POSITION_RELATIVE) {
+ // The main dimension is the sum of all the elements dimension plus
+ // the spacing.
+ mainDim += betweenMainDim + getDimWithMargin(child, mainAxis);
+ // The cross dimension is the max of the elements dimension since there
+ // can only be one element in that cross dimension.
+ crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
+ }
+ }
+ }
+
+ float containerCrossAxis = node->layout.dimensions[dim[crossAxis]];
+ if (!isCrossDimDefined) {
+ containerCrossAxis = fmaxf(
+ // For the cross dim, we add both sides at the end because the value
+ // is aggregate via a max function. Intermediate negative values
+ // can mess this computation otherwise
+ boundAxis(node, crossAxis, crossDim + paddingAndBorderAxisCross),
+ paddingAndBorderAxisCross
+ );
+ }
+
+ // <Loop D> Position elements in the cross axis
+ for (i = firstComplexCross; i < endLine; ++i) {
+ child = node->get_child(node->context, i);
+
+ if (child->style.position_type == CSS_POSITION_ABSOLUTE &&
+ isPosDefined(child, leading[crossAxis])) {
+ // In case the child is absolutely positionned and has a
+ // top/left/bottom/right being set, we override all the previously
+ // computed positions to set it correctly.
+ child->layout.position[pos[crossAxis]] = getPosition(child, leading[crossAxis]) +
+ getLeadingBorder(node, crossAxis) +
+ getLeadingMargin(child, crossAxis);
+
+ } else {
+ float leadingCrossDim = leadingPaddingAndBorderCross;
+
+ // For a relative children, we're either using alignItems (parent) or
+ // alignSelf (child) in order to determine the position in the cross axis
+ if (child->style.position_type == CSS_POSITION_RELATIVE) {
+ /*eslint-disable */
+ // This variable is intentionally re-defined as the code is transpiled to a block scope language
+ css_align_t alignItem = getAlignItem(node, child);
+ /*eslint-enable */
+ if (alignItem == CSS_ALIGN_STRETCH) {
+ // You can only stretch if the dimension has not already been defined
+ // previously.
+ if (!isStyleDimDefined(child, crossAxis)) {
+ float dimCrossAxis = child->layout.dimensions[dim[crossAxis]];
+ child->layout.dimensions[dim[crossAxis]] = fmaxf(
+ boundAxis(child, crossAxis, containerCrossAxis -
+ paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)),
+ // You never want to go smaller than padding
+ getPaddingAndBorderAxis(child, crossAxis)
+ );
+
+ // If the size has changed, and this child has children we need to re-layout this child
+ if (dimCrossAxis != child->layout.dimensions[dim[crossAxis]] && child->children_count > 0) {
+ // Reset child margins before re-layout as they are added back in layoutNode and would be doubled
+ child->layout.position[leading[mainAxis]] -= getLeadingMargin(child, mainAxis) +
+ getRelativePosition(child, mainAxis);
+ child->layout.position[trailing[mainAxis]] -= getTrailingMargin(child, mainAxis) +
+ getRelativePosition(child, mainAxis);
+ child->layout.position[leading[crossAxis]] -= getLeadingMargin(child, crossAxis) +
+ getRelativePosition(child, crossAxis);
+ child->layout.position[trailing[crossAxis]] -= getTrailingMargin(child, crossAxis) +
+ getRelativePosition(child, crossAxis);
+
+ layoutNode(child, maxWidth, maxHeight, direction);
+ }
+ }
+ } else if (alignItem != CSS_ALIGN_FLEX_START) {
+ // The remaining space between the parent dimensions+padding and child
+ // dimensions+margin.
+ float remainingCrossDim = containerCrossAxis -
+ paddingAndBorderAxisCross - getDimWithMargin(child, crossAxis);
+
+ if (alignItem == CSS_ALIGN_CENTER) {
+ leadingCrossDim += remainingCrossDim / 2;
+ } else { // CSS_ALIGN_FLEX_END
+ leadingCrossDim += remainingCrossDim;
+ }
+ }
+ }
+
+ // And we apply the position
+ child->layout.position[pos[crossAxis]] += linesCrossDim + leadingCrossDim;
+
+ // Define the trailing position accordingly.
+ if (isCrossDimDefined) {
+ setTrailingPosition(node, child, crossAxis);
+ }
+ }
+ }
+
+ linesCrossDim += crossDim;
+ linesMainDim = fmaxf(linesMainDim, mainDim);
+ linesCount += 1;
+ startLine = endLine;
+ }
+
+ // <Loop E>
+ //
+ // Note(prenaux): More than one line, we need to layout the crossAxis
+ // according to alignContent.
+ //
+ // Note that we could probably remove <Loop D> and handle the one line case
+ // here too, but for the moment this is safer since it won't interfere with
+ // previously working code.
+ //
+ // See specs:
+ // http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/#layout-algorithm
+ // section 9.4
+ //
+ if (linesCount > 1 && isCrossDimDefined) {
+ float nodeCrossAxisInnerSize = node->layout.dimensions[dim[crossAxis]] -
+ paddingAndBorderAxisCross;
+ float remainingAlignContentDim = nodeCrossAxisInnerSize - linesCrossDim;
+
+ float crossDimLead = 0;
+ float currentLead = leadingPaddingAndBorderCross;
+
+ css_align_t alignContent = node->style.align_content;
+ if (alignContent == CSS_ALIGN_FLEX_END) {
+ currentLead += remainingAlignContentDim;
+ } else if (alignContent == CSS_ALIGN_CENTER) {
+ currentLead += remainingAlignContentDim / 2;
+ } else if (alignContent == CSS_ALIGN_STRETCH) {
+ if (nodeCrossAxisInnerSize > linesCrossDim) {
+ crossDimLead = (remainingAlignContentDim / linesCount);
+ }
+ }
+
+ int endIndex = 0;
+ for (i = 0; i < linesCount; ++i) {
+ int startIndex = endIndex;
+
+ // compute the line's height and find the endIndex
+ float lineHeight = 0;
+ for (ii = startIndex; ii < childCount; ++ii) {
+ child = node->get_child(node->context, ii);
+ if (child->style.position_type != CSS_POSITION_RELATIVE) {
+ continue;
+ }
+ if (child->line_index != i) {
+ break;
+ }
+ if (isLayoutDimDefined(child, crossAxis)) {
+ lineHeight = fmaxf(
+ lineHeight,
+ child->layout.dimensions[dim[crossAxis]] + getMarginAxis(child, crossAxis)
+ );
+ }
+ }
+ endIndex = ii;
+ lineHeight += crossDimLead;
+
+ for (ii = startIndex; ii < endIndex; ++ii) {
+ child = node->get_child(node->context, ii);
+ if (child->style.position_type != CSS_POSITION_RELATIVE) {
+ continue;
+ }
+
+ css_align_t alignContentAlignItem = getAlignItem(node, child);
+ if (alignContentAlignItem == CSS_ALIGN_FLEX_START) {
+ child->layout.position[pos[crossAxis]] = currentLead + getLeadingMargin(child, crossAxis);
+ } else if (alignContentAlignItem == CSS_ALIGN_FLEX_END) {
+ child->layout.position[pos[crossAxis]] = currentLead + lineHeight - getTrailingMargin(child, crossAxis) - child->layout.dimensions[dim[crossAxis]];
+ } else if (alignContentAlignItem == CSS_ALIGN_CENTER) {
+ float childHeight = child->layout.dimensions[dim[crossAxis]];
+ child->layout.position[pos[crossAxis]] = currentLead + (lineHeight - childHeight) / 2;
+ } else if (alignContentAlignItem == CSS_ALIGN_STRETCH) {
+ child->layout.position[pos[crossAxis]] = currentLead + getLeadingMargin(child, crossAxis);
+ // TODO(prenaux): Correctly set the height of items with undefined
+ // (auto) crossAxis dimension.
+ }
+ }
+
+ currentLead += lineHeight;
+ }
+ }
+
+ bool needsMainTrailingPos = false;
+ bool needsCrossTrailingPos = false;
+
+ // If the user didn't specify a width or height, and it has not been set
+ // by the container, then we set it via the children.
+ if (!isMainDimDefined) {
+ node->layout.dimensions[dim[mainAxis]] = fmaxf(
+ // We're missing the last padding at this point to get the final
+ // dimension
+ boundAxis(node, mainAxis, linesMainDim + getTrailingPaddingAndBorder(node, mainAxis)),
+ // We can never assign a width smaller than the padding and borders
+ paddingAndBorderAxisMain
+ );
+
+ if (mainAxis == CSS_FLEX_DIRECTION_ROW_REVERSE ||
+ mainAxis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
+ needsMainTrailingPos = true;
+ }
+ }
+
+ if (!isCrossDimDefined) {
+ node->layout.dimensions[dim[crossAxis]] = fmaxf(
+ // For the cross dim, we add both sides at the end because the value
+ // is aggregate via a max function. Intermediate negative values
+ // can mess this computation otherwise
+ boundAxis(node, crossAxis, linesCrossDim + paddingAndBorderAxisCross),
+ paddingAndBorderAxisCross
+ );
+
+ if (crossAxis == CSS_FLEX_DIRECTION_ROW_REVERSE ||
+ crossAxis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
+ needsCrossTrailingPos = true;
+ }
+ }
+
+ // <Loop F> Set trailing position if necessary
+ if (needsMainTrailingPos || needsCrossTrailingPos) {
+ for (i = 0; i < childCount; ++i) {
+ child = node->get_child(node->context, i);
+
+ if (needsMainTrailingPos) {
+ setTrailingPosition(node, child, mainAxis);
+ }
+
+ if (needsCrossTrailingPos) {
+ setTrailingPosition(node, child, crossAxis);
+ }
+ }
+ }
+
+ // <Loop G> Calculate dimensions for absolutely positioned elements
+ currentAbsoluteChild = firstAbsoluteChild;
+ while (currentAbsoluteChild != NULL) {
+ // Pre-fill dimensions when using absolute position and both offsets for
+ // the axis are defined (either both left and right or top and bottom).
+ for (ii = 0; ii < 2; ii++) {
+ axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
+
+ if (isLayoutDimDefined(node, axis) &&
+ !isStyleDimDefined(currentAbsoluteChild, axis) &&
+ isPosDefined(currentAbsoluteChild, leading[axis]) &&
+ isPosDefined(currentAbsoluteChild, trailing[axis])) {
+ currentAbsoluteChild->layout.dimensions[dim[axis]] = fmaxf(
+ boundAxis(currentAbsoluteChild, axis, node->layout.dimensions[dim[axis]] -
+ getBorderAxis(node, axis) -
+ getMarginAxis(currentAbsoluteChild, axis) -
+ getPosition(currentAbsoluteChild, leading[axis]) -
+ getPosition(currentAbsoluteChild, trailing[axis])
+ ),
+ // You never want to go smaller than padding
+ getPaddingAndBorderAxis(currentAbsoluteChild, axis)
+ );
+ }
+
+ if (isPosDefined(currentAbsoluteChild, trailing[axis]) &&
+ !isPosDefined(currentAbsoluteChild, leading[axis])) {
+ currentAbsoluteChild->layout.position[leading[axis]] =
+ node->layout.dimensions[dim[axis]] -
+ currentAbsoluteChild->layout.dimensions[dim[axis]] -
+ getPosition(currentAbsoluteChild, trailing[axis]);
+ }
+ }
+
+ child = currentAbsoluteChild;
+ currentAbsoluteChild = currentAbsoluteChild->next_absolute_child;
+ child->next_absolute_child = NULL;
+ }
+ /** END_GENERATED **/
+}
+
+void layoutNode(css_node_t *node, float parentMaxWidth, float parentMaxHeight, css_direction_t parentDirection) {
+ css_layout_t *layout = &node->layout;
+ css_direction_t direction = node->style.direction;
+ layout->should_update = true;
+
+ bool skipLayout =
+ !node->is_dirty(node->context) &&
+ eq(layout->last_requested_dimensions[CSS_WIDTH], layout->dimensions[CSS_WIDTH]) &&
+ eq(layout->last_requested_dimensions[CSS_HEIGHT], layout->dimensions[CSS_HEIGHT]) &&
+ eq(layout->last_parent_max_width, parentMaxWidth) &&
+ eq(layout->last_parent_max_height, parentMaxHeight) &&
+ eq(layout->last_direction, direction);
+
+ if (skipLayout) {
+ layout->dimensions[CSS_WIDTH] = layout->last_dimensions[CSS_WIDTH];
+ layout->dimensions[CSS_HEIGHT] = layout->last_dimensions[CSS_HEIGHT];
+ layout->position[CSS_TOP] = layout->last_position[CSS_TOP];
+ layout->position[CSS_LEFT] = layout->last_position[CSS_LEFT];
+ } else {
+ layout->last_requested_dimensions[CSS_WIDTH] = layout->dimensions[CSS_WIDTH];
+ layout->last_requested_dimensions[CSS_HEIGHT] = layout->dimensions[CSS_HEIGHT];
+ layout->last_parent_max_width = parentMaxWidth;
+ layout->last_parent_max_height = parentMaxHeight;
+ layout->last_direction = direction;
+
+ for (int i = 0, childCount = node->children_count; i < childCount; i++) {
+ resetNodeLayout(node->get_child(node->context, i));
+ }
+
+ layoutNodeImpl(node, parentMaxWidth, parentMaxHeight, parentDirection);
+
+ layout->last_dimensions[CSS_WIDTH] = layout->dimensions[CSS_WIDTH];
+ layout->last_dimensions[CSS_HEIGHT] = layout->dimensions[CSS_HEIGHT];
+ layout->last_position[CSS_TOP] = layout->position[CSS_TOP];
+ layout->last_position[CSS_LEFT] = layout->position[CSS_LEFT];
+ }
+}
+
+void resetNodeLayout(css_node_t *node) {
+ node->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ node->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+ node->layout.position[CSS_LEFT] = 0;
+ node->layout.position[CSS_TOP] = 0;
+}
[43/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
* [ios] add bundle js
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f4fd0820
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f4fd0820
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f4fd0820
Branch: refs/heads/master
Commit: f4fd082008dda9997d36a3d077e39670f0c06088
Parents: 7554c53
Author: acton393 <zh...@gmail.com>
Authored: Mon Jun 13 11:35:22 2016 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jun 13 11:35:22 2016 +0800
----------------------------------------------------------------------
ios/playground/bundlejs/animation.js | 1426 +++++++
ios/playground/bundlejs/component/a-demo.js | 1213 ++++++
.../bundlejs/component/countdown-demo.js | 1398 ++++++
ios/playground/bundlejs/component/image-demo.js | 1336 ++++++
.../bundlejs/component/list/list-basic.js | 1370 ++++++
.../bundlejs/component/list/list-demo.js | 1156 +++++
.../bundlejs/component/marquee-demo.js | 1264 ++++++
.../bundlejs/component/navigator-demo.js | 1313 ++++++
.../bundlejs/component/scroller-demo.js | 1317 ++++++
.../bundlejs/component/slider/index.js | 1741 ++++++++
.../bundlejs/component/slider/slider-item.js | 84 +
.../bundlejs/component/slider/slider-page.js | 134 +
.../bundlejs/component/tabbar/tabbar-demo.js | 1273 ++++++
.../bundlejs/component/tabbar/tabbar-item.js | 117 +
ios/playground/bundlejs/component/text-demo.js | 1515 +++++++
ios/playground/bundlejs/component/video-demo.js | 1261 ++++++
ios/playground/bundlejs/component/web-demo.js | 1315 ++++++
ios/playground/bundlejs/hello.js | 69 +
.../bundlejs/include/example-list-item.js | 1210 ++++++
ios/playground/bundlejs/include/example-list.js | 1291 ++++++
ios/playground/bundlejs/index.js | 1343 ++++++
ios/playground/bundlejs/module/instance-api.js | 1208 ++++++
ios/playground/bundlejs/module/modal.js | 1301 ++++++
ios/playground/bundlejs/module/stream-demo.js | 1247 ++++++
ios/playground/bundlejs/showcase/calculator.js | 1485 +++++++
.../bundlejs/showcase/new-fashion/banner.js | 92 +
.../bundlejs/showcase/new-fashion/banners.js | 188 +
.../bundlejs/showcase/new-fashion/brand.js | 278 ++
.../bundlejs/showcase/new-fashion/category.js | 750 ++++
.../bundlejs/showcase/new-fashion/coupon.js | 176 +
.../bundlejs/showcase/new-fashion/fashion.js | 280 ++
.../bundlejs/showcase/new-fashion/goods.js | 265 ++
.../bundlejs/showcase/new-fashion/headlines.js | 373 ++
.../bundlejs/showcase/new-fashion/index.js | 1277 ++++++
.../bundlejs/showcase/new-fashion/link.js | 84 +
.../bundlejs/showcase/new-fashion/main.js | 3977 ++++++++++++++++++
.../bundlejs/showcase/new-fashion/match.js | 217 +
.../bundlejs/showcase/new-fashion/resource.js | 252 ++
.../bundlejs/showcase/new-fashion/scene.js | 455 ++
ios/playground/bundlejs/showcase/ui.js | 1355 ++++++
ios/playground/bundlejs/style/index.js | 2330 ++++++++++
ios/playground/bundlejs/style/style-box.js | 1525 +++++++
ios/playground/bundlejs/style/style-flex.js | 1874 +++++++++
ios/playground/bundlejs/style/style-item.js | 95 +
ios/playground/bundlejs/template.js | 1292 ++++++
45 files changed, 45522 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/animation.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/animation.js b/ios/playground/bundlejs/animation.js
new file mode 100644
index 0000000..5f7fcdc
--- /dev/null
+++ b/ios/playground/bundlejs/animation.js
@@ -0,0 +1,1426 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/6dce51f79ed815347754cd36fdb73f89", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ transformOrigin: 'center center',
+ current_rotate: 0,
+ current_scale: 1,
+ current_color: '#FF0000',
+ current_opacity: 1,
+ current_translate: '',
+ current_transform: '',
+ isStop: true
+ }},
+ methods: {
+ anim: function(styles, timingFunction, duration, callback) {
+ this.$call('animation', 'transition', this._ids.block.el.ref, {
+ styles: styles,
+ timingFunction: timingFunction,
+ duration: duration
+ }, callback);
+ },
+ rotate: function() {
+ var self = this;
+ self.current_rotate += 90;
+ self.anim({
+ transform: 'rotate(' + self.current_rotate + 'deg)'
+ }, 'ease-in-out', 500, function() {
+ if (self.current_rotate === 360) {
+ self.current_rotate = 0;
+ }
+ else {
+ self.rotate();
+ }
+ });
+ },
+ translate: function() {
+ this.current_translate = this.current_translate ? '' : 'translate(50%, 50%)';
+ this.anim({
+ transform: this.current_translate
+ }, 'ease-in', 500, function() {
+ });
+ },
+ scale: function() {
+ var self = this;
+ self.current_scale = self.current_scale === 2 ? .5 : 2
+ self.anim({
+ transform: 'scale(' + self.current_scale + ')'
+ }, 'linear', 500, function() {
+ });
+ },
+ transform: function() {
+ var self = this;
+ this.current_transform = this.current_transform ? '' : 'rotate(45deg) scale(1.5)';
+ this.anim({
+ transform: this.current_transform,
+ transformOrigin: 'left top'
+ }, 'ease-out', 500, function() {
+ if (self.current_transform !== '') {
+ self.anim({
+ transform: 'rotate(-90deg) scale(1.2)',
+ transformOrigin: 'left top'
+ }, 'ease-out', 500, function() {
+ })
+ }
+ else {
+
+ }
+ });
+ },
+ composite: function() {
+ var self = this;
+ self.current_transform = self.current_transform ? '' : 'rotate(45deg) scale(1.5) translate(50%, 50%)';
+ self.current_color = self.current_color === '#F0AD4E' ? '#D9534F' : '#F0AD4E';
+ self.current_opacity = self.current_opacity === 1 ? 0.1 : 1;
+ this.anim({
+ transform: this.current_transform,
+ transformOrigin: 'left top',
+ backgroundColor: self.current_color,
+ opacity: self.current_opacity
+ }, 'ease-out', 1000, function() {
+ });
+ },
+ color: function() {
+ var self = this;
+ self.current_color = self.current_color === '#F0AD4E' ? '#D9534F' : '#F0AD4E';
+ self.anim({
+ backgroundColor: self.current_color
+ }, 'linear', 500, function() {
+ });
+ },
+ opacity: function() {
+ var self = this;
+ self.current_opacity = self.current_opacity === 1 ? 0.1 : 1;
+ self.anim({
+ opacity: self.current_opacity
+ }, 'linear', 500, function() {
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Transform",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "Rotate",
+ "type": "primary",
+ "size": "middle"
+ },
+ "events": {
+ "click": "rotate"
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "Scale",
+ "type": "primary",
+ "size": "middle"
+ },
+ "events": {
+ "click": "scale"
+ },
+ "style": {
+ "marginTop": 12
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "Translate",
+ "type": "primary",
+ "size": "middle"
+ },
+ "events": {
+ "click": "translate"
+ },
+ "style": {
+ "marginTop": 12
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "Transform",
+ "type": "success",
+ "size": "middle"
+ },
+ "events": {
+ "click": "transform"
+ },
+ "style": {
+ "marginTop": 12
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Others",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "BgColor",
+ "type": "primary",
+ "size": "middle"
+ },
+ "events": {
+ "click": "color"
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "Opacity",
+ "type": "primary",
+ "size": "middle"
+ },
+ "events": {
+ "click": "opacity"
+ },
+ "style": {
+ "marginTop": 12
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "value": "All",
+ "type": "success",
+ "size": "middle"
+ },
+ "events": {
+ "click": "composite"
+ },
+ "style": {
+ "marginTop": 12
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "id": "block",
+ "classList": [
+ "block"
+ ],
+ "style": {
+ "transformOrigin": function () {return this.transformOrigin}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "block-txt"
+ ],
+ "attr": {
+ "value": "Anim"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "block": {
+ "position": "absolute",
+ "width": 250,
+ "height": 250,
+ "top": 300,
+ "left": 400,
+ "backgroundColor": "#F0AD4E",
+ "alignItems": "center",
+ "justifyContent": "center"
+ },
+ "block-txt": {
+ "color": "#FFFFFF",
+ "fontSize": 70
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/6dce51f79ed815347754cd36fdb73f89", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/a-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/a-demo.js b/ios/playground/bundlejs/component/a-demo.js
new file mode 100644
index 0000000..bbb9ccb
--- /dev/null
+++ b/ios/playground/bundlejs/component/a-demo.js
@@ -0,0 +1,1213 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/17107d7a196dfe552c13bac72d7c156f", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ img: '//gw.alicdn.com/tps/i2/TB1DpsmMpXXXXabaXXX20ySQVXX-512-512.png_400x400.jpg'
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Hyperlink",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "a",
+ "attr": {
+ "href": "http://g.tbcdn.cn/ali-wireless-h5/res/0.0.16/hello.js"
+ },
+ "children": [
+ {
+ "type": "wxc-tip",
+ "attr": {
+ "type": "info",
+ "value": "Click me to see how 'A' element opens a new world."
+ },
+ "style": {
+ "marginBottom": 20
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/17107d7a196dfe552c13bac72d7c156f", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[49/50] [abbrv] incubator-weex git commit: * [ios] add week icon
Posted by ji...@apache.org.
* [ios] add week icon
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/51653ea1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/51653ea1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/51653ea1
Branch: refs/heads/master
Commit: 51653ea1c430e8be223b1c83d83882d42f524515
Parents: 0b308aa
Author: acton393 <zh...@gmail.com>
Authored: Mon Jun 13 17:07:22 2016 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jun 13 17:07:22 2016 +0800
----------------------------------------------------------------------
ios/playground/WeexDemo/AppDelegate.m | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/51653ea1/ios/playground/WeexDemo/AppDelegate.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/AppDelegate.m b/ios/playground/WeexDemo/AppDelegate.m
index 005f2d0..1928fad 100644
--- a/ios/playground/WeexDemo/AppDelegate.m
+++ b/ios/playground/WeexDemo/AppDelegate.m
@@ -181,7 +181,7 @@
- (void)atAddPlugin {
- [[ATManager shareInstance] addPluginWithId:@"weex" andName:@"weex" andIconName:@"weex" andEntry:@"" andArgs:@[@""]];
+ [[ATManager shareInstance] addPluginWithId:@"weex" andName:@"weex" andIconName:@"../weex" andEntry:@"" andArgs:@[@""]];
[[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"logger" andName:@"logger" andIconName:@"log" andEntry:@"WXATLoggerPlugin" andArgs:@[@""]];
// [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"viewHierarchy" andName:@"hierarchy" andIconName:@"log" andEntry:@"WXATViewHierarchyPlugin" andArgs:@[@""]];
[[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"test2" andName:@"test" andIconName:@"at_arr_refresh" andEntry:@"" andArgs:@[]];
[32/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/fashion.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/fashion.js b/ios/playground/bundlejs/showcase/new-fashion/fashion.js
new file mode 100644
index 0000000..76679e3
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/fashion.js
@@ -0,0 +1,280 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/29432e9104bfbc477db30914749dfb5b", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+ __webpack_require__(18);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_750: 750,
+ NUMBER_250: 250,
+ NUMBER_220: 220,
+ NUMBER_262: 262,
+ NUMBER_375: 375
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self._randomStarBanner();
+ },
+ _randomStarBanner: function () {
+ var self = this;
+ if (!self.ds||!self.ds.firstStarBannerItems||!self.ds.secondStarBannerItems||!self.ds.thirdStarBannerItems) return;
+ var starBanners = [];
+ starBanners.push(self._app.Util.randomItemFromArr(self.ds.firstStarBannerItems));
+ starBanners.push(self._app.Util.randomItemFromArr(self.ds.secondStarBannerItems));
+ starBanners.push(self._app.Util.randomItemFromArr(self.ds.thirdStarBannerItems));
+ self.ds.starBanners = starBanners;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "shown": function () {return !this.ds.isHide},
+ "children": [
+ {
+ "type": "image",
+ "shown": function () {return this.ds.floorTitle},
+ "classList": [
+ "title"
+ ],
+ "attr": {
+ "src": function () {return this.ds.floorTitle}
+ }
+ },
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_750},
+ "height": function () {return this.NUMBER_262},
+ "src": function () {return this.ds.bigBannerImg},
+ "href": function () {return this.ds.bigBannerUrl}
+ }
+ },
+ {
+ "type": "banners",
+ "attr": {
+ "ds": function () {return this.ds.smallBannerItems},
+ "width": function () {return this.NUMBER_375},
+ "height": function () {return this.NUMBER_262},
+ "direction": "row"
+ }
+ },
+ {
+ "type": "container",
+ "shown": function () {return !this.ds.isHideStarBanner},
+ "children": [
+ {
+ "type": "banners",
+ "attr": {
+ "ds": function () {return this.ds.starBanners},
+ "width": function () {return this.NUMBER_250},
+ "height": function () {return this.NUMBER_220},
+ "direction": "row"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/29432e9104bfbc477db30914749dfb5b", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ },
+
+/***/ 18:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/banners", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ space: 0,
+ width: 0,
+ height: 0,
+ spmc:0,
+ spmdprefix:'',
+ ds: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ var ds = self.ds;
+ var length = ds.length;
+ for (var i = 0; i < length; i++) {
+ var item = ds[i];
+ item.index = i;
+ item.space = (i % length === 0) ? 0 : self.space;
+ }
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='row'},
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginLeft": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='column'},
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginTop": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/goods.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/goods.js b/ios/playground/bundlejs/showcase/new-fashion/goods.js
new file mode 100644
index 0000000..fb10bbb
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/goods.js
@@ -0,0 +1,265 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/288f1d10e56a339d2751caec3346b80a", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_251: 251,
+ NUMBER_240: 240,
+ NUMBER_292: 292,
+ NUMBER_588: 588
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ var ds = self.ds;
+ if (!ds || !ds.bannerItems) return;
+ var bannerItems = ds.bannerItems;
+ for (var i = 0; i < bannerItems.length; i++) {
+ bannerItems[i].index = i;
+ }
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "shown": function () {return !this.ds.isHide},
+ "children": [
+ {
+ "type": "image",
+ "shown": function () {return this.ds.floorTitle},
+ "classList": [
+ "title"
+ ],
+ "attr": {
+ "src": function () {return this.ds.floorTitle}
+ }
+ },
+ {
+ "type": "slider",
+ "classList": [
+ "slider"
+ ],
+ "attr": {
+ "showIndicators": "true",
+ "autoPlay": "true",
+ "interval": "3000"
+ },
+ "children": [
+ {
+ "type": "container",
+ "classList": [
+ "pannel"
+ ],
+ "repeat": function () {return this.ds.bannerItems},
+ "children": [
+ {
+ "type": "container",
+ "children": [
+ {
+ "type": "banner",
+ "style": {
+ "marginBottom": 4
+ },
+ "attr": {
+ "width": function () {return this.NUMBER_251},
+ "height": function () {return this.NUMBER_292},
+ "src": function () {return this.img1},
+ "href": function () {return this.url1}
+ }
+ },
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_251},
+ "height": function () {return this.NUMBER_292},
+ "src": function () {return this.img2},
+ "href": function () {return this.url2}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "middle-col"
+ ],
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_240},
+ "height": function () {return this.NUMBER_588},
+ "src": function () {return this.img3},
+ "href": function () {return this.url3}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "children": [
+ {
+ "type": "banner",
+ "style": {
+ "marginBottom": 4
+ },
+ "attr": {
+ "width": function () {return this.NUMBER_251},
+ "height": function () {return this.NUMBER_292},
+ "src": function () {return this.img4},
+ "href": function () {return this.url4}
+ }
+ },
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_251},
+ "height": function () {return this.NUMBER_292},
+ "src": function () {return this.img5},
+ "href": function () {return this.url5}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "indicator",
+ "style": {
+ "position": "absolute",
+ "width": 714,
+ "height": 200,
+ "left": 10,
+ "bottom": -80,
+ "itemSize": 20,
+ "itemColor": "#999999",
+ "itemSelectedColor": "#000000"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ },
+ "slider": {
+ "height": 652
+ },
+ "pannel": {
+ "width": 750,
+ "height": 592,
+ "flexDirection": "row"
+ },
+ "middle-col": {
+ "marginLeft": 4,
+ "marginRight": 4,
+ "width": 240,
+ "height": 588
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/288f1d10e56a339d2751caec3346b80a", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/headlines.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/headlines.js b/ios/playground/bundlejs/showcase/new-fashion/headlines.js
new file mode 100644
index 0000000..b6efe5a
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/headlines.js
@@ -0,0 +1,373 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/de0c661a89abd9ebbbf4e61f69038784", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(19);
+ __webpack_require__(18);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ ds: {},
+ NUMBER_233: 233,
+ NUMBER_172: 172,
+ NUMBER_3: 3
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self.isH5 = self._app.IS_H5;
+ self.isTM = self._app.IS_TM;
+ self.isTest = self._app.IS_TEST;
+ },
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "classList": [
+ "container"
+ ],
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "banner"
+ ],
+ "attr": {
+ "src": function () {return this.ds.topBanner}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "rule-container"
+ ],
+ "children": [
+ {
+ "type": "link",
+ "style": {
+ "fontSize": 22,
+ "color": "#ffffff",
+ "textAlign": "center"
+ },
+ "attr": {
+ "text": "\u5e2e\u52a9",
+ "href": function () {return this.ds.ruleLink}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "announce"
+ ],
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "announce-hd"
+ ],
+ "attr": {
+ "src": function () {return this.ds.announceHdBanner}
+ }
+ },
+ {
+ "type": "banners",
+ "style": {
+ "marginLeft": 6,
+ "marginRight": 6
+ },
+ "attr": {
+ "ds": function () {return this.ds.bannerItems},
+ "direction": "row",
+ "width": function () {return this.NUMBER_233},
+ "height": function () {return this.NUMBER_172},
+ "space": function () {return this.NUMBER_3}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "banner": {
+ "width": 750,
+ "height": 782
+ },
+ "share-container": {
+ "position": "absolute",
+ "right": 100,
+ "top": 15,
+ "zIndex": 100,
+ "fontSize": 20,
+ "color": "#ffffff",
+ "backgroundColor": "#000000",
+ "borderRadius": 17,
+ "width": 110,
+ "height": 35,
+ "justifyContent": "center",
+ "alignItems": "center"
+ },
+ "rule-container": {
+ "position": "absolute",
+ "right": 22,
+ "top": 15,
+ "zIndex": 100,
+ "fontSize": 20,
+ "color": "#ffffff",
+ "backgroundColor": "#000000",
+ "borderRadius": 17,
+ "width": 70,
+ "height": 35,
+ "justifyContent": "center"
+ },
+ "announce": {
+ "backgroundColor": "#f5f3f4",
+ "width": 716,
+ "height": 286,
+ "position": "absolute",
+ "bottom": 17,
+ "left": 17,
+ "borderRadius": 5
+ },
+ "announce-hd": {
+ "width": 700,
+ "height": 90,
+ "marginTop": 8,
+ "marginBottom": 8,
+ "marginLeft": 5,
+ "marginRight": 5
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/de0c661a89abd9ebbbf4e61f69038784", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ },
+
+/***/ 18:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/banners", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ space: 0,
+ width: 0,
+ height: 0,
+ spmc:0,
+ spmdprefix:'',
+ ds: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ var ds = self.ds;
+ var length = ds.length;
+ for (var i = 0; i < length; i++) {
+ var item = ds[i];
+ item.index = i;
+ item.space = (i % length === 0) ? 0 : self.space;
+ }
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='row'},
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginLeft": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='column'},
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginTop": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+
+/***/ },
+
+/***/ 19:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/link", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ text: '',
+ href: ''
+ }},
+ methods: {
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "text",
+ "classList": [
+ "link"
+ ],
+ "shown": function () {return this.href},
+ "events": {
+ "click": "_clickHandler"
+ },
+ "attr": {
+ "value": function () {return this.text}
+ }
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/index.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/index.js b/ios/playground/bundlejs/showcase/new-fashion/index.js
new file mode 100644
index 0000000..465bf54
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/index.js
@@ -0,0 +1,1277 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/77d6180d05bb4533129b6c9f59794269", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1)
+ __weex_module__.exports = {
+ data: function () {return {
+ dir: 'examples',
+ tabItems: [
+ {
+ index: 0,
+ title: "\u4f1a\u573a",
+ titleColor: 0x0,
+ icon: "",
+ image: "http://gtms01.alicdn.com/tps/i1/TB1qw.hMpXXXXagXXXX9t7RGVXX-46-46.png",
+ selectedImage: "http://gtms04.alicdn.com/tps/i4/TB16jjPMpXXXXazXVXX9t7RGVXX-46-46.png",
+ src: "showcase/new-fashion/main.js",
+ visibility: "visible",
+ },
+ {
+ index: 1,
+ title: "WEEX",
+ titleColor: 0x0,
+ icon:"",
+ image: "http://gtms03.alicdn.com/tps/i3/TB1LEn9MpXXXXaUXpXX9t7RGVXX-46-46.png",
+ selectedImage: "http://gtms02.alicdn.com/tps/i2/TB1qysbMpXXXXcnXXXX9t7RGVXX-46-46.png",
+ src: "component/image-demo.js",
+ visibility: "hidden",
+ },
+ {
+ index: 2,
+ title: "\u5217\u8868",
+ titleColor: 0x0,
+ icon:"",
+ image: "http://gtms01.alicdn.com/tps/i1/TB1B0v5MpXXXXcvXpXX9t7RGVXX-46-46.png",
+ selectedImage: "http://gtms04.alicdn.com/tps/i4/TB1NxY5MpXXXXcrXpXX9t7RGVXX-46-46.png",
+ src: "component/list/list-demo.js",
+ visibility: "hidden",
+ }
+ ],
+ }},
+ created: function () {
+ var bundleUrl = this.$getConfig().bundleUrl;
+ var nativeBase;
+ var isAndroidAssets = bundleUrl.indexOf('file://assets/') >= 0;
+ var isiOSAssets = bundleUrl.indexOf('file:///') >= 0 && bundleUrl.indexOf('.app') > 0;
+ if (isAndroidAssets) {
+ nativeBase = 'file://assets/';
+ } else if (isiOSAssets) {
+ // file:///var/mobile/Containers/Bundle/Application/{id}/WeexDemo.app/
+ // file:///Users/{user}/Library/Developer/CoreSimulator/Devices/{id}/data/Containers/Bundle/Application/{id}/WeexDemo.app/
+ nativeBase = bundleUrl.substring(0, bundleUrl.indexOf('.app') + 4) + '/bundlejs/'
+ } else {
+ var host = 'localhost:12580';
+ var matches = /\/\/([^\/]+?)\//.exec(this.$getConfig().bundleUrl);
+ if (matches && matches.length >= 2) {
+ host = matches[1];
+ }
+ nativeBase = 'http://' + host + '/' + this.dir + '/build/';
+ }
+ var h5Base = './' + this.dir + '/build/';
+ // in Native
+ var base = nativeBase;
+ if (typeof window === 'object') {
+ // in Browser or WebView
+ base = h5Base;
+ }
+
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ tabItem.src = base + tabItem.src;
+ }
+ },
+ methods: {
+ ready: function (e) {
+ var vm = this;
+ vm.$on('tabBar.onClick',function(e){
+ var detail= e.detail;
+ nativeLog('tabBar.onClick ' + detail.index);
+ });
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "wxc-tabbar",
+ "classList": [
+ "tabbar"
+ ],
+ "attr": {
+ "tabItems": function () {return this.tabItems}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "content": {
+ "color": "#353535",
+ "backgroundColor": "#666666"
+ },
+ "tabbar": {
+ "backgroundColor": "#ffffff"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/77d6180d05bb4533129b6c9f59794269", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/link.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/link.js b/ios/playground/bundlejs/showcase/new-fashion/link.js
new file mode 100644
index 0000000..aa0167d
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/link.js
@@ -0,0 +1,84 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/85bc89788e4c68b54486adfe45d92247", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ text: '',
+ href: ''
+ }},
+ methods: {
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "text",
+ "classList": [
+ "link"
+ ],
+ "shown": function () {return this.href},
+ "events": {
+ "click": "_clickHandler"
+ },
+ "attr": {
+ "value": function () {return this.text}
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/85bc89788e4c68b54486adfe45d92247", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[13/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.h b/ios/sdk/WeexSDK/Sources/Model/WXComponent.h
new file mode 100644
index 0000000..5682e80
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.h
@@ -0,0 +1,310 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "Layout.h"
+@class WXSDKInstance;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface WXComponent : NSObject
+
+///--------------------------------------
+/// @name Component Hierarchy Management
+///--------------------------------------
+
+/**
+ * @abstract Initializes a new component using the specified properties.
+ *
+ * @param ref the identity string of component
+ * @param type component type
+ * @param styles component's styles
+ * @param attributes component's attributes
+ * @param events component's events
+ * @param weexInstance the weexInstance with which the component associated
+ *
+ * @return A WXComponent instance.
+ */
+- (instancetype)initWithRef:(NSString *)ref
+ type:(NSString*)type
+ styles:(nullable NSDictionary *)styles
+ attributes:(nullable NSDictionary *)attributes
+ events:(nullable NSArray *)events
+ weexInstance:(WXSDKInstance *)weexInstance;
+
+/**
+ * @abstract The component's identifier string.
+ */
+@property (nonatomic, readonly, strong) NSString *ref;
+
+/**
+ * @abstract The component's styles.
+ */
+@property (nonatomic, readonly, strong) NSDictionary *styles;
+
+/**
+ * @abstract The component's attributes.
+ */
+@property (nonatomic, readonly, strong) NSDictionary *attributes;
+
+/**
+ * @abstract The component's events.
+ */
+@property (nonatomic, readonly, strong) NSArray *events;
+
+/**
+ * @abstract The reference to
+ */
+@property (nonatomic, readonly, weak, nullable) WXSDKInstance *weexInstance;
+
+/**
+ * @abstract The component's subcomponents.
+ */
+@property (nonatomic, readonly, strong, nullable) NSArray<WXComponent *> *subcomponents;
+
+/**
+ * @abstract The component's supercomponent.
+ */
+@property (nonatomic, readonly, weak, nullable) WXComponent *supercomponent;
+
+///--------------------------------------
+/// @name Layout
+///--------------------------------------
+
+/**
+ * @abstract Return the calculated frame.
+ *
+ * @warning Subclasses must not override this.
+ */
+@property(nonatomic, readonly, assign) CGRect calculatedFrame;
+
+/**
+ * @abstract Return the calculated absolute position.
+ *
+ * @warning Subclasses must not override this.
+ */
+@property(nonatomic, assign) CGPoint absolutePosition;
+
+/**
+ * @abstract Return the css node used to layout.
+ *
+ * @warning Subclasses must not override this.
+ */
+@property(nonatomic, readonly, assign) css_node_t *cssNode;
+
+/**
+ * @abstract Invalidates the component's layout and marks it as needing an update.
+ *
+ * @discussion You can call this method to indicate that the layout of a component has changed and must be updated. Weex typically calls this method automatically when the layout-related styles change or when subcomponents are added or removed.
+ *
+ */
+- (void)setNeedsLayout;
+
+/**
+ * @abstract Returns a Boolean indicating whether the component has been marked as needing a layout update.
+ *
+ * @return YES if the component has been marked as requiring a layout update.
+ *
+ */
+- (BOOL)needsLayout;
+
+/**
+ * @abstract return a measure block for measure component's layout
+ *
+ * @param constrainedSize The maximum size the receiver should fit in.
+ *
+ * @return A block which will ask the component to measure and return the size that best fits for a constrained size.
+ *
+ * @discussion Subclasses can override this method to perform their own layout behaviour. Weex will use the returned block to measure the component's layout, ignoring its own layout mechanism.
+ *
+ */
+- (nullable CGSize (^)(CGSize))measureBlock;
+
+/**
+ * @abstract Called on main thread when the component has just laid out.
+ */
+- (void)layoutDidFinish;
+
+
+///--------------------------------------
+/// @name View Management
+///--------------------------------------
+
+/**
+ * @abstract The view that the component manages.
+ *
+ * @discussion If you access this property and its value is currently nil, the component automatically calls the loadView method and returns the resulting view.
+ *
+ * @warning It must be on accessed on the main thread.Subclasses must not override this;
+ */
+@property(nonatomic, readonly, strong) UIView *view;
+
+/**
+ * @abstract The layer that the component manages.
+ *
+ * @discussion The layer property is also lazily initialized, similar to the view property.
+ *
+ * @warning It must be on accessed on the main thread. Subclasses must not override this;
+ */
+@property(nonatomic, readonly, strong) CALayer *layer;
+
+/**
+ * @abstract Creates the view that the component manages.
+ *
+ * @return View to be created
+ *
+ * @discussion This method loads or creates a view and assigns it to the view property. This is where subclasses should create their custom view hierarchy. Should never be called directly.The method is called on the main thread.
+ *
+ * @warning Your custom implementation of this method should not call super
+ */
+- (UIView *)loadView;
+
+/**
+ * @abstract Returns a Boolean value indicating whether the view is currently loaded.
+ */
+- (BOOL)isViewLoaded;
+
+/**
+ * @abstract Called before the load of component'��s view .
+ *
+ * @discussion This is before -loadView. The method is called on the main thread.
+ */
+- (void)viewWillLoad;
+
+/**
+ * @abstract Called after the component'��s view is loaded and set.
+ *
+ * @discussion This is after -loadView. This is the best time to perform additional initialization like adding gesture recognizers to the view.The method is called on the main thread.
+ */
+- (void)viewDidLoad;
+
+/**
+ * @abstract Called just before releasing the component'��s view.The method is called on the main thread.
+ */
+- (void)viewWillUnload;
+
+/**
+ * @abstract Called when the component'��s view is released.The method is called on the main thread.
+ */
+- (void)viewDidUnload;
+
+/**
+ * @abstract Inserts a subview at the specified index.
+ *
+ * @param subcomponent The subcomponent whose view will be inserted in the component's view.
+ * @param index The index in the array of the subcomponents property at which to insert the view. subcomponent indices start at 0 and cannot be greater than the number of subcomponents.
+ *
+ * @discussion This will insert subcomponent's view to the view hierachy by default, it can be overrided to change the view hierachy. The method is called on the main thread.
+ */
+- (void)insertSubview:(WXComponent *)subcomponent atIndex:(NSInteger)index;
+
+/**
+ * @abstract Remove the component's view from its superview.
+ *
+ * @discussion The method is called on the main thread.
+ */
+- (void)removeFromSuperview;
+
+/**
+ * @abstract Moves the subview to a new super component in the scene. The node maintains its current position in scene coordinates.
+ *
+ * @param newSupercomponent An WXComponent object to move the component to
+ * @param index The index in the array of the subcomponents property at which to insert the view. subcomponent indices start at 0 and cannot be greater than the number of subcomponents.
+ */
+- (void)moveToSuperview:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index;
+
+///--------------------------------------
+/// @name Events
+///--------------------------------------
+
+/**
+ * @abstract Fire an event to the component in Javascript.
+ *
+ * @param eventName The name of the event to fire
+ * @param params The parameters to fire with
+ **/
+- (void)fireEvent:(NSString *)eventName params:(nullable NSDictionary *)params;
+
+///--------------------------------------
+/// @name Updating
+///--------------------------------------
+
+/**
+ * @abstract Called when component's style are updated
+ *
+ * @param styles The updated style dictionary
+ * @discussion It can be overrided to handle specific style updating. The method is called on the main thread.
+ **/
+- (void)updateStyles:(NSDictionary *)styles;
+
+/**
+ * @abstract Called when component's attributes are updated
+ *
+ * @param attributes The updated attributes dictionary
+ * @discussion It can be overrided to handle specific attribute updating. The method is called on the main thread.
+ **/
+- (void)updateAttributes:(NSDictionary *)attributes;
+
+/**
+ * @abstract Called when adding an event to the component
+ *
+ * @param eventName The added event's name
+ * @discussion It can be overrided to handle specific event adding. The method is called on the main thread.
+ **/
+- (void)addEvent:(NSString *)eventName;
+
+/**
+ * @abstract Called when removing an event frome the component
+ *
+ * @param eventName The removed event's name
+ * @discussion It can be overrided to handle specific event removing. The method is called on the main thread.
+ **/
+- (void)removeEvent:(NSString *)evetName;
+
+///--------------------------------------
+/// @name Display
+///--------------------------------------
+
+typedef UIImage * _Nonnull(^WXDisplayBlock)(CGRect bounds, BOOL(^isCancelled)(void));
+typedef void(^WXDisplayCompeletionBlock)(CALayer *layer, BOOL finished);
+
+/**
+ * @abstract Marks the view as needing display. The method should be called on the main thread.
+ */
+- (void)setNeedsDisplay;
+
+/**
+ * @abstract Return a block to be called to draw layer.
+ *
+ * @discussion The block returned will be called on any thread.
+ *
+ */
+- (WXDisplayBlock)displayBlock;
+
+/**
+ * @abstract Return a block to be called while drawing is finished.
+ *
+ * @discussion The block returned will be called on main thread.
+ *
+ */
+- (WXDisplayCompeletionBlock)displayCompeletionBlock;
+
+@end
+
+@interface UIView (WXComponent)
+
+@property (nonatomic, weak) WXComponent *wx_component;
+
+@end
+
+@interface CALayer (WXComponent)
+
+@property (nonatomic, weak) WXComponent *wx_component;
+
+@end
+
+NS_ASSUME_NONNULL_END
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
new file mode 100644
index 0000000..6f900e9
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
@@ -0,0 +1,288 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+#import "WXComponent_internal.h"
+#import "WXComponentManager.h"
+#import "WXSDKManager.h"
+#import "WXSDKInstance.h"
+#import "WXSDKInstance_private.h"
+#import "WXDefine.h"
+#import "WXLog.h"
+#import "WXWeakObjectWrapper.h"
+#import "WXUtility.h"
+#import "WXConvert.h"
+#import "WXAssert.h"
+#import "WXThreadSafeMutableDictionary.h"
+#import "WXThreadSafeMutableArray.h"
+
+#pragma clang diagnostic ignored "-Wincomplete-implementation"
+
+@interface WXComponent () <UIGestureRecognizerDelegate>
+
+@end
+
+@implementation WXComponent
+{
+@private
+ NSString *_ref;
+ WXThreadSafeMutableDictionary *_styles;
+ WXThreadSafeMutableDictionary *_attributes;
+ WXThreadSafeMutableArray *_events;
+
+ WXThreadSafeMutableArray *_subcomponents;
+ __weak WXComponent *_supercomponent;
+ __weak id<WXScrollerProtocol> _ancestorScroller;
+ __weak WXSDKInstance *_weexInstance;
+}
+
+#pragma mark Life Cycle
+
+- (instancetype)initWithRef:(NSString *)ref
+ type:(NSString *)type
+ styles:(NSDictionary *)styles
+ attributes:(NSDictionary *)attributes
+ events:(NSArray *)events
+ weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super init]) {
+ _ref = ref;
+ _type = type;
+ _weexInstance = weexInstance;
+ _styles = styles ? [WXThreadSafeMutableDictionary dictionaryWithDictionary:styles] : [WXThreadSafeMutableDictionary dictionary];
+ _attributes = attributes ? [WXThreadSafeMutableDictionary dictionaryWithDictionary:attributes] : [WXThreadSafeMutableDictionary dictionary];
+ _events = events ? [WXThreadSafeMutableArray arrayWithArray:events] : [WXThreadSafeMutableArray array];
+
+ _subcomponents = [WXThreadSafeMutableArray array];
+
+ _isNeedJoinLayoutSystem = YES;
+ _isLayoutDirty = YES;
+
+ _async = NO;
+
+ //TODO set indicator style
+ if ([type isEqualToString:@"indicator"]) {
+ _styles[@"position"] = @"absolute";
+ if (!_styles[@"left"] && !_styles[@"right"]) {
+ _styles[@"left"] = @0.0f;
+ }
+ if (!_styles[@"top"] && !_styles[@"bottom"]) {
+ _styles[@"top"] = @0.0f;
+ }
+ }
+
+ [self _setupNavBarWithStyles:_styles attributes:_attributes];
+ [self _initCSSNodeWithStyles:_styles];
+ [self _initViewPropertyWithStyles:_styles];
+ [self _handleBorders:styles isUpdating:NO];
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ free_css_node(_cssNode);
+}
+
+- (NSDictionary *)styles
+{
+ return _styles;
+}
+
+- (NSDictionary *)attributes
+{
+ return _attributes;
+}
+
+- (WXSDKInstance *)weexInstance
+{
+ return _weexInstance;
+}
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"<%@ ref=%@> %@", _type, _ref, _view];
+}
+
+#pragma mark Component Hierarchy
+
+- (NSArray<WXComponent *> *)subcomponents
+{
+ return _subcomponents;
+}
+
+- (WXComponent *)supercomponent
+{
+ return _supercomponent;
+}
+
+- (void)_insertSubcomponent:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ WXAssert(subcomponent, @"The subcomponent to insert to %@ at index %d must not be nil", self, index);
+
+ subcomponent->_supercomponent = self;
+
+ [_subcomponents insertObject:subcomponent atIndex:index];
+
+ if (subcomponent->_positionType == WXPositionTypeFixed) {
+ [self.weexInstance.componentManager addFixedComponent:subcomponent];
+ subcomponent->_isNeedJoinLayoutSystem = NO;
+ }
+
+ [self _recomputeCSSNodeChildren];
+ [self setNeedsLayout];
+}
+
+- (void)_removeFromSupercomponent
+{
+ [self.supercomponent->_subcomponents removeObject:self];
+ [self.supercomponent _recomputeCSSNodeChildren];
+ [self.supercomponent setNeedsLayout];
+
+ if (_positionType == WXPositionTypeFixed) {
+ [self.weexInstance.componentManager removeFixedComponent:self];
+ self->_isNeedJoinLayoutSystem = YES;
+ }
+}
+
+- (void)_moveToSupercomponent:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index
+{
+ [self _removeFromSupercomponent];
+ [newSupercomponent _insertSubcomponent:self atIndex:index];
+}
+
+- (id<WXScrollerProtocol>)ancestorScroller
+{
+ if(!_ancestorScroller){
+ WXComponent *supercomponent = self.supercomponent;
+ while (supercomponent) {
+ if([supercomponent conformsToProtocol:@protocol(WXScrollerProtocol)]){
+ _ancestorScroller = (id<WXScrollerProtocol>)supercomponent;
+ break;
+ }
+ supercomponent = supercomponent.supercomponent;
+ }
+ }
+
+ return _ancestorScroller;
+}
+
+#pragma mark Updating
+
+- (void)_updateStylesOnComponentThread:(NSDictionary *)styles
+{
+ [_styles addEntriesFromDictionary:styles];
+ [self _updateCSSNodeStyles:styles];
+}
+
+- (void)_updateAttributesOnComponentThread:(NSDictionary *)attributes
+{
+ [_attributes addEntriesFromDictionary:attributes];
+}
+
+- (void)_addEventOnComponentThread:(NSString *)eventName
+{
+ [_events addObject:eventName];
+}
+
+- (void)_removeEventOnComponentThread:(NSString *)eventName
+{
+ [_events removeObject:eventName];
+}
+
+- (void)_updateStylesOnMainThread:(NSDictionary *)styles
+{
+ WXAssertMainThread();
+
+ [self _updateViewStyles:styles];
+ [self _handleBorders:styles isUpdating:YES];
+
+ [self updateStyles:styles];
+}
+
+- (void)_updateAttributesOnMainThread:(NSDictionary *)attributes
+{
+ WXAssertMainThread();
+
+ [[_attributes mutableCopy] addEntriesFromDictionary:attributes];
+
+ [self _updateNavBarAttributes:attributes];
+
+ [self updateAttributes:attributes];
+}
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+ WXAssertMainThread();
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ WXAssertMainThread();
+}
+
+#pragma mark Layout
+
+/**
+ * @see WXComponents+Layout.m
+ */
+
+#pragma mark View Management
+
+/**
+ * @see WXComponents+ViewManagement.m
+ */
+
+#pragma mark Events
+
+/**
+ * @see WXComponents+Events.m
+ */
+
+#pragma mark Display
+
+/**
+ * @see WXComponents+Display.m
+ */
+
+@end
+
+
+@implementation UIView (WXComponent)
+
+- (WXComponent *)wx_component
+{
+ WXWeakObjectWrapper *weakWrapper = objc_getAssociatedObject(self, @selector(wx_component));
+ return [weakWrapper weakObject];
+}
+
+- (void)setWx_component:(WXComponent *)wx_component
+{
+ id weakWrapper = [[WXWeakObjectWrapper alloc] initWithWeakObject:wx_component];
+ objc_setAssociatedObject(self, @selector(wx_component), weakWrapper, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+@implementation CALayer (WXComponents_new)
+
+- (WXComponent *)wx_component
+{
+ WXWeakObjectWrapper *weakWrapper = objc_getAssociatedObject(self, @selector(wx_component));
+ return [weakWrapper weakObject];
+}
+
+- (void)setWx_component:(WXComponent *)wx_component
+{
+ id weakWrapper = [[WXWeakObjectWrapper alloc] initWithWeakObject:wx_component];
+ objc_setAssociatedObject(self, @selector(wx_component), weakWrapper, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h
new file mode 100644
index 0000000..20988bb
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h
@@ -0,0 +1,200 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import "WXComponent.h"
+
+extern NSString *const bundleUrlOptionKey;
+
+@interface WXSDKInstance : NSObject
+
+/**
+ * The viewControler which the weex bundle is rendered in.
+ **/
+@property (nonatomic, weak) UIViewController *viewController;
+
+/**
+ * The rootView which the weex bundle is rendered at.
+ **/
+@property (nonatomic, strong) UIView *rootView;
+
+/**
+ * The scriptURL of weex bundle.
+ **/
+@property (nonatomic, strong) NSURL *scriptURL;
+
+/**
+ * The parent instance.
+ **/
+@property (nonatomic, weak) WXSDKInstance *parentInstance;
+
+/**
+ * The node reference of parent instance.
+ **/
+@property (nonatomic, weak) NSString *parentNodeRef;
+
+/**
+ * The unique id to indentify current weex instance.
+ **/
+@property (nonatomic, strong) NSString *instanceId;
+
+/**
+ * The state of current instance.
+ **/
+typedef NS_ENUM(NSInteger, WXState) {//state.code
+ WeexInstanceAppear = 100,
+ WeexInstanceDisappear,
+ WeexInstanceForeground,
+ WeexInstanceBackground,
+ WeexInstanceMemoryWarning,
+ WeexInstanceDestroy
+};
+
+@property (nonatomic, assign) WXState state;
+
+/**
+ * The callback triggered when the instance finishes creating the body.
+ *
+ * @param view The rootView.
+ **/
+@property (nonatomic, copy) void (^onCreate)(UIView *);
+
+/**
+ * The callback triggered when the instance finishes refreshing weex view.
+ *
+ * @param view The rootView.
+ **/
+@property (nonatomic, copy) void (^refreshFinish)(UIView *);
+
+/**
+ * The callback triggered when the instance finishes rendering.
+ *
+ * @param view The rootView.
+ **/
+@property (nonatomic, copy) void (^renderFinish)(UIView *);
+
+/**
+ * The callback triggered when the instance finishes updating.
+ *
+ * @param view The rootView.
+ **/
+@property (nonatomic, copy) void (^updateFinish)(UIView *);
+
+
+typedef NS_ENUM(NSInteger, WXErrorType) {//error.domain
+ TemplateErrorType = 1,
+};
+typedef NS_ENUM(NSInteger, WXErrorCode) {//error.code
+ PlatformErrorCode = 1000,
+ OSVersionErrorCode,
+ AppVersionErrorCode,
+ WeexSDKVersionErrorCode,
+ DeviceModelErrorCode,
+ FrameworkVersionErrorCode,
+};
+
+/**
+ * The callback triggered when the instance fails to render.
+ *
+ * @param error The error code .
+ **/
+@property (nonatomic, copy) void (^onFailed)(NSError *error);
+
+/**
+ * The callback triggered when the instacne executes scrolling .
+ *
+ * @param contentOffset The point at which the origin of the content view is offset from the origin of the scroll view
+ **/
+@property (nonatomic, copy) void (^onScroll)(CGPoint contentOffset);
+
+/**
+ * the callback to be run repeatedly while the instance is rendering.
+ *
+ * @param renderRect The view's frame that is just rendered.
+ **/
+@property (nonatomic, copy) void (^onRenderProgress)(CGRect renderRect);
+
+/**
+ * the frame of current instance.
+ **/
+@property (nonatomic, assign) CGRect frame;
+
+/**
+ * the info stored by user.
+ */
+@property (nonatomic, strong) NSDictionary *userInfo;
+
+/**
+ * Renders weex view with bundle url.
+ *
+ * @param url The url of bundle rendered to a weex view.
+ **/
+- (void)renderWithURL:(NSURL *)url;
+
+/**
+ * Renders weex view with bundle url and some others.
+ *
+ * @param url The url of bundle rendered to a weex view.
+ *
+ * @param options The params passed by user, sometimes you should pass the value of "bundleUrl".
+ *
+ * @param data The data the bundle needs when rendered.
+ **/
+- (void)renderWithURL:(NSURL *)url options:(NSDictionary *)options data:(id)data;
+
+/**
+ * Renders weex view with source string of bundle and some others.
+ *
+ * @param url The source string of bundle rendered to a weex view.
+ *
+ * @param options The params passed by user, sometimes you should pass the value of "bundleUrl".
+ *
+ * @param data The data the bundle needs when rendered.
+ **/
+- (void)renderView:(NSString *)source options:(NSDictionary *)options data:(id)data;
+
+/**
+ * Refreshes current instance with data.
+ *
+ * @param data The data the bundle needs when rendered.
+ **/
+- (void)refreshInstance:(id)data;
+
+/**
+ * Destroys current instance.
+ **/
+- (void)destroyInstance;
+
+/**
+ * get module instance by class
+ */
+- (id)moduleForClass:(Class)moduleClass;
+
+/**
+ * get Componet instance by ref
+ */
+- (WXComponent *) componentForRef:(NSString *)ref;
+
+/**
+ * application performance statistics
+ */
+@property (nonatomic, strong) NSString *bizType;
+@property (nonatomic, strong) NSString *pageName;
+@property (nonatomic, strong) NSDictionary *properties;
+@property (nonatomic, weak) id pageObject;
+@property (nonatomic, strong) NSDate *renderStartDate;
+@property (nonatomic) NSTimeInterval networkTime;
+@property (nonatomic) NSTimeInterval communicateTime;
+extern NSTimeInterval JSLibInitTime;
+@property (nonatomic) NSTimeInterval screenRenderTime;
+
+- (void)finishPerformance;
+
+- (void)reloadData:(id)data DEPRECATED_MSG_ATTRIBUTE("Use refreshInstance: method instead.");
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
new file mode 100644
index 0000000..5903940
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -0,0 +1,314 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSDKInstance.h"
+#import "WXSDKInstance_private.h"
+#import "WXSDKManager.h"
+#import "WXAppMonitorProtocol.h"
+#import "WXNetworkProtocol.h"
+#import "WXModuleFactory.h"
+#import "WXHandlerFactory.h"
+#import "WXDebugTool.h"
+#import "WXUtility.h"
+#import "WXLog.h"
+#import "WXView.h"
+
+NSString *const bundleUrlOptionKey = @"bundleUrl";
+
+NSTimeInterval JSLibInitTime = 0;
+
+@implementation WXSDKInstance
+{
+ id<WXNetworkProtocol> _networkHandler;
+
+ WXComponentManager *_componentManager;
+}
+
+- (void) dealloc
+{
+ [self removeObservers];
+}
+
+- (instancetype)init
+{
+ self = [super init];
+ if(self){
+ NSInteger instanceId = 0;
+ @synchronized(self){
+ static NSInteger __instance = 0;
+ instanceId = __instance % (1024*1024);
+ __instance++;
+ }
+ _instanceId = [NSString stringWithFormat:@"%ld", (long)instanceId];
+
+ [WXSDKManager storeInstance:self forID:_instanceId];
+ _frame = CGRectMake(NAN, NAN, NAN, NAN);
+
+ _bizType = @"";
+ _pageName = @"";
+ _screenRenderTime = 0;
+
+ _frame = CGRectMake(NAN, NAN, NAN, NAN);
+ _moduleInstances = [NSMutableDictionary new];
+ _styleConfigs = [NSMutableDictionary new];
+ _attrConfigs = [NSMutableDictionary new];
+
+ [self addObservers];
+ }
+ return self;
+}
+
+#pragma mark Public Mehtods
+
+- (void)renderWithURL:(NSURL *)url
+{
+ [self renderWithURL:url options:nil data:nil];
+}
+
+- (void)renderWithURL:(NSURL *)url options:(NSDictionary *)options data:(id)data
+{
+ WXLogInfo(@"Render URL: %@", url);
+ if (!url) {
+ WXLogError(@"Url must be passed if you use renderWithURL");
+ return;
+ }
+
+ _scriptURL = url;
+ NSMutableDictionary *newOptions = [options mutableCopy];
+ newOptions[bundleUrlOptionKey] = url.absoluteString;
+
+ if (!self.pageName || [self.pageName isEqualToString:@""]) {
+ self.pageName = url.absoluteString ? : @"";
+ }
+
+ __weak typeof(self) weakSelf = self;
+ if ([url isFileURL]) {
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ NSString *path = [url path];
+ NSData *scriptData = [[NSFileManager defaultManager] contentsAtPath:path];
+ NSString *script = [[NSString alloc] initWithData:scriptData encoding:NSUTF8StringEncoding];
+ if (!script) {
+ NSString *errorDesc = [NSString stringWithFormat:@"File read error at url: %@", url];
+ WXLogError(@"%@", errorDesc);
+ if (weakSelf.onFailed) {
+ weakSelf.onFailed([NSError errorWithDomain:WX_ERROR_DOMAIN code:0 userInfo:@{NSLocalizedDescriptionKey: errorDesc}]);
+ }
+ return;
+ }
+ [weakSelf renderView:script options:newOptions data:data];
+ });
+ } else {
+ NSDate *networkStart = [NSDate date];
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request setValue:[WXUtility userAgent] forHTTPHeaderField:@"User-Agent"];
+
+ id<WXNetworkProtocol> networkHandler = [self networkHandler];
+
+ __block NSURLResponse *urlResponse;
+ [networkHandler sendRequest:request
+ withSendingData:^(int64_t bytesSent, int64_t totalBytes) {}
+ withResponse:^(NSURLResponse *response) {
+ urlResponse = response;
+ }
+ withReceiveData:^(NSData *data) {}
+ withCompeletion:^(NSData *totalData, NSError *error) {
+ //TODO 304
+ if (!error && [urlResponse isKindOfClass:[NSHTTPURLResponse class]] && ((NSHTTPURLResponse *)urlResponse).statusCode != 200) {
+ error = [NSError errorWithDomain:WX_ERROR_DOMAIN
+ code:((NSHTTPURLResponse *)urlResponse).statusCode
+ userInfo:@{@"message":@"status code error."}];
+ }
+
+ if (error) {
+ WXLogError(@"Connection to %@ occurs an error:%@", request.URL, error);
+ if (weakSelf.onFailed) {
+ weakSelf.onFailed(error);
+ }
+ return ;
+ }
+
+ NSString *script = [[NSString alloc] initWithData:totalData encoding:NSUTF8StringEncoding];
+ weakSelf.networkTime = -[networkStart timeIntervalSinceNow];
+ [weakSelf renderView:script options:newOptions data:data];
+ }];
+ }
+}
+
+- (void)renderView:(NSString *)source options:(NSDictionary *)options data:(id)data
+{
+ WXLogVerbose(@"Render view: %@, data:%@", self, [WXUtility JSONString:data]);
+
+ if (!self.instanceId) {
+ WXLogError(@"Fail to find instance\uff01");
+ return;
+ }
+
+ _renderStartDate = [NSDate new];
+
+ NSMutableDictionary *dictionary = [options mutableCopy];
+ if ([WXLog logLevel] >= WXLogLevelVerbose) {
+ dictionary[@"debug"] = @(YES);
+ }
+
+ if ([WXDebugTool getReplacedBundleJS]) {
+ source = [WXDebugTool getReplacedBundleJS];
+ }
+
+ //TODO WXRootView
+ self.rootView = [[WXView alloc] initWithFrame:self.frame];
+ if(self.onCreate) {
+ self.onCreate(self.rootView);
+ }
+
+ [[WXSDKManager bridgeMgr] createInstance:self.instanceId template:source options:dictionary data:data];
+}
+
+- (void)setFrame:(CGRect)frame
+{
+ _frame = frame;
+// [self.componentManager changeRootFrame];
+}
+
+- (void)reloadData:(id)data
+{
+ [self refreshInstance:data];
+}
+
+- (void)refreshInstance:(id)data
+{
+ WXLogVerbose(@"refresh instance: %@, data:%@", self, [WXUtility JSONString:data]);
+
+ if (!self.instanceId) {
+ WXLogError(@"Fail to find instance\uff01");
+ return;
+ }
+
+ [[WXSDKManager bridgeMgr] refreshInstance:self.instanceId data:data];
+}
+
+- (void)destroyInstance
+{
+ if (!self.instanceId) {
+ WXLogError(@"Fail to find instance\uff01");
+ return;
+ }
+
+ [[WXSDKManager bridgeMgr] destroyInstance:self.instanceId];
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnComponentThread(^{
+ [self.componentManager unload];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [WXSDKManager removeInstanceforID:weakSelf.instanceId];
+ });
+ });
+}
+
+- (void)updateState:(WXState)state
+{
+ if (!self.instanceId) {
+ WXLogError(@"Fail to find instance\uff01");
+ return;
+ }
+
+ NSMutableDictionary *data = [NSMutableDictionary dictionary];
+ [data setObject:[NSNumber numberWithLong:state] forKey:@"state"];
+ [[WXSDKManager bridgeMgr] updateState:self.instanceId data:data];
+}
+
+- (id)moduleForClass:(Class)moduleClass
+{
+ if (!moduleClass)
+ return nil;
+
+ id<WXModuleProtocol> moduleInstance = self.moduleInstances[NSStringFromClass(moduleClass)];
+ if (!moduleInstance) {
+ moduleInstance = [[moduleClass alloc] init];
+ if ([moduleInstance respondsToSelector:@selector(setWeexInstance:)])
+ [moduleInstance setWeexInstance:self];
+ self.moduleInstances[NSStringFromClass(moduleClass)] = moduleInstance;
+ }
+
+ return moduleInstance;
+}
+
+- (WXComponent *)componentForRef:(NSString *)ref
+{
+ return [self.componentManager componentForRef:ref];
+}
+
+- (void)finishPerformance
+{
+ NSTimeInterval totalTime = 0;
+ if (_renderStartDate) {
+ totalTime = [[NSDate new] timeIntervalSinceDate:_renderStartDate];
+ }
+ else {
+ NSAssert(NO, @"");
+ }
+
+ NSDictionary* dict = @{BIZTYPE:self.bizType,
+ PAGENAME:self.pageName,
+ WXSDKVERSION:WX_SDK_VERSION,
+ NETWORKTIME:@(_networkTime * 1000),
+ COMMUNICATETIME:[NSNumber numberWithDouble:_communicateTime * 1000],
+ JSLIBINITTIME:[NSNumber numberWithDouble:JSLibInitTime * 1000],
+ SCREENRENDERTIME:[NSNumber numberWithDouble:(_screenRenderTime > 0 ? _screenRenderTime : totalTime) * 1000],
+ TOTALTIME:[NSNumber numberWithDouble:totalTime * 1000]
+ };
+ WXLogInfo(@"Performance: %@", dict);
+
+ id<WXAppMonitorProtocol> appMonitor = [WXHandlerFactory handlerForProtocol:@protocol(WXAppMonitorProtocol)];
+ if (appMonitor && [appMonitor respondsToSelector:@selector(commitAppMonitorArgs:)]){
+ [appMonitor commitAppMonitorArgs:dict];
+ }
+}
+
+#pragma mark Private Methods
+
+- (void)addObservers
+{
+ [self addObserver:self forKeyPath:@"state" options:NSKeyValueObservingOptionNew context:nil];
+}
+
+- (void)removeObservers
+{
+ [self removeObserver:self forKeyPath:@"state"];
+}
+
+- (WXComponentManager *)componentManager
+{
+ if (!_componentManager) {
+ _componentManager = [[WXComponentManager alloc] initWithWeexInstance:self];
+ }
+
+ return _componentManager;
+}
+
+- (id<WXNetworkProtocol>)networkHandler
+{
+ if (!_networkHandler) {
+ _networkHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXNetworkProtocol)];
+ }
+
+ return _networkHandler;
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+ if ([keyPath isEqualToString:@"state"]) {
+ WXState state = [change[@"new"] longValue];
+ [self updateState:state];
+
+ if (state == WeexInstanceDestroy) {
+ [self destroyInstance];
+ }
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_private.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_private.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_private.h
new file mode 100644
index 0000000..3ec3059
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_private.h
@@ -0,0 +1,22 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXSDKInstance.h"
+#import "WXComponentManager.h"
+
+@interface WXSDKInstance ()
+
+@property (nonatomic, strong) NSMutableDictionary *moduleInstances;
+@property (nonatomic, strong) NSMutableDictionary *naviBarStyles;
+@property (nonatomic, strong) NSMutableDictionary *styleConfigs;
+@property (nonatomic, strong) NSMutableDictionary *attrConfigs;
+
+@property (nonatomic, readonly, strong) WXComponentManager *componentManager;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.h b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.h
new file mode 100644
index 0000000..592bcb4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXModuleProtocol.h"
+
+@interface WXAnimationModule : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
new file mode 100644
index 0000000..bd88ba7
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
@@ -0,0 +1,75 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXAnimationModule.h"
+#import "WXSDKInstance_private.h"
+#import "WXConvert.h"
+#import "WXTransform.h"
+
+@implementation WXAnimationModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(transition:args:callback:))
+
+- (void)transition:(NSString *)nodeRef args:(NSDictionary *)args callback:(WXModuleCallback)callback
+{
+ WXComponent *targetComponent = [self.weexInstance componentForRef:nodeRef];
+ if (!targetComponent) {
+ callback([NSString stringWithFormat:@"No component find for ref:%@", nodeRef]);
+ return;
+ }
+
+ CALayer *layer = targetComponent.layer;
+ UIView *view = targetComponent.view;
+
+ NSDictionary *styles = args[@"styles"];
+
+ NSTimeInterval duration = [args[@"duration"] doubleValue] / 1000;
+ NSTimeInterval delay = [args[@"delay"] doubleValue] / 1000;
+// CAMediaTimingFunction *timingFunction = [WXConvert CAMediaTimingFunction:args[@"timingFunction"]];
+ UIViewAnimationOptions timingFunction = [WXConvert UIViewAnimationTimingFunction:args[@"timingFunction"]];
+
+ // Rotate 360 not work , have not found any solution
+ // http://stackoverflow.com/questions/9844925/uiview-infinite-360-degree-rotation-animation
+ [UIView animateWithDuration:duration delay:delay options:UIViewAnimationOptionAllowUserInteraction | timingFunction animations:^{
+ for (NSString *property in styles) {
+ if ([property isEqualToString:@"transform"]) {
+ NSString *transformOrigin = styles[@"transformOrigin"];
+ layer.transform = [[WXTransform new] getTransform:styles[property] withView:view withOrigin:transformOrigin];
+ } else if ([property isEqualToString:@"backgroundColor"]) {
+ layer.backgroundColor = [WXConvert CGColor:styles[property]];
+ } else if ([property isEqualToString:@"opacity"]) {
+ layer.opacity = [styles[property] floatValue];
+ }
+ }
+ } completion:^(BOOL finished) {
+ if (callback) {
+ callback(finished ? @"SUCCESS" : @"FAIL");
+ }
+ }];
+
+//
+// CAAnimationGroup *group = [CAAnimationGroup animation];
+// group.fillMode = kCAFillModeForwards;
+// group.removedOnCompletion = NO;
+// group.timingFunction = timingFunction;
+// group.animations = animations;
+// group.delegate = self;
+// group.beginTime = CACurrentMediaTime() + delay;
+// group.duration = duration;
+//
+// _callback = [callback copy];
+// [layer addAnimation:group forKey:nil];
+}
+
+//- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
+//{
+//}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXDomModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXDomModule.h b/ios/sdk/WeexSDK/Sources/Module/WXDomModule.h
new file mode 100644
index 0000000..be9367f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXDomModule.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleProtocol.h"
+
+@interface WXDomModule : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXDomModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXDomModule.m b/ios/sdk/WeexSDK/Sources/Module/WXDomModule.m
new file mode 100644
index 0000000..49bdb39
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXDomModule.m
@@ -0,0 +1,148 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXDomModule.h"
+#import "WXDefine.h"
+#import "WXSDKManager.h"
+#import "WXComponentManager.h"
+#import "WXSDKInstance_private.h"
+#import "WXLog.h"
+#import "WXModuleProtocol.h"
+
+@interface WXDomModule ()
+
+@end
+
+@implementation WXDomModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(createBody:))
+WX_EXPORT_METHOD(@selector(addElement:element:atIndex:))
+WX_EXPORT_METHOD(@selector(removeElement:))
+WX_EXPORT_METHOD(@selector(moveElement:parentRef:index:))
+WX_EXPORT_METHOD(@selector(addEvent:event:))
+WX_EXPORT_METHOD(@selector(removeElement:))
+WX_EXPORT_METHOD(@selector(createFinish))
+WX_EXPORT_METHOD(@selector(updateFinish))
+WX_EXPORT_METHOD(@selector(refreshFinish))
+WX_EXPORT_METHOD(@selector(scrollToElement:options:))
+WX_EXPORT_METHOD(@selector(updateStyle:styles:))
+WX_EXPORT_METHOD(@selector(updateAttrs:attrs:))
+
+- (void)performBlockOnComponentMananger:(void(^)(WXComponentManager *))block
+{
+ if (!block) {
+ return;
+ }
+ __weak typeof(self) weakSelf = self;
+
+ WXPerformBlockOnComponentThread(^{
+ WXComponentManager *mananger = weakSelf.weexInstance.componentManager;
+ [mananger startComponentTasks];
+ block(mananger);
+ });
+}
+
+- (NSThread *)targetExecuteThread
+{
+ return [WXComponentManager componentThread];
+}
+
+- (void)createBody:(NSDictionary *)body
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager createRoot:body];
+ }];
+}
+
+- (void)addElement:(NSString *)parentRef element:(NSDictionary *)element atIndex:(NSInteger)index
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager addComponent:element toSupercomponent:parentRef atIndex:index appendingInTree:NO];
+ }];
+}
+
+- (void)removeElement:(NSString *)ref
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager removeComponent:ref];
+ }];
+}
+
+- (void)moveElement:(NSString *)elemRef parentRef:(NSString *)parentRef index:(NSInteger)index
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager moveComponent:elemRef toSuper:parentRef atIndex:index];
+ }];
+}
+
+- (void)addEvent:(NSString *)elemRef event:(NSString *)event
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager addEvent:event toComponent:elemRef];
+ }];
+}
+
+- (void)removeEvent:(NSString *)elemRef event:(NSString *)event
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager removeEvent:event fromComponent:elemRef];
+ }];
+}
+
+- (void)createFinish
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager createFinish];
+ }];
+}
+
+- (void)updateFinish
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager updateFinish];
+ }];
+}
+
+- (void)refreshFinish
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager refreshFinish];
+ }];
+}
+
+- (void)scrollToElement:(NSString *)elemRef options:(NSDictionary *)dict
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager scrollToComponent:elemRef options:dict];
+ }];
+}
+
+-(void)updateStyle:(NSString *)elemRef styles:(NSDictionary *)styles
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager updateStyles:styles forComponent:elemRef];
+ }];
+}
+
+- (void)updateAttrs:(NSString *)elemRef attrs:(NSDictionary *)attrs
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager updateAttributes:attrs forComponent:elemRef];
+ }];
+}
+
+- (void)destoryInstance
+{
+ [self performBlockOnComponentMananger:^(WXComponentManager *manager) {
+ [manager unload];
+ }];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.h b/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.h
new file mode 100644
index 0000000..a7da464
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleProtocol.h"
+
+@interface WXInstanceWrap : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.m b/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.m
new file mode 100644
index 0000000..ce6d077
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.m
@@ -0,0 +1,44 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXInstanceWrap.h"
+#import "WXEmbedComponent.h"
+
+@implementation WXInstanceWrap
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(error:code:info:))
+WX_EXPORT_METHOD(@selector(refresh))
+
+- (void)error:(NSInteger)type code:(NSInteger)code info:(NSString *)info
+{
+ NSString *domain = [NSString stringWithFormat:@"%ld", (long)type];
+ NSDictionary *userInfo = @{ NSLocalizedDescriptionKey:info };
+ NSError *error = [NSError errorWithDomain:domain code:code userInfo:userInfo];
+ if (weexInstance.onFailed)
+ weexInstance.onFailed(error);
+}
+
+- (void)refresh
+{
+ if (self.weexInstance.parentInstance) {
+ WXSDKInstance *instance = self.weexInstance.parentInstance;
+ NSString *nodeRef = self.weexInstance.parentNodeRef;
+ WXEmbedComponent *embedComponent= (WXEmbedComponent *)[instance componentForRef:nodeRef];
+ [embedComponent refreshWeex];
+ }
+ else {
+ UIViewController *controller = self.weexInstance.viewController;
+ if ([controller respondsToSelector:@selector(refreshWeex)]) {
+ [controller performSelector:@selector(refreshWeex) withObject:nil];
+ }
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.h b/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.h
new file mode 100644
index 0000000..8305bdc
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXModuleProtocol.h"
+
+@interface WXModalUIModule : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m b/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m
new file mode 100644
index 0000000..21e9261
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m
@@ -0,0 +1,308 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModalUIModule.h"
+#import <objc/runtime.h>
+#import "WXUtility.h"
+#import "WXAssert.h"
+
+static NSString *WXModalCallbackKey;
+
+typedef enum : NSUInteger {
+ WXModalTypeToast = 1,
+ WXModalTypeAlert,
+ WXModalTypeConfirm,
+ WXModalTypePrompt
+} WXModalType;
+
+@interface WXToastInfo : NSObject
+
+@property (nonatomic, strong) UIView *toastView;
+@property (nonatomic, weak) UIView *superView;
+@property (nonatomic, assign) double duration;
+
+@end
+
+@implementation WXToastInfo
+
+@end
+
+@interface WXToastManager : NSObject
+
+@property (strong, nonatomic) NSMutableArray<WXToastInfo *> *toastQueue;
+@property (strong, nonatomic) UIView *toastingView;
+
++ (WXToastManager *)sharedManager;
+
+@end
+
+@implementation WXToastManager
+
++ (WXToastManager *)sharedManager{
+ static WXToastManager * shareInstance;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ shareInstance = [[WXToastManager alloc] init];
+ shareInstance.toastQueue = [NSMutableArray new];
+ });
+ return shareInstance;
+}
+
+@end
+
+@interface WXModalUIModule () <UIAlertViewDelegate>
+
+@end
+
+@implementation WXModalUIModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(toast:))
+WX_EXPORT_METHOD(@selector(alert:callback:))
+WX_EXPORT_METHOD(@selector(confirm:callback:))
+WX_EXPORT_METHOD(@selector(prompt:callback:))
+
+#pragma mark - Toast
+
+static const double WXToastDefaultDuration = 3.0;
+static const CGFloat WXToastDefaultFontSize = 16.0;
+static const CGFloat WXToastDefaultWidth = 230.0;
+static const CGFloat WXToastDefaultHeight = 30.0;
+static const CGFloat WXToastDefaultPadding = 30.0;
+
+- (void)toast:(NSDictionary *)param
+{
+ NSString *message = param[@"message"];
+ if (!message) return;
+
+ double duration = [param[@"duration"] doubleValue];
+ if (duration <= 0) {
+ duration = WXToastDefaultDuration;
+ }
+
+ WXPerformBlockOnMainThread(^{
+ [self toast:message duration:duration];
+ });
+}
+
+- (void)toast:(NSString *)message duration:(double)duration
+{
+ WXAssertMainThread();
+ UIView *superView = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
+ if (!superView) {
+ superView = self.weexInstance.rootView;
+ }
+ UIView *toastView = [self toastViewForMessage:message superView:superView];
+ WXToastInfo *info = [WXToastInfo new];
+ info.toastView = toastView;
+ info.superView = superView;
+ info.duration = duration;
+ [[WXToastManager sharedManager].toastQueue addObject:info];
+
+ if (![WXToastManager sharedManager].toastingView) {
+ [self showToast:toastView superView:superView duration:duration];
+ }
+}
+
+- (UIView *)toastViewForMessage:(NSString *)message superView:(UIView *)superView
+{
+ CGFloat padding = WXToastDefaultPadding;
+ UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(padding/2, padding/2, WXToastDefaultWidth, WXToastDefaultHeight)];
+ messageLabel.numberOfLines = 0;
+ messageLabel.textAlignment = NSTextAlignmentCenter;
+ messageLabel.text = message;
+ messageLabel.font = [UIFont boldSystemFontOfSize:WXToastDefaultFontSize];
+ messageLabel.lineBreakMode = NSLineBreakByTruncatingTail;
+ messageLabel.textColor = [UIColor whiteColor];
+ messageLabel.backgroundColor = [UIColor clearColor];
+ [messageLabel sizeToFit];
+
+ UIView *toastView = [[UIView alloc] initWithFrame:
+ CGRectMake(
+ (superView.frame.size.width-messageLabel.frame.size.width-padding)/2,
+ (superView.frame.size.height-messageLabel.frame.size.height-padding)/2,
+ messageLabel.frame.size.width+padding,
+ messageLabel.frame.size.height+padding
+ )];
+
+ CGPoint point = CGPointZero;
+ UIWindow *window = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
+
+ // adjust to screen orientation
+ UIInterfaceOrientation orientation = (UIInterfaceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
+ switch (orientation) {
+ case UIDeviceOrientationPortrait: {
+ point = CGPointMake(window.frame.size.width/2, window.frame.size.height/2);
+ break;
+ }
+ case UIDeviceOrientationPortraitUpsideDown: {
+ toastView.transform = CGAffineTransformMakeRotation(M_PI);
+ float width = window.frame.size.width;
+ float height = window.frame.size.height;
+ point = CGPointMake(width/2, height/2);
+ break;
+ }
+ case UIDeviceOrientationLandscapeLeft: {
+ toastView.transform = CGAffineTransformMakeRotation(M_PI/2); //rotation in radians
+ point = CGPointMake(window.frame.size.width/2, window.frame.size.height/2);
+ break;
+ }
+ case UIDeviceOrientationLandscapeRight: {
+ toastView.transform = CGAffineTransformMakeRotation(-M_PI/2);
+ point = CGPointMake(window.frame.size.width/2, window.frame.size.height/2);
+ break;
+ }
+ default:
+ break;
+ }
+
+ toastView.center = point;
+ toastView.frame = CGRectIntegral(toastView.frame);
+
+ [toastView addSubview:messageLabel];
+ toastView.layer.cornerRadius = 7;
+ toastView.backgroundColor=[UIColor colorWithWhite:0 alpha:0.7];
+
+ return toastView;
+}
+
+- (void)showToast:(UIView *)toastView superView:(UIView *)superView duration:(double)duration
+{
+ if (!toastView || !superView) {
+ return;
+ }
+
+ [WXToastManager sharedManager].toastingView = toastView;
+ [superView addSubview:toastView];
+
+ [UIView animateWithDuration:0.2 delay:duration options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ toastView.transform = CGAffineTransformConcat(toastView.transform, CGAffineTransformMakeScale(0.8, 0.8)) ;
+ } completion:^(BOOL finished) {
+ [UIView animateWithDuration:0.2 delay:0.2 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ toastView.alpha = 0;
+ } completion:^(BOOL finished){
+ [toastView removeFromSuperview];
+ [WXToastManager sharedManager].toastingView = nil;
+
+ NSMutableArray *queue = [WXToastManager sharedManager].toastQueue;
+ if (queue.count > 0) {
+ [queue removeObjectAtIndex:0];
+ if (queue.count > 0) {
+ WXToastInfo *info = [queue firstObject];
+ [self showToast:info.toastView superView:info.superView duration:info.duration];
+ }
+ }
+ }];
+ }];
+}
+
+#pragma mark - Alert
+
+- (void)alert:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ NSString *message = param[@"message"];
+ NSString *okTitle = param[@"okTitle"];
+
+ if ([WXUtility isBlankString:okTitle]) {
+ okTitle = @"OK";
+ }
+
+ [self alert:message okTitle:nil cancelTitle:okTitle defaultText:nil type:WXModalTypeAlert callback:callback];
+}
+
+#pragma mark - Confirm
+
+- (void)confirm:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ NSString *message = param[@"message"];
+ NSString *okTitle = param[@"okTitle"];
+ NSString *cancelTitle = param[@"cancelTitle"];
+
+ if ([WXUtility isBlankString:okTitle]) {
+ okTitle = @"OK";
+ }
+ if ([WXUtility isBlankString:cancelTitle]) {
+ cancelTitle = @"Cancel";
+ }
+
+ [self alert:message okTitle:okTitle cancelTitle:cancelTitle defaultText:nil type:WXModalTypeConfirm callback:callback];
+}
+
+#pragma mark - Prompt
+
+- (void)prompt:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ NSString *message = param[@"message"];
+ NSString *defaultValue = param[@"default"];
+ NSString *okTitle = param[@"okTitle"];
+ NSString *cancelTitle = param[@"cancelTitle"];
+
+ if ([WXUtility isBlankString:okTitle]) {
+ okTitle = @"OK";
+ }
+ if ([WXUtility isBlankString:cancelTitle]) {
+ cancelTitle = @"Cancel";
+ }
+
+ [self alert:message okTitle:okTitle cancelTitle:cancelTitle defaultText:defaultValue type:WXModalTypePrompt callback:callback];
+}
+
+
+#pragma mark - Private
+
+- (void)alert:(NSString *)message okTitle:(NSString *)okTitle cancelTitle:(NSString *)cancelTitle defaultText:(NSString *)defaultText type:(WXModalType)type callback:(WXModuleCallback)callback
+{
+ if (!message) {
+ callback(@"Error: message should be passed.");
+ return;
+ }
+
+ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"" message:message delegate:self cancelButtonTitle:cancelTitle otherButtonTitles:okTitle, nil];
+ alertView.tag = type;
+ if (type == WXModalTypePrompt) {
+ alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
+ UITextField *textField = [alertView textFieldAtIndex:0];
+ textField.placeholder = defaultText;
+ }
+ objc_setAssociatedObject(alertView, &WXModalCallbackKey, [callback copy], OBJC_ASSOCIATION_COPY_NONATOMIC);
+
+ WXPerformBlockOnMainThread(^{
+ [alertView show];
+ });
+}
+
+- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
+{
+ WXModuleCallback callback = objc_getAssociatedObject(alertView, &WXModalCallbackKey);
+ if (!callback) return;
+
+ NSString *result = @"";
+ switch (alertView.tag) {
+ case WXModalTypeAlert: {
+ result = @"";
+ break;
+ }
+ case WXModalTypeConfirm: {
+ NSString *clickTitle = [alertView buttonTitleAtIndex:buttonIndex];
+ result = clickTitle;
+ break;
+ }
+ case WXModalTypePrompt: {
+ NSString *clickTitle = [alertView buttonTitleAtIndex:buttonIndex];
+ NSString *text= [[alertView textFieldAtIndex:0] text] ?: @"";
+ result = [WXUtility JSONString:@{ @"result": clickTitle, @"data": text }];
+ }
+ default:
+ break;
+ }
+
+ callback(result);
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.h b/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.h
new file mode 100644
index 0000000..3327e6a
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WeexSDK/WXModuleProtocol.h>
+
+@interface WXNavigatorModule : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.m b/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.m
new file mode 100644
index 0000000..37dbae3
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXNavigatorModule.m
@@ -0,0 +1,156 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXNavigatorModule.h"
+#import "WXSDKManager.h"
+#import "WXUtility.h"
+#import "WXBaseViewController.h"
+#import "WXNavigationProtocol.h"
+#import "WXHandlerFactory.h"
+#import "WXConvert.h"
+
+@implementation WXNavigatorModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(push:callback:))
+WX_EXPORT_METHOD(@selector(pop:callback:))
+WX_EXPORT_METHOD(@selector(close:callback:))
+WX_EXPORT_METHOD(@selector(setNavBarBackgroundColor:callback:))
+WX_EXPORT_METHOD(@selector(setNavBarLeftItem:callback:))
+WX_EXPORT_METHOD(@selector(clearNavBarLeftItem:callback:))
+WX_EXPORT_METHOD(@selector(setNavBarRightItem:callback:))
+WX_EXPORT_METHOD(@selector(clearNavBarRightItem:callback:))
+WX_EXPORT_METHOD(@selector(setNavBarMoreItem:callback:))
+WX_EXPORT_METHOD(@selector(clearNavBarMoreItem:callback:))
+WX_EXPORT_METHOD(@selector(setNavBarTitle:callback:))
+WX_EXPORT_METHOD(@selector(clearNavBarTitle:callback:))
+
+- (id<WXNavigationProtocol>)navigator
+{
+ id<WXNavigationProtocol> navigator = [WXHandlerFactory handlerForProtocol:@protocol(WXNavigationProtocol)];
+ return navigator;
+}
+
+#pragma mark Weex Application Interface
+
+- (void)push:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ id<WXNavigationProtocol> navigator = [self navigator];
+ UIViewController *container = self.weexInstance.viewController;
+ [navigator pushViewControllerWithParam:param completion:^(NSString *code, NSDictionary *responseData) {
+ if (callback && code) {
+ callback(code);
+ }
+ } withContainer:container];
+}
+
+- (void)pop:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ id<WXNavigationProtocol> navigator = [self navigator];
+ UIViewController *container = self.weexInstance.viewController;
+ [navigator popViewControllerWithParam:param completion:^(NSString *code, NSDictionary *responseData) {
+ if (callback && code) {
+ callback(code);
+ }
+ } withContainer:container];
+}
+
+- (void)close:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ id<WXNavigationProtocol> navigator = [self navigator];
+ UIViewController *container = self.weexInstance.viewController;
+ [navigator popToRootViewControllerWithParam:param completion:^(NSString *code, NSDictionary *responseData) {
+ if (callback && code) {
+ callback(code);
+ }
+ } withContainer:container];
+}
+
+#pragma mark Navigation Setup
+
+- (void)setNavBarBackgroundColor:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ NSString *backgroundColor = param[@"backgroundColor"];
+ if (!backgroundColor) {
+ callback(MSG_PARAM_ERR);
+ }
+
+ id<WXNavigationProtocol> navigator = [self navigator];
+ UIViewController *container = self.weexInstance.viewController;
+ [navigator setNavigationBackgroundColor:[WXConvert UIColor:backgroundColor] withContainer:container];
+ callback(MSG_SUCCESS);
+}
+
+- (void)setNavBarRightItem:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self setNavigationItemWithParam:param position:WXNavigationItemPositionRight withCallback:callback];
+}
+
+- (void)clearNavBarRightItem:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self clearNavigationItemWithParam:param position:WXNavigationItemPositionRight withCallback:callback];
+}
+
+- (void)setNavBarLeftItem:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self setNavigationItemWithParam:param position:WXNavigationItemPositionLeft withCallback:callback];
+}
+
+- (void)clearNavBarLeftItem:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self clearNavigationItemWithParam:param position:WXNavigationItemPositionLeft withCallback:callback];
+}
+
+- (void)setNavBarMoreItem:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self setNavigationItemWithParam:param position:WXNavigationItemPositionMore withCallback:callback];
+}
+
+- (void)clearNavBarMoreItem:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self clearNavigationItemWithParam:param position:WXNavigationItemPositionMore withCallback:callback];
+}
+
+- (void)setNavBarTitle:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self setNavigationItemWithParam:param position:WXNavigationItemPositionCenter withCallback:callback];
+}
+
+- (void)clearNavBarTitle:(NSDictionary *)param callback:(WXModuleCallback)callback
+{
+ [self clearNavigationItemWithParam:param position:WXNavigationItemPositionCenter withCallback:callback];
+}
+
+- (void)setNavigationItemWithParam:(NSDictionary *)param position:(WXNavigationItemPosition)position withCallback:(WXModuleCallback)callback
+{
+ id<WXNavigationProtocol> navigator = [self navigator];
+ UIViewController *container = self.weexInstance.viewController;
+
+ NSMutableDictionary *mutableParam = [param mutableCopy];
+ [mutableParam setObject:self.weexInstance.instanceId forKey:@"instanceId"];
+
+ [navigator setNavigationItemWithParam:mutableParam position:position completion:^(NSString *code, NSDictionary *responseData) {
+ if (callback && code) {
+ callback(code);
+ }
+ } withContainer:container];
+}
+
+- (void)clearNavigationItemWithParam:(NSDictionary *)param position:(WXNavigationItemPosition)position withCallback:(WXModuleCallback)callback
+{
+ id<WXNavigationProtocol> navigator = [self navigator];
+ UIViewController *container = self.weexInstance.viewController;
+ [navigator clearNavigationItemWithParam:param position:position completion:^(NSString *code, NSDictionary *responseData) {
+ if (callback && code) {
+ callback(code);
+ }
+ } withContainer:container];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.h b/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.h
new file mode 100644
index 0000000..fe79e81
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <WeexSDK/WeexSDK.h>
+#import <WeexSDK/WXModuleProtocol.h>
+
+@interface WXStorageModule : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.m b/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.m
new file mode 100644
index 0000000..a458c87
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXStorageModule.m
@@ -0,0 +1,202 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXStorageModule.h"
+#import <WeexSDK/WXSDKManager.h>
+#import <WeexSDK/WXUtility.h>
+
+#define defaultKey @"default"
+#define LocalStoreFile @"store.plist"
+
+@implementation WXStorageModule
+{
+ NSString *_plist;
+ BOOL _setupFinished;
+}
+
+@synthesize weexInstance;
+
+
+WX_EXPORT_METHOD(@selector(mutiSet:callback:))
+WX_EXPORT_METHOD(@selector(mutiGet:callback:))
+WX_EXPORT_METHOD(@selector(mutiRemove:callback:))
+WX_EXPORT_METHOD(@selector(clear:))
+
+static dispatch_queue_t WXStorageQueue()
+{
+ static dispatch_queue_t queue;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ queue = dispatch_queue_create("com.taobao.weex.storageQueue", NULL);
+ });
+ return queue;
+}
+
+- (id)init
+{
+ self= [super init];
+ if (self) {
+ [self setup];
+ }
+ return self;
+}
+
+- (void)setup
+{
+ _setupFinished = NO;
+ _plist = [WXDocumentPath stringByAppendingString: LocalStoreFile];
+ NSFileManager *fileManager = [NSFileManager defaultManager];
+ if (![fileManager fileExistsAtPath:_plist]) {
+ BOOL ret = [fileManager createFileAtPath:_plist contents:nil attributes:nil];
+ if (ret) {
+ _setupFinished = YES;
+ }
+ }
+ else {
+ _setupFinished = YES;
+ }
+}
+
+- (void)mutiSet:(id)data callback:(NSString *)callback {
+
+ if (!_setupFinished) {
+ return;
+ }
+
+ dispatch_async(WXStorageQueue(), ^{
+ NSData *storeData = [NSData dataWithContentsOfFile:_plist];
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:storeData];
+ NSMutableDictionary *inputDict = [unarchiver decodeObjectForKey:defaultKey] ;
+ [unarchiver finishDecoding];
+
+ if (!inputDict) {
+ inputDict = [NSMutableDictionary new];
+ }
+
+ NSEnumerator *enumerator = [data keyEnumerator];
+ NSString *key;
+ while ((key = [enumerator nextObject])) {
+ id object = [data objectForKey:key];
+ [inputDict setObject:object forKey:key];
+ [WXGlobalCache setObject:object forKey:key];
+ }
+
+ NSMutableData *ouputData = [[NSMutableData alloc] init];
+ NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:ouputData];
+ [archiver encodeObject:inputDict forKey:defaultKey];
+ [archiver finishEncoding];
+
+ [ouputData writeToFile:_plist atomically:YES];
+
+ NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ @"success", @"result",
+ nil];
+ NSString *params = WXEncodeJson(dict);
+ [[WXSDKManager bridgeMgr] callBack:self.weexInstance.instanceId funcId:callback params:params];
+ });
+}
+
+-(void)mutiGet:(id)data callback:(NSString *)callback
+{
+ if (!_setupFinished || ![data isKindOfClass:[NSArray class]]) {
+ return;
+ }
+
+ dispatch_async(WXStorageQueue(), ^{
+
+ NSMutableArray *keys = [NSMutableArray arrayWithArray:data];
+ NSMutableDictionary *retValue = [NSMutableDictionary new];
+
+ for (id key in data) {
+ id object = [WXGlobalCache objectForKey:key];
+ if (object) {
+ [retValue setObject:object forKey:key];
+ [keys removeObject:key];
+ }
+ }
+
+ if ([keys count] > 0) {
+ NSData *storeData = [NSData dataWithContentsOfFile:_plist];
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:storeData];
+ NSDictionary *inputDict = [unarchiver decodeObjectForKey:defaultKey];
+ [unarchiver finishDecoding];
+
+ for (id key in keys) {
+ id object = [inputDict objectForKey:key];
+ if (object) {
+ [retValue setObject:object forKey:key];
+ [WXGlobalCache setObject:object forKey:key];
+ }
+ else {
+ [retValue setObject:@"" forKey:key];
+ }
+ }
+ }
+
+ NSString *params = WXEncodeJson(retValue);
+ [[WXSDKManager bridgeMgr] callBack:self.weexInstance.instanceId funcId:callback params:params];
+ });
+}
+
+- (void)mutiRemove:(id)data callback:(NSString *)callback
+{
+ if (!_setupFinished || ![data isKindOfClass:[NSArray class]]) {
+ return;
+ }
+
+ dispatch_async(WXStorageQueue(), ^{
+ NSArray *keys = (NSArray *)data;
+ NSData *storeData = [NSData dataWithContentsOfFile:_plist];
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:storeData];
+ NSMutableDictionary *inputDict = [unarchiver decodeObjectForKey:defaultKey];
+ [unarchiver finishDecoding];
+
+ for (NSString *key in keys) {
+ [inputDict removeObjectForKey:key];
+ [WXGlobalCache removeObjectForKey:key];
+ }
+
+ NSMutableData *ouputData = [[NSMutableData alloc] init];
+ NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:ouputData];
+ [archiver encodeObject:inputDict forKey:defaultKey];
+ [archiver finishEncoding];
+
+ [ouputData writeToFile:_plist atomically:YES];
+
+ NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ @"success", @"result",
+ nil];
+ NSString *params = WXEncodeJson(dict);
+ [[WXSDKManager bridgeMgr] callBack:self.weexInstance.instanceId funcId:callback params:params];
+ });
+}
+
+- (void)clear:(NSString *)callback
+{
+ if (!_setupFinished) {
+ return;
+ }
+
+ dispatch_async(WXStorageQueue(), ^{
+ NSData *storeData = [NSData dataWithContentsOfFile:_plist];
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:storeData];
+ NSMutableDictionary *inputDict = [unarchiver decodeObjectForKey:defaultKey];
+ [unarchiver finishDecoding];
+
+ [inputDict removeAllObjects];
+ [WXGlobalCache removeAllObjects];
+
+ NSMutableData *ouputData = [[NSMutableData alloc] init];
+ NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:ouputData];
+ [archiver encodeObject:inputDict forKey:defaultKey];
+ [archiver finishEncoding];
+ });
+}
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.h b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.h
new file mode 100644
index 0000000..f561d2d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXModuleProtocol.h"
+
+@interface WXStreamModule : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
new file mode 100644
index 0000000..94f0ec9
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
@@ -0,0 +1,152 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXStreamModule.h"
+#import "WXSDKManager.h"
+#import "WXUtility.h"
+#import "WXHandlerFactory.h"
+#import "WXNetworkProtocol.h"
+
+@implementation WXStreamModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(sendHttp:callback:))
+WX_EXPORT_METHOD(@selector(fetch:progressCallback:callback:))
+
+- (void)sendHttp:(NSDictionary*)param callback:(WXModuleCallback)callback
+{
+ NSString* method = [param objectForKey:@"method"];
+ NSString* urlStr = [param objectForKey:@"url"];
+ NSDictionary* header = [param objectForKey:@"header"];
+ NSString* body = [param objectForKey:@"body"];
+
+ NSURL *url = [NSURL URLWithString:urlStr];
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request setHTTPMethod:method];
+ [request setTimeoutInterval:60.0];
+ for (NSString *key in header) {
+ NSString *value = [header objectForKey:key];
+ [request setValue:value forHTTPHeaderField:key];
+ }
+ [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
+ [request setValue:[WXUtility userAgent] forHTTPHeaderField:@"User-Agent"];
+
+ id<WXNetworkProtocol> networkHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXNetworkProtocol)];
+
+ [networkHandler sendRequest:request
+ withSendingData:^(int64_t bytesSent, int64_t totalBytes) {
+ } withResponse:^(NSURLResponse *response) {
+ } withReceiveData:^(NSData *data) {
+ } withCompeletion:^(NSData *totalData, NSError *error) {
+ NSString *responseData = nil;
+ if (!error) {
+ responseData = [[NSString alloc] initWithData:totalData encoding:NSUTF8StringEncoding];
+ }
+ //else ok
+ callback(responseData);
+ }];
+}
+
+- (void)fetch:(NSDictionary *)options progressCallback:(NSString *)progressCallback callback:(WXModuleCallback)callback {
+ __block NSInteger received = 0;
+ __block NSHTTPURLResponse *httpResponse = nil;
+ __block NSMutableDictionary * callbackRsp =[[NSMutableDictionary alloc] init];
+ __block NSString *statusText = @"ERR_CONNECT_FAILED";
+
+ NSString *method = [options objectForKey:@"method"];
+ if ([WXUtility isBlankString:method]) {
+ method = @"GET";
+ }
+ NSString *urlStr = [options objectForKey:@"url"];
+ if (!options || [WXUtility isBlankString:urlStr]) {
+ [callbackRsp setObject:@(-1) forKey:@"status"];
+ [callbackRsp setObject:@false forKey:@"ok"];
+
+ callback([WXUtility JSONString:callbackRsp]);
+
+ return;
+ }
+ NSDictionary *headers = [options objectForKey:@"headers"];
+ NSString *body = [options objectForKey:@"body"];
+
+ NSURL *url = [NSURL URLWithString:urlStr];
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request setHTTPMethod:method];
+ [request setTimeoutInterval:60.0];
+ for (NSString *header in headers) {
+ NSString *value = [headers objectForKey:header];
+ [request setValue:value forHTTPHeaderField:header];
+ }
+ [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
+ [request setValue:[WXUtility userAgent] forHTTPHeaderField:@"User-Agent"];
+
+ [callbackRsp setObject:@{ @"OPENED": @1 } forKey:@"readyState"];
+
+ [[WXSDKManager bridgeMgr] callBack:self.weexInstance.instanceId funcId:progressCallback params:[WXUtility JSONString:callbackRsp] keepAlive:true];
+
+ id<WXNetworkProtocol> networkHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXNetworkProtocol)];
+ [networkHandler sendRequest:request
+ withSendingData:^(int64_t bytesSent, int64_t totalBytes) {
+ } withResponse:^(NSURLResponse *response) {
+ httpResponse = (NSHTTPURLResponse*)response;
+
+ [callbackRsp setObject:@{ @"HEADERS_RECEIVED" : @2 } forKey:@"readyState"];
+ [callbackRsp setObject:[NSNumber numberWithInteger:httpResponse.statusCode] forKey:@"status"];
+ [callbackRsp setObject:httpResponse.allHeaderFields forKey:@"headers"];
+ if (httpResponse.statusCode == 200) {
+ statusText = @"OK";
+ }else {
+ statusText = [NSHTTPURLResponse localizedStringForStatusCode:httpResponse.statusCode].capitalizedString;
+ }
+ [callbackRsp setObject:statusText forKey:@"statusText"];
+ [callbackRsp setObject:[NSNumber numberWithInteger:received] forKey:@"length"];
+
+ [[WXSDKManager bridgeMgr] callBack:self.weexInstance.instanceId funcId:progressCallback params:[WXUtility JSONString:callbackRsp] keepAlive:true];
+
+ } withReceiveData:^(NSData *data) {
+ [callbackRsp setObject:@{ @"LOADING" : @3 } forKey:@"readyState"];
+ received += [data length];
+ [callbackRsp setObject:[NSNumber numberWithInteger:received] forKey:@"length"];
+
+ [[WXSDKManager bridgeMgr] callBack:self.weexInstance.instanceId funcId:progressCallback params:[WXUtility JSONString:callbackRsp] keepAlive:true];
+
+ } withCompeletion:^(NSData *totalData, NSError *error) {
+
+ [callbackRsp removeObjectForKey:@"readyState"];
+ [callbackRsp removeObjectForKey:@"length"];
+ [callbackRsp removeObjectForKey:@"keepalive"];
+ [callbackRsp setObject:httpResponse.statusCode >= 200 && httpResponse.statusCode <= 299?@true : @false forKey:@"ok"];
+ if (error) {
+ //error
+ [callbackRsp setObject:@(-1) forKey:@"status"];
+ [callbackRsp setObject:[NSString stringWithFormat:@"%@(%ld)",[error localizedDescription], (long)[error code]] forKey:@"data"];
+
+ switch ([error code]) {
+ case -1000:
+ case -1002:
+ case -1003:
+ statusText = @"ERR_INVALID_REQUEST";
+ break;
+ default:
+ break;
+ }
+ [callbackRsp setObject:statusText forKey:@"statusText"];
+
+ }else {
+ // no error
+ NSString *responseData = nil;
+ responseData = [[NSString alloc] initWithData:totalData encoding:NSUTF8StringEncoding];
+ [callbackRsp setObject:responseData forKey:@"data"];
+ }
+
+ callback([WXUtility JSONString:callbackRsp]);
+ }];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.h b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.h
new file mode 100644
index 0000000..5b83ac8
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.h
@@ -0,0 +1,14 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXModuleProtocol.h"
+
+@interface WXTimerModule : NSObject <WXModuleProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m
new file mode 100644
index 0000000..4785880
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m
@@ -0,0 +1,75 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXTimerModule.h"
+#import "WXSDKManager.h"
+
+@interface WXTimerModule ()
+
+@property (nonatomic, strong) NSMutableDictionary *timerMap;
+
+@end
+
+@implementation WXTimerModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(setTimeout:time:))
+WX_EXPORT_METHOD(@selector(clearTimeout:))
+
+// When timer fires notify JS
+- (void)timerRespones:(NSInteger) callbackId {
+ if (self.weexInstance) {
+ [[WXSDKManager bridgeMgr] callBack:self.weexInstance.instanceId funcId:[@(callbackId) stringValue] params:nil];
+ }
+ [self clearTimeout:callbackId];
+}
+
+// Add timer
+- (void)setTimeout:(NSInteger)callbackId time:(NSInteger)time {
+ SEL method = @selector(timerRespones:);
+ NSMethodSignature *signature = [self methodSignatureForSelector:method];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setTarget: self];
+ [invocation setSelector:method];
+ [invocation setArgument:&callbackId atIndex:2];
+
+ NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:time/1000.0 invocation:invocation repeats:NO];
+ [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
+
+ if (_timerMap == nil) {
+ _timerMap = [[NSMutableDictionary alloc] init];
+ }
+
+ [_timerMap setValue:timer forKey:[@(callbackId) stringValue]];
+}
+
+// Remove Timer
+- (void)clearTimeout:(NSInteger)callbackId {
+ NSString *key = [@(callbackId) stringValue];
+ NSTimer *timer = [_timerMap valueForKey:key];
+ if (timer) {
+ [timer invalidate];
+ timer = nil;
+ [_timerMap removeObjectForKey:key];
+ }
+}
+
+- (void)dealloc {
+ if (_timerMap) {
+ for (NSString *key in _timerMap) {
+ NSTimer *timer = [_timerMap valueForKey:key];
+ [timer invalidate];
+ timer = nil;
+ }
+ [_timerMap removeAllObjects];
+ _timerMap = nil;
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.h b/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.h
new file mode 100644
index 0000000..56d50bb
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.h
@@ -0,0 +1,15 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXModuleProtocol.h"
+#import "WXDomModule.h"
+
+@interface WXWebViewModule : WXDomModule <WXModuleProtocol>
+
+@end
[25/50] [abbrv] incubator-weex git commit: * [ios] cocoapods 1.0.0
compatible
Posted by ji...@apache.org.
* [ios] cocoapods 1.0.0 compatible
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ce029c6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ce029c6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ce029c6d
Branch: refs/heads/master
Commit: ce029c6dffc371a656e80c1f67e4108df43f8201
Parents: 93435d8
Author: acton393 <zh...@gmail.com>
Authored: Mon Jun 13 11:02:36 2016 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jun 13 11:02:36 2016 +0800
----------------------------------------------------------------------
ios/.gitignore | 3 ++-
ios/playground/Podfile | 1 +
ios/playground/WeexDemo/AppDelegate.m | 2 +-
ios/sdk/WeexSDK.podspec | 6 ++++--
4 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ce029c6d/ios/.gitignore
----------------------------------------------------------------------
diff --git a/ios/.gitignore b/ios/.gitignore
index 4865962..3d7104d 100644
--- a/ios/.gitignore
+++ b/ios/.gitignore
@@ -37,7 +37,8 @@ xcuserdata
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
-# Pods/
+Pods/
+Podfile.lock
# Carthage
#
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ce029c6d/ios/playground/Podfile
----------------------------------------------------------------------
diff --git a/ios/playground/Podfile b/ios/playground/Podfile
index 46ae78b..ed6e27f 100644
--- a/ios/playground/Podfile
+++ b/ios/playground/Podfile
@@ -1,3 +1,4 @@
+source 'git@github.com:CocoaPods/Specs.git'
platform :ios, '7.0'
#inhibit_all_warnings!
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ce029c6d/ios/playground/WeexDemo/AppDelegate.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/AppDelegate.m b/ios/playground/WeexDemo/AppDelegate.m
index 5295055..fc228f3 100644
--- a/ios/playground/WeexDemo/AppDelegate.m
+++ b/ios/playground/WeexDemo/AppDelegate.m
@@ -89,7 +89,7 @@
#ifdef DEBUG
[WXDebugTool setDebug:YES];
- [WXLog setLogLevel:WXLogLevelVerbose];
+ [WXLog setLogLevel:WXLogLevelInfo];
#else
[WXDebugTool setDebug:NO];
#endif
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ce029c6d/ios/sdk/WeexSDK.podspec
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK.podspec b/ios/sdk/WeexSDK.podspec
index 4e53655..1006229 100644
--- a/ios/sdk/WeexSDK.podspec
+++ b/ios/sdk/WeexSDK.podspec
@@ -1,7 +1,6 @@
# coding: utf-8
Pod::Spec.new do |s|
-
s.name = "WeexSDK"
s.version = "0.6.0"
s.summary = "WeexSDK Source ."
@@ -17,7 +16,10 @@ Pod::Spec.new do |s|
Alibaba-INC copyright
LICENSE
}
-
+ s.authors = { "cxfeng1" => "cxfeng1@gmail.com",
+ "boboning" => "ningli928@163.com",
+ "acton393" =>"zhangxing610321@gmail.com"
+ }
s.platform = :ios
s.ios.deployment_target = '7.0'
s.source = { :path => '.' }
[20/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK.xcscheme
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK.xcscheme b/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK.xcscheme
new file mode 100644
index 0000000..ab38999
--- /dev/null
+++ b/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK.xcscheme
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0720"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "77D160FC1C02DBE70010B15B"
+ BuildableName = "WeexSDK.framework"
+ BlueprintName = "WeexSDK"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "77D161061C02DBE70010B15B"
+ BuildableName = "WeexSDKTests.xctest"
+ BlueprintName = "WeexSDKTests"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "77D160FC1C02DBE70010B15B"
+ BuildableName = "WeexSDK.framework"
+ BlueprintName = "WeexSDK"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "77D160FC1C02DBE70010B15B"
+ BuildableName = "WeexSDK.framework"
+ BlueprintName = "WeexSDK"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "77D160FC1C02DBE70010B15B"
+ BuildableName = "WeexSDK.framework"
+ BlueprintName = "WeexSDK"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK_xcode7.xcscheme
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK_xcode7.xcscheme b/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK_xcode7.xcscheme
new file mode 100644
index 0000000..f32707b
--- /dev/null
+++ b/ios/sdk/WeexSDK.xcodeproj/xcshareddata/xcschemes/WeexSDK_xcode7.xcscheme
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0720"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2A1BE4FE1C23AB0500F141D6"
+ BuildableName = "WeexSDK_xcode7.framework"
+ BlueprintName = "WeexSDK_xcode7"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2A1BE4FE1C23AB0500F141D6"
+ BuildableName = "WeexSDK_xcode7.framework"
+ BlueprintName = "WeexSDK_xcode7"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2A1BE4FE1C23AB0500F141D6"
+ BuildableName = "WeexSDK_xcode7.framework"
+ BlueprintName = "WeexSDK_xcode7"
+ ReferencedContainer = "container:WeexSDK.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Info.plist
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Info.plist b/ios/sdk/WeexSDK/Info.plist
new file mode 100644
index 0000000..d3de8ee
--- /dev/null
+++ b/ios/sdk/WeexSDK/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
[18/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h
new file mode 100644
index 0000000..1ad5fcf
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h
@@ -0,0 +1,91 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class WXBridgeMethod;
+
+@interface WXBridgeContext : NSObject
+
+/**
+ * Create Instance Method
+ * @param instance : instance id
+ * @param template : template data
+ * @param options : parameters
+ * @param data : external data
+ **/
+- (void)createInstance:(NSString *)instance
+ template:(NSString *)temp
+ options:(NSDictionary *)options
+ data:(id)data;
+
+/**
+ * Destroy Instance Method
+ * @param instance : instance id
+ **/
+- (void)destroyInstance:(NSString *)instance;
+
+/**
+ * Refresh Instance Method
+ * @param instance : instance id
+ * @param data : external data
+ **/
+- (void)refreshInstance:(NSString *)instance
+ data:(id)data;
+
+/**
+ * Update Instacne State Method
+ * @param instance : instance id
+ * @param data : parameters
+ **/
+- (void)updateState:(NSString *)instance
+ data:(id)data;
+
+/**
+ * Execute JSFramework Script
+ * @param script : script code
+ **/
+- (void)executeJsFramework:(NSString *)script;
+
+/**
+ * Execute JS Method
+ * @param method : object of bridge method
+ **/
+- (void)executeJsMethod:(WXBridgeMethod *)method;
+
+/**
+ * Register Modules Method
+ * @param modules : module list
+ **/
+- (void)registerModules:(NSDictionary *)modules;
+
+/**
+ * Register Components Method
+ * @param components: component list
+ **/
+- (void)registerComponents:(NSArray *)components;
+
+/**
+ * Connect To WebSocket
+ * @param url : url to connect
+ **/
+- (void)connectToWebSocket:(NSURL *)url;
+
+/**
+ * Log To WebSocket
+ * @param flag : the tag to indentify
+ * @param message : message to output
+ **/
+- (void)logToWebSocket:(NSString *)flag message:(NSString *)message;
+
+/**
+ * Reset Environment
+ **/
+- (void)resetEnvironment;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/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
new file mode 100644
index 0000000..ced9330
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -0,0 +1,372 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXBridgeContext.h"
+#import "WXBridgeProtocol.h"
+#import "WXJSCoreBridge.h"
+#import "WXWebSocketBridge.h"
+#import "WXLog.h"
+#import "WXUtility.h"
+#import "WXBridgeMethod.h"
+#import "WXModuleFactory.h"
+#import "WXModuleProtocol.h"
+#import "WXUtility.h"
+#import "WXSDKError.h"
+#import "WXAssert.h"
+#import "WXSDKManager.h"
+
+@interface WXBridgeContext ()
+
+@property (nonatomic, strong) id<WXBridgeProtocol> jsBridge;
+@property (nonatomic, strong) WXWebSocketBridge *socketBridge;
+@property (nonatomic, assign) BOOL debugJS;
+//store the methods which will be executed from native to js
+@property (nonatomic, strong) NSMutableDictionary *sendQueue;
+//the instance stack
+@property (nonatomic, strong) NSMutableArray *insStack;
+//identify if the JSFramework has been loaded
+@property (nonatomic) BOOL frameworkLoadFinished;
+//store some methods temporarily before JSFramework is loaded
+@property (nonatomic, strong) NSMutableArray *methodQueue;
+
+@end
+
+@implementation WXBridgeContext
+
+- (instancetype) init
+{
+ self = [super init];
+ if (self) {
+ _methodQueue = [NSMutableArray new];
+ _frameworkLoadFinished = NO;
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jsError:) name:WX_JS_ERROR_NOTIFICATION_NAME object:nil];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:WX_JS_ERROR_NOTIFICATION_NAME object:nil];
+}
+
+- (void)jsError:(NSNotification *)note
+{
+ NSString *errorMessage = @"";
+ if (note.userInfo) {
+ errorMessage = note.userInfo[@"message"];
+ }
+
+ NSURL *url;
+ if (self.insStack.count > 0) {
+ WXSDKInstance *topInstance = [WXSDKManager instanceForID:[self.insStack firstObject]];
+ url = topInstance.scriptURL;
+ }
+
+ [WXSDKError monitorAlarm:NO errorCode:WX_ERR_JS_EXECUTE errorMessage:errorMessage withURL:url];
+}
+
+- (id<WXBridgeProtocol>)jsBridge
+{
+ WXAssertBridgeThread();
+
+ Class bridgeClass = _debugJS ? [WXWebSocketBridge class] : [WXJSCoreBridge class];
+
+ if (_jsBridge && [_jsBridge isKindOfClass:bridgeClass]) {
+ return _jsBridge;
+ }
+
+ if (_jsBridge) {
+ [_methodQueue removeAllObjects];
+ _frameworkLoadFinished = NO;
+ }
+
+ _jsBridge = _debugJS ? self.socketBridge : [[WXJSCoreBridge alloc] init];
+ __weak typeof(self) weakSelf = self;
+ [_jsBridge registerCallNative:^(NSString *instance, NSArray *tasks, NSString *callback) {
+ [weakSelf invokeNative:instance tasks:tasks callback:callback];
+ }];
+
+ return _jsBridge;
+}
+
+- (NSMutableArray *)insStack
+{
+ WXAssertBridgeThread();
+
+ if (_insStack) return _insStack;
+
+ _insStack = [NSMutableArray array];
+
+ return _insStack;
+}
+
+- (NSMutableDictionary *)sendQueue
+{
+ WXAssertBridgeThread();
+
+ if (_sendQueue) return _sendQueue;
+
+ _sendQueue = [NSMutableDictionary dictionary];
+
+ return _sendQueue;
+}
+
+#pragma mark JS Bridge Management
+
+- (void)invokeNative:(NSString *)instance tasks:(NSArray *)tasks callback:(NSString *)callback
+{
+ WXAssertBridgeThread();
+
+ if (!instance || !tasks) {
+ [WXSDKError monitorAlarm:NO errorCode:WX_ERR_JSFUNC_PARAM msg:@"JS call Native params error !"];
+ return;
+ }
+ [WXSDKError monitorAlarm:YES errorCode:WX_ERR_JSFUNC_PARAM msg:@""];
+
+ for (NSDictionary *task in tasks) {
+ WXBridgeMethod *method = [[WXBridgeMethod alloc] initWihData:task];
+ method.instance = instance;
+ [[WXSDKManager moduleMgr] dispatchMethod:method];
+ }
+
+ NSMutableArray *sendQueue = [self.sendQueue valueForKey:instance];
+ if (!sendQueue) {
+ WXLogError(@"No send queue for instance:%@", instance);
+ return;
+ }
+
+ if (callback && ![callback isEqualToString:@"-1"]) {
+ WXBridgeMethod *method = [self _methodWithCallback:callback];
+ method.instance = instance;
+ [sendQueue addObject:method];
+ }
+
+ [self performSelector:@selector(_sendQueueLoop) withObject:nil];
+}
+
+- (void)createInstance:(NSString *)instance
+ template:(NSString *)temp
+ options:(NSDictionary *)options
+ data:(id)data
+{
+ WXAssertBridgeThread();
+ WXAssertParam(instance);
+
+ if (![self.insStack containsObject:instance]) {
+ if ([options[@"RENDER_IN_ORDER"] boolValue]) {
+ [self.insStack addObject:instance];
+ } else {
+ [self.insStack insertObject:instance atIndex:0];
+ }
+ }
+
+ //create a sendQueue bind to the current instance
+ NSMutableArray *sendQueue = [NSMutableArray array];
+ [self.sendQueue setValue:sendQueue forKey:instance];
+
+ NSArray *args = nil;
+ if (data){
+ args = @[instance, temp, options, data];
+ } else {
+ args = @[instance, temp, options];
+ }
+
+ WXSDKInstance *sdkInstance = [WXSDKManager instanceForID:instance] ;
+ [WXBridgeContext _timeSince:^() {
+ [self callJSMethod:@"createInstance" args:args];
+ WXLogInfo(@"CreateInstance Finish...%f", -[sdkInstance.renderStartDate timeIntervalSinceNow]);
+ } endBlock:^(NSTimeInterval time) {
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ sdkInstance.communicateTime = time;
+ });
+ }];
+}
+
+- (void)destroyInstance:(NSString *)instance
+{
+ WXAssertBridgeThread();
+ WXAssertParam(instance);
+
+ //remove instance from stack
+ if([self.insStack containsObject:instance]){
+ [self.insStack removeObject:instance];
+ }
+
+ if(self.sendQueue[instance]){
+ [self.sendQueue removeObjectForKey:instance];
+ }
+
+ [self callJSMethod:@"destroyInstance" args:@[instance]];
+}
+
+- (void)refreshInstance:(NSString *)instance
+ data:(id)data
+{
+ WXAssertBridgeThread();
+ WXAssertParam(instance);
+
+ [self callJSMethod:@"refreshInstance" args:@[instance, data]];
+}
+
+- (void)updateState:(NSString *)instance data:(id)data
+{
+ WXAssertBridgeThread();
+ WXAssertParam(instance);
+
+ //[self.jsBridge callJSMethod:@"updateState" args:@[instance, data]];
+}
+
+- (void)executeJsFramework:(NSString *)script
+{
+ WXAssertBridgeThread();
+ WXAssertParam(script);
+
+ __weak __typeof__(self) weakSelf = self;
+ [WXBridgeContext _timeSince:^() {
+ WXLogVerbose(@"JSFramework starts executing...");
+ [self.jsBridge executeJSFramework:script];
+ WXLogVerbose(@"JSFramework ends executing...");
+ if ([self.jsBridge exception]) {
+ [WXSDKError monitorAlarm:NO errorCode:WX_ERR_LOAD_JSLIB msg:@"JSFramework executes error !"];
+ }
+ else {
+ [WXSDKError monitorAlarm:YES errorCode:WX_ERR_LOAD_JSLIB msg:@""];
+
+ //the JSFramework has been load successfully.
+ weakSelf.frameworkLoadFinished = YES;
+
+ //execute methods which has been stored in methodQueue temporarily.
+ for (NSDictionary *method in _methodQueue) {
+ [self callJSMethod:method[@"method"] args:method[@"args"]];
+ }
+ [_methodQueue removeAllObjects];
+ }
+ } endBlock:^(NSTimeInterval time) {
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ JSLibInitTime = time;
+ });
+ }];
+}
+
+- (void)executeJsMethod:(WXBridgeMethod *)method
+{
+ WXAssertBridgeThread();
+
+ if (!method.instance) {
+ WXLogError(@"Instance doesn't exist!");
+ return;
+ }
+
+ NSMutableArray *sendQueue = self.sendQueue[method.instance];
+ if (!sendQueue) {
+ WXLogInfo(@"No send queue for instance:%@, may it has been destroyed so method:%@ is ignored", method.instance, method.method);
+ return;
+ }
+
+ [sendQueue addObject:method];
+ [self performSelector:@selector(_sendQueueLoop) withObject:nil];
+}
+
+- (void)registerModules:(NSDictionary *)modules
+{
+ WXAssertBridgeThread();
+
+ if(!modules) return;
+
+ [self callJSMethod:@"registerModules" args:@[modules]];
+}
+
+- (void)registerComponents:(NSArray *)components
+{
+ WXAssertBridgeThread();
+
+ if(!components) return;
+
+ [self callJSMethod:@"registerComponents" args:@[components]];
+}
+
+- (void)callJSMethod:(NSString *)method args:(NSArray *)args
+{
+ if (self.frameworkLoadFinished) {
+ [self.jsBridge callJSMethod:method args:args];
+ }
+ else {
+ [_methodQueue addObject:@{@"method":method, @"args":args}];
+ }
+}
+
+- (void)resetEnvironment
+{
+ [_jsBridge resetEnvironment];
+}
+
+#pragma mark JS Debug Management
+
+- (void)connectToWebSocket:(NSURL *)url
+{
+ _socketBridge = [[WXWebSocketBridge alloc] initWithURL:url];
+}
+
+- (void)logToWebSocket:(NSString *)flag message:(NSString *)message
+{
+ [_socketBridge callJSMethod:@"__logger" args:@[flag, message]];
+}
+
+#pragma mark Private Mehtods
+
+- (WXBridgeMethod *)_methodWithCallback:(NSString *)callback
+{
+ WXAssertBridgeThread();
+
+ if (!callback) return nil;
+
+ NSDictionary *method = @{@"module":@"jsBridge", @"method":@"callback", @"args":@[callback]};
+
+ return [[WXBridgeMethod alloc] initWihData:method];
+}
+
+- (void)_sendQueueLoop
+{
+ WXAssertBridgeThread();
+
+ BOOL hasTask = NO;
+ NSMutableArray *methods = [NSMutableArray array];
+ NSString *execIns = nil;
+
+ for (NSString *instance in self.insStack) {
+ NSMutableArray *sendQueue = self.sendQueue[instance];
+ if(sendQueue.count > 0){
+ hasTask = YES;
+ for(WXBridgeMethod *method in sendQueue){
+ [methods addObject:[method dataDesc]];
+ }
+ [sendQueue removeAllObjects];
+ execIns = instance;
+ break;
+ }
+ }
+
+ if ([methods count] > 0 && execIns) {
+ [self callJSMethod:@"callJS" args:@[execIns, methods]];
+ }
+
+ if (hasTask) {
+ [self performSelector:@selector(_sendQueueLoop) withObject:nil];
+ }
+}
+
++ (void)_timeSince:(void(^)())startBlock endBlock:(void(^)(NSTimeInterval))endBlock
+{
+ NSDate *startDate = [NSDate new];
+ startBlock();
+ NSDate *endDate = [NSDate new];
+ NSTimeInterval time = [endDate timeIntervalSinceDate:startDate];
+ endBlock(time);
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.h b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.h
new file mode 100644
index 0000000..b3c604c
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXBridgeProtocol.h"
+
+@interface WXJSCoreBridge : NSObject <WXBridgeProtocol>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m
new file mode 100644
index 0000000..0d9a73a
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m
@@ -0,0 +1,133 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXJSCoreBridge.h"
+#import "WXDefine.h"
+#import "WXAssert.h"
+#import "WXLog.h"
+#import "WXUtility.h"
+#import "WXSDKEngine.h"
+#import "WXSDKError.h"
+#import <sys/utsname.h>
+#import <JavaScriptCore/JavaScriptCore.h>
+
+@interface WXJSCoreBridge ()
+
+@property (nonatomic, strong) JSContext *jsContext;
+
+@end
+
+@implementation WXJSCoreBridge
+
+- (instancetype)init
+{
+ self = [super init];
+
+ if(self){
+ _jsContext = [[JSContext alloc] init];
+
+ __weak typeof(self) weakSelf = self;
+
+ NSDictionary *data = [WXUtility getEnvironment];
+ _jsContext[@"WXEnvironment"] = data;
+
+ _jsContext[@"setTimeout"] = ^(JSValue* function, JSValue* timeout) {
+ [weakSelf performSelector: @selector(triggerTimeout:) withObject:^() {
+ [function callWithArguments:@[]];
+ } afterDelay:[timeout toDouble] / 1000];
+ };
+
+ _jsContext[@"nativeLog"] = ^() {
+ static NSDictionary *levelMap;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ levelMap = @{
+ @"__ERROR":@(WXLogFlagError),
+ @"__WARN": @(WXLogFlagWarning),
+ @"__INFO": @(WXLogFlagInfo),
+ @"__DEBUG": @(WXLogFlagDebug),
+ @"__VERBOSE": @(WXLogFlagVerbose)
+ };
+ });
+
+ NSMutableString *string = [NSMutableString string];
+ [string appendString:@"jsLog: "];
+ NSArray *args = [JSContext currentArguments];
+
+ [args enumerateObjectsUsingBlock:^(JSValue *jsVal, NSUInteger idx, BOOL *stop) {
+ if (idx == args.count - 1) {
+ NSNumber *flag = levelMap[[jsVal toString]];
+ if (flag) {
+ WX_LOG([flag unsignedIntegerValue], @"%@", string);
+ } else {
+ [string appendFormat:@"%@ ", jsVal];
+ WXLogInfo(@"%@", string);
+ }
+ }
+ [string appendFormat:@"%@ ", jsVal ];
+ }];
+ };
+
+ _jsContext.exceptionHandler = ^(JSContext *context, JSValue *exception){
+ context.exception = exception;
+ NSString *message = [NSString stringWithFormat:@"[%@:%@:%@] %@\n%@", exception[@"sourceURL"], exception[@"line"], exception[@"column"], exception, [exception[@"stack"] toObject]];
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:WX_JS_ERROR_NOTIFICATION_NAME object:weakSelf userInfo:message ? @{@"message":message} : nil];
+ };
+ }
+ return self;
+}
+
+#pragma mark - WXBridgeProtocol
+
+- (void)executeJSFramework:(NSString *)frameworkScript
+{
+ WXAssertParam(frameworkScript);
+
+ [_jsContext evaluateScript:frameworkScript];
+}
+
+- (void)callJSMethod:(NSString *)method args:(NSArray *)args
+{
+ WXLogVerbose(@"Calling JS... method:%@, args:%@", method, args);
+
+ [[_jsContext globalObject] invokeMethod:method withArguments:args];
+}
+
+- (void)registerCallNative:(WXJSCallNative)callNative
+{
+ void (^callNativeBlock)(JSValue *, JSValue *, JSValue *) = ^(JSValue *instance, JSValue *tasks, JSValue *callback){
+ NSString *instanceId = [instance toString];
+ NSArray *tasksArray = [tasks toArray];
+ NSString *callbackId = [callback toString];
+ WXLogVerbose(@"Calling native... instance:%@, tasks:%@, callback:%@", instanceId, tasksArray, callbackId);
+ callNative(instanceId, tasksArray, callbackId);
+ };
+
+ _jsContext[@"callNative"] = callNativeBlock;
+}
+
+- (JSValue*)exception
+{
+ return _jsContext.exception;
+}
+
+- (void)resetEnvironment
+{
+ NSDictionary *data = [WXUtility getEnvironment];
+ _jsContext[@"WXEnvironment"] = data;
+}
+
+#pragma mark - Private
+
+- (void)triggerTimeout:(void(^)())block
+{
+ block();
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.h b/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.h
new file mode 100644
index 0000000..116c3c4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.h
@@ -0,0 +1,15 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXBridgeProtocol.h"
+
+@interface WXWebSocketBridge : NSObject <WXBridgeProtocol>
+
+- (instancetype)initWithURL:(NSURL *) URL;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.m b/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.m
new file mode 100644
index 0000000..2059909
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXWebSocketBridge.m
@@ -0,0 +1,203 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXWebSocketBridge.h"
+#import "SRWebSocket.h"
+#import "WXSDKManager.h"
+#import "WXUtility.h"
+#import "WXLog.h"
+
+/**
+ * call format:
+ * {
+ * id:1234,
+ * method:(__logger/__hotReload/__inspector/evalFramework...),
+ * arguments:[arg1,arg2,..],
+ * }
+ *
+ * callback format:
+ * {
+ * callbackID:1234,(same as call id)
+ * result:{a:1,b:2}
+ * }
+ */
+@interface WXWebSocketBridge()<SRWebSocketDelegate>
+
+@end
+
+@implementation WXWebSocketBridge
+{
+ BOOL _isConnect;
+ SRWebSocket *_webSocket;
+ NSMutableArray *_msgAry;
+ WXJSCallNative _nativeCallBlock;
+ NSThread *_curThread;
+}
+
+- (void)dealloc
+{
+ _nativeCallBlock = nil;
+ [self _disconnect];
+}
+
+- (instancetype)initWithURL:(NSURL *) URL
+{
+ self = [super init];
+
+ _isConnect = NO;
+ _curThread = [NSThread currentThread];
+
+ [self _connect:URL];
+
+ return self;
+}
+
+- (void)_initEnvironment
+{
+ [self callJSMethod:@"setEnvironment" args:@[[WXUtility getEnvironment]]];
+}
+
+- (void)_disconnect
+{
+ _msgAry = nil;
+ _isConnect = NO;
+ _webSocket.delegate = nil;
+ [_webSocket close];
+ _webSocket = nil;
+}
+
+- (void)_connect:(NSURL *)URL
+{
+ _msgAry = nil;
+ _msgAry = [NSMutableArray array];
+ _webSocket.delegate = nil;
+ [_webSocket close];
+
+ _webSocket = [[SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:URL]];
+ _webSocket.delegate = self;
+
+ [_webSocket open];
+}
+
+-(void)_executionMsgAry
+{
+ if (!_isConnect) return;
+
+ for (NSString *msg in _msgAry) {
+ [_webSocket send:msg];
+ }
+ [_msgAry removeAllObjects];
+}
+
+-(void)_evaluateNative:(NSString *)data
+{
+ NSDictionary *dict = [WXUtility objectFromJSON:data];
+ NSString *method = [dict objectForKey:@"method"];
+ NSArray *args = [dict objectForKey:@"arguments"];
+
+ if ([method isEqualToString:@"callNative"]) {
+ // call native
+ NSString *instanceId = args[0];
+ NSArray *methods = args[1];
+ NSString *callbackId = args[2];
+
+ // params parse
+ if(!methods || methods.count <= 0){
+ return;
+ }
+ //call native
+ WXLogVerbose(@"Calling native... instancdId:%@, methods:%@, callbackId:%@", instanceId, [WXUtility JSONString:methods], callbackId);
+ _nativeCallBlock(instanceId, methods, callbackId);
+ } else if ([method isEqualToString:@"setLogLevel"]) {
+ NSString *levelString = [args firstObject];
+ [WXLog setLogLevelString:levelString];
+ }
+}
+
+#pragma mark - WXBridgeProtocol
+
+- (void)executeJSFramework:(NSString *)frameworkScript
+{
+ [self callJSMethod:@"evalFramework" args:@[frameworkScript]];
+}
+
+- (void)callJSMethod:(NSString *)method args:(NSArray *)args
+{
+ if (![method isEqualToString:@"__logger"]) {
+ // prevent recursion
+ WXLogVerbose(@"Calling JS... method:%@, args:%@", method, [WXUtility JSONString:args]);
+ }
+
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+ [dict setObject:method forKey:@"method"];
+ [dict setObject:args forKey:@"arguments"];
+
+ [_msgAry addObject:[WXUtility JSONString:dict]];
+ [self _executionMsgAry];
+}
+
+- (void)registerCallNative:(WXJSCallNative)callNative
+{
+ _nativeCallBlock = callNative;
+}
+
+- (JSValue*) exception
+{
+ return nil;
+}
+
+- (void)resetEnvironment
+{
+ [self _initEnvironment];
+}
+
+- (void)executeBridgeThead:(dispatch_block_t)block
+{
+ if([NSThread currentThread] == _curThread){
+ block();
+ } else {
+ [self performSelector:@selector(executeBridgeThead:)
+ onThread:_curThread
+ withObject:[block copy]
+ waitUntilDone:NO];
+ }
+}
+
+#pragma mark - SRWebSocketDelegate
+
+- (void)webSocketDidOpen:(SRWebSocket *)webSocket;
+{
+ WXLogWarning(@"Websocket Connected:%@", webSocket.url);
+ _isConnect = YES;
+ [self _initEnvironment];
+ __weak typeof(self) weakSelf = self;
+ [self executeBridgeThead:^() {
+ [weakSelf _executionMsgAry];
+ }];
+}
+
+- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error;
+{
+ WXLogError(@":( Websocket Failed With Error %@", error);
+}
+
+- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message;
+{
+ __weak typeof(self) weakSelf = self;
+ [self executeBridgeThead:^() {
+ [weakSelf _evaluateNative:message];
+ }];
+}
+
+- (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
+{
+ WXLogInfo(@"Websocket closed with code: %ld, reason:%@, wasClean: %d", (long)code, reason, wasClean);
+ _isConnect = NO;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXAComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXAComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXAComponent.h
new file mode 100644
index 0000000..5ebf7a0
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXAComponent.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXAComponent : WXComponent <UIGestureRecognizerDelegate>
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXAComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXAComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXAComponent.m
new file mode 100644
index 0000000..c916b0d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXAComponent.m
@@ -0,0 +1,75 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXAComponent.h"
+#import "WXNavigationProtocol.h"
+#import "WXHandlerFactory.h"
+#import "WXLog.h"
+#import "WXComponent+Events.h"
+
+@interface WXAComponent()
+
+@property (nonatomic, strong) UITapGestureRecognizer *tap;
+@property (nonatomic, strong) NSString *href;
+
+@end
+
+@implementation WXAComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ _tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(openURL)];
+ _tap.delegate = self;
+ if (attributes[@"href"]) {
+ _href = attributes[@"href"];
+ }
+ }
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [self.view addGestureRecognizer:_tap];
+}
+
+- (void)openURL
+{
+ if (_href && [_href length] > 0) {
+ id<WXNavigationProtocol> navigationHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXNavigationProtocol)];
+ if ([navigationHandler respondsToSelector:@selector(pushViewControllerWithParam:
+ completion:
+ withContainer:)]) {
+ __weak typeof(self) weexSelf = self;
+ [navigationHandler pushViewControllerWithParam:@{@"url":_href} completion:^(NSString *code, NSDictionary *responseData) {
+ WXLogVerbose(@"Push success -> %@", weexSelf.href);
+ } withContainer:self.weexInstance.viewController];
+ } else {
+ WXLogError(@"Event handler of class %@ does not respond to pushViewControllerWithParam", NSStringFromClass([navigationHandler class]));
+ }
+ }
+}
+
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
+{
+ if (gestureRecognizer == _tap) return YES;
+
+ if (otherGestureRecognizer == _tap) return YES;
+
+ return [super gestureRecognizer:gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer];
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@""]) {
+ _href = attributes[@"href"];
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h
new file mode 100644
index 0000000..d016117
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h
@@ -0,0 +1,18 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+@class WXListComponent;
+
+@interface WXCellComponent : WXComponent
+
+@property (nonatomic, strong) NSIndexPath *indexPath;
+@property (nonatomic, strong) NSString *scope;
+@property (nonatomic, weak) WXListComponent *list;
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m
new file mode 100644
index 0000000..02a7e84
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m
@@ -0,0 +1,93 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSDKInstance.h"
+#import "WXLog.h"
+#import "WXCellComponent.h"
+#import "WXListComponent.h"
+#import "WXComponent_internal.h"
+
+@implementation WXCellComponent
+{
+ NSIndexPath *_indexPathBeforeMove;
+}
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+
+ if (self) {
+ _async = YES;
+ _lazyCreateView = YES;
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+
+}
+
+- (void)layoutDidFinish
+{
+ [self.list cellDidLayout:self];
+}
+
+- (WXDisplayCompeletionBlock)displayCompeletionBlock
+{
+ return ^(CALayer *layer, BOOL finished) {
+ if ([super displayCompeletionBlock]) {
+ [super displayCompeletionBlock](layer, finished);
+ [self.list cellDidRendered:self];
+ }
+ };
+}
+
+- (void)_moveToSupercomponent:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index
+{
+ _indexPathBeforeMove = self.indexPath;
+ [super _moveToSupercomponent:newSupercomponent atIndex:index];
+}
+
+- (void)moveToSuperview:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index
+{
+ if (newSupercomponent == self.list) {
+ [self.list cell:self didMoveFromIndexPath:_indexPathBeforeMove toIndexPath:_indexPath];
+ } else {
+ [super moveToSuperview:newSupercomponent atIndex:index];
+ }
+}
+
+- (void)_removeFromSupercomponent
+{
+ [super _removeFromSupercomponent];
+
+ [self.list cellWillRemove:self];
+}
+
+- (void)removeFromSuperview
+{
+ [self.list cellDidRemove:self];
+}
+
+- (void)_calculateFrameWithSuperAbsolutePosition:(CGPoint)superAbsolutePosition gatherDirtyComponents:(NSMutableSet<WXComponent *> *)dirtyComponents
+{
+ if (isUndefined(self.cssNode->style.dimensions[CSS_WIDTH]) && self.list) {
+ self.cssNode->style.dimensions[CSS_WIDTH] = self.list.scrollerCSSNode->style.dimensions[CSS_WIDTH];
+ }
+
+ if ([self needsLayout]) {
+ layoutNode(self.cssNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT);
+// print_css_node(self.cssNode, CSS_PRINT_LAYOUT | CSS_PRINT_STYLE | CSS_PRINT_CHILDREN);
+ }
+
+ [super _calculateFrameWithSuperAbsolutePosition:superAbsolutePosition gatherDirtyComponents:dirtyComponents];
+}
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
new file mode 100644
index 0000000..4d1ecdb
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
@@ -0,0 +1,163 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXScrollerProtocol.h"
+#import "WXComponent.h"
+#import "WXConvert.h"
+@class WXTouchGestureRecognizer;
+@class WXThreadSafeCounter;
+
+
+/**
+ * The following variables and methods are used in Weex INTERNAL logic.
+ * @warning These variables and methods must never be called or overridden.
+ */
+@interface WXComponent ()
+{
+@package
+ NSString *_type;
+ /**
+ * Layout
+ */
+ css_node_t *_cssNode;
+ BOOL _isLayoutDirty;
+ CGRect _calculatedFrame;
+ CGPoint _absolutePosition;
+ WXPositionType _positionType;
+
+ /**
+ * View
+ */
+ UIColor *_backgroundColor;
+ WXClipType _clipToBounds;
+ UIView *_view;
+ CGFloat _opacity;
+ WXVisibility _visibility;
+
+ /**
+ * Events
+ */
+ BOOL _appearEvent;
+ BOOL _disappearEvent;
+ UITapGestureRecognizer *_tapGesture;
+ NSMutableArray *_swipeGestures;
+ UILongPressGestureRecognizer *_longPressGesture;
+ UIPanGestureRecognizer *_panGesture;
+ BOOL _listenPanStart;
+ BOOL _listenPanMove;
+ BOOL _listenPanEnd;
+ WXTouchGestureRecognizer* _touchGesture;
+
+ /**
+ * Display
+ */
+ CALayer *_layer;
+ BOOL _composite;
+ BOOL _compositingChild;
+ WXThreadSafeCounter *_displayCounter;
+
+ UIColor *_borderTopColor;
+ UIColor *_borderRightColor;
+ UIColor *_borderLeftColor;
+ UIColor *_borderBottomColor;
+
+ CGFloat _borderTopWidth;
+ CGFloat _borderRightWidth;
+ CGFloat _borderLeftWidth;
+ CGFloat _borderBottomWidth;
+
+ CGFloat _borderTopLeftRadius;
+ CGFloat _borderTopRightRadius;
+ CGFloat _borderBottomLeftRadius;
+ CGFloat _borderBottomRightRadius;
+
+ WXBorderStyle _borderTopStyle;
+ WXBorderStyle _borderRightStyle;
+ WXBorderStyle _borderBottomStyle;
+ WXBorderStyle _borderLeftStyle;
+
+
+ BOOL _isFixed;
+ BOOL _async;
+ BOOL _isNeedJoinLayoutSystem;
+ BOOL _lazyCreateView;
+
+ NSString *_transform;
+ NSString *_transformOrigin;
+}
+
+///--------------------------------------
+/// @name Package Internal Methods
+///--------------------------------------
+
+- (void)_layoutDidFinish;
+- (void)_calculateFrameWithSuperAbsolutePosition:(CGPoint)superAbsolutePosition
+ gatherDirtyComponents:(NSMutableSet<WXComponent *> *)dirtyComponents;
+
+
+- (void)_willDisplayLayer:(CALayer *)layer;
+
+- (void)_unloadView;
+
+- (id<WXScrollerProtocol>)ancestorScroller;
+
+- (void)_insertSubcomponent:(WXComponent *)subcomponent atIndex:(NSInteger)index;
+- (void)_removeFromSupercomponent;
+- (void)_moveToSupercomponent:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index;
+
+- (void)_updateStylesOnComponentThread:(NSDictionary *)styles;
+- (void)_updateAttributesOnComponentThread:(NSDictionary *)attributes;
+- (void)_updateStylesOnMainThread:(NSDictionary *)styles;
+- (void)_updateAttributesOnMainThread:(NSDictionary *)attributes;
+
+- (void)_addEventOnComponentThread:(NSString *)eventName;
+- (void)_removeEventOnComponentThread:(NSString *)eventName;
+- (void)_addEventOnMainThread:(NSString *)eventName;
+- (void)_removeEventOnMainThread:(NSString *)eventName;
+
+///--------------------------------------
+/// @name Protected Methods
+///--------------------------------------
+
+- (BOOL)_needsDrawBorder;
+
+- (void)_drawBorderWithContext:(CGContextRef)context size:(CGSize)size;
+
+- (void)_calculatedFrameDidChange;
+
+- (NSUInteger)_childrenCountForLayout;
+
+- (void)_fillAbsolutePositions;
+
+///--------------------------------------
+/// @name Private Methods
+///--------------------------------------
+
+- (void)_initCSSNodeWithStyles:(NSDictionary *)styles;
+
+- (void)_updateCSSNodeStyles:(NSDictionary *)styles;
+
+- (void)_recomputeCSSNodeChildren;
+
+- (void)_recomputeBorderRadius;
+
+- (void)_handleBorders:(NSDictionary *)styles isUpdating:(BOOL)updating;
+
+- (void)_initViewPropertyWithStyles:(NSDictionary *)styles;
+
+- (void)_updateViewStyles:(NSDictionary *)styles;
+
+- (void)_initEvents:(NSArray *)events;
+
+- (void)_removeAllEvents;
+
+- (void)_setupNavBarWithStyles:(NSMutableDictionary *)styles attributes:(NSMutableDictionary *)attributes;
+
+- (void)_updateNavBarAttributes:(NSDictionary *)attributes;
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.h
new file mode 100644
index 0000000..677eae2
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXDivComponent : WXComponent
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.m
new file mode 100644
index 0000000..c07f1c4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXDivComponent.m
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXDivComponent.h"
+
+@interface WXDivComponent ()
+@end
+
+@implementation WXDivComponent
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.h
new file mode 100644
index 0000000..9e28ece
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.h
@@ -0,0 +1,15 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXEmbedComponent : WXComponent
+
+- (void)refreshWeex;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.m
new file mode 100644
index 0000000..5b70f03
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.m
@@ -0,0 +1,175 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXEmbedComponent.h"
+#import "WXComponent_internal.h"
+#import "WXSDKInstance_private.h"
+#import "WXComponent+Navigation.h"
+#import "WXSDKInstance.h"
+#import "WXConvert.h"
+
+@interface WXEmbedComponent ()
+
+@property (nonatomic, strong) WXSDKInstance *embedInstance;
+@property (nonatomic, strong) UIView *embedView;
+@property (nonatomic, assign) BOOL renderFinished;
+@property (nonatomic, assign) WXVisibility visible;
+@property (nonatomic, strong) NSURL *sourceURL;
+
+@end
+
+@implementation WXEmbedComponent
+
+#pragma mark Life Cycle
+
+- (void)dealloc
+{
+ if (self.weexInstance) {
+ [self.weexInstance removeObserver:self forKeyPath:@"state"];
+ }
+
+ if (self.embedInstance) {
+ [self.embedInstance destroyInstance];
+ }
+}
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
+ _sourceURL = [NSURL URLWithString: attributes[@"src"]];
+ _visible = [WXConvert WXVisibility:styles[@"visibility"]];
+
+ [self.weexInstance addObserver:self forKeyPath:@"state" options:NSKeyValueObservingOptionNew context:nil];
+ }
+
+ return self;
+}
+
+- (void)viewDidLoad {
+
+ [super viewDidLoad];
+
+ [self _layoutEmbedView];
+}
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+ [super updateStyles:styles];
+
+ if (styles[@"visibility"]) {
+ WXVisibility visible = [WXConvert WXVisibility:styles[@"visibility"]];
+ if (_visible != visible) {
+ _visible = visible;
+ [self _layoutEmbedView];
+ }
+ }
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ [super updateAttributes:attributes];
+
+ if (attributes[@"src"]) {
+ NSURL *sourceURL = [NSURL URLWithString:attributes[@"src"]];
+ if (!sourceURL|| ![[sourceURL absoluteString] isEqualToString:[_sourceURL absoluteString]]) {
+ _sourceURL = sourceURL;
+ [self _layoutEmbedView];
+ }
+ }
+}
+
+- (void)refreshWeex
+{
+ [self _renderWithURL:_sourceURL];
+}
+
+- (void)_layoutEmbedView
+{
+ if (_visible == WXVisibilityShow) {
+ if (!_renderFinished && !CGRectEqualToRect(CGRectZero, self.calculatedFrame)) {
+ [self _renderWithURL:_sourceURL];
+ }
+ [self _updateState:WeexInstanceAppear];
+ }
+ else {
+ [self _updateState:WeexInstanceDisappear];
+ }
+}
+
+- (void)_renderWithURL:(NSURL *)sourceURL
+{
+ if (!sourceURL || [[sourceURL absoluteString] length] == 0) {
+ return;
+ }
+
+ [_embedInstance destroyInstance];
+ _embedInstance = [[WXSDKInstance alloc] init];
+ _embedInstance.parentInstance = self.weexInstance;
+ _embedInstance.parentNodeRef = self.ref;
+ _embedInstance.frame = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, self.view.frame.size.height);
+ _embedInstance.pageName = [sourceURL absoluteString];
+ _embedInstance.pageObject = self.weexInstance.viewController;
+ _embedInstance.viewController = self.weexInstance.viewController;
+
+ NSString *newURL = nil;
+
+ if ([sourceURL.absoluteString rangeOfString:@"?"].location != NSNotFound) {
+ newURL = [NSString stringWithFormat:@"%@&random=%d", sourceURL.absoluteString, arc4random()];
+ }
+ else {
+ newURL = [NSString stringWithFormat:@"%@?random=%d", sourceURL.absoluteString, arc4random()];
+ }
+
+ [_embedInstance renderWithURL:[NSURL URLWithString:newURL] options:@{@"bundleUrl":[sourceURL absoluteString]} data:nil];
+
+ __weak typeof(self) weakSelf = self;
+ _embedInstance.onCreate = ^(UIView *view) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [weakSelf.embedView removeFromSuperview];
+ weakSelf.embedView = view;
+ weakSelf.renderFinished = YES;
+ [weakSelf.view addSubview:weakSelf.embedView];
+ });
+ };
+}
+
+- (void)_updateState:(WXState)state
+{
+ if (!_embedInstance) {
+ return;
+ }
+
+ _embedInstance.state = state;
+
+ if (state == WeexInstanceAppear || state == WeexInstanceForeground )
+ {
+ [self setNavigationWithStyles:self.embedInstance.naviBarStyles];
+ }
+}
+
+-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+ if ([keyPath isEqualToString:@"state"]) {
+ WXState state = [change[@"new"] longValue];
+ if (_visible == WXVisibilityHidden) {
+ switch (state) {
+ case WeexInstanceBackground:
+ [self _updateState:WeexInstanceBackground];
+ break;
+ default:
+ [self _updateState:WeexInstanceDisappear];
+ break;
+ }
+ }
+ else {
+ [self _updateState:state];
+ }
+ }
+}
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.h
new file mode 100644
index 0000000..749bd17
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXImageComponent : WXComponent
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
new file mode 100644
index 0000000..57b373b
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
@@ -0,0 +1,234 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXImageComponent.h"
+#import "WXHandlerFactory.h"
+#import "WXComponent_internal.h"
+#import "WXImgLoaderProtocol.h"
+#import "WXLayer.h"
+#import "WXType.h"
+#import "WXConvert.h"
+
+@interface WXImageView : UIImageView
+
+@end
+
+@implementation WXImageView
+
++ (Class)layerClass
+{
+ return [WXLayer class];
+}
+
+@end
+
+static dispatch_queue_t WXImageUpdateQueue;
+
+@interface WXImageComponent ()
+
+@property (nonatomic, strong) NSString *imageSrc;
+@property (nonatomic, assign) UIViewContentMode resizeMode;
+@property (nonatomic, assign) WXImageQuality imageQuality;
+@property (nonatomic, assign) WXImageSharp imageSharp;
+@property (nonatomic, strong) UIImage *image;
+@property (nonatomic, strong) id<WXImageOperationProtocol> imageOperation;
+
+@end
+
+@implementation WXImageComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
+ _async = YES;
+ if (!WXImageUpdateQueue) {
+ WXImageUpdateQueue = dispatch_queue_create("com.taobao.weex.ImageUpdateQueue", DISPATCH_QUEUE_SERIAL);
+ }
+
+ _imageSrc = [WXConvert NSString:attributes[@"src"]];
+ _resizeMode = [WXConvert UIViewContentMode:attributes[@"resize"]];
+ _imageQuality = [WXConvert WXImageQuality:styles[@"quality"]];
+ _imageSharp = [WXConvert WXImageSharp:styles[@"sharpen"]];
+ }
+
+ return self;
+}
+
+- (UIView *)loadView
+{
+ return [[WXImageView alloc] init];
+}
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+ if (styles[@"quality"]) {
+ _imageQuality = [WXConvert WXImageQuality:styles[@"quality"]];
+ [self updateImage];
+ }
+
+ if (styles[@"sharpen"]) {
+ _imageSharp = [WXConvert WXImageSharp:styles[@"sharpen"]];
+ [self updateImage];
+ }
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"src"]) {
+ _imageSrc = [WXConvert NSString:attributes[@"src"]];
+ [self updateImage];
+ }
+
+ if (attributes[@"resize"]) {
+ _resizeMode = [WXConvert UIViewContentMode:attributes[@"resize"]];
+ self.view.contentMode = _resizeMode;
+ }
+}
+
+- (void)viewDidLoad
+{
+ UIImageView *imageView = (UIImageView *)self.view;
+ imageView.contentMode = _resizeMode;
+ imageView.userInteractionEnabled = YES;
+ imageView.clipsToBounds = YES;
+ imageView.exclusiveTouch = YES;
+
+ if (_image) {
+ imageView.image = _image;
+ _image = nil;
+ } else {
+ [self updateImage];
+ }
+}
+
+- (WXDisplayBlock)displayBlock
+{
+ if ([self isViewLoaded]) {
+ // if has a image view, image is setted by image view, displayBlock is not needed
+ return nil;
+ }
+
+ __weak typeof(self) weakSelf = self;
+ return ^UIImage *(CGRect bounds, BOOL(^isCancelled)(void)) {
+ if (isCancelled()) {
+ return nil;
+ }
+
+ if (!weakSelf.image) {
+ [weakSelf updateImage];
+ return nil;
+ }
+
+ if (isCancelled && isCancelled()) {
+ return nil;
+ }
+
+ UIGraphicsBeginImageContextWithOptions(bounds.size, self.layer.opaque, 1.0);
+
+ [weakSelf.image drawInRect:bounds];
+
+ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+
+ UIGraphicsEndImageContext();
+
+ return image;
+ };
+}
+
+- (void)viewWillUnload
+{
+ [super viewWillUnload];
+ [self cancelImage];
+ _image = nil;
+}
+
+- (void)setImageSrc:(NSString*)src
+{
+ if (![src isEqualToString:_imageSrc]) {
+ _imageSrc = src;
+ [self updateImage];
+ }
+}
+
+- (void)updateImage
+{
+ __weak typeof(self) weakSelf = self;
+ dispatch_async(WXImageUpdateQueue, ^{
+ [self cancelImage];
+
+ if (CGRectEqualToRect(self.calculatedFrame, CGRectZero)) {
+ return;
+ }
+
+ if (weakSelf.imageSrc) {
+ NSString *imageSrc = weakSelf.imageSrc;
+ NSDictionary *userInfo = @{@"imageQuality":@(weakSelf.imageQuality), @"imageSharp":@(weakSelf.imageSharp)};
+ WXLogVerbose(@"Updating image, component:%@, image source:%@, userInfo:%@", self.ref, imageSrc, userInfo);
+ weakSelf.imageOperation = [[weakSelf imageLoader] downloadImageWithURL:imageSrc imageFrame:weakSelf.calculatedFrame userInfo:userInfo completed:^(UIImage *image, NSError *error, BOOL finished) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ __strong typeof(self) strongSelf = weakSelf;
+ if (error) {
+ WXLogError(@"Error downloading image:%@, detail:%@", imageSrc, [error localizedDescription]);
+ if ([strongSelf isViewLoaded]) {
+ ((UIImageView *)(strongSelf.view)).image = nil;
+ }
+ return ;
+ }
+
+ if (![imageSrc isEqualToString:strongSelf.imageSrc]) {
+ return ;
+ }
+ if ([strongSelf isViewLoaded]) {
+ ((UIImageView *)strongSelf.view).image = image;
+ } else {
+ //TODO: Need this?
+ strongSelf.image = image;
+ [strongSelf setNeedsDisplay];
+ }
+ });
+ }];
+ } else {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ self.layer.contents = nil;
+ });
+ }
+ });
+}
+
+- (void)cancelImage
+{
+ [_imageOperation cancel];
+ _imageOperation = nil;
+}
+
+- (id<WXImgLoaderProtocol>)imageLoader
+{
+ static id<WXImgLoaderProtocol> imageLoader;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ imageLoader = [WXHandlerFactory handlerForProtocol:@protocol(WXImgLoaderProtocol)];
+ });
+ return imageLoader;
+}
+
+- (BOOL)_needsDrawBorder
+{
+ return NO;
+}
+
+#ifdef UITEST
+- (NSString *)description
+{
+ NSString *superDescription = super.description;
+ NSRange semicolonRange = [superDescription rangeOfString:@";"];
+ NSString *replacement = [NSString stringWithFormat:@"; imageSrc: %@; imageQuality: %@; imageSharp: %@; ",_imageSrc,_imageQuality,_imageSharp];
+ return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
+}
+#endif
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h
new file mode 100644
index 0000000..faeae40
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h
@@ -0,0 +1,33 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+typedef enum
+{
+ WXPointIndicatorAlignCenter, // point indicator align center
+ WXPointIndicatorAlignLeft, // point indicator align left
+ WXPointIndicatorAlignRight, // point indicator align right
+} WXPointIndicatorAlignStyle;
+
+@interface WXIndicatorView : UIView
+
+@property (nonatomic, assign) NSInteger pointCount; // total count point of point indicator
+@property (nonatomic, assign) NSInteger currentPoint; // current light index of point at point indicator
+@property (nonatomic, strong) UIColor *pointColor; // normal point color of point indicator
+@property (nonatomic, strong) UIColor *lightColor; // highlight point color of point indicator
+@property (nonatomic, assign) WXPointIndicatorAlignStyle alignStyle; //align style of point indicator
+@property (nonatomic, assign) CGFloat pointSize; // point size of point indicator
+@property (nonatomic, assign) CGFloat pointSpace; // point space of point indicator
+
+@end
+
+
+@interface WXIndicatorComponent : WXComponent
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m
new file mode 100644
index 0000000..c903c2a
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m
@@ -0,0 +1,186 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXIndicatorComponent.h"
+#import "WXSliderComponent.h"
+#import "WXConvert.h"
+
+@implementation WXIndicatorView
+
+@synthesize pointCount = _pointCount;
+@synthesize currentPoint = _currentPoint;
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.pointSpace = 5.0f;
+ }
+ return self;
+}
+
+- (void)setBackgroundColor:(UIColor *)backgroundColor
+{
+ [super setBackgroundColor:backgroundColor];
+}
+
+- (void)setPointCount:(NSInteger)pointCount
+{
+ _pointCount = pointCount;
+ [self setNeedsDisplay];
+}
+
+- (void)setCurrentPoint:(NSInteger)currentPoint
+{
+ if (currentPoint < _pointCount && currentPoint >= 0) {
+ _currentPoint = currentPoint;
+ [self setNeedsDisplay];
+ }
+}
+
+- (void)setPointSize:(CGFloat)pointSize
+{
+ _pointSize = pointSize;
+ [self setNeedsDisplay];
+}
+
+- (void)setPointSpace:(CGFloat)pointSpace
+{
+ _pointSpace = pointSpace;
+ [self setNeedsDisplay];
+}
+
+- (void)drawRect:(CGRect)rect
+{
+ if (self.alignStyle == WXPointIndicatorAlignCenter) {
+ CGFloat startX = 0.0f, centerX = self.frame.size.width / 2.0f;
+ if (self.pointCount % 2) {
+ startX = centerX - (self.pointSize + self.pointSpace) * (int)(self.pointCount / 2.0f) - self.pointSize / 2.0f;
+ } else {
+ startX = centerX - (self.pointSize + self.pointSpace) * (int)(self.pointCount / 2.0f) + self.pointSpace / 2.0f;
+ }
+
+ CGContextRef context=UIGraphicsGetCurrentContext();
+ CGContextBeginPath(context);
+
+ for (int i = 0; i < self.pointCount; i++) {
+ if (self.currentPoint == i) {
+ CGContextSetFillColorWithColor(context, self.lightColor.CGColor);
+ CGContextAddEllipseInRect(context, CGRectMake(startX, (self.frame.size.height - self.pointSize) / 2.0f, self.pointSize, self.pointSize));
+ CGContextFillPath(context);
+ } else {
+ CGContextSetFillColorWithColor(context, self.pointColor.CGColor);
+ CGContextAddEllipseInRect(context, CGRectMake(startX, (self.frame.size.height - self.pointSize) / 2.0f, self.pointSize, self.pointSize));
+ CGContextFillPath(context);
+ }
+ startX += self.pointSize + self.pointSpace;
+ }
+ } else if (self.alignStyle == WXPointIndicatorAlignRight) {
+ CGFloat startX = self.frame.size.width - self.pointSize * self.pointCount - self.pointSpace * (self.pointCount - 1) - 10; //10 right margin
+ CGContextRef context=UIGraphicsGetCurrentContext();
+ CGContextBeginPath(context);
+
+ for(int i = 0; i < self.pointCount; i++) {
+ if (self.currentPoint == i) {
+ CGContextSetFillColorWithColor(context, self.lightColor.CGColor);
+ CGContextAddEllipseInRect(context, CGRectMake(startX, (self.frame.size.height - self.pointSize) / 2.0f, self.pointSize, self.pointSize));
+ CGContextFillPath(context);
+ } else {
+ CGContextSetFillColorWithColor(context, self.pointColor.CGColor);
+ CGContextAddEllipseInRect(context, CGRectMake(startX, (self.frame.size.height - self.pointSize) / 2.0f, self.pointSize, self.pointSize));
+ CGContextFillPath(context);
+ }
+ startX += self.pointSize + self.pointSpace;
+ }
+ } else if (self.alignStyle == WXPointIndicatorAlignLeft) {
+ CGFloat startX = 10.0f; //10 left margin
+ CGContextRef context=UIGraphicsGetCurrentContext();
+ CGContextBeginPath(context);
+ for(int i = 0; i < self.pointCount; i++) {
+ if (self.currentPoint == i) {
+ CGContextSetFillColorWithColor(context, self.lightColor.CGColor);
+ CGContextAddEllipseInRect(context, CGRectMake(startX, (self.frame.size.height - self.pointSize) / 2.0f, self.pointSize, self.pointSize));
+ CGContextFillPath(context);
+ } else {
+ CGContextSetFillColorWithColor(context, self.pointColor.CGColor);
+ CGContextAddEllipseInRect(context, CGRectMake(startX, (self.frame.size.height - self.pointSize) / 2.0f, self.pointSize, self.pointSize));
+ CGContextFillPath(context);
+ }
+ startX += self.pointSize + self.pointSpace;
+ }
+ }
+}
+
+@end
+
+@interface WXIndicatorComponent()
+
+@property (nonatomic, strong) WXIndicatorView *indicatorView;
+
+@property (nonatomic, strong) UIColor *itemColor;
+@property (nonatomic, strong) UIColor *itemSelectedColor;
+@property (nonatomic) CGFloat itemSize;
+
+@end
+
+@implementation WXIndicatorComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
+ _itemColor = styles[@"itemColor"] ? [WXConvert UIColor:styles[@"itemColor"]]:[UIColor colorWithRed:0xff/255.0f green:0xff/255.0f blue:0xff/255.0f alpha:0.5f];
+ _itemSelectedColor = styles[@"itemSelectedColor"] ? [WXConvert UIColor:styles[@"itemSelectedColor"]]:[UIColor colorWithRed:0xff/255.0f green:0xd5/255.0f blue:0x45/255.0f alpha:1.0f];
+ _itemSize = styles[@"itemSize"] ? [WXConvert CGFloat:styles[@"itemSize"]]: 5.0f;
+ }
+ return self;
+}
+
+- (UIView *)loadView
+{
+ return [[WXIndicatorView alloc] init];
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ _indicatorView = (WXIndicatorView *)self.view;
+ _indicatorView.alignStyle = WXPointIndicatorAlignCenter;
+ _indicatorView.userInteractionEnabled = NO;
+ _indicatorView.pointColor = _itemColor;
+ _indicatorView.lightColor = _itemSelectedColor;
+ _indicatorView.pointSize = _itemSize;
+
+ WXComponent *parent = self.supercomponent;
+ if([parent isKindOfClass:[WXSliderComponent class]]) {
+ WXSliderComponent *parentSlider = (WXSliderComponent *)parent;
+ [parentSlider setIndicatorView:_indicatorView];
+ }
+ else {
+ NSAssert(NO, @"");
+ }
+}
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+ if (styles[@"itemColor"]) {
+ _itemColor = [WXConvert UIColor:styles[@"itemColor"]];
+ [_indicatorView setPointColor:_itemColor];
+ }
+ else if (styles[@"itemSelectedColor"]) {
+ _itemSelectedColor = [WXConvert UIColor:styles[@"itemSelectedColor"]];
+ [_indicatorView setLightColor:_itemSelectedColor];
+ }
+ else if (styles[@"itemSize"]) {
+ _itemSize = [WXConvert WXPixelType:styles[@"itemSelectedColor"]];
+ [_indicatorView setPointSize:_itemSize];
+ }
+}
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXListComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.h
new file mode 100644
index 0000000..2a62c0b
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.h
@@ -0,0 +1,24 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXCellComponent.h"
+#import "WXScrollerComponent.h"
+
+@interface WXListComponent : WXScrollerComponent
+
+- (void)cellWillRemove:(WXCellComponent *)cell;
+
+- (void)cellDidRemove:(WXCellComponent *)cell;
+
+- (void)cellDidLayout:(WXCellComponent *)cell;
+
+- (void)cellDidRendered:(WXCellComponent *)cell;
+
+- (void)cell:(WXCellComponent *)cell didMoveFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath;
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
new file mode 100644
index 0000000..f4fbfd9
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -0,0 +1,296 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXListComponent.h"
+#import "WXComponent.h"
+#import "WXComponent_internal.h"
+#import "NSArray+Weex.h"
+#import "WXAssert.h"
+#import "WXUtility.h"
+#import "WXSDKInstance.h"
+
+@interface WXTableView : UITableView
+
+@end
+
+@implementation WXTableView
+
++ (BOOL) requiresConstraintBasedLayout
+{
+ return NO;
+}
+
+- (void)layoutSubviews
+{
+ [super layoutSubviews];
+ [self.wx_component layoutDidFinish];
+}
+
+@end
+
+@interface WXListComponent () <UITableViewDataSource, UITableViewDelegate>
+
+@end
+
+@implementation WXListComponent
+{
+ __weak UITableView * _tableView;
+ NSMutableArray * _cellComponents;
+ NSMutableArray * _completedCells;
+ NSUInteger _previousLoadMoreRowNumber;
+}
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
+
+ _cellComponents = [NSMutableArray wx_mutableArrayUsingWeakReferences];
+ _completedCells = [NSMutableArray wx_mutableArrayUsingWeakReferences];
+ }
+
+ return self;
+}
+
+- (UIView *)loadView
+{
+ return [[WXTableView alloc] init];
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ _tableView = (UITableView *)self.view;
+ _tableView.allowsSelection = NO;
+ _tableView.allowsMultipleSelection = NO;
+ _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+ _tableView.delegate = self;
+ _tableView.dataSource = self;
+ _tableView.userInteractionEnabled = YES;
+}
+
+- (void)setContentSize:(CGSize)contentSize
+{
+ // Do Nothing
+}
+
+- (NSUInteger)childrenCountForScrollerLayout
+{
+ return [super childrenCountForScrollerLayout] - _cellComponents.count;
+}
+
+#pragma mark - Inheritance
+
+- (void)_insertSubcomponent:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ [super _insertSubcomponent:subcomponent atIndex:index];
+
+ if ([subcomponent isKindOfClass:[WXCellComponent class]]) {
+ WXCellComponent *cellComponent = (WXCellComponent *)subcomponent;
+ cellComponent.list = self;
+
+ NSInteger insertIndex = index;
+ for (int j = 0; j <= index && j < self.subcomponents.count; j++) {
+ WXComponent *child = self.subcomponents[j];
+ if (![child isKindOfClass:[WXCellComponent class]]) {
+ insertIndex--;
+ }
+ }
+
+ cellComponent.indexPath = [NSIndexPath indexPathForRow:insertIndex inSection:0];
+ [_cellComponents insertObject:subcomponent atIndex:insertIndex];
+ }
+}
+
+
+- (void)insertSubview:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ //List View insert cell's view by - cellForRowAtIndexPath:, so here will not insert cell's view again
+ if (![subcomponent isKindOfClass:[WXCellComponent class]]) {
+ [super insertSubview:subcomponent atIndex:index];
+ }
+}
+
+- (void)cellWillRemove:(WXCellComponent *)cell
+{
+ WXAssertComponentThread();
+
+ [_cellComponents removeObject:cell];
+}
+
+- (void)cellDidRemove:(WXCellComponent *)cell
+{
+ WXAssertMainThread();
+
+ NSIndexPath *indexPath = cell.indexPath;
+ WXAssert(indexPath, @"Removing cell:%@ has not been inserted to cell list before", cell);
+
+ [_completedCells removeObject:cell];
+
+ [UIView performWithoutAnimation:^{
+ [_tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
+ }];
+}
+
+- (void)cellDidLayout:(WXCellComponent *)cell
+{
+ WXAssertMainThread();
+
+ NSIndexPath *indexPath = cell.indexPath;
+ WXAssert(indexPath, @"Laid out cell:%@ has not been inserted to cell list before", cell);
+
+ if (indexPath.row == 0) {
+ cell.absolutePosition = CGPointZero;
+ } else {
+ WXCellComponent *previousCell = _cellComponents[indexPath.row - 1];
+ CGPoint previousCellPostion = previousCell.absolutePosition;
+ cell.absolutePosition = CGPointMake(previousCellPostion.x, previousCellPostion.y + previousCell.calculatedFrame.size.height);
+ }
+
+ [cell _fillAbsolutePositions];
+
+ if (![_completedCells containsObject:cell]) {
+ [_completedCells addObject:cell];
+ WXLogVerbose(@"Insert cell at row:%ld", (long)indexPath.row);
+ [UIView performWithoutAnimation:^{
+ [_tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
+ }];
+ } else {
+ WXLogVerbose(@"Reload cell at row:%ld", (long)indexPath.row);
+ [UIView performWithoutAnimation:^{
+ [_tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
+ }];
+ }
+}
+
+- (void)cellDidRendered:(WXCellComponent *)cell
+{
+ WXAssertMainThread();
+
+ NSIndexPath *indexPath = cell.indexPath;
+ WXAssert(indexPath, @"Rendered cell:%@ has not been inserted to cell list before", cell);
+
+ CGRect cellRect = [_tableView rectForRowAtIndexPath:indexPath];
+ if (cellRect.origin.y + cellRect.size.height >= _tableView.frame.size.height) {
+ if (self.weexInstance.screenRenderTime == 0) {
+ self.weexInstance.screenRenderTime = [[NSDate new] timeIntervalSinceDate:self.weexInstance.renderStartDate];
+ }
+ }
+
+ if (self.weexInstance.onRenderProgress) {
+ CGRect renderRect = CGRectMake(self.absolutePosition.x + cellRect.origin.x,
+ self.absolutePosition.y + cellRect.origin.y,
+ cellRect.size.width, cellRect.size.height);
+
+ self.weexInstance.onRenderProgress(renderRect);
+ }
+
+}
+
+- (void)cell:(WXCellComponent *)cell didMoveFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
+{
+ WXAssert(fromIndexPath, @"Moved cell:%@ has not been inserted to cell list before", cell);
+
+ [UIView performWithoutAnimation:^{
+ [_tableView moveRowAtIndexPath:fromIndexPath toIndexPath:toIndexPath];
+ }];
+}
+
+#pragma mark - TableView delegate
+
+- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
+{
+
+}
+
+- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ NSArray *visibleIndexPaths = [tableView indexPathsForVisibleRows];
+ if (![visibleIndexPaths containsObject:indexPath]) {
+ WXCellComponent *component = [_cellComponents wx_safeObjectAtIndex:indexPath.row];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [component _unloadView];
+ });
+ }
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ WXCellComponent *cell = _cellComponents[indexPath.row];
+ return cell.calculatedFrame.size.height;
+}
+
+#pragma mark - TableView Data Source
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return [_completedCells count];
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ static NSString *reuseIdentifier = @"WXTableViewCell";
+
+ WXCellComponent *cell = _cellComponents[indexPath.row];
+ if (cell.scope.length > 0) {
+ // reuseIdentifier = cell.scope;
+ }
+
+ UITableViewCell *cellView = [_tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
+ if (!cellView) {
+ cellView = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
+ cellView.backgroundColor = [UIColor clearColor];
+ } else {
+ }
+
+ if (cell.view.superview == cellView.contentView) {
+ return cellView;
+ }
+
+ for (UIView *view in cellView.contentView.subviews) {
+ [view removeFromSuperview];
+ }
+
+ [cellView.contentView addSubview:cell.view];
+
+ double time = -[self.weexInstance.renderStartDate timeIntervalSinceNow] * 1000;
+ WXLogInfo(@"View Create Finish...%ld, %f", (long)indexPath.row, time);
+
+ return cellView;
+}
+
+#pragma mark - Load More Event
+
+- (void)setLoadmoreretry:(NSUInteger)loadmoreretry
+{
+ if (loadmoreretry > self.loadmoreretry) {
+ _previousLoadMoreRowNumber = 0;
+ }
+
+ [super setLoadmoreretry:loadmoreretry];
+}
+
+- (void)loadMore
+{
+ [super loadMore];
+ _previousLoadMoreRowNumber = [self tableView:_tableView numberOfRowsInSection:0];
+}
+
+- (BOOL)isNeedLoadMore
+{
+ BOOL superNeedLoadMore = [super isNeedLoadMore];
+ return superNeedLoadMore && _previousLoadMoreRowNumber != [self tableView:_tableView numberOfRowsInSection:0];
+}
+
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.h
new file mode 100644
index 0000000..6a78b04
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.h
@@ -0,0 +1,17 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXLoadingComponent : WXComponent
+
+- (void)resizeFrame;
+- (void)loading;
+- (BOOL)displayState;
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.m
new file mode 100644
index 0000000..78006ef
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.m
@@ -0,0 +1,137 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXLoadingComponent.h"
+#import "WXScrollerComponent.h"
+#import "WXLoadingIndicator.h"
+#import "WXComponent_internal.h"
+#import "WXLog.h"
+
+@interface WXLoadingComponent()
+
+@property (nonatomic) BOOL initFinished;
+@property (nonatomic) BOOL loadingEvent;
+@property (nonatomic) BOOL displayState;
+
+@property (nonatomic, weak) WXLoadingIndicator *indicator;
+
+@end
+
+@implementation WXLoadingComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ if (attributes[@"display"]) {
+ if ([attributes[@"display"] isEqualToString:@"show"]) {
+ _displayState = YES;
+ } else if ([attributes[@"display"] isEqualToString:@"hide"]){
+ _displayState = NO;
+ } else {
+ WXLogError(@"");
+ }
+ }
+ self.cssNode->style.position_type = CSS_POSITION_ABSOLUTE;
+ }
+ return self;
+}
+
+- (void)viewWillUnload
+{
+ _displayState = NO;
+ _loadingEvent = NO;
+ _initFinished = NO;
+}
+
+-(void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"display"]) {
+ if ([attributes[@"display"] isEqualToString:@"show"]) {
+ _displayState = YES;
+
+ } else if ([attributes[@"display"] isEqualToString:@"hide"]) {
+ _displayState = NO;
+ } else {
+ WXLogError(@"");
+ }
+ [self setDisplay];
+ }
+}
+
+- (void)viewDidLoad
+{
+ _initFinished = YES;
+}
+
+- (void)addEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"loading"]) {
+ _loadingEvent = YES;
+ }
+}
+
+- (void)removeEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"loading"]) {
+ _loadingEvent = NO;
+ }
+}
+
+- (void)loading
+{
+ if (!_loadingEvent)
+ return;
+
+ [self fireEvent:@"loading" params:nil];
+}
+
+- (void)setDisplay
+{
+ id<WXScrollerProtocol> scrollerProtocol = self.ancestorScroller;
+ if (scrollerProtocol == nil || !_initFinished)
+ return;
+
+ WXComponent *scroller = (WXComponent*)scrollerProtocol;
+ CGPoint contentOffset = [scrollerProtocol contentOffset];
+ if (_displayState) {
+ contentOffset.y = [scrollerProtocol contentSize].height - scroller.calculatedFrame.size.height + self.view.frame.size.height;
+ [scrollerProtocol setContentOffset:contentOffset animated:YES];
+ [_indicator start];
+ } else {
+ UIEdgeInsets insets = [scrollerProtocol contentInset];
+ insets.bottom = 0;
+
+ [scrollerProtocol setContentInset:insets];
+ [_indicator stop];
+ }
+}
+
+- (void)_insertSubcomponent:(WXComponent *)subcomponent atIndex:(NSInteger)index
+{
+ if (subcomponent) {
+ [super _insertSubcomponent:subcomponent atIndex:index];
+ if ([subcomponent isKindOfClass:[WXLoadingIndicator class]]) {
+ _indicator = (WXLoadingIndicator*)subcomponent;
+ }
+ }
+}
+
+- (void)resizeFrame
+{
+ CGRect rect = self.view.frame;
+
+ id<WXScrollerProtocol> scrollerProtocol = self.ancestorScroller;
+ if (scrollerProtocol) {
+ rect.origin.y = [scrollerProtocol contentSize].height;
+ }
+
+ [self.view setFrame:rect];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.h b/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.h
new file mode 100644
index 0000000..8cc9990
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.h
@@ -0,0 +1,17 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXLoadingIndicator : WXComponent
+
+- (void)start;
+- (void)stop;
+- (void)setFrame:(CGRect)frame;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.m b/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.m
new file mode 100644
index 0000000..16af357
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXLoadingIndicator.m
@@ -0,0 +1,78 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXLoadingIndicator.h"
+#import "WXConvert.h"
+
+@interface WXLoadingIndicator()
+
+@property (nonatomic, strong) UIActivityIndicatorView* indicator;
+
+@end
+
+@implementation WXLoadingIndicator
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance {
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ _indicator = [[UIActivityIndicatorView alloc] init];
+ if (styles[@"color"]) {
+ [self setColor:[WXConvert UIColor:styles[@"color"]]];
+ }
+ }
+
+ return self;
+}
+
+- (void)updateStyles:(NSDictionary *)styles
+{
+ if (styles[@"color"]) {
+ [self setColor:[WXConvert UIColor:styles[@"color"]]];
+ }
+}
+
+- (UIView *)loadView
+{
+ return _indicator;
+}
+
+#pragma mark - lifeCircle
+- (void)viewWillUnload
+{
+ [_indicator stopAnimating];
+ _indicator = nil;
+
+}
+
+- (void)viewDidLoad
+{
+ [self setFrame:self.calculatedFrame];
+}
+
+- (void)setColor:(UIColor *)color
+{
+ _indicator.color = color;
+}
+
+- (void)start
+{
+ [_indicator startAnimating];
+}
+
+- (void)stop
+{
+ [_indicator stopAnimating];
+}
+
+- (void)setFrame:(CGRect)frame
+{
+ [_indicator setFrame:frame];
+}
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.h
new file mode 100644
index 0000000..46275f5
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.h
@@ -0,0 +1,17 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXRefreshComponent : WXComponent
+
+- (void)refresh;
+
+- (BOOL)displayState;
+
+@end
[12/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.m b/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.m
new file mode 100644
index 0000000..4948839
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Module/WXWebViewModule.m
@@ -0,0 +1,70 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXWebViewModule.h"
+#import "WXWebComponent.h"
+#import "WXSDKManager.h"
+#import "WXSDKInstance_private.h"
+
+@implementation WXWebViewModule
+
+@synthesize weexInstance;
+
+WX_EXPORT_METHOD(@selector(notifyWebview:data:))
+WX_EXPORT_METHOD(@selector(reload:))
+WX_EXPORT_METHOD(@selector(goBack:))
+WX_EXPORT_METHOD(@selector(goForward:))
+
+- (void)performBlockWithWebView:(NSString *)elemRef block:(void (^)(WXWebComponent *))block {
+ if (!elemRef) {
+ return;
+ }
+
+ __weak typeof(self) weakSelf = self;
+
+ WXPerformBlockOnComponentThread(^{
+ WXWebComponent *webview = (WXWebComponent *)[weakSelf.weexInstance componentForRef:elemRef];
+ if (!webview) {
+ return;
+ }
+
+ [weakSelf performSelectorOnMainThread:@selector(doBlock:) withObject:^() {
+ block(webview);
+ } waitUntilDone:NO];
+ });
+}
+
+- (void)doBlock:(void (^)())block {
+ block();
+}
+
+- (void)notifyWebview:(NSString *)elemRef data:(NSDictionary *)data {
+ [self performBlockWithWebView:elemRef block:^void (WXWebComponent *webview) {
+ [webview notifyWebview:data];
+ }];
+}
+
+- (void)reload:(NSString *)elemRef {
+ [self performBlockWithWebView:elemRef block:^void (WXWebComponent *webview) {
+ [webview reload];
+ }];
+}
+
+- (void)goBack:(NSString *)elemRef {
+ [self performBlockWithWebView:elemRef block:^void (WXWebComponent *webview) {
+ [webview goBack];
+ }];
+}
+
+- (void)goForward:(NSString *)elemRef {
+ [self performBlockWithWebView:elemRef block:^void (WXWebComponent *webview) {
+ [webview goForward];
+ }];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h
new file mode 100644
index 0000000..73cb34f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h
@@ -0,0 +1,26 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleProtocol.h"
+
+#define BIZTYPE @"bizType"
+#define PAGENAME @"pageName"
+#define WXSDKVERSION @"WXSDKVersion"
+#define JSLIBINITTIME @"JSLibInitTime"
+#define NETWORKTIME @"networkTime"
+#define COMMUNICATETIME @"communicateTime"
+#define SCREENRENDERTIME @"screenRenderTime"
+#define TOTALTIME @"totalTime"
+
+@protocol WXAppMonitorProtocol <WXModuleProtocol>
+
+- (void)commitAppMonitorArgs:(NSDictionary *)args;
+
++ (void)commitAppMonitorAlarm:(NSString *)pageName monitorPoint:(NSString *)monitorPoint success:(BOOL)success errorCode:(NSString *)errorCode errorMsg:(NSString *)errorMsg arg:(NSString *)arg;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h
new file mode 100644
index 0000000..cd52578
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h
@@ -0,0 +1,25 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <JavaScriptCore/JavaScriptCore.h>
+
+typedef void (^WXJSCallNative)(NSString *instance, NSArray *tasks, NSString *callback);
+
+@protocol WXBridgeProtocol <NSObject>
+
+@property (nonatomic, readonly) JSValue* exception;
+
+- (void)executeJSFramework:(NSString *)frameworkScript;
+
+- (void)callJSMethod:(NSString *)method args:(NSArray*)args;
+
+- (void)registerCallNative:(WXJSCallNative)callNative;
+
+- (void)resetEnvironment;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXDestroyProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXDestroyProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXDestroyProtocol.h
new file mode 100644
index 0000000..d82faf4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXDestroyProtocol.h
@@ -0,0 +1,18 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@protocol WXDestroyProtocol <NSObject>
+
+/**
+ * @abstract execute unload function before dealloc
+ */
+- (void)unload;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXEventModuleProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXEventModuleProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXEventModuleProtocol.h
new file mode 100644
index 0000000..d4d91fd
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXEventModuleProtocol.h
@@ -0,0 +1,15 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleProtocol.h"
+
+@protocol WXEventModuleProtocol<WXModuleProtocol>
+
+- (void)openURL:(NSString *)url;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXImgLoaderProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXImgLoaderProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXImgLoaderProtocol.h
new file mode 100644
index 0000000..09f4426
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXImgLoaderProtocol.h
@@ -0,0 +1,36 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleProtocol.h"
+#import "WXType.h"
+
+@protocol WXImageOperationProtocol <NSObject>
+
+- (void)cancel;
+
+@end
+
+@protocol WXImgLoaderProtocol <WXModuleProtocol>
+
+/**
+ * @abstract Creates a image download handler with a given URL
+ *
+ * @param imageUrl The URL of the image to download
+ *
+ * @param imageFrame The frame of the image you want to set
+ *
+ * @param options : The options to be used for this download
+ *
+ * @param completedBlock : A block called once the download is completed.
+ * image : the image which has been download to local.
+ * error : the error which has happened in download.
+ * finished : a Boolean value indicating whether download action has finished.
+ */
+- (id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)options completed:(void(^)(UIImage *image, NSError *error, BOOL finished))completedBlock;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXModuleProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXModuleProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXModuleProtocol.h
new file mode 100644
index 0000000..726866b
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXModuleProtocol.h
@@ -0,0 +1,47 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import "WXDefine.h"
+#import "WXSDKInstance.h"
+
+@protocol WXModuleProtocol <NSObject>
+
+/**
+ * @abstract the module callback , result can be string or dictionary.
+ */
+typedef void (^WXModuleCallback)(id result);
+
+/**
+ * @abstract export public method
+ */
+
+#define WX_EXPORT_METHOD(method) \
++ (NSString *)WX_CONCAT_WRAPPER(wx_export_method_, __LINE__) { \
+ return NSStringFromSelector(method); \
+}
+
+@optional
+
+/**
+ * @abstract Returns the execute thread for this target
+ *
+ * @return a NSThread Object
+ *
+ * @discussion the implementation of this interface is optional. If you want to execute module actions in the special thread, you can create a new
+ * one.
+ *
+ */
+- (NSThread *)targetExecuteThread;
+
+/**
+ * @abstract the instance bind to this module. It helps you to get many useful properties related to the instance.
+ */
+@property (nonatomic, weak) WXSDKInstance *weexInstance;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXNavigationProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXNavigationProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXNavigationProtocol.h
new file mode 100644
index 0000000..ce062a3
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXNavigationProtocol.h
@@ -0,0 +1,143 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleProtocol.h"
+
+#define MSG_SUCCESS @"WX_SUCCESS"
+#define MSG_NO_HANDLER @"WX_NO_HANDLER"
+#define MSG_NO_PERMIT @"WX_NO_PERMISSION"
+#define MSG_FAILED @"WX_FAILED"
+#define MSG_PARAM_ERR @"WX_PARAM_ERR"
+#define MSG_EXP @"WX_EXCEPTION"
+
+/**
+ * This enum is used to define the position of navbar item.
+ */
+typedef NS_ENUM(NSInteger, WXNavigationItemPosition) {
+ WXNavigationItemPositionCenter = 0x00,
+ WXNavigationItemPositionRight,
+ WXNavigationItemPositionLeft,
+ WXNavigationItemPositionMore
+};
+
+/**
+ * @abstract The callback after executing navigator operations. The code has some status such as 'WX_SUCCESS'\u3001'WX_FAILED' etc. The responseData
+ * contains some useful info you can handle.
+ */
+typedef void (^WXNavigationResultBlock)(NSString *code, NSDictionary * responseData);
+
+@protocol WXNavigationProtocol <WXModuleProtocol>
+
+/**
+ * @abstract Returns the navigation controller.
+ *
+ * @param container The target controller.
+ */
+- (id)navigationControllerOfContainer:(UIViewController *)container;
+
+/**
+ * @abstract Sets the navigation bar hidden.
+ *
+ * @param hidden If YES, the navigation bar is hidden.
+ *
+ * @param animated Specify YES to animate the transition or NO if you do not want the transition to be animated.
+ *
+ * @param container The navigation controller.
+ *
+ */
+- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated
+ withContainer:(UIViewController *)container;
+
+/**
+ * @abstract Sets the background color of navigation bar.
+ *
+ * @param backgroundColor The background color of navigation bar.
+ *
+ * @param container The target controller.
+ *
+ */
+- (void)setNavigationBackgroundColor:(UIColor *)backgroundColor
+ withContainer:(UIViewController *)container;
+
+/**
+ * @abstract Sets the item in navigation bar.
+ *
+ * @param param The data which is passed to the implementation of the protocol.
+ *
+ * @param position The value indicates the position of item.
+ *
+ * @param block A block called once the action is completed.
+ *
+ * @param container The target controller.
+ *
+ */
+- (void)setNavigationItemWithParam:(NSDictionary *)param
+ position:(WXNavigationItemPosition)position
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container;
+
+/**
+ * @abstract Clears the item in navigation bar.
+ *
+ * @param param The data which is passed to the implementation of the protocol.
+ *
+ * @param position The value indicates the position of item.
+ *
+ * @param block A block called once the action is completed.
+ *
+ * @param container The target controller.
+ *
+ */
+- (void)clearNavigationItemWithParam:(NSDictionary *)param
+ position:(WXNavigationItemPosition)position
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container;
+
+/**
+ * @abstract Pushes a view controller onto the receiver\u2019s stack.
+ *
+ * @param param The data which is passed to the implementation of the protocol.
+ *
+ * @param block A block called once the action is completed.
+ *
+ * @param container The target controller.
+ *
+ */
+- (void)pushViewControllerWithParam:(NSDictionary *)param
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container;
+
+/**
+ * @abstract Pops the top view controller from the navigation stack.
+ *
+ * @param param The data which is passed to the implementation of the protocol.
+ *
+ * @param block A block called once the action is completed.
+ *
+ * @param container The target controller.
+ *
+ */
+- (void)popViewControllerWithParam:(NSDictionary *)param
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container;
+
+/**
+ * @abstract Pops all the view controllers on the stack except the root view controller.
+ *
+ * @param param The data which is passed to the implementation of the protocol.
+ *
+ * @param block A block called once the action is completed.
+ *
+ * @param container The target controller.
+ *
+ */
+- (void)popToRootViewControllerWithParam:(NSDictionary *)param
+ completion:(WXNavigationResultBlock)block
+ withContainer:(UIViewController *)container;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXNetworkProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXNetworkProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXNetworkProtocol.h
new file mode 100644
index 0000000..336a1d2
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXNetworkProtocol.h
@@ -0,0 +1,32 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WXModuleProtocol.h>
+
+@protocol WXNetworkProtocol <NSObject>
+
+/**
+ * @abstract send request
+ *
+ * @param request The URL Request
+ *
+ * @param sendDataCallback This block is called periodically to notify the progress.
+ *
+ * @param responseCallback This block is called when receiving a response and no further messages will be received until the completion block is called.
+ *
+ * @param receiveDataCallback This block is called when data is available.
+ *
+ * @param compeletionCallback This block is called when the last message related to a specific task is sent.
+ */
+- (id)sendRequest:(NSURLRequest *)request withSendingData:(void (^)(int64_t bytesSent, int64_t totalBytes))sendDataCallback
+ withResponse:(void (^)(NSURLResponse *response))responseCallback
+ withReceiveData:(void (^)(NSData *data))receiveDataCallback
+ withCompeletion:(void (^)(NSData *totalData, NSError *error))compeletionCallback;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXScrollerProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXScrollerProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXScrollerProtocol.h
new file mode 100644
index 0000000..adae1f4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXScrollerProtocol.h
@@ -0,0 +1,56 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+@class WXComponent;
+@protocol WXScrollerProtocol <NSObject>
+
+/**
+ * @abstract add sticky component
+ */
+- (void)addStickyComponent:(WXComponent *)sticky;
+
+/**
+ * @abstract remove sticky component
+ */
+- (void)removeStickyComponent:(WXComponent *)sticky;
+
+/**
+ * @abstract adjust sticky components
+ */
+- (void)adjustSticky;
+
+/**
+ * @abstract add scroll listener
+ */
+- (void)addScrollToListener:(WXComponent *)target;
+
+/**
+ * @abstract remove scroll listener
+ */
+- (void)removeScrollToListener:(WXComponent *)target;
+
+- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset;
+
+- (BOOL)isNeedLoadMore;
+
+- (void)loadMore;
+
+- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;
+
+- (CGPoint) contentOffset;
+
+- (CGSize) contentSize;
+
+- (void)setContentSize:(CGSize)size;
+
+- (UIEdgeInsets) contentInset;
+
+- (void) setContentInset:(UIEdgeInsets)contentInset;
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Protocol/WXTextComponentProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXTextComponentProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXTextComponentProtocol.h
new file mode 100644
index 0000000..823bae0
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXTextComponentProtocol.h
@@ -0,0 +1,15 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+@protocol WXTextComponentProtocol
+
+@property (nonatomic, strong) NSTextStorage *textStorage;
+@property (nonatomic, assign) UIEdgeInsets border;
+@property (nonatomic, assign) UIEdgeInsets padding;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Supporting Files/WeexSDK-Prefix.pch
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Supporting Files/WeexSDK-Prefix.pch b/ios/sdk/WeexSDK/Sources/Supporting Files/WeexSDK-Prefix.pch
new file mode 100644
index 0000000..5b3dab0
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Supporting Files/WeexSDK-Prefix.pch
@@ -0,0 +1,11 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+ #import "WXDefine.h"
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.h b/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.h
new file mode 100644
index 0000000..7df7e26
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.h
@@ -0,0 +1,23 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface NSArray (Weex)
+
+- (id)wx_safeObjectAtIndex:(NSUInteger)index;
+
+@end
+
+@interface NSMutableArray (Weex)
+
++ (id)wx_mutableArrayUsingWeakReferences;
+
++ (id)wx_mutableArrayUsingWeakReferencesWithCapacity:(NSUInteger)capacity;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.m b/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.m
new file mode 100644
index 0000000..68d53b4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/NSArray+Weex.m
@@ -0,0 +1,37 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "NSArray+Weex.h"
+
+@implementation NSArray (Weex)
+
+- (id)wx_safeObjectAtIndex:(NSUInteger)index
+{
+ if (index >= self.count) {
+ return nil;
+ }
+
+ return [self objectAtIndex:index];
+}
+
+@end
+
+@implementation NSMutableArray (Weex)
+
+// It's quite ingenius, using a Category to allow the creation of a mutable array that does no retain/release by backing it with a CFArray with proper callbacks.http://stackoverflow.com/questions/4692161/non-retaining-array-for-delegates
++ (id)wx_mutableArrayUsingWeakReferences {
+ return [self wx_mutableArrayUsingWeakReferencesWithCapacity:0];
+}
+
++ (id)wx_mutableArrayUsingWeakReferencesWithCapacity:(NSUInteger)capacity {
+ CFArrayCallBacks callbacks = {0, NULL, NULL, CFCopyDescription, CFEqual};
+ // We create a weak reference array
+ return (__bridge id)(CFArrayCreateMutable(0, capacity, &callbacks));
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.h b/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.h
new file mode 100644
index 0000000..b6080d2
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.h
@@ -0,0 +1,17 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface NSTimer (Weex)
+
++ (NSTimer *)wx_scheduledTimerWithTimeInterval:(NSTimeInterval)interval
+ block:(void(^)())block
+ repeats:(BOOL)repeats;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.m b/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.m
new file mode 100644
index 0000000..65d46b5
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/NSTimer+Weex.m
@@ -0,0 +1,32 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "NSTimer+Weex.h"
+
+@implementation NSTimer (Weex)
+
++ (NSTimer *)wx_scheduledTimerWithTimeInterval:(NSTimeInterval)interval
+ block:(void(^)())block
+ repeats:(BOOL)repeats
+{
+ return [self scheduledTimerWithTimeInterval:interval
+ target:self
+ selector:@selector(blockInvoke:)
+ userInfo:[block copy]
+ repeats:repeats];
+}
+
++ (void)blockInvoke:(NSTimer*)timer
+{
+ void (^block)() = timer.userInfo;
+ if (block) {
+ block();
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.h b/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.h
new file mode 100644
index 0000000..09a878b
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.h
@@ -0,0 +1,37 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WXAppConfiguration : NSObject
+
+/**
+ * @abstract Group or organization of your app, default value is nil.
+ */
++ (NSString *)appGroup;
++ (void)setAppGroup:(NSString *) appGroup;
+
+/**
+ * @abstract Name of your app, default is value for CFBundleDisplayName in main bundle.
+ */
++ (NSString *)appName;
++ (void)setAppName:(NSString *)appName;
+
+/**
+ * @abstract Version of your app, default is value for CFBundleShortVersionString in main bundle.
+ */
++ (NSString *)appVersion;
++ (void)setAppVersion:(NSString *)appVersion;
+
+/**
+ * @abstract External user agent of your app, all requests sent by weex will set the user agent on header, default value is nil.
+ */
++ (NSString *)externalUserAgent;
++ (void)setExternalUserAgent:(NSString *)userAgent;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.m b/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.m
new file mode 100644
index 0000000..90767f3
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXAppConfiguration.m
@@ -0,0 +1,72 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXAppConfiguration.h"
+
+@interface WXAppConfiguration ()
+
+@property (nonatomic, strong) NSString * appGroup;
+@property (nonatomic, strong) NSString * appName;
+@property (nonatomic, strong) NSString * appVersion;
+@property (nonatomic, strong) NSString * externalUA;
+
+@end
+
+@implementation WXAppConfiguration
+
++ (instancetype)sharedConfiguration
+{
+ static id _sharedInstance = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedInstance = [[self alloc] init];
+ });
+ return _sharedInstance;
+}
+
++ (NSString *)appGroup
+{
+ return [WXAppConfiguration sharedConfiguration].appGroup;
+}
+
++ (void)setAppGroup:(NSString *)appGroup
+{
+ [WXAppConfiguration sharedConfiguration].appGroup = appGroup;
+}
+
++ (NSString *)appName
+{
+ return [WXAppConfiguration sharedConfiguration].appName ?: [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
+}
+
++ (void)setAppName:(NSString *)appName
+{
+ [WXAppConfiguration sharedConfiguration].appName = appName;
+}
+
++ (NSString *)appVersion
+{
+ return [WXAppConfiguration sharedConfiguration].appVersion ?: [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
+}
+
++ (void)setAppVersion:(NSString *)appVersion
+{
+ [WXAppConfiguration sharedConfiguration].appVersion = appVersion;
+}
+
++ (NSString *)externalUserAgent
+{
+ return [WXAppConfiguration sharedConfiguration].externalUA;
+}
+
++ (void)setExternalUserAgent:(NSString *)userAgent
+{
+ [WXAppConfiguration sharedConfiguration].externalUA = userAgent;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h b/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h
new file mode 100644
index 0000000..e61b113
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h
@@ -0,0 +1,61 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXDefine.h"
+
+void WXAssertIntenal(NSString *func, NSString *file, int lineNum, NSString *format, ...);
+
+#if DEBUG
+#define WXAssert(condition, ...) \
+do{\
+ if(!(condition)){\
+ WXAssertIntenal(@(__func__), @(__FILE__), __LINE__, __VA_ARGS__);\
+ }\
+}while(0)
+#else
+#define WXAssert(condition, ...)
+#endif
+
+/**
+ * @abstract macro for asserting that a parameter is required.
+ */
+#define WXAssertParam(name) WXAssert(name, \
+@"the parameter '%s' is required", #name)
+
+/**
+ * @abstract macro for asserting if the handler conforms to the protocol
+ */
+#define WXAssertProtocol(handler, protocol) WXAssert([handler conformsToProtocol:protocol], \
+@"handler does not conform to protocol")
+
+/**
+ * @abstract macro for asserting that the object is kind of special class.
+ */
+#define WXAssertClass(name,className) WXAssert([name isKindOfClass:[className class]], \
+@"the variable '%s' is not a kind of '%s' class", #name,#className)
+
+/**
+ * @abstract macro for asserting that we are running on the main thread.
+ */
+#define WXAssertMainThread() WXAssert([NSThread isMainThread], \
+@"must be called on the main thread")
+
+/**
+ * @abstract macro for asserting that we are running on the component thread.
+ */
+#define WXAssertComponentThread() \
+WXAssert([[NSThread currentThread].name isEqualToString:WX_COMPONENT_THREAD_NAME], \
+@"must be called on the component thread")
+
+/**
+ * @abstract macro for asserting that we are running on the bridge thread.
+ */
+#define WXAssertBridgeThread() \
+WXAssert([[NSThread currentThread].name isEqualToString:WX_BRIDGE_THREAD_NAME], \
+@"must be called on the bridge thread")
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXAssert.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXAssert.m b/ios/sdk/WeexSDK/Sources/Utility/WXAssert.m
new file mode 100644
index 0000000..2655434
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXAssert.m
@@ -0,0 +1,21 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXAssert.h"
+#import "WXLog.h"
+
+void WXAssertIntenal(NSString *func, NSString *file, int lineNum, NSString *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
+ va_end(args);
+
+ WXLogError(@"%@", message);
+ [[NSAssertionHandler currentHandler] handleFailureInFunction:func file:file lineNumber:lineNum description:format, message];
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h
new file mode 100644
index 0000000..ece51e7
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h
@@ -0,0 +1,58 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+#import <objc/runtime.h>
+#import "WXLog.h"
+#import "Layout.h"
+#import "WXType.h"
+
+@interface WXConvert : NSObject
+
++ (BOOL)BOOL:(id)value;
++ (CGFloat)CGFloat:(id)value;
++ (NSUInteger)NSUInteger:(id)value;
++ (NSInteger)NSInteger:(id)value;
++ (NSString *)NSString:(id)value;
+
+/**
+ * 750px Adaptive
+ */
+typedef CGFloat WXPixelType;
++ (WXPixelType)WXPixelType:(id)value;
+
++ (css_flex_direction_t)css_flex_direction_t:(id)value;
++ (css_align_t)css_align_t:(id)value;
++ (css_wrap_type_t)css_wrap_type_t:(id)value;
++ (css_justify_t)css_justify_t:(id)value;
++ (css_position_type_t)css_position_type_t:(id)value;
+
++ (UIViewContentMode)UIViewContentMode:(id)value;
++ (WXImageQuality)WXImageQuality:(id)value;
++ (WXImageSharp)WXImageSharp:(id)value;
+
++ (UIColor *)UIColor:(id)value;
++ (CGColorRef)CGColor:(id)value;
++ (WXBorderStyle)WXBorderStyle:(id)value;
+typedef BOOL WXClipType;
++ (WXClipType)WXClipType:(id)value;
++ (WXPositionType)WXPositionType:(id)value;
+
++ (WXTextStyle)WXTextStyle:(id)value;
++ (WXTextWeight)WXTextWeight:(id)value;
++ (WXTextDecoration)WXTextDecoration:(id)value;
++ (NSTextAlignment)NSTextAlignment:(id)value;
+
++ (WXScrollDirection)WXScrollDirection:(id)value;
+
++ (UIViewAnimationOptions)UIViewAnimationTimingFunction:(id)value;
++ (CAMediaTimingFunction *)CAMediaTimingFunction:(id)value;
+
++ (WXVisibility)WXVisibility:(id)value;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m
new file mode 100644
index 0000000..dd4d8eb
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m
@@ -0,0 +1,622 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXConvert.h"
+#import "WXUtility.h"
+
+@implementation WXConvert
+
+#pragma mark Number & String & Collection
+
+#define WX_NUMBER_CONVERT(type, op) \
++ (type)type:(id)value {\
+ if([value respondsToSelector:@selector(op)]){\
+ return (type)[value op];\
+ } else {\
+ WXLogError(@"Convert Error:%@ not respond selector:%@", value, @#op);\
+ }\
+ return 0;\
+}
+
+WX_NUMBER_CONVERT(BOOL, boolValue)
+WX_NUMBER_CONVERT(int, intValue)
+WX_NUMBER_CONVERT(short, shortValue)
+WX_NUMBER_CONVERT(int64_t, longLongValue)
+WX_NUMBER_CONVERT(uint8_t, unsignedShortValue)
+WX_NUMBER_CONVERT(uint16_t, unsignedIntValue)
+WX_NUMBER_CONVERT(uint32_t, unsignedLongValue)
+WX_NUMBER_CONVERT(uint64_t, unsignedLongLongValue)
+WX_NUMBER_CONVERT(float, floatValue)
+WX_NUMBER_CONVERT(double, doubleValue)
+WX_NUMBER_CONVERT(NSInteger, integerValue)
+WX_NUMBER_CONVERT(NSUInteger, unsignedIntegerValue)
+
++ (CGFloat)CGFloat:(id)value
+{
+ if ([value isKindOfClass:[NSString class]]) {
+ NSString *valueString = (NSString *)value;
+ if ([valueString hasSuffix:@"px"]) {
+ valueString = [valueString substringToIndex:(valueString.length - 2)];
+ }
+ return [valueString doubleValue];
+ }
+
+ return [self double:value];
+}
+
++ (NSString *)NSString:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ return value;
+ } else if([value isKindOfClass:[NSNumber class]]){
+ return [NSString stringWithFormat:@"%f", [value floatValue]];
+ } else {
+ WXLogError(@"Convert Error:%@ can not be converted to string", value);
+ }
+ return nil;
+}
+
++ (WXPixelType)WXPixelType:(id)value
+{
+ CGFloat pixel = [self CGFloat:value];
+
+ return pixel * WXScreenResizeRadio();
+}
+
+#pragma mark CSS Layout
+
++(css_position_type_t)css_position_type_t:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ if ([value isEqualToString:@"absolute"]) {
+ return CSS_POSITION_ABSOLUTE;
+ } else if ([value isEqualToString:@"relative"]) {
+ return CSS_POSITION_RELATIVE;
+ } else if ([value isEqualToString:@"fixed"]) {
+ return CSS_POSITION_ABSOLUTE;
+ } else if ([value isEqualToString:@"sticky"]) {
+ return CSS_POSITION_RELATIVE;
+ }
+ }
+ return CSS_POSITION_RELATIVE;
+}
+
++ (css_flex_direction_t)css_flex_direction_t:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ if ([value isEqualToString:@"column"]) {
+ return CSS_FLEX_DIRECTION_COLUMN;
+ } else if ([value isEqualToString:@"column-reverse"]) {
+ return CSS_FLEX_DIRECTION_COLUMN_REVERSE;
+ } else if ([value isEqualToString:@"row"]) {
+ return CSS_FLEX_DIRECTION_ROW;
+ } else if ([value isEqualToString:@"row-reverse"]) {
+ return CSS_FLEX_DIRECTION_ROW_REVERSE;
+ }
+ }
+ return CSS_FLEX_DIRECTION_COLUMN;
+}
+
++ (css_align_t)css_align_t:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ if ([value isEqualToString:@"stretch"]) {
+ return CSS_ALIGN_STRETCH;
+ } else if ([value isEqualToString:@"flex-start"]) {
+ return CSS_ALIGN_FLEX_START;
+ } else if ([value isEqualToString:@"flex-end"]) {
+ return CSS_ALIGN_FLEX_END;
+ } else if ([value isEqualToString:@"center"]) {
+ return CSS_ALIGN_CENTER;
+ } else if ([value isEqualToString:@"auto"]) {
+ return CSS_ALIGN_AUTO;
+ }
+ }
+
+ return CSS_ALIGN_STRETCH;
+}
+
++ (css_wrap_type_t)css_wrap_type_t:(id)value
+{
+ if([value isKindOfClass:[NSString class]]) {
+ if ([value isEqualToString:@"nowrap"]) {
+ return CSS_NOWRAP;
+ } else if ([value isEqualToString:@"wrap"]) {
+ return CSS_WRAP;
+ }
+ }
+
+ return CSS_NOWRAP;
+}
+
++ (css_justify_t)css_justify_t:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ if ([value isEqualToString:@"flex-start"]) {
+ return CSS_JUSTIFY_FLEX_START;
+ } else if ([value isEqualToString:@"center"]) {
+ return CSS_JUSTIFY_CENTER;
+ } else if ([value isEqualToString:@"flex-end"]) {
+ return CSS_JUSTIFY_FLEX_END;
+ } else if ([value isEqualToString:@"space-between"]) {
+ return CSS_JUSTIFY_SPACE_BETWEEN;
+ } else if ([value isEqualToString:@"space-around"]) {
+ return CSS_JUSTIFY_SPACE_AROUND;
+ }
+ }
+
+ return CSS_JUSTIFY_FLEX_START;
+}
+
+#pragma mark Style
+
++ (UIColor *)UIColor:(id)value
+{
+ // 1. check cache
+ static NSCache *colorCache;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ colorCache = [[NSCache alloc] init];
+ colorCache.countLimit = 64;
+ });
+
+ if ([value isKindOfClass:[NSNull class]]) {
+ return nil;
+ }
+
+ UIColor *color = [colorCache objectForKey:value];
+ if (color) {
+ return color;
+ }
+
+ // Default color is white
+ double red = 255, green = 255, blue = 255, alpha = 1.0;
+
+ if([value isKindOfClass:[NSString class]]){
+ // 2. check if is color keyword or transparent
+ static NSDictionary *knownColors;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ knownColors = @{
+ // https://www.w3.org/TR/css3-color/#svg-color
+ @"aliceblue": @"#f0f8ff",
+ @"antiquewhite": @"#faebd7",
+ @"aqua": @"#00ffff",
+ @"aquamarine": @"#7fffd4",
+ @"azure": @"#f0ffff",
+ @"beige": @"#f5f5dc",
+ @"bisque": @"#ffe4c4",
+ @"black": @"#000000",
+ @"blanchedalmond": @"#ffebcd",
+ @"blue": @"#0000ff",
+ @"blueviolet": @"#8a2be2",
+ @"brown": @"#a52a2a",
+ @"burlywood": @"#deb887",
+ @"cadetblue": @"#5f9ea0",
+ @"chartreuse": @"#7fff00",
+ @"chocolate": @"#d2691e",
+ @"coral": @"#ff7f50",
+ @"cornflowerblue": @"#6495ed",
+ @"cornsilk": @"#fff8dc",
+ @"crimson": @"#dc143c",
+ @"cyan": @"#00ffff",
+ @"darkblue": @"#00008b",
+ @"darkcyan": @"#008b8b",
+ @"darkgoldenrod": @"#b8860b",
+ @"darkgray": @"#a9a9a9",
+ @"darkgrey": @"#a9a9a9",
+ @"darkgreen": @"#006400",
+ @"darkkhaki": @"#bdb76b",
+ @"darkmagenta": @"#8b008b",
+ @"darkolivegreen": @"#556b2f",
+ @"darkorange": @"#ff8c00",
+ @"darkorchid": @"#9932cc",
+ @"darkred": @"#8b0000",
+ @"darksalmon": @"#e9967a",
+ @"darkseagreen": @"#8fbc8f",
+ @"darkslateblue": @"#483d8b",
+ @"darkslategray": @"#2f4f4f",
+ @"darkslategrey": @"#2f4f4f",
+ @"darkturquoise": @"#00ced1",
+ @"darkviolet": @"#9400d3",
+ @"deeppink": @"#ff1493",
+ @"deepskyblue": @"#00bfff",
+ @"dimgray": @"#696969",
+ @"dimgrey": @"#696969",
+ @"dodgerblue": @"#1e90ff",
+ @"firebrick": @"#b22222",
+ @"floralwhite": @"#fffaf0",
+ @"forestgreen": @"#228b22",
+ @"fuchsia": @"#ff00ff",
+ @"gainsboro": @"#dcdcdc",
+ @"ghostwhite": @"#f8f8ff",
+ @"gold": @"#ffd700",
+ @"goldenrod": @"#daa520",
+ @"gray": @"#808080",
+ @"grey": @"#808080",
+ @"green": @"#008000",
+ @"greenyellow": @"#adff2f",
+ @"honeydew": @"#f0fff0",
+ @"hotpink": @"#ff69b4",
+ @"indianred": @"#cd5c5c",
+ @"indigo": @"#4b0082",
+ @"ivory": @"#fffff0",
+ @"khaki": @"#f0e68c",
+ @"lavender": @"#e6e6fa",
+ @"lavenderblush": @"#fff0f5",
+ @"lawngreen": @"#7cfc00",
+ @"lemonchiffon": @"#fffacd",
+ @"lightblue": @"#add8e6",
+ @"lightcoral": @"#f08080",
+ @"lightcyan": @"#e0ffff",
+ @"lightgoldenrodyellow": @"#fafad2",
+ @"lightgray": @"#d3d3d3",
+ @"lightgrey": @"#d3d3d3",
+ @"lightgreen": @"#90ee90",
+ @"lightpink": @"#ffb6c1",
+ @"lightsalmon": @"#ffa07a",
+ @"lightseagreen": @"#20b2aa",
+ @"lightskyblue": @"#87cefa",
+ @"lightslategray": @"#778899",
+ @"lightslategrey": @"#778899",
+ @"lightsteelblue": @"#b0c4de",
+ @"lightyellow": @"#ffffe0",
+ @"lime": @"#00ff00",
+ @"limegreen": @"#32cd32",
+ @"linen": @"#faf0e6",
+ @"magenta": @"#ff00ff",
+ @"maroon": @"#800000",
+ @"mediumaquamarine": @"#66cdaa",
+ @"mediumblue": @"#0000cd",
+ @"mediumorchid": @"#ba55d3",
+ @"mediumpurple": @"#9370db",
+ @"mediumseagreen": @"#3cb371",
+ @"mediumslateblue": @"#7b68ee",
+ @"mediumspringgreen": @"#00fa9a",
+ @"mediumturquoise": @"#48d1cc",
+ @"mediumvioletred": @"#c71585",
+ @"midnightblue": @"#191970",
+ @"mintcream": @"#f5fffa",
+ @"mistyrose": @"#ffe4e1",
+ @"moccasin": @"#ffe4b5",
+ @"navajowhite": @"#ffdead",
+ @"navy": @"#000080",
+ @"oldlace": @"#fdf5e6",
+ @"olive": @"#808000",
+ @"olivedrab": @"#6b8e23",
+ @"orange": @"#ffa500",
+ @"orangered": @"#ff4500",
+ @"orchid": @"#da70d6",
+ @"palegoldenrod": @"#eee8aa",
+ @"palegreen": @"#98fb98",
+ @"paleturquoise": @"#afeeee",
+ @"palevioletred": @"#db7093",
+ @"papayawhip": @"#ffefd5",
+ @"peachpuff": @"#ffdab9",
+ @"peru": @"#cd853f",
+ @"pink": @"#ffc0cb",
+ @"plum": @"#dda0dd",
+ @"powderblue": @"#b0e0e6",
+ @"purple": @"#800080",
+ @"rebeccapurple": @"#663399",
+ @"red": @"#ff0000",
+ @"rosybrown": @"#bc8f8f",
+ @"royalblue": @"#4169e1",
+ @"saddlebrown": @"#8b4513",
+ @"salmon": @"#fa8072",
+ @"sandybrown": @"#f4a460",
+ @"seagreen": @"#2e8b57",
+ @"seashell": @"#fff5ee",
+ @"sienna": @"#a0522d",
+ @"silver": @"#c0c0c0",
+ @"skyblue": @"#87ceeb",
+ @"slateblue": @"#6a5acd",
+ @"slategray": @"#708090",
+ @"slategrey": @"#708090",
+ @"snow": @"#fffafa",
+ @"springgreen": @"#00ff7f",
+ @"steelblue": @"#4682b4",
+ @"tan": @"#d2b48c",
+ @"teal": @"#008080",
+ @"thistle": @"#d8bfd8",
+ @"tomato": @"#ff6347",
+ @"turquoise": @"#40e0d0",
+ @"violet": @"#ee82ee",
+ @"wheat": @"#f5deb3",
+ @"white": @"#ffffff",
+ @"whitesmoke": @"#f5f5f5",
+ @"yellow": @"#ffff00",
+ @"yellowgreen": @"#9acd32",
+
+ // https://www.w3.org/TR/css3-color/#transparent
+ @"transparent": @"rgba(0,0,0,0)",
+ };
+ });
+ NSString *rgba = knownColors[value];
+ if (!rgba) {
+ rgba = value;
+ }
+
+ if ([rgba hasPrefix:@"#"]) {
+ // 3. #rrggbb
+ uint32_t colorValue = 0;
+ sscanf(rgba.UTF8String, "#%x", &colorValue);
+ red = ((colorValue & 0xFF0000) >> 16) / 255.0;
+ green = ((colorValue & 0x00FF00) >> 8) / 255.0;
+ blue = (colorValue & 0x0000FF) / 255.0;
+ } else if ([rgba hasPrefix:@"rgb("]) {
+ // 4. rgb(r,g,b)
+ int r,g,b;
+ sscanf(rgba.UTF8String, "rgb(%d,%d,%d)", &r, &g, &b);
+ red = r / 255.0;
+ green = g / 255.0;
+ blue = b / 255.0;
+ } else if ([rgba hasPrefix:@"rgba("]) {
+ // 5. rgba(r,g,b,a)
+ int r,g,b;
+ sscanf(rgba.UTF8String, "rgba(%d,%d,%d,%lf)", &r, &g, &b, &alpha);
+ red = r / 255.0;
+ green = g / 255.0;
+ blue = b / 255.0;
+ }
+
+ } else if([value isKindOfClass:[NSNumber class]]) {
+ NSUInteger colorValue = [value unsignedIntegerValue];
+ red = ((colorValue & 0xFF0000) >> 16) / 255.0;
+ green = ((colorValue & 0x00FF00) >> 8) / 255.0;
+ blue = (colorValue & 0x0000FF) / 255.0;
+ }
+
+ color = [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
+ // 6. cache color
+ if (color && value) {
+ [colorCache setObject:color forKey:value];
+ }
+
+ return color;
+}
+
++ (CGColorRef)CGColor:(id)value
+{
+ UIColor *color = [self UIColor:value];
+ return [color CGColor];
+}
+
++ (WXBorderStyle)WXBorderStyle:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ if ([value isEqualToString:@"solid"]) {
+ return WXBorderStyleSolid;
+ } else if ([value isEqualToString:@"dotted"]) {
+ return WXBorderStyleDotted;
+ } else if ([value isEqualToString:@"dashed"]) {
+ return WXBorderStyleDashed;
+ }
+ }
+
+ return WXBorderStyleSolid;
+}
+
++ (WXClipType)WXClipType:(id)value
+{
+ if([value isKindOfClass:[NSString class]]) {
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"visible"]) {
+ return NO;
+ } else if ([string isEqualToString:@"hidden"]) {
+ return YES;
+ }
+ }
+
+ return NO;
+}
+
++ (WXPositionType)WXPositionType:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ if ([value isEqualToString:@"relative"]) {
+ return WXPositionTypeRelative;
+ } else if ([value isEqualToString:@"absolute"]) {
+ return WXPositionTypeAbsolute;
+ } else if ([value isEqualToString:@"sticky"]) {
+ return WXPositionTypeSticky;
+ } else if ([value isEqualToString:@"fixed"]) {
+ return WXPositionTypeFixed;
+ }
+ }
+
+ return WXPositionTypeRelative;
+}
+
+#pragma mark Text
+
++ (NSTextAlignment)NSTextAlignment:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"left"])
+ return NSTextAlignmentLeft;
+ else if ([string isEqualToString:@"center"])
+ return NSTextAlignmentCenter;
+ else if ([string isEqualToString:@"right"])
+ return NSTextAlignmentRight;
+ }
+ return NSTextAlignmentNatural;
+}
+
++ (WXTextStyle)WXTextStyle:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"normal"])
+ return WXTextStyleNormal;
+ else if ([string isEqualToString:@"italic"])
+ return WXTextStyleItalic;
+ }
+ return WXTextStyleNormal;
+}
+
++ (WXTextWeight)WXTextWeight:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"normal"])
+ return WXTextWeightNormal;
+ else if ([string isEqualToString:@"bold"])
+ return WXTextWeightBold;
+ }
+ return WXTextWeightNormal;
+}
+
++ (WXTextDecoration)WXTextDecoration:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"none"])
+ return WXTextDecorationNone;
+ else if ([string isEqualToString:@"underline"])
+ return WXTextDecorationUnderline;
+ else if ([string isEqualToString:@"line-through"])
+ return WXTextDecorationLineThrough;
+ }
+ return WXTextDecorationNone;
+}
+
+#pragma mark Image
+
++ (UIViewContentMode)UIViewContentMode:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"cover"])
+ return UIViewContentModeScaleAspectFill;
+ else if ([string isEqualToString:@"contain"])
+ return UIViewContentModeScaleAspectFit;
+ else if ([string isEqualToString:@"stretch"])
+ return UIViewContentModeScaleToFill;
+ }
+ return UIViewContentModeScaleToFill;
+}
+
++ (WXImageQuality)WXImageQuality:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"original"])
+ return WXImageQualityOriginal;
+ else if ([string isEqualToString:@"normal"])
+ return WXImageQualityNormal;
+ else if ([string isEqualToString:@"low"])
+ return WXImageQualityLow;
+ else if ([string isEqualToString:@"high"])
+ return WXImageQualityHigh;
+ }
+
+ return WXImageQualityNormal;
+}
+
++ (WXImageSharp)WXImageSharp:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"sharpen"])
+ return WXImageSharpening;
+ else if ([string isEqualToString:@"unsharpen"])
+ return WXImageSharpeningNone;
+ }
+ return WXImageSharpening;
+}
+
+#pragma mark Scroller
+
++ (WXScrollDirection)WXScrollDirection:(id)value
+{
+ if([value isKindOfClass:[NSString class]]){
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"none"])
+ return WXScrollDirectionNone;
+ else if ([string isEqualToString:@"vertical"])
+ return WXScrollDirectionVertical;
+ else if ([string isEqualToString:@"horizontal"])
+ return WXScrollDirectionHorizontal;
+ }
+ return WXScrollDirectionVertical;
+}
+
+#pragma mark Animation
+
++ (UIViewAnimationOptions)UIViewAnimationTimingFunction:(id)value
+{
+ if (![value isKindOfClass:[NSString class]]) {
+ return UIViewAnimationOptionCurveEaseInOut;
+ }
+
+ static NSDictionary *timingFunctionMapping;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ timingFunctionMapping = @{
+ @"ease-in":@(UIViewAnimationOptionCurveEaseIn),
+ @"ease-out":@(UIViewAnimationOptionCurveEaseOut),
+ @"ease-in-out":@(UIViewAnimationOptionCurveEaseInOut),
+ @"linear":@(UIViewAnimationOptionCurveLinear)
+ };
+ });
+
+ return [timingFunctionMapping[value] unsignedIntegerValue];
+}
+
++ (CAMediaTimingFunction *)CAMediaTimingFunction:(id)value
+{
+ if (![value isKindOfClass:[NSString class]]) {
+ return nil;
+ }
+
+ static NSDictionary *mapping;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ mapping = @{
+ @"ease-in":kCAMediaTimingFunctionEaseIn,
+ @"ease-out":kCAMediaTimingFunctionEaseOut,
+ @"ease-in-out":kCAMediaTimingFunctionEaseInEaseOut,
+ @"linear":kCAMediaTimingFunctionLinear
+ };
+ });
+
+ NSString *timingFunction = mapping[value];
+ if ([timingFunction length] > 0) {
+ return [CAMediaTimingFunction functionWithName:timingFunction];
+ }
+
+ if ([value hasPrefix:@"cubic-bezier"]) {
+ float x1, y1, x2, y2;
+ sscanf(((NSString *)value).UTF8String, "cubic-bezier(%f,%f,%f,%f)", &x1, &y1, &x2, &y2);
+ return [CAMediaTimingFunction functionWithControlPoints:x1 :y1 :x2 :y2];
+ }
+
+ return nil;
+}
+
+#pragma mark Visibility
+
++ (WXVisibility)WXVisibility:(id)value
+{
+ if ([value isKindOfClass:[NSString class]]) {
+ NSString *string = (NSString *)value;
+ if ([string isEqualToString:@"visible"]) {
+ return WXVisibilityShow;
+ } else if ([string isEqualToString:@"hidden"]) {
+ return WXVisibilityHidden;
+ }
+ }
+
+ return WXVisibilityShow;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h b/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
new file mode 100644
index 0000000..071d2ad
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
@@ -0,0 +1,118 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#ifndef __WX_DEFINE_H__
+#define __WX_DEFINE_H__
+
+#define WX_SDK_VERSION @"0.6.0"
+
+#if defined(__cplusplus)
+#define WX_EXTERN extern "C" __attribute__((visibility("default")))
+#else
+#define WX_EXTERN extern __attribute__((visibility("default")))
+#endif
+
+/*
+ * Concatenate preprocessor tokens a and b without expanding macro definitions
+ * (however, if invoked from a macro, macro arguments are expanded).
+ */
+#define WX_CONCAT(a, b) a ## b
+/*
+ * Concatenate preprocessor tokens a and b after macro-expanding them.
+ */
+#define WX_CONCAT_WRAPPER(a, b) WX_CONCAT(a, b)
+
+#define WX_CONCAT_TRIPLE(a, b, c) a ## b ## c
+
+#define WX_NSSTRING_HELPER(x) #x
+#define WX_NSSTRING(x) @WX_NSSTRING_HELPER(x)
+
+#define WX_SDK_ROOT_REF @"_root"
+
+#define WX_TEXT_FONT_SIZE (32.0 * WXScreenResizeRadio())
+
+#define WX_UPDATE_CONFIG(prefix, name, configs) \
+NSString *selStr = [NSString stringWithFormat:@"%@_%@", prefix, name];\
+SEL selector = NSSelectorFromString(selStr);\
+Class clazz = WX_COMPONENT_CLASS(_properties[@"type"]);\
+if ([clazz respondsToSelector:selector]) {\
+ configs = ((NSArray *(*)(id, SEL))objc_msgSend)(clazz, selector);\
+}\
+
+#define WX_TYPE_KEYPATH(config, name, type, parts, vKey) \
+type = [config[0] stringByAppendingString:@":"];\
+NSString *keyPath = config.count > 1 ? config[1] : nil;\
+if(keyPath){\
+ parts = [keyPath componentsSeparatedByString:@"."];\
+ vKey = parts.lastObject;\
+parts = [parts subarrayWithRange:(NSRange){0, parts.count - 1}];\
+} else {\
+ vKey = name;\
+}
+
+#define RGB(r, g, b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
+#define RGB_A(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
+
+#define ScreenWidth ([[UIScreen mainScreen] bounds].size.width)
+
+#define WX_ERROR_DOMAIN @"WXErrorDomain"
+
+#define WX_JS_ERROR_NOTIFICATION_NAME @"WXJSErrorNotification"
+
+#define WX_COMPONENT_THREAD_NAME @"com.taobao.weex.component"
+
+#define WX_BRIDGE_THREAD_NAME @"com.taobao.weex.bridge"
+
+/**
+ * @abstract Compared with system version of current device
+ *
+ * @return YES if greater than or equal to the system verison, otherwise, NO.
+ *
+ */
+#define WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
+
+/**
+ * @abstract Compared with system version of current device
+ *
+ * @return YES if greater than the system verison, otherwise, NO.
+ *
+ */
+#define WX_SYS_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
+
+/**
+ * @abstract Compared with system version of current device
+ *
+ * @return YES if equal to the system verison, otherwise, NO.
+ *
+ */
+#define WX_SYS_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
+
+/**
+ * @abstract Compared with system version of current device
+ *
+ * @return YES if less than the system verison, otherwise, NO.
+ *
+ */
+#define WX_SYS_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
+
+/**
+ * @abstract Compared with system version of current device
+ *
+ * @return YES if less than or equal to the system verison, otherwise, NO.
+ *
+ */
+#define WX_SYS_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
+
+
+#if __has_attribute(objc_requires_super)
+ #define WX_REQUIRES_SUPER __attribute__((objc_requires_super))
+#else
+ #define WX_REQUIRES_SUPER
+#endif
+
+#endif
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXLog.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXLog.h b/ios/sdk/WeexSDK/Sources/Utility/WXLog.h
new file mode 100644
index 0000000..b87f665
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXLog.h
@@ -0,0 +1,105 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+typedef NS_ENUM(NSInteger, WXLogFlag) {
+ WXLogFlagError = 1 << 0,
+ WXLogFlagWarning = 1 << 1,
+ WXLogFlagInfo = 1 << 2,
+ WXLogFlagDebug = 1 << 3,
+ WXLogFlagVerbose = 1 << 4
+};
+
+/**
+ * Use Log levels to filter logs.
+ */
+typedef NS_ENUM(NSUInteger, WXLogLevel){
+ /**
+ * No logs
+ */
+ WXLogLevelOff = 0,
+
+ /**
+ * Error only
+ */
+ WXLogLevelError = WXLogFlagError,
+
+ /**
+ * Error and warning
+ */
+ WXLogLevelWarning = WXLogLevelError | WXLogFlagWarning,
+
+ /**
+ * Error, warning and info
+ */
+ WXLogLevelInfo = WXLogLevelWarning | WXLogFlagInfo,
+
+ /**
+ * Error, warning, info and debug logs
+ */
+ WXLogLevelDebug = WXLogLevelInfo | WXLogFlagDebug,
+
+ /**
+ * Error, warning, info, debug and verbose
+ */
+ WXLogLevelVerbose = WXLogLevelDebug | WXLogFlagVerbose,
+
+ /**
+ * All
+ */
+ WXLogLevelAll = NSUIntegerMax
+};
+
+/**
+ * External log protocol, which is used to output the log to the external.
+ */
+@protocol WXLogProtocol <NSObject>
+
+@required
+
+/**
+ * External log level.
+ */
+- (WXLogLevel)logLevel;
+
+- (void)log:(WXLogFlag)flag message:(NSString *)message;
+
+@end
+
+@interface WXLog : NSObject
+
++ (WXLogLevel)logLevel;
+
++ (void)setLogLevel:(WXLogLevel)level;
+
++ (NSString *)logLevelString;
+
++ (void)setLogLevelString:(NSString *)levelString;
+
++ (void)log:(WXLogFlag)flag file:(const char *)fileName line:(NSUInteger)line format:(NSString *)format, ... NS_FORMAT_FUNCTION(4,5);
+
++ (void)registerExternalLog:(id<WXLogProtocol>)externalLog;
+
+@end
+
+#define WX_FILENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
+
+#define WX_LOG(flag, fmt, ...) \
+do { \
+ [WXLog log:flag \
+ file:WX_FILENAME \
+ line:__LINE__ \
+ format:(fmt), ## __VA_ARGS__]; \
+} while(0)
+
+#define WXLogVerbose(format, ...) WX_LOG(WXLogFlagVerbose, format, ##__VA_ARGS__)
+#define WXLogDebug(format, ...) WX_LOG(WXLogFlagDebug, format, ##__VA_ARGS__)
+#define WXLogInfo(format, ...) WX_LOG(WXLogFlagInfo, format, ##__VA_ARGS__)
+#define WXLogWarning(format, ...) WX_LOG(WXLogFlagWarning, format, ##__VA_ARGS__)
+#define WXLogError(format, ...) WX_LOG(WXLogFlagError, format, ##__VA_ARGS__)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXLog.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXLog.m b/ios/sdk/WeexSDK/Sources/Utility/WXLog.m
new file mode 100644
index 0000000..8619ab1
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXLog.m
@@ -0,0 +1,171 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXLog.h"
+#import "WXUtility.h"
+#import "WXAssert.h"
+#import "WXSDKManager.h"
+
+// Xcode does NOT natively support colors in the Xcode debugging console.
+// You'll need to install the XcodeColors plugin to see colors in the Xcode console.
+// https://github.com/robbiehanson/XcodeColors
+//
+// The following is documentation from the XcodeColors project:
+//
+//
+// How to apply color formatting to your log statements:
+//
+// To set the foreground color:
+// Insert the ESCAPE_SEQ into your string, followed by "fg124,12,255;" where r=124, g=12, b=255.
+//
+// To set the background color:
+// Insert the ESCAPE_SEQ into your string, followed by "bg12,24,36;" where r=12, g=24, b=36.
+//
+// To reset the foreground color (to default value):
+// Insert the ESCAPE_SEQ into your string, followed by "fg;"
+//
+// To reset the background color (to default value):
+// Insert the ESCAPE_SEQ into your string, followed by "bg;"
+//
+// To reset the foreground and background color (to default values) in one operation:
+// Insert the ESCAPE_SEQ into your string, followed by ";"
+
+#define XCODE_COLORS_ESCAPE_SEQ "\033["
+
+#define XCODE_COLORS_RESET_FG XCODE_COLORS_ESCAPE_SEQ "fg;" // Clear any foreground color
+#define XCODE_COLORS_RESET_BG XCODE_COLORS_ESCAPE_SEQ "bg;" // Clear any background color
+#define XCODE_COLORS_RESET XCODE_COLORS_ESCAPE_SEQ ";" // Clear any foreground or background color
+
+
+#ifdef DEBUG
+static const WXLogLevel defaultLogLevel = WXLogLevelDebug;
+#else
+static const WXLogLevel defaultLogLevel = WXLogLevelWarning;
+#endif
+
+static id<WXLogProtocol> _externalLog;
+
+@implementation WXLog
+{
+ WXLogLevel _logLevel;
+}
+
++ (instancetype)sharedInstance
+{
+ static WXLog *_sharedInstance = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedInstance = [[self alloc] init];
+ _sharedInstance->_logLevel = defaultLogLevel;
+ });
+ return _sharedInstance;
+}
+
+
++ (void)setLogLevel:(WXLogLevel)level
+{
+ if (((WXLog*)[self sharedInstance])->_logLevel != level) {
+ ((WXLog*)[self sharedInstance])->_logLevel = level;
+
+ [[WXSDKManager bridgeMgr] resetEnvironment];
+ }
+}
+
++ (WXLogLevel)logLevel
+{
+ return ((WXLog*)[self sharedInstance])->_logLevel;
+}
+
++ (NSString *)logLevelString
+{
+ NSDictionary *logLevelEnumToString =
+ @{
+ @(WXLogLevelAll) : @"all",
+ @(WXLogLevelError) : @"error",
+ @(WXLogLevelWarning) : @"warn",
+ @(WXLogLevelInfo) : @"info",
+ @(WXLogLevelDebug) : @"debug",
+ @(WXLogLevelVerbose) : @"verbose"
+ };
+ return [logLevelEnumToString objectForKey:@([self logLevel])];
+}
+
++ (void)setLogLevelString:(NSString *)levelString
+{
+ NSDictionary *logLevelStringToEnum =
+ @{
+ @"all" : @(WXLogLevelAll),
+ @"error" : @(WXLogLevelError),
+ @"warn" : @(WXLogLevelWarning),
+ @"info" : @(WXLogLevelInfo),
+ @"debug" : @(WXLogLevelDebug),
+ @"verbose" : @(WXLogLevelVerbose)
+ };
+
+ [self setLogLevel:[logLevelStringToEnum[levelString] unsignedIntegerValue]];
+}
+
++ (void)log:(WXLogFlag)flag file:(const char *)fileName line:(NSUInteger)line format:(NSString *)format, ...
+{
+ if ([WXLog logLevel] & flag || [_externalLog logLevel] & flag) {
+ if (!format) {
+ return;
+ }
+
+ va_list args;
+ va_start(args, format);
+ NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
+ va_end(args);
+
+ NSString *flagString;
+ NSString *flagColor;
+ switch (flag) {
+ case WXLogFlagError:
+ flagString = @"error";
+ flagColor = @"fg255,0,0;";
+ break;
+ case WXLogFlagWarning:
+ flagString = @"warn";
+ flagColor = @"fg255,165,0;";
+ break;
+ case WXLogFlagDebug:
+ flagString = @"debug";
+ flagColor = @"fg0,128,0;";
+ break;
+ case WXLogFlagVerbose:
+ flagString = @"verbose";
+ flagColor = @"fg128,128,128;";
+ break;
+ default:
+ flagString = @"info";
+ flagColor = @"fg100,149,237;";
+ break;
+ }
+
+ NSString *logMessage = [NSString stringWithFormat:@"%s%@ <Weex>[%@]%s:%ld, %@ %s", XCODE_COLORS_ESCAPE_SEQ, flagColor, flagString, fileName, (unsigned long)line, message, XCODE_COLORS_RESET];
+
+ if ([_externalLog logLevel] & flag) {
+ [_externalLog log:flag message:logMessage];
+ }
+
+ [[WXSDKManager bridgeMgr] logToWebSocket:flagString message:message];
+
+ if ([WXLog logLevel] & flag) {
+ NSLog(@"%@", logMessage);
+ }
+ }
+}
+
+#pragma mark - External Log
+
++ (void)registerExternalLog:(id<WXLogProtocol>)externalLog
+{
+ _externalLog = externalLog;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.h b/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.h
new file mode 100644
index 0000000..1f197cd
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.h
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@interface WXSimulatorShortcutMananger : NSObject
+
++ (void)registerSimulatorShortcutWithKey:(NSString *)key modifierFlags:(UIKeyModifierFlags)flags action:(dispatch_block_t)action;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.m b/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.m
new file mode 100644
index 0000000..ef69eeb
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXSimulatorShortcutMananger.m
@@ -0,0 +1,118 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSimulatorShortcutMananger.h"
+#import "WXUtility.h"
+#import <objc/message.h>
+
+#if TARGET_OS_SIMULATOR
+
+@interface UIEvent (WXSimulatorShortcutMananger)
+
+@property (nonatomic, strong) NSString *_modifiedInput;
+@property (nonatomic, strong) NSString *_unmodifiedInput;
+@property (nonatomic, assign) UIKeyModifierFlags _modifierFlags;
+@property (nonatomic, assign) BOOL _isKeyDown;
+@property (nonatomic, assign) long _keyCode;
+
+@end
+
+@interface WXKeyInput : NSObject
+
+@property (nonatomic, strong) NSString *key;
+@property (nonatomic, assign) UIKeyModifierFlags flags;
+
+@end
+
+@implementation WXKeyInput
+
++ (instancetype)keyInputForKey:(NSString *)key flags:(UIKeyModifierFlags)flags
+{
+ WXKeyInput *keyInput = [[self alloc] init];
+ if (keyInput) {
+ keyInput.key = key;
+ keyInput.flags = flags;
+ }
+ return keyInput;
+}
+
+- (BOOL)isEqual:(id)object
+{
+ BOOL isEqual = NO;
+ if ([object isKindOfClass:[WXKeyInput class]]) {
+ WXKeyInput *keyInput = (WXKeyInput *)object;
+ isEqual = [self.key isEqualToString:keyInput.key] && self.flags == keyInput.flags;
+ }
+ return isEqual;
+}
+
+@end
+
+
+@implementation WXSimulatorShortcutMananger
+{
+ NSCache *_actions;
+}
+
++ (instancetype)sharedManager
+{
+ static WXSimulatorShortcutMananger *_sharedInstance = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedInstance = [[self alloc] init];
+ _sharedInstance->_actions = [[NSCache alloc] init];
+ SEL handleKeyEventSelector = NSSelectorFromString(@"handleKeyUIEvent:");
+ SEL replacedSelector = WXSwizzledSelectorForSelector(handleKeyEventSelector);
+ WXSwizzleInstanceMethodWithBlock([UIApplication class], handleKeyEventSelector, ^(UIApplication *application, UIEvent *event) {
+ [[[self class] sharedManager] handleKeyUIEvent:event];
+ ((void(*)(id, SEL, id))objc_msgSend)(application, replacedSelector, event);
+ }, replacedSelector);
+ });
+ return _sharedInstance;
+}
+
++ (void)registerSimulatorShortcutWithKey:(NSString *)key modifierFlags:(UIKeyModifierFlags)flags action:(dispatch_block_t)action
+{
+ WXKeyInput *keyInput = [WXKeyInput keyInputForKey:key flags:flags];
+ [[WXSimulatorShortcutMananger sharedManager]->_actions setObject:action forKey:keyInput];
+}
+
+- (void)handleKeyUIEvent:(UIEvent *)event
+{
+ BOOL isKeyDown = NO;
+ NSString *modifiedInput = nil;
+ NSString *unmodifiedInput = nil;
+ UIKeyModifierFlags flags = 0;
+ if ([event respondsToSelector:@selector(_isKeyDown)]) {
+ isKeyDown = [event _isKeyDown];
+ }
+
+ if ([event respondsToSelector:@selector(_modifiedInput)]) {
+ modifiedInput = [event _modifiedInput];
+ }
+
+ if ([event respondsToSelector:@selector(_unmodifiedInput)]) {
+ unmodifiedInput = [event _unmodifiedInput];
+ }
+
+ if ([event respondsToSelector:@selector(_modifierFlags)]) {
+ flags = [event _modifierFlags];
+ }
+
+ if (isKeyDown && [modifiedInput length] > 0) {
+ WXKeyInput *keyInput = [WXKeyInput keyInputForKey:unmodifiedInput flags:flags];
+ dispatch_block_t block = [_actions objectForKey:keyInput];
+ if (block) {
+ block();
+ }
+ }
+}
+
+@end
+
+#endif
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.h b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.h
new file mode 100644
index 0000000..c454ded
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.h
@@ -0,0 +1,20 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+/**
+ * @abstract a thread-safe counter
+ */
+@interface WXThreadSafeCounter : NSObject
+
+@property (atomic, readonly) int32_t value;
+
+- (int32_t)increase;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.m b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.m
new file mode 100644
index 0000000..7dad802
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeCounter.m
@@ -0,0 +1,25 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXThreadSafeCounter.h"
+#import <libkern/OSAtomic.h>
+
+@implementation WXThreadSafeCounter{
+ int32_t _value;
+}
+
+- (int32_t)value
+{
+ return _value;
+}
+
+- (int32_t)increase {
+ return OSAtomicIncrement32(&_value);
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.h b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.h
new file mode 100644
index 0000000..7d6f518
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.h
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+/**
+ * @abstract Thread safe NSMutableArray
+ */
+@interface WXThreadSafeMutableArray : NSMutableArray
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m
new file mode 100644
index 0000000..66abb96
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m
@@ -0,0 +1,147 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXThreadSafeMutableArray.h"
+
+@interface WXThreadSafeMutableArray ()
+
+@property (nonatomic, strong) dispatch_queue_t queue;
+@property (nonatomic, strong) NSMutableArray* array;
+
+@end
+
+@implementation WXThreadSafeMutableArray
+
+- (instancetype)initCommon
+{
+ self = [super init];
+ if (self) {
+ NSString* uuid = [NSString stringWithFormat:@"com.taobao.weex.array_%p", self];
+ _queue = dispatch_queue_create([uuid UTF8String], DISPATCH_QUEUE_CONCURRENT);
+ }
+ return self;
+}
+
+- (instancetype)init
+{
+ self = [self initCommon];
+ if (self) {
+ _array = [NSMutableArray array];
+ }
+ return self;
+}
+
+- (instancetype)initWithCapacity:(NSUInteger)numItems
+{
+ self = [self initCommon];
+ if (self) {
+ _array = [NSMutableArray arrayWithCapacity:numItems];
+ }
+ return self;
+}
+
+- (NSArray *)initWithContentsOfFile:(NSString *)path
+{
+ self = [self initCommon];
+ if (self) {
+ _array = [NSMutableArray arrayWithContentsOfFile:path];
+ }
+ return self;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)aDecoder
+{
+ self = [self initCommon];
+ if (self) {
+ _array = [[NSMutableArray alloc] initWithCoder:aDecoder];
+ }
+ return self;
+}
+
+- (instancetype)initWithObjects:(const id [])objects count:(NSUInteger)cnt
+{
+ self = [self initCommon];
+ if (self) {
+ _array = [NSMutableArray array];
+ for (NSUInteger i = 0; i < cnt; ++i) {
+ [_array addObject:objects[i]];
+ }
+ }
+ return self;
+}
+
+- (NSUInteger)count
+{
+ __block NSUInteger count;
+ dispatch_sync(_queue, ^{
+ count = _array.count;
+ });
+ return count;
+}
+
+-(id)objectAtIndex:(NSUInteger)index
+{
+ __block id obj;
+ dispatch_sync(_queue, ^{
+ obj = _array[index];
+ });
+ return obj;
+}
+
+- (NSEnumerator *)keyEnumerator
+{
+ __block NSEnumerator *enu;
+ dispatch_sync(_queue, ^{
+ enu = [_array objectEnumerator];
+ });
+ return enu;
+}
+
+-(void)insertObject:(id)anObject atIndex:(NSUInteger)index
+{
+ dispatch_barrier_async(_queue, ^{
+ [_array insertObject:anObject atIndex:index];
+ });
+}
+
+-(void)addObject:(id)anObject;
+{
+ dispatch_barrier_async(_queue, ^{
+ [_array addObject:anObject];
+ });
+}
+
+-(void)removeObjectAtIndex:(NSUInteger)index
+{
+ dispatch_barrier_async(_queue, ^{
+ [_array removeObjectAtIndex:index];
+ });
+}
+
+-(void)removeLastObject
+{
+ dispatch_barrier_async(_queue, ^{
+ [_array removeLastObject];
+ });
+}
+
+-(void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject
+{
+ dispatch_barrier_async(_queue, ^{
+ [_array replaceObjectAtIndex:index withObject:anObject];
+ });
+}
+
+- (void)dealloc
+{
+ if (_queue) {
+ _queue = NULL;
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.h b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.h
new file mode 100644
index 0000000..3a53a27
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.h
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+/**
+ * @abstract Thread safe NSMutableDictionary
+ */
+@interface WXThreadSafeMutableDictionary : NSMutableDictionary
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
new file mode 100644
index 0000000..266cbd9
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
@@ -0,0 +1,121 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXThreadSafeMutableDictionary.h"
+
+@interface WXThreadSafeMutableDictionary ()
+
+@property (nonatomic, strong) dispatch_queue_t queue;
+@property (nonatomic, strong) NSMutableDictionary* dict;
+
+@end
+
+@implementation WXThreadSafeMutableDictionary
+
+- (instancetype)initCommon
+{
+ self = [super init];
+ if (self) {
+ NSString* uuid = [NSString stringWithFormat:@"com.taobao.weex.dictionary_%p", self];
+ _queue = dispatch_queue_create([uuid UTF8String], DISPATCH_QUEUE_CONCURRENT);
+ }
+ return self;
+}
+
+- (instancetype)init
+{
+ self = [self initCommon];
+ if (self) {
+ _dict = [NSMutableDictionary dictionary];
+ }
+ return self;
+}
+
+- (instancetype)initWithCapacity:(NSUInteger)numItems
+{
+ self = [self initCommon];
+ if (self) {
+ _dict = [NSMutableDictionary dictionaryWithCapacity:numItems];
+ }
+ return self;
+}
+
+- (NSDictionary *)initWithContentsOfFile:(NSString *)path
+{
+ self = [self initCommon];
+ if (self) {
+ _dict = [NSMutableDictionary dictionaryWithContentsOfFile:path];
+ }
+ return self;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)aDecoder
+{
+ self = [self initCommon];
+ if (self) {
+ _dict = [[NSMutableDictionary alloc] initWithCoder:aDecoder];
+ }
+ return self;
+}
+
+- (instancetype)initWithObjects:(const id [])objects forKeys:(const id<NSCopying> [])keys count:(NSUInteger)cnt
+{
+ self = [self initCommon];
+ if (self) {
+ _dict = [NSMutableDictionary dictionary];
+ for (NSUInteger i = 0; i < cnt; ++i) {
+ _dict[keys[i]] = objects[i];
+ }
+
+ }
+ return self;
+}
+
+- (NSUInteger)count
+{
+ __block NSUInteger count;
+ dispatch_sync(_queue, ^{
+ count = _dict.count;
+ });
+ return count;
+}
+
+- (id)objectForKey:(id)aKey
+{
+ __block id obj;
+ dispatch_sync(_queue, ^{
+ obj = _dict[aKey];
+ });
+ return obj;
+}
+
+- (NSEnumerator *)keyEnumerator
+{
+ __block NSEnumerator *enu;
+ dispatch_sync(_queue, ^{
+ enu = [_dict keyEnumerator];
+ });
+ return enu;
+}
+
+- (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey
+{
+ aKey = [aKey copyWithZone:NULL];
+ dispatch_barrier_async(_queue, ^{
+ _dict[aKey] = anObject;
+ });
+}
+
+- (void)removeObjectForKey:(id)aKey
+{
+ dispatch_barrier_async(_queue, ^{
+ [_dict removeObjectForKey:aKey];
+ });
+}
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Utility/WXType.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXType.h b/ios/sdk/WeexSDK/Sources/Utility/WXType.h
new file mode 100644
index 0000000..8043cc2
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXType.h
@@ -0,0 +1,65 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+typedef NS_ENUM(NSUInteger, WXScrollDirection) {
+ WXScrollDirectionVertical,
+ WXScrollDirectionHorizontal,
+ WXScrollDirectionNone,
+};
+
+typedef NS_ENUM(NSUInteger, WXTextStyle) {
+ WXTextStyleNormal = 0,
+ WXTextStyleItalic
+};
+
+typedef NS_ENUM(NSUInteger, WXTextWeight) {
+ WXTextWeightNormal = 0,
+ WXTextWeightBold,
+};
+
+typedef NS_ENUM(NSInteger, WXTextDecoration) {
+ WXTextDecorationNone = 0,
+ WXTextDecorationUnderline,
+ WXTextDecorationLineThrough
+};
+
+typedef NS_ENUM(NSInteger, WXImageQuality) {
+ WXImageQualityOriginal = -1,
+ WXImageQualityLow = 0,
+ WXImageQualityNormal,
+ WXImageQualityHigh,
+ WXImageQualityNone,
+};
+
+typedef NS_ENUM(NSInteger, WXImageSharp) {
+ WXImageSharpeningNone = 0,
+ WXImageSharpening
+};
+
+typedef NS_ENUM(NSInteger, WXVisibility) {
+ WXVisibilityShow = 0,
+ WXVisibilityHidden
+};
+
+typedef NS_ENUM(NSInteger, WXBorderStyle) {
+ WXBorderStyleNone = 0,
+ WXBorderStyleDotted,
+ WXBorderStyleDashed,
+ WXBorderStyleSolid
+};
+
+typedef NS_ENUM(NSInteger, WXPositionType) {
+ WXPositionTypeRelative = 0,
+ WXPositionTypeAbsolute,
+ WXPositionTypeSticky,
+ WXPositionTypeFixed
+};
+
[31/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/main.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/main.js b/ios/playground/bundlejs/showcase/new-fashion/main.js
new file mode 100644
index 0000000..41ebc4f
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/main.js
@@ -0,0 +1,3977 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/73b44713db2eae6d536291fb7cc654e4", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(20);
+ __webpack_require__(21);
+ __webpack_require__(22);
+ __webpack_require__(23);
+ __webpack_require__(24);
+ __webpack_require__(25);
+ __webpack_require__(26);
+ __webpack_require__(27);
+
+ ;
+ __webpack_require__(1)
+ __weex_module__.exports = {
+ data: function () {return {
+ navBarHeight: 88,
+ cnt: 0,
+ show0: true,
+ show1: false,
+ show2: false,
+ displayRefresh: 'show',
+ displayLoading: 'show',
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self._initData();
+ self._initEnv();
+ self._initUtil();
+ },
+ _initData: function () {
+ var self = this;
+ self.showData = {
+ "header": {
+ "topBanner": "https://gw.alicdn.com/tps/TB1J48kMXXXXXXtapXXXXXXXXXX-750-782.jpg",
+ "ruleLink": "https://chaoshi.m.tmall.com/",
+ "isShowShare": true,
+ "shareInfo": {
+ "shareTitle": "\u6211\u662f\u5206\u4eab\u6807\u9898",
+ "shareIntro": " \u6211\u662f\u5206\u4eab\u5185\u5bb9\u6d4b\u8bd5",
+ "allLink": "https://www.tmall.com",
+ "mobileImage": "https://gw.alicdn.com/tps/TB1J48kMXXXXXXtapXXXXXXXXXX-750-782.jpg",
+ "pcImage": "https://img.alicdn.com/tps/i4/TB1Dyw1LVXXXXXEapXXSutbFXXX.jpg",
+ "shareScene": "\u6211\u662f\u6d4b\u8bd5\u4e1a\u52a1",
+ "bizId": ""
+ },
+ "announceHdBanner": "https://gw.alicdn.com/tps/i4/TB1fzclLVXXXXaVaXXXwu0bFXXX.png",
+ "bannerItems": [{
+ "img": "https://img.alicdn.com/tps/TB1U8LHLVXXXXa3XpXXXXXXXXXX-233-172.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img": "https://img.alicdn.com/tps/TB1U8LHLVXXXXa3XpXXXXXXXXXX-233-172.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img": "https://img.alicdn.com/tps/TB1U8LHLVXXXXa3XpXXXXXXXXXX-233-172.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ }]
+ },
+ "fashion": {
+ "isHide": false,
+ "floorTitle": "https://gw.alicdn.com/tps/TB1._64LVXXXXatXVXXXXXXXXXX-750-100.jpg",
+ "bigBannerImg": "https://gw.alicdn.com/tps/TB1tO.aLVXXXXcvXpXXXXXXXXXX-750-262.jpg",
+ "bigBannerUrl": "https://chaoshi.m.tmall.com/",
+ "smallBannerItems": [{
+ "img": "https://img.alicdn.com/tps/TB1Ff_0LVXXXXXNaXXXXXXXXXXX-375-262.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img": "https://img.alicdn.com/tps/TB1Ff_0LVXXXXXNaXXXXXXXXXXX-375-262.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ }],
+ "isHideStarBanner": false,
+ "firstStarBannerItems": [{
+ "img": "https://gw.alicdn.com/tps/TB1xlIVLVXXXXckXVXXXXXXXXXX-250-220.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img": "https://gw.alicdn.com/tps/TB1xlIVLVXXXXckXVXXXXXXXXXX-250-220.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ }],
+ "secondStarBannerItems": [{
+ "img": "https://gw.alicdn.com/tps/TB1xlIVLVXXXXckXVXXXXXXXXXX-250-220.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img": "https://gw.alicdn.com/tps/TB1xlIVLVXXXXckXVXXXXXXXXXX-250-220.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ }],
+ "thirdStarBannerItems": [{
+ "img": "https://gw.alicdn.com/tps/TB1xlIVLVXXXXckXVXXXXXXXXXX-250-220.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img": "https://gw.alicdn.com/tps/TB1xlIVLVXXXXckXVXXXXXXXXXX-250-220.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ }]
+ },
+ "goods": {
+ "isHide": false,
+ "floorTitle": "https://gw.alicdn.com/tps/TB1._64LVXXXXatXVXXXXXXXXXX-750-100.jpg",
+ "bannerItems": [{
+ "img1": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url1": "https://chaoshi.m.tmall.com/",
+ "img2": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url2": "https://chaoshi.m.tmall.com/",
+ "img3": "https://gw.alicdn.com/tps/TB12MPFLVXXXXXnXVXXXXXXXXXX-250-592.jpg",
+ "url3": "https://chaoshi.m.tmall.com/",
+ "img4": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url4": "https://chaoshi.m.tmall.com/",
+ "img5": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url5": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img1": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url1": "https://chaoshi.m.tmall.com/",
+ "img2": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url2": "https://chaoshi.m.tmall.com/",
+ "img3": "https://gw.alicdn.com/tps/TB12MPFLVXXXXXnXVXXXXXXXXXX-250-592.jpg",
+ "url3": "https://chaoshi.m.tmall.com/",
+ "img4": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url4": "https://chaoshi.m.tmall.com/",
+ "img5": "https://gw.alicdn.com/tps/TB1TUzGLVXXXXc1XFXXXXXXXXXX-250-296.jpg",
+ "url5": "https://chaoshi.m.tmall.com/"
+ }]
+ },
+ "coupon": {
+ "floorTitle": "https://gw.alicdn.com/tps/TB1._64LVXXXXatXVXXXXXXXXXX-750-100.jpg"
+ },
+ "scene": {
+ "floorTitle": "https://gw.alicdn.com/tps/TB1._64LVXXXXatXVXXXXXXXXXX-750-100.jpg",
+ "_backup": {
+ "id": "03653",
+ "data": [{
+ "id": "1395",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1395&scm=1003.1.03653.MAIN_1395_710531&pos=1",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i2/TB1n6bVLVXXXXcCXVXXTCU0QpXX-300-300.jpg",
+ "sceneCat": "50008881,50008883,50008882,50008884,50012774,50012775,50012776,50012781,50008886,50012766,50012771,50012772,50010850,50000671,162201,50022566,50007068,50026651,50000852,162104,162116,162205,1623,123216004,162404,162401,50011412,50011411,16240,50012773,50006846,50010394,50008888,50008890,50008889,50012784,50012785,50012786,50012787,50008885,50012777,50012778,124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,50011740,50006843,50006842,124942005,50010368,50011892,50011894,50023751,121366037,121458036,121392038,121420035,121364028,121468026,121400029,121418030,121478031,121480030,121366035,121424025,121426030,121484030,121412031,125054002,125074007,125074008,125104003,125080003,125024006,125080004,121400030,121424024,121482025,121418031,121402028,121388035",
+ "finalScore": "77.26011111111112",
+ "_pos_": 1,
+ "entityType": "MAIN",
+ "benefitImg": "//img.alicdn.com/tps/i3/TB1Onr9LVXXXXbiXpXXB8gAQpXX-300-100.png",
+ },
+ {
+ "id": "1394",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1394&scm=1003.1.03653.MAIN_1394_710531&pos=2",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i1/TB13mj1LVXXXXa.XFXXTCU0QpXX-300-300.jpg",
+ "sceneCat": "50010850,50000671,162201,50022566,50007068,50026651,50000852,162104,162116,162205,1623,123216004,162404,162401,50011412,50011411,162402,50008903,50011413,162403,50000697,1629,50011277,121412004,50008897,50008901,50008899,50013194,50008904,50008905,50008898,162103,50008900,50013196,121434004,50005065,162702,162701,162703,1636,124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,50011740,50006843,50006842,124986002,50010368, 50011892,50011894,121480030,121366035,121424025,121426030,121484030,121412031",
+ "finalScore": "77.06103999999999",
+ "_pos_": 2,
+ "entityType": "MAIN",
+ "benefitImg": "//img.alicdn.com/tps/i2/TB17kvVLVXXXXaTXVXXB8gAQpXX-300-100.png",
+ },
+ {
+ "id": "1396",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1396&scm=1003.1.03653.MAIN_1396_710531&pos=3",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i2/TB1ZOAXLVXXXXa0XXXXTCU0QpXX-300-300.jpg",
+ "sceneCat": "50010368,50011892,50011894,50013794,50010792,50010790,50010790,121434025,121396024,50010793,50010789,50010793,121386035,121392037,121458034,121392036,121482027,121392015,121368014,121418013,121392016,50011982,122690003,302910,50012010,122654005,50012019,50012825,50012027,50012042,50011744,50012906,50012907,50008881,50008883,50008882?,50012784?,50022889,50022728,50013228,50013896,50014775,50019578,50014822,50026394,50019694,50019279,50019272,50014079,50014078,50014076,50014077,50017238,121464011,121468014,50019130,50019127,50019126,50019128,50019125,50015984,50014803,50014802,50015980,50014788,50014787,50019526,50014791,50019520,50013932,50014677,50015978,50014786,50014785,50522001,50014493,50023100,121418021,121388027,121424021,121418020,121368020,50012036,50012044,50012043,50010368, 50011892, 50019274,50012044,50012048,50012043,50013228,50013238,50011726,50019279,50015984,50014803,50014802,50019526,50014791,50019520,50013932,50014677,50019526,50013314,
50023341,50016752,50016749,50016747,50016744,50016741,50016740,50016739,50016738,50016737,50016769,50016763,50016750,50007003,302910,50012010,50012032,50012033,50011745,50011746,50011894,121458034,121756003,121426033,50011982,50011979,121390006,124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,50010850,50000671,162201,50022566,50007068,50026651,50000852,162104,162116,162205,1623,123216004,162404,162401,50011412,50011411,162402,50008903,50011413,162403,50000697,1629,50011277,121412004,50008897,50008901,50008899,50013194,50008904,50008905,50008898,162103,50008900,50013196,121434004,50005065,162702,162701,162703,1636,1512,123534001,14,50008090,50012341,50132002,50012342,50012343,50012345,50012346,50013189,50010527,121394006,50013618,50010537,50012424,121452038,121484044,50010540,50010548,50024769,121450007,50013697,50010218,50005960,50005962,50012820,50012406,
50023620,50023605,50008829,50024064,50023440,50008687,124392001,50023771,50006804,50012410,124482010,121398023,50023789,50011975",
+ "finalScore": "76.76379487179486",
+ "_pos_": 3,
+ "entityType": "MAIN",
+ "benefitImg": "//img.alicdn.com/tps/i3/TB1Usn.LVXXXXaoXpXXB8gAQpXX-300-100.png",
+ },
+ {
+ "id": "1619",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1619&scm=1003.1.03653.SUB_1619_710531&pos=4",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i2/TB1MpoBLVXXXXbxXpXXKofZZpXX-182-206.jpg",
+ "sceneCat": "124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,122654005,50011740,50009032,124688012\uff0c213202,121396029,121476023,121410029,213203,50023326,213205,50022686,50023293,50466023,50024999,50016885\uff0c50011894",
+ "finalScore": "75.88480000000001",
+ "_pos_": 4,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i4/TB1j0AxLVXXXXaRXFXX3bpXTXXX-170-100.png",
+ },
+ {
+ "id": "1612",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1612&scm=1003.1.03653.SUB_1612_710531&pos=5",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i3/TB1NNwyLVXXXXaEXVXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50010850,50000671,162104,162116,123216004",
+ "finalScore": "75.23733333333334",
+ "_pos_": 5,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i1/TB1PsoBLVXXXXbQXpXX3bpXTXXX-170-100.png",
+ },
+ {
+ "id": "1610",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1610&scm=1003.1.03653.SUB_1610_710531&pos=6",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i4/TB1EkczLVXXXXcVXpXXKofZZpXX-182-206.jpg",
+ "sceneCat": "121484044,121452038,50012342,50012027,50012032,50006843,50010850,50000671,162104,1623,50011277,162116,123216004,50008898,121366037,121458036,121392038,121420035,121364028,121468026,121472031,121476036,121470042,121418032,121410036,121472032,121420032,121470040,121384032,121460028,121448028,121400030,121424024,121482025,121418031,121402028,121388035,121460029,121400028,121400029,121418030,121476034,121478031,121448029,121480030,121366035,121424025,121426030,121484030,121412031,121384033,121424023,121402027,121408039,121420033,121452028,121466040,121416029,121482028,121420034,121396046,121422052,121370037,121424031,21364043,121472040,121412045,121424032,125054002,125074007,125074008,125104003,125080003,125024006,125080004",
+ "finalScore": "75.00533333333334",
+ "_pos_": 6,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i2/TB1RzwFLVXXXXXsXpXX3bpXTXXX-170-100.png",
+ },
+ {
+ "id": "1620",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1620&scm=1003.1.03653.SUB_1620_710531&pos=7",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i1/TB1IJsILVXXXXbGXXXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50010789,50010790,50010792,50010793,50010794,50010796,50010797,50010798,50010801,50010803,50010805,50010807,50010808,50010813,50010814,50010815,50013794,121382014,121386023,121388007,121388008,121398004,121364007,121398006,121410007,121426007,121452004,50012010,50012027,50012032\uff0c124688012, 124986002, 124942005\uff0c50010850,50000671,162104,162201,50022566,162116,1623,50011277,50008897,162401,162402",
+ "finalScore": "74.72522222222223",
+ "_pos_": 7,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i1/TB16A.yLVXXXXX8XFXX3bpXTXXX-170-100.png",
+ },
+ {
+ "id": "1608",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1608&scm=1003.1.03653.SUB_1608_710531&pos=8",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i3/TB1xA3jLVXXXXXqapXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50012010,50012027,50012032,50007003,50008881,50008883,1623,162116,50010850,123216004",
+ "finalScore": "74.626",
+ "_pos_": 8,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i2/TB1WvoALVXXXXcdXpXX3bpXTXXX-170-100.png",
+ },
+ {
+ "id": "1615",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1615&scm=1003.1.03653.SUB_1615_710531&pos=9",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i1/TB1PVctLVXXXXchXFXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50011978,50011979,50011980,50011993,50011996,50011997,121390006,121408011,121474010,50010789,50010790,50010792,50010793,50010803,50013794,121398004,121410007\uff0c213205,121470030,50024980,121408030",
+ "finalScore": "74.02799999999999",
+ "_pos_": 9,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i4/TB1yKwBLVXXXXa4XpXX3bpXTXXX-170-100.png",
+ },
+ {
+ "id": "1618",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1618&scm=1003.1.03653.SUB_1618_710531&pos=10",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i1/TB1vn3sLVXXXXX5XVXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50008886,50012766,50012771,50012772,50012773,50008090,111219,50012100,50012082,50012478,50012475,213202,50018977,121396029,121476023,50018994,121410029,213203,50023326,50003820,213205,50022686,50012481,50013976?,50001871,122854005,121458010,121452006,121416008,50008779,50002777,121394007,121386009,50010825,50013810,121434010,50001865,50008565,50008246,50017192,121404045,121368009,121462014,50019372,50008248,121418011,50008249,50017193,50008252,50008251,50000512,121364047",
+ "finalScore": "73.94212121212121",
+ "_pos_": 10,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i4/TB1kSkpLVXXXXbTXVXX3bpXTXXX-170-100.png",
+ },
+ {
+ "id": "1617",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.710531&aldid=TPMkJDIw&wh_id=1617&scm=1003.1.03653.SUB_1617_710531&pos=11",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i1/TB1ELwrLVXXXXaNXVXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50013189,50010527,121394006,50013618,50010537,50012424,121452038,121484044,50010540,50010548,50024769,50012341,50132002,50012342,50012343,50012345,50012346,50012341,50132002,50012342,50012343,50012345,50012346",
+ "finalScore": "73.78883333333334",
+ "_pos_": 11,
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i3/TB1CtsuLVXXXXcJXFXX3bpXTXXX-170-100.png",
+ }],
+ "exposureParam": "//ac.mmstat.com/1.gif?apply=vote&abbucket=_AB-M1001_B5&com=02&acm=03653.1003.1.710531&cod=03653&cache=jWl8FJsb&aldid=TPMkJDIw&logtype=4&abtest=_AB-LR1001-PR1001&scm=1003.1.03653.710531",
+ "serverTime": 1458296110334
+ }
+ },
+ "resource": {
+ "isHide": false,
+ "bigBannerImg": "https://gw.alicdn.com/tps/TB1tO.aLVXXXXcvXpXXXXXXXXXX-750-262.jpg",
+ "bigBannerUrl": "https://chaoshi.m.tmall.com/",
+ "smallBannerItems": [{
+ "img": "https://img.alicdn.com/tps/TB1Ff_0LVXXXXXNaXXXXXXXXXXX-375-262.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "img": "https://img.alicdn.com/tps/TB1Ff_0LVXXXXXNaXXXXXXXXXXX-375-262.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ }]
+ },
+ "category": {
+ "floorTitle": "https://gw.alicdn.com/tps/TB1._64LVXXXXatXVXXXXXXXXXX-750-100.jpg",
+ "_backup": {
+ "main": [],
+ "sub": [{
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/dqc?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_15_735362&pos=1",
+ "entityType": "OTHER",
+ "colour": "b4ebff",
+ "industryTitle": "\u6570\u7801",
+ "_pos_": 1,
+ "industryBenefit": "\u75af\u62a2\u5927\u724c\u65b0\u54c1",
+ "industryId": "15",
+ "industryImg": "//img.alicdn.com/tps/i4/TB1_xG.LVXXXXbWaXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/xihu?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_13_735362&pos=2",
+ "entityType": "OTHER",
+ "colour": "cdffa4",
+ "industryTitle": "\u6d17\u62a4",
+ "_pos_": 2,
+ "industryBenefit": "\u7206\u6b3e1\u5206\u94b1\u62a2",
+ "industryId": "13",
+ "industryImg": "//img.alicdn.com/tps/i3/TB1Ft_CLVXXXXX2XXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/mobilephone?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_14_735362&pos=3",
+ "entityType": "OTHER",
+ "colour": "c5ffdf",
+ "industryTitle": "\u624b\u673a",
+ "_pos_": 3,
+ "industryBenefit": "1\u5143\u62a2\u4f18\u60e0\u5238",
+ "industryId": "14",
+ "industryImg": "//img.alicdn.com/tps/i3/TB1mJjuLVXXXXc.XXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/xiangbaohuanxin?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_11_735362&pos=4",
+ "entityType": "OTHER",
+ "colour": "ffccdc",
+ "industryTitle": "\u7bb1\u5305",
+ "_pos_": 4,
+ "industryBenefit": "\u6781\u81f4\u7115\u65b0\u5c16\u8d27",
+ "industryId": "11",
+ "industryImg": "//img.alicdn.com/tps/i2/TB1_5P9KVXXXXayaXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/newfood?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_12_735362&pos=5",
+ "entityType": "OTHER",
+ "colour": "fff5a3",
+ "industryTitle": "\u98df\u54c1",
+ "_pos_": 5,
+ "industryBenefit": "\u65b0\u54c11\u5206\u8bd5\u5403",
+ "industryId": "12",
+ "industryImg": "//img.alicdn.com/tps/i2/TB1HfLzLVXXXXb_XXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/zbps?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_3_735362&pos=6",
+ "entityType": "OTHER",
+ "colour": "bbffe5",
+ "industryTitle": "\u73e0\u5b9d\u914d\u9970",
+ "_pos_": 6,
+ "industryBenefit": "\u5927\u724c1\u6298\u79d2\u6740",
+ "industryId": "3",
+ "industryImg": "//img.alicdn.com/tps/i1/TB1s5y.LVXXXXb.aXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/getbeauty?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_2_735362&pos=7",
+ "entityType": "OTHER",
+ "colour": "ffd1b6",
+ "industryTitle": "\u7f8e\u5986",
+ "_pos_": 7,
+ "industryBenefit": "\u5373\u523b\u9884\u7ea6\u7f8e\u4e3d",
+ "industryId": "2",
+ "industryImg": "//img.alicdn.com/tps/i1/TB1lNvoLVXXXXaoXFXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/guojixfs?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_1_735362&pos=8",
+ "entityType": "OTHER",
+ "colour": "b9eaf2",
+ "industryTitle": "\u5929\u732b\u56fd\u9645",
+ "_pos_": 8,
+ "industryBenefit": "\u5524\u9192\u5168\u7403\u6f6e\u6d41",
+ "industryId": "1",
+ "industryImg": "//img.alicdn.com/tps/i4/TB1JHbkLVXXXXblXFXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/newnv?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_10_735362&pos=9",
+ "entityType": "OTHER",
+ "colour": "fff8ee",
+ "industryTitle": "\u978b\u5c65",
+ "_pos_": 9,
+ "industryBenefit": "\u6f6e\u54c1\u7cbe\u9009\u978b\u5c65",
+ "industryId": "10",
+ "industryImg": "//img.alicdn.com/tps/i2/TB1RovwLVXXXXXnXpXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/nvzhuang?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_7_735362&pos=10",
+ "entityType": "OTHER",
+ "colour": "d5cbe8",
+ "industryTitle": "\u5973\u88c5",
+ "_pos_": 10,
+ "industryBenefit": "\u6298\u540e\u7528\u5238\u62a2\u65b0",
+ "industryId": "7",
+ "industryImg": "//img.alicdn.com/tps/i1/TB1BOncLVXXXXXSaXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/man?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_6_735362&pos=11",
+ "entityType": "OTHER",
+ "colour": "cbe9a9",
+ "industryTitle": "\u7537\u88c5",
+ "_pos_": 11,
+ "industryBenefit": "\u65b0\u54c1\u4f4e\u81f39.9\u5143",
+ "industryId": "6",
+ "industryImg": "//img.alicdn.com/tps/i4/TB1t9TmLVXXXXbkXFXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/myxfs?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_5_735362&pos=12",
+ "entityType": "OTHER",
+ "colour": "f8e1ff",
+ "industryTitle": "\u6bcd\u5a74\u7ae5\u88c5",
+ "_pos_": 12,
+ "industryBenefit": "\u8de8\u5e97\u6ee1299\u51cf40",
+ "industryId": "5",
+ "industryImg": "//img.alicdn.com/tps/i3/TB1kpziLVXXXXabXVXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/jfjs?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_4_735362&pos=13",
+ "entityType": "OTHER",
+ "colour": "bbffe5",
+ "industryTitle": "\u5bb6\u7eba\u5bb6\u9970",
+ "_pos_": 13,
+ "industryBenefit": "\u5168\u573a\u4f4e\u81f39.9\u5143",
+ "industryId": "4",
+ "industryImg": "//img.alicdn.com/tps/i1/TB1lUjzLVXXXXbAXXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/neiyi328?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_9_735362&pos=14",
+ "entityType": "OTHER",
+ "colour": "ffc7c9",
+ "industryTitle": "\u5185\u8863",
+ "_pos_": 14,
+ "industryBenefit": "\u65b0\u54c13\u6298\u8d77",
+ "industryId": "9",
+ "industryImg": "//img.alicdn.com/tps/i1/TB1S7PuLVXXXXcVXXXXrdvGIFXX-248-155.jpg"
+ },
+ {
+ "finalScore": 0,
+ "industryUrl": "//pages.tmall.com/wow/act/15617/ydhw?abbucket=_AB-M1011_B5&acm=03654.1003.1.735362&aldid=e5zPEI6R&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_8_735362&pos=15",
+ "entityType": "OTHER",
+ "colour": "cbdbfe",
+ "industryTitle": "\u8fd0\u52a8\u6237\u5916",
+ "_pos_": 15,
+ "industryBenefit": "\u5927\u724c\u65b0\u54c1\u62a2\u5238",
+ "industryId": "8",
+ "industryImg": "//img.alicdn.com/tps/i2/TB1mQDALVXXXXbdXXXXrdvGIFXX-248-155.jpg"
+ }],
+ "isFormal": false,
+ "exposureParam": "//ac.mmstat.com/1.gif?apply=vote&abbucket=_AB-M1011_B5&com=02&acm=03654.1003.1.735362&cod=03654&cache=CG5ZB02B&aldid=e5zPEI6R&logtype=4&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.735362",
+ "id": "03654"
+ }
+ },
+ "brand": {
+ "floorTitle": "https://gw.alicdn.com/tps/TB1._64LVXXXXatXVXXXXXXXXXX-750-100.jpg",
+ "bannerItems": [{
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ }]
+ },
+ "match": {
+ "floorTitle": "https://gw.alicdn.com/tps/TB1._64LVXXXXatXVXXXXXXXXXX-750-100.jpg",
+ "isShowTmSpecBanner": true,
+ "tmSpecBanner": {
+ "img": "https://gw.alicdn.com/tps/TB1F2fJLVXXXXccXFXXXXXXXXXX-750-230.jpg",
+ "url": "https://chaoshi.m.tmall.com/"
+ },
+ "bannerItems": [{
+ "leftImg": "https://gw.alicdn.com/tps/TB1OUnILVXXXXcoXFXXXXXXXXXX-374-416.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1OUnILVXXXXcoXFXXXXXXXXXX-374-416.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ },
+ {
+ "leftImg": "https://gw.alicdn.com/tps/TB1OUnILVXXXXcoXFXXXXXXXXXX-374-416.jpg",
+ "leftUrl": "https://chaoshi.m.tmall.com/",
+ "rightImg": "https://gw.alicdn.com/tps/TB1OUnILVXXXXcoXFXXXXXXXXXX-374-416.jpg",
+ "rightUrl": "https://chaoshi.m.tmall.com/"
+ }]
+ }
+ }
+ self.simLoadingData(this.cnt++)
+ },
+ _initEnv: function () {
+ var self = this;
+ var config = self.$getConfig(function () {
+ }) || {};
+ self._app.IS_H5 = typeof window === 'object';
+ self._app.IS_TEST = config.bundleUrl ? config.bundleUrl.indexOf('wh_test') > -1 : false;
+ self._app.OS = config.os;
+ self._app.PLATFORM = config.platform;
+ var title = '\u65b0\u98ce\u5c1a\u4e3b\u4f1a\u573a';
+ self._app.config = {
+ title: title,
+ pageName: '2016-xfs-main'
+ };
+ },
+ _initUtil: function () {
+ var self = this;
+ var app = self._app || {};
+ app.Util = {
+ randomInt: function (min, max) {
+ return Math.round(Math.random() * (max - min)) + min;
+ },
+ randomItemFromArr: function (arr) {
+ if (!arr) return;
+ return arr[self._app.Util.randomInt(0, arr.length - 1)];
+ },
+ httpurl: function (url) {
+ var params = {};
+
+ Object.defineProperty(this, 'params', {
+ set: function (v) {
+ if (typeof v === 'object') {
+ for (var p in params) {
+ delete params[p];
+ }
+ for (var p in v) {
+ params[p] = v[p];
+ }
+ }
+ },
+ get: function () {
+ return params;
+ },
+ enumerable: true
+ });
+
+ Object.defineProperty(this, 'search', {
+ set: function (v) {
+ if (typeof v === 'string') {
+ if (v.indexOf('?') === 0) {
+ v = v.substr(1);
+ }
+ var search = v.split('&');
+ for (var p in params) {
+ delete params[p];
+ }
+ for (var i = 0; i < search.length; i++) {
+ var pair = search[i].split('=');
+ if (pair[0]) {
+ try {
+ params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
+ } catch (e) {
+ params[pair[0]] = pair[1] || '';
+ }
+ }
+ }
+ }
+ },
+ get: function () {
+ var search = [];
+ for (var p in params) {
+ if (params[p]) {
+ try {
+ search.push(encodeURIComponent(p) + '=' + encodeURIComponent(params[p]));
+ } catch (e) {
+ search.push(p + '=' + params[p]);
+ }
+ } else {
+ try {
+ search.push(encodeURIComponent(p));
+ } catch (e) {
+ search.push(p);
+ }
+ }
+ }
+ if (search.length) {
+ return '?' + search.join('&');
+ } else {
+ return '';
+ }
+ },
+ enumerable: true
+ });
+
+ var hash;
+ Object.defineProperty(this, 'hash', {
+ set: function (v) {
+ if (typeof v === 'string') {
+ if (v && v.indexOf('#') < 0) {
+ v = '#' + v;
+ }
+ hash = v || '';
+ }
+ },
+ get: function () {
+ return hash;
+ },
+ enumerable: true
+ });
+
+ this.set = function (v) {
+ var matchArr;
+ if ((matchArr = v.match(new RegExp('^([a-z0-9-]+\:)?' + //protocol
+ '[/]{2}' + //slash x 2
+ '(?:([^@/:\?]+)(?::([^@/:]+))?@)?' + //username:password@
+ '([^:/?#]+)' + //hostname
+ '(?:[:]([0-9]+))?' + //port
+ '([/][^?#;]*)?' + //pathname
+ '(?:[?]([^?#]*))?' + //search
+ '(#[^#]*)?$' //hash
+ , 'i')))) {
+ this.protocol = matchArr[1] || '';
+ this.username = matchArr[2] || '';
+ this.password = matchArr[3] || '';
+ this.hostname = this.host = matchArr[4];
+ this.port = matchArr[5] || '';
+ this.pathname = matchArr[6] || '/';
+ this.search = matchArr[7] || '';
+ this.hash = matchArr[8] || '';
+ this.origin = this.protocol + '//' + this.hostname;
+ } else {
+ throw new Error('Wrong uri scheme.');
+ }
+ };
+
+ this.toString = function () {
+ var string = this.protocol + '//';
+ if (this.username) {
+ string += this.username;
+ if (this.password) {
+ string += ':' + this.password;
+ }
+ string += '@';
+ }
+ string += this.host;
+ if (this.port && this.port !== '80') {
+ string += ':' + this.port;
+ }
+ if (this.pathname) {
+ string += this.pathname;
+ }
+ if (this.search) {
+ string += this.search;
+ }
+ if (this.hash) {
+ string += this.hash;
+ }
+ return string;
+ };
+
+ this.set(url.toString());
+ }
+
+ }
+ },
+ handleRefresh: function (e) {
+ var vm = this
+ vm.displayRefresh = 'show'
+ var timer = __weex_require__('@weex-module/timer')
+ if (timer) {
+ timer.setTimeout(function () {
+ vm.displayRefresh = 'hide'
+ }, 2000)
+ } else {
+ this.$call('modal', 'alert', {
+ message: 'refreshing.'
+ }, function () {
+ vm.displayRefresh = 'hide'
+ })
+ }
+ },
+ handleLoading: function (e) {
+ var vm = this
+ vm.displayLoading = 'show'
+ this.$call('modal', 'toast', {
+ message: 'loading.'
+ })
+ var timer = __weex_require__('@weex-module/timer')
+ if (timer) {
+ timer.setTimeout(function () {
+ vm.simLoadingData(vm.cnt++)
+ vm.displayLoading = 'hide'
+ }, 2000)
+ } else {
+ vm.simLoadingData(vm.cnt++)
+ vm.displayLoading = 'hide'
+ }
+ },
+ simLoadingData: function (num) {
+ if (num >= 3) {
+ this.$call('modal', 'toast', {
+ message: '\u5df2\u5230\u5e95\u90e8'
+ })
+ return
+ }
+ this['show' + num] = true
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "wxc-navpage",
+ "attr": {
+ "dataRole": "none",
+ "height": function () {return this.navBarHeight},
+ "backgroundColor": "#ff5898",
+ "title": "\u65b0\u98ce\u5c1a\u4f1a\u573a",
+ "titleColor": "white",
+ "rightItemSrc": "http://gtms02.alicdn.com/tps/i2/TB1ED7iMpXXXXXEXXXXWA_BHXXX-48-48.png"
+ },
+ "children": [
+ {
+ "type": "scroller",
+ "classList": [
+ "content"
+ ],
+ "children": [
+ {
+ "type": "refresh",
+ "classList": [
+ "refresh"
+ ],
+ "events": {
+ "refresh": "handleRefresh"
+ },
+ "attr": {
+ "display": function () {return this.displayRefresh}
+ },
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "loading-indicator"
+ },
+ {
+ "type": "text",
+ "style": {
+ "marginLeft": 36,
+ "color": "#eeeeee"
+ },
+ "attr": {
+ "value": "\u4e0b\u62c9\u5237\u65b0..."
+ }
+ }
+ ]
+ },
+ {
+ "type": "headlines",
+ "shown": function () {return this.show0},
+ "attr": {
+ "ds": function () {return this.showData.header}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "category",
+ "shown": function () {return this.show0},
+ "attr": {
+ "ds": function () {return this.showData.category}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "coupon",
+ "shown": function () {return this.show1},
+ "attr": {
+ "ds": function () {return this.showData.coupon}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "goods",
+ "shown": function () {return this.show1},
+ "attr": {
+ "ds": function () {return this.showData.goods}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "resource",
+ "shown": function () {return this.show1},
+ "attr": {
+ "ds": function () {return this.showData.resource}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "scene",
+ "shown": function () {return this.show1},
+ "attr": {
+ "ds": function () {return this.showData.scene}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "match",
+ "shown": function () {return this.show2},
+ "attr": {
+ "ds": function () {return this.showData.match}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "brand",
+ "shown": function () {return this.show2},
+ "attr": {
+ "ds": function () {return this.showData.brand}
+ },
+ "append": "tree"
+ },
+ {
+ "type": "loading",
+ "classList": [
+ "loading"
+ ],
+ "events": {
+ "loading": "handleLoading"
+ },
+ "attr": {
+ "display": function () {return this.displayLoading}
+ },
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "color": "#eeeeee"
+ },
+ "attr": {
+ "value": "\u52a0\u8f7d\u66f4\u591a..."
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "content": {
+ "color": "#353535",
+ "backgroundColor": "#666666",
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "refresh": {
+ "display": "flex",
+ "alignItems": "center",
+ "justifyContent": "center"
+ },
+ "loading": {
+ "display": "flex",
+ "alignItems": "center",
+ "justifyContent": "center"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/73b44713db2eae6d536291fb7cc654e4", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ },
+/* 13 */,
+/* 14 */,
+/* 15 */,
+/* 16 */,
+/* 17 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ },
+/* 18 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/banners", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ space: 0,
+ width: 0,
+ height: 0,
+ spmc:0,
+ spmdprefix:'',
+ ds: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ var ds = self.ds;
+ var length = ds.length;
+ for (var i = 0; i < length; i++) {
+ var item = ds[i];
+ item.index = i;
+ item.space = (i % length === 0) ? 0 : self.space;
+ }
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='row'},
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginLeft": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='column'},
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginTop": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+
+/***/ },
+/* 19 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/link", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ text: '',
+ href: ''
+ }},
+ methods: {
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "text",
+ "classList": [
+ "link"
+ ],
+ "shown": function () {return this.href},
+ "events": {
+ "click": "_clickHandler"
+ },
+ "attr": {
+ "value": function () {return this.text}
+ }
+ }
+ })
+
+/***/ },
+/* 20 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/headlines", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(19);
+ __webpack_require__(18);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ ds: {},
+ NUMBER_233: 233,
+ NUMBER_172: 172,
+ NUMBER_3: 3
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self.isH5 = self._app.IS_H5;
+ self.isTM = self._app.IS_TM;
+ self.isTest = self._app.IS_TEST;
+ },
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "classList": [
+ "container"
+ ],
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "banner"
+ ],
+ "attr": {
+ "src": function () {return this.ds.topBanner}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "rule-container"
+ ],
+ "children": [
+ {
+ "type": "link",
+ "style": {
+ "fontSize": 22,
+ "color": "#ffffff",
+ "textAlign": "center"
+ },
+ "attr": {
+ "text": "\u5e2e\u52a9",
+ "href": function () {return this.ds.ruleLink}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "announce"
+ ],
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "announce-hd"
+ ],
+ "attr": {
+ "src": function () {return this.ds.announceHdBanner}
+ }
+ },
+ {
+ "type": "banners",
+ "style": {
+ "marginLeft": 6,
+ "marginRight": 6
+ },
+ "attr": {
+ "ds": function () {return this.ds.bannerItems},
+ "direction": "row",
+ "width": function () {return this.NUMBER_233},
+ "height": function () {return this.NUMBER_172},
+ "space": function () {return this.NUMBER_3}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "banner": {
+ "width": 750,
+ "height": 782
+ },
+ "share-container": {
+ "position": "absolute",
+ "right": 100,
+ "top": 15,
+ "zIndex": 100,
+ "fontSize": 20,
+ "color": "#ffffff",
+ "backgroundColor": "#000000",
+ "borderRadius": 17,
+ "width": 110,
+ "height": 35,
+ "justifyContent": "center",
+ "alignItems": "center"
+ },
+ "rule-container": {
+ "position": "absolute",
+ "right": 22,
+ "top": 15,
+ "zIndex": 100,
+ "fontSize": 20,
+ "color": "#ffffff",
+ "backgroundColor": "#000000",
+ "borderRadius": 17,
+ "width": 70,
+ "height": 35,
+ "justifyContent": "center"
+ },
+ "announce": {
+ "backgroundColor": "#f5f3f4",
+ "width": 716,
+ "height": 286,
+ "position": "absolute",
+ "bottom": 17,
+ "left": 17,
+ "borderRadius": 5
+ },
+ "announce-hd": {
+ "width": 700,
+ "height": 90,
+ "marginTop": 8,
+ "marginBottom": 8,
+ "marginLeft": 5,
+ "marginRight": 5
+ }
+ }
+ })
+
+/***/ },
+/* 21 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/category", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_248: 248,
+ NUMBER_155: 155,
+ NUMBER_373: 373,
+ NUMBER_237: 237,
+ NUMBER_186: 186,
+ NUMBER_208: 208,
+ NUMBER_750: 750,
+ subItemBg: '//gw.alicdn.com/tps/TB1QzUfLVXXXXaOXVXXXXXXXXXX-248-86.jpg',
+ items: [],
+ subItems: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self._loadData();
+ },
+
+ _loadData: function () {
+ var self = this;
+ var content = {
+ "main": [{
+ "shopList": [{
+ "id": "619123122",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1Cl5MLVXXXXXTaXXXSutbFXXX.jpg",
+ "finalScore": "0.884765209440857",
+ "shopUrl": "http://liangpinpuzi.tmall.com/campaign-3735-7.htm",
+ "entityType": "SHOP",
+ "brandId": "7724367"
+ }, {
+ "id": "880734502",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1HN2XLVXXXXbkXFXXSutbFXXX.jpg",
+ "finalScore": "0.8822246866512714",
+ "shopUrl": "http://sanzhisongshu.tmall.com/campaign-3735-7.htm",
+ "entityType": "SHOP",
+ "brandId": "147280915"
+ }, {
+ "id": "392147177",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1yq6dLVXXXXbXXpXXSutbFXXX.jpg",
+ "finalScore": "0.8805854724243631",
+ "shopUrl": "http://zhouheiya.tmall.com/campaign-3735-6.htm",
+ "entityType": "SHOP",
+ "brandId": "111496"
+ }, {
+ "id": "2081058060",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1w4jxLVXXXXaxXXXXtKXbFXXX.gif",
+ "finalScore": "0.8640439551049249",
+ "shopUrl": "http://rongxintang.tmall.com/campaign-3735-6.htm",
+ "entityType": "SHOP",
+ "brandId": "8709890"
+ }],
+ "finalScore": "4.657333333333334",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#fff5a3",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/newfood?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_12_735362&pos=1",
+ "leftBannerImg": "http://img.alicdn.com/tps/i1/TB1LHh4MXXXXXbsXpXXeWjm2pXX-750-240.jpg",
+ "_pos_": "1",
+ "industryBenefit": null,
+ "industryId": "12",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i4/TB1wshUMXXXXXXaXVXXeWjm2pXX-750-240.jpg"
+ }, {
+ "shopList": [{
+ "id": "520557274",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1aMjXLVXXXXbUaXXXSutbFXXX.jpg",
+ "finalScore": "0.8986382989845325",
+ "shopUrl": "http://newbalance.tmall.com/campaign-3735-20.htm",
+ "entityType": "SHOP",
+ "brandId": "20584"
+ }, {
+ "id": "746866993",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1pXG9LVXXXXaLXFXXSutbFXXX.jpg",
+ "finalScore": "0.8917855242977327",
+ "shopUrl": "http://vans.tmall.com/campaign-3735-19.htm",
+ "entityType": "SHOP",
+ "brandId": "29529"
+ }, {
+ "id": "1612713147",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1jHfXLVXXXXXPXFXXSutbFXXX.jpg",
+ "finalScore": "0.8895943606442631",
+ "shopUrl": "http://dcshoecousa.tmall.com/campaign-3735-8.htm",
+ "entityType": "SHOP",
+ "brandId": "3851662"
+ }, {
+ "id": "2379251418",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1sbLlLVXXXXbeXXXXSutbFXXX.jpg",
+ "finalScore": "0.8881539668874383",
+ "shopUrl": "http://baijinydhw.tmall.com/campaign-3735-2.htm",
+ "entityType": "SHOP",
+ "brandId": "20579"
+ }],
+ "finalScore": "4.545333333333334",
+ "industryUrl": null,
+ "entityType": "OTHER",
+ "colour": "#cbdbfe",
+ "industryTitle": null,
+ "bannerUrl": "//pages.tmall.com/wow/act/15617/ydhw?abbucket=_AB-M1011_B14&acm=03654.1003.1.735362&aldid=KXPpnvEH&abtest=_AB-LR1011-PR1011&scm=1003.1.03654.OTHER_8_735362&pos=2",
+ "leftBannerImg": "http://img.alicdn.com/tps/i3/TB1h4kzLVXXXXawXpXXeWjm2pXX-750-240.jpg",
+ "_pos_": "2",
+ "industryBenefit": null,
+ "industryId": "8",
+ "industryImg": null,
+ "rightBannerImg": "//img.alicdn.com/tps/i4/TB19VMjLVXXXXaeaXXXeWjm2pXX-750-240.jpg"
+ }, {
+ "shopList": [{
+ "id": "811383091",
+ "picUrl": "//img.alicdn.com/tps/i1/TB1q49ZLVXXXXaJXVXXSutbFXXX.jpg",
+ "finalScore": "0.8723682716749482",
+ "shopUrl": "http://tongrentangbj.tmall.com/campaign-3735-9.htm",
+ "entityType": "SHOP",
+ "brandId": "44652"
+ }, {
+ "id": "838914626",
+ "picUrl": "//img.alicdn.com/tps/i1/T
<TRUNCATED>
[29/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/style/index.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/style/index.js b/ios/playground/bundlejs/style/index.js
new file mode 100644
index 0000000..f22fed6
--- /dev/null
+++ b/ios/playground/bundlejs/style/index.js
@@ -0,0 +1,2330 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/2d0eb19485821566128decfe84fa4812", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(28);
+ __webpack_require__(30);
+ __webpack_require__(29);
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {}}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "style-box"
+ },
+ {
+ "type": "style-flex"
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "opacity",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "opacity": 1
+ },
+ "attr": {
+ "value": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "opacity": 0.9
+ },
+ "attr": {
+ "value": "0.9"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "opacity": 0.5
+ },
+ "attr": {
+ "value": "0.5"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "opacity": 0.2
+ },
+ "attr": {
+ "value": "0.2"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "background-color",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "style-item",
+ "classList": [
+ "bg-item"
+ ],
+ "style": {
+ "backgroundColor": "#333333"
+ },
+ "attr": {
+ "value": "#333"
+ }
+ },
+ {
+ "type": "style-item",
+ "classList": [
+ "bg-item"
+ ],
+ "style": {
+ "backgroundColor": "#333333"
+ },
+ "attr": {
+ "value": "#333333"
+ }
+ },
+ {
+ "type": "style-item",
+ "classList": [
+ "bg-item"
+ ],
+ "style": {
+ "backgroundColor": "rgb(238,162,54)"
+ },
+ "attr": {
+ "value": "rgb()"
+ }
+ },
+ {
+ "type": "style-item",
+ "classList": [
+ "bg-item"
+ ],
+ "style": {
+ "backgroundColor": "rgba(238,162,54,0.5)"
+ },
+ "attr": {
+ "value": "rgba()"
+ }
+ },
+ {
+ "type": "style-item",
+ "classList": [
+ "bg-item"
+ ],
+ "style": {
+ "backgroundColor": "#FF0000"
+ },
+ "attr": {
+ "value": "red"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "bg-item": {
+ "width": 690,
+ "marginBottom": 10
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/2d0eb19485821566128decfe84fa4812", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ },
+/* 13 */,
+/* 14 */,
+/* 15 */,
+/* 16 */,
+/* 17 */,
+/* 18 */,
+/* 19 */,
+/* 20 */,
+/* 21 */,
+/* 22 */,
+/* 23 */,
+/* 24 */,
+/* 25 */,
+/* 26 */,
+/* 27 */,
+/* 28 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/style-box", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(29);
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ size: 40
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Box Model",
+ "paddingBody": "0",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "box"
+ ],
+ "attr": {
+ "value": "Box"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-width",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 2,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 10,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderLeftWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderBottomWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-color",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#dddddd"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#FF0000"
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-style",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "wxc-tip",
+ "attr": {
+ "type": "warning",
+ "value": "just support four edges"
+ },
+ "style": {
+ "marginBottom": 10
+ }
+ },
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "solid",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "dashed",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": "",
+ "type": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderStyle": "dotted",
+ "borderWidth": 4,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "border-radius",
+ "type": ""
+ },
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "width": 75,
+ "borderRadius": 38
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderRadius": 20
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderTopLeftRadius": 20,
+ "borderTopRightRadius": 20
+ },
+ "attr": {
+ "value": ""
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "borderBottomLeftRadius": 20,
+ "borderBottomRightRadius": 20
+ },
+ "attr": {
+ "value": ""
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "box": {
+ "backgroundColor": "#f5f5f5",
+ "width": 260,
+ "height": 260,
+ "paddingLeft": 40,
+ "paddingTop": 40,
+ "paddingRight": 40,
+ "paddingBottom": 40,
+ "marginLeft": 40,
+ "marginTop": 40,
+ "marginRight": 40,
+ "marginBottom": 40,
+ "borderWidth": 40,
+ "borderColor": "#333333",
+ "borderStyle": "solid"
+ }
+ }
+ })
+
+/***/ },
+/* 29 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/style-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ value: '',
+ type: '0' // 0, 1
+ }},
+ methods: {
+ bgColor: function() {
+ return this.type == '1' ? '#7BA3A8' : '#BEAD92';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "text",
+ "classList": [
+ "item",
+ "txt"
+ ],
+ "attr": {
+ "value": function () {return this.value}
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor()}
+ }
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "marginRight": 10,
+ "width": 160,
+ "height": 75,
+ "paddingLeft": 8,
+ "paddingRight": 8,
+ "paddingTop": 8,
+ "paddingBottom": 8
+ },
+ "txt": {
+ "color": "#eeeeee"
+ }
+ }
+ })
+
+/***/ },
+/* 30 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/style-flex", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(29);
+
+ ;
+ __webpack_require__(1);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "flex-direction",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "row"
+ },
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "type": "1"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexDirection": "column"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "column"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "type": "1"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "justify-content",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "flex-end"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "justifyContent": "space-between"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "align-items",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "flex-end"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "center"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row",
+ "row-align"
+ ],
+ "style": {
+ "alignItems": "stretch"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "flex",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex",
+ "type": "1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0
+ },
+ "attr": {
+ "value": "no flex"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "type": "1",
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 2
+ },
+ "attr": {
+ "value": "flex:2"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "type": "1",
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "value": "flex:1"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "alignItems": "flex-start"
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 1
+ },
+ "attr": {
+ "value": "flex:1"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 2
+ },
+ "attr": {
+ "type": "1",
+ "value": "flex:2"
+ }
+ },
+ {
+ "type": "style-item",
+ "style": {
+ "marginRight": 0,
+ "flex": 3
+ },
+ "attr": {
+ "value": "flex:3"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "flex-wrap",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexWrap": "wrap",
+ "backgroundColor": "#808080",
+ "padding": 10
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "1:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "2:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "3:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "4:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "5:wrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "6:wrap"
+ }
+ }
+ ]
+ },
+ {
+ "type": "div",
+ "classList": [
+ "row"
+ ],
+ "style": {
+ "flexWrap": "nowrap",
+ "backgroundColor": "#808080",
+ "padding": 10
+ },
+ "children": [
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "1:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "2:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "3:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "4:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "5:nowrap"
+ }
+ },
+ {
+ "type": "style-item",
+ "attr": {
+ "value": "6:nowrap"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "row": {
+ "flexDirection": "row",
+ "marginBottom": 10
+ },
+ "row-align": {
+ "height": 160,
+ "borderWidth": 3,
+ "borderColor": "#dddddd",
+ "borderStyle": "solid"
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[24/50] [abbrv] incubator-weex git commit: + [ios] Add gitignore file
in iOS
Posted by ji...@apache.org.
+ [ios] Add gitignore file in iOS
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/93435d86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/93435d86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/93435d86
Branch: refs/heads/master
Commit: 93435d867d4e7282754e7002d6b0dee0aac70762
Parents: 185fe55
Author: \u9690\u98ce <cx...@gmail.com>
Authored: Sun Jun 12 23:38:31 2016 +0800
Committer: \u9690\u98ce <cx...@gmail.com>
Committed: Sun Jun 12 23:38:31 2016 +0800
----------------------------------------------------------------------
ios/.gitignore | 66 ++++++++++++++++++++++++++++++++++
ios/playground/CFNetwork.gcno | Bin 12900 -> 0 bytes
ios/playground/CoreGraphics.gcno | Bin 2348 -> 0 bytes
ios/playground/Foundation.gcno | Bin 4020 -> 0 bytes
ios/playground/ObjectiveC.gcno | Bin 24364 -> 0 bytes
5 files changed, 66 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/93435d86/ios/.gitignore
----------------------------------------------------------------------
diff --git a/ios/.gitignore b/ios/.gitignore
new file mode 100644
index 0000000..4865962
--- /dev/null
+++ b/ios/.gitignore
@@ -0,0 +1,66 @@
+# Created by https://www.gitignore.io/api/objective-c
+
+### Objective-C ###
+# Xcode
+#
+# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
+
+## Build generated
+build/
+_demo/
+DerivedData
+
+## Various settings
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata
+
+## Other
+*.xccheckout
+*.moved-aside
+*.xcuserstate
+*.xcscmblueprint
+
+## Obj-C/Swift specific
+*.hmap
+*.ipa
+
+# CocoaPods
+#
+# We recommend against adding the Pods directory to your .gitignore. However
+# you should judge for yourself, the pros and cons are mentioned at:
+# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
+#
+# Pods/
+
+# Carthage
+#
+# Add this line if you want to avoid checking in source code from Carthage dependencies.
+# Carthage/Checkouts
+
+Carthage/Build
+
+# fastlane
+#
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# screenshots whenever they are needed.
+# For more information about the recommended setup visit:
+# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
+
+fastlane/report.xml
+fastlane/screenshots
+
+### Objective-C Patch ###
+*.xcscmblueprint
+
+
+# Created by https://www.gitignore.io/api/node
+
+*.gcno
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/93435d86/ios/playground/CFNetwork.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/CFNetwork.gcno b/ios/playground/CFNetwork.gcno
deleted file mode 100644
index 5b6ec63..0000000
Binary files a/ios/playground/CFNetwork.gcno and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/93435d86/ios/playground/CoreGraphics.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/CoreGraphics.gcno b/ios/playground/CoreGraphics.gcno
deleted file mode 100644
index cf63b22..0000000
Binary files a/ios/playground/CoreGraphics.gcno and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/93435d86/ios/playground/Foundation.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/Foundation.gcno b/ios/playground/Foundation.gcno
deleted file mode 100644
index e13f146..0000000
Binary files a/ios/playground/Foundation.gcno and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/93435d86/ios/playground/ObjectiveC.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/ObjectiveC.gcno b/ios/playground/ObjectiveC.gcno
deleted file mode 100644
index ae8b21c..0000000
Binary files a/ios/playground/ObjectiveC.gcno and /dev/null differ
[44/50] [abbrv] incubator-weex git commit: - [ios] remove weex demo
taget in WXSelectComponent
Posted by ji...@apache.org.
- [ios] remove weex demo taget in WXSelectComponent
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/bd962e77
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/bd962e77
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/bd962e77
Branch: refs/heads/master
Commit: bd962e77cc7cee410d1d047d39a2ba1c74286182
Parents: f4fd082
Author: \u9690\u98ce <cx...@gmail.com>
Authored: Mon Jun 13 11:35:32 2016 +0800
Committer: \u9690\u98ce <cx...@gmail.com>
Committed: Mon Jun 13 11:36:16 2016 +0800
----------------------------------------------------------------------
ios/playground/QuartzCore.gcno | Bin 13724 -> 0 bytes
ios/playground/WeexDemo/AppDelegate.m | 3 +--
2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bd962e77/ios/playground/QuartzCore.gcno
----------------------------------------------------------------------
diff --git a/ios/playground/QuartzCore.gcno b/ios/playground/QuartzCore.gcno
deleted file mode 100644
index 0113b7c..0000000
Binary files a/ios/playground/QuartzCore.gcno and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bd962e77/ios/playground/WeexDemo/AppDelegate.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/AppDelegate.m b/ios/playground/WeexDemo/AppDelegate.m
index fc228f3..005f2d0 100644
--- a/ios/playground/WeexDemo/AppDelegate.m
+++ b/ios/playground/WeexDemo/AppDelegate.m
@@ -10,7 +10,6 @@
#import "WXDemoViewController.h"
#import "UIViewController+WXDemoNaviBar.h"
#import "WXStreamModule.h"
-#import "WXSelectComponent.h"
#import "WXEventModule.h"
#import "WXNavigationDefaultImpl.h"
#import "WXImgLoaderDefaultImpl.h"
@@ -83,7 +82,7 @@
[WXSDKEngine registerHandler:[WXImgLoaderDefaultImpl new] withProtocol:@protocol(WXImgLoaderProtocol)];
[WXSDKEngine registerHandler:[WXEventModule new] withProtocol:@protocol(WXEventModuleProtocol)];
- [WXSDKEngine registerComponent:@"select" withClass:[WXSelectComponent class]];
+ [WXSDKEngine registerComponent:@"select" withClass:NSClassFromString(@"WXSelectComponent")];
[WXSDKEngine registerModule:@"event" withClass:[WXEventModule class]];
[self atAddPlugin];
[07/50] [abbrv] incubator-weex git commit: Merge pull request #400
from tz-world/dev
Posted by ji...@apache.org.
Merge pull request #400 from tz-world/dev
* [doc] fix gitbook version
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/23dd719c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/23dd719c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/23dd719c
Branch: refs/heads/master
Commit: 23dd719ccfa31521dbb0e14af162b9d69b6b70ab
Parents: d77c0d0 25efd05
Author: Jinjiang <zh...@me.com>
Authored: Sun Jun 5 08:38:20 2016 -0500
Committer: Jinjiang <zh...@me.com>
Committed: Sun Jun 5 08:38:20 2016 -0500
----------------------------------------------------------------------
doc/book.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[04/50] [abbrv] incubator-weex git commit: Merge pull request #316
from alibaba/doc-upgrade_gitbook
Posted by ji...@apache.org.
Merge pull request #316 from alibaba/doc-upgrade_gitbook
Doc upgrade gitbook
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/32847dc8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/32847dc8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/32847dc8
Branch: refs/heads/master
Commit: 32847dc8561266fde4017cfb30c03230e9e2748c
Parents: 9de5695 ca86007
Author: gurisxie <27...@qq.com>
Authored: Thu May 26 00:09:03 2016 +0800
Committer: gurisxie <27...@qq.com>
Committed: Thu May 26 00:09:03 2016 +0800
----------------------------------------------------------------------
doc/SUMMARY.md | 30 +++++-----
doc/_layouts/website/languages.html | 2 +-
doc/_layouts/website/layout.html | 6 +-
doc/_layouts/website/page.html | 89 +++++++++++-------------------
doc/_layouts/website/summary.html | 61 ++++++++++----------
doc/_layouts/website/weex_header.html | 24 ++++++++
doc/book.json | 2 +-
7 files changed, 106 insertions(+), 108 deletions(-)
----------------------------------------------------------------------
[35/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/index.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/index.js b/ios/playground/bundlejs/index.js
new file mode 100644
index 0000000..1751ec5
--- /dev/null
+++ b/ios/playground/bundlejs/index.js
@@ -0,0 +1,1343 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/e186bc461decd02d9edfd73b2750de6a", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(16);
+ __weex_module__.exports = {
+ data: function () {return {
+ items: [
+ // `name` key is the example filename without '.we'
+ // Support sub directory, e.g. 'new-fashion/index'
+ {name: 'hello', title: 'Hello World'},
+ {name: 'style/index', title: 'Common Style'},
+ {name: 'animation', title: 'Animation'},
+ // component
+ {name: 'component/text-demo', title: 'Text'},
+ {name: 'component/image-demo', title: 'Image'},
+ {name: 'component/scroller-demo', title: 'Scroller'},
+ {name: 'component/list/list-basic', title: 'List (Basic)'},
+ {name: 'component/list/list-demo', title: 'List (Advanced)'},
+ {name: 'component/slider/index', title: 'Slider'},
+ {name: 'component/a-demo',title:'A'},
+ {name: 'component/video-demo', title: 'Video'},
+ {name: 'component/countdown-demo', title: 'Countdown'},
+ {name: 'component/marquee-demo', title: 'Marquee'},
+ {name: 'component/web-demo', title: 'Web'},
+ {name: 'component/navigator-demo', title: 'Navigator'},
+ {name: 'component/tabbar/tabbar-demo', title: 'Tabbar'},
+
+ // module
+ {name: 'module/instance-api', title: 'Instance API'},
+ {name: 'module/modal', title: 'Modal'},
+ {name: 'module/stream-demo', title: 'Stream'},
+ // showcase
+ {name: 'showcase/new-fashion/index', title: 'Activity'},
+ {name: 'showcase/calculator', title: 'Calculator'},
+ {name: 'showcase/ui', title: 'UI Gallery'}
+ ]
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "example-list",
+ "attr": {
+ "items": function () {return this.items},
+ "dir": "examples"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/e186bc461decd02d9edfd73b2750de6a", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ },
+/* 13 */,
+/* 14 */,
+/* 15 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/example-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ title: '',
+ url: ''
+ }},
+ methods: {
+ redirect: function() {
+ this.$openURL(this.url);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "wxc-list-item",
+ "events": {
+ "click": "redirect"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "item-txt"
+ ],
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item-txt": {
+ "fontSize": 48,
+ "color": "#555555"
+ }
+ }
+ })
+
+/***/ },
+/* 16 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/example-list", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(15);
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ dir: 'examples', // examples, test ...
+ items: [
+ {name: 'hello', title: 'Hello World', url: ''}
+ ]
+ }},
+ created: function() {
+ var bundleUrl = this.$getConfig().bundleUrl;
+ console.log('hit', bundleUrl);
+ var nativeBase;
+ var isAndroidAssets = bundleUrl.indexOf('your_current_IP') >= 0;
+ var isiOSAssets = bundleUrl.indexOf('file:///') >= 0 && bundleUrl.indexOf('WeexDemo.app') > 0;
+ if (isAndroidAssets) {
+ nativeBase = 'file://assets/';
+ }
+ else if (isiOSAssets) {
+ // file:///var/mobile/Containers/Bundle/Application/{id}/WeexDemo.app/
+ // file:///Users/{user}/Library/Developer/CoreSimulator/Devices/{id}/data/Containers/Bundle/Application/{id}/WeexDemo.app/
+ nativeBase = bundleUrl.substring(0, bundleUrl.lastIndexOf('/') + 1);
+ }
+ else {
+ var host = 'localhost:12580';
+ var matches = /\/\/([^\/]+?)\//.exec(this.$getConfig().bundleUrl);
+ if (matches && matches.length >= 2) {
+ host = matches[1];
+ }
+ nativeBase = '//' + host + '/' + this.dir + '/build/';
+ }
+ var h5Base = './index.html?page=./' + this.dir + '/build/';
+ // in Native
+ var base = nativeBase;
+ if (typeof window === 'object') {
+ // in Browser or WebView
+ base = h5Base;
+ }
+
+ for (var i in this.items) {
+ var item = this.items[i];
+ if (!item.url) {
+ item.url = base + item.name + '.js';
+ }
+ }
+ // see log in Android Logcat
+ if (this.items.length) console.log('hit', this.items[0].url);
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "list",
+ "children": [
+ {
+ "type": "cell",
+ "append": "tree",
+ "repeat": function () {return this.items},
+ "children": [
+ {
+ "type": "example-list-item",
+ "attr": {
+ "title": function () {return this.title},
+ "url": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={}
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/module/instance-api.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/module/instance-api.js b/ios/playground/bundlejs/module/instance-api.js
new file mode 100644
index 0000000..bb0b3eb
--- /dev/null
+++ b/ios/playground/bundlejs/module/instance-api.js
@@ -0,0 +1,1208 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/cfb8de6a4b80bcd056ebdda8166f0ce5", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+
+ __weex_module__.exports = {
+ data: function () {return {
+ config: ''
+ }},
+ ready: function() {
+ var config = this.$getConfig();
+ console.log('config', JSON.stringify(config));
+ this.config = JSON.stringify(config, null, 2);
+ },
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "$getConfig()",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "text",
+ "attr": {
+ "value": function () {return this.config}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/cfb8de6a4b80bcd056ebdda8166f0ce5", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[34/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/module/modal.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/module/modal.js b/ios/playground/bundlejs/module/modal.js
new file mode 100644
index 0000000..c0e3f51
--- /dev/null
+++ b/ios/playground/bundlejs/module/modal.js
@@ -0,0 +1,1301 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/8ea70668c6413be67c175cef15957ba2", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {}},
+ methods: {
+ toast: function(msg, duration) {
+ if (!msg || typeof msg !== 'string') {
+ msg = 'I am Toast show!';
+ }
+
+ duration = duration || 2;
+ this.$call('modal', 'toast', {
+ 'message': msg,
+ 'duration': duration
+ });
+ },
+ alert: function(msg, okTitle, cancelTitle) {
+ var self = this;
+ if (!msg || typeof msg !== 'string') {
+ msg = "I am Alert!";
+ }
+ this.$call('modal', 'alert', {
+ 'message': msg,
+ 'okTitle': okTitle,
+ 'cancelTitle': cancelTitle
+ }, function() {
+ self.toast("Click Alert OK Bnt!!");
+ });
+ },
+ confirm: function(msg, okTitle, cancelTitle) {
+ var self = this
+ if (!msg || typeof msg !== 'string') {
+ msg = "I am Confirm!";
+ }
+
+ okTitle = okTitle || "OK";
+ cancelTitle = cancelTitle || "Cancel";
+ this.$call('modal', 'confirm', {
+ 'message': msg,
+ 'okTitle': okTitle,
+ 'cancelTitle': cancelTitle
+ }, function(result) {
+ self.toast("Click Confirm " + result);
+ });
+ },
+ prompt: function() {
+ var self = this;
+ this.$call('modal', 'prompt', {
+ 'message': 'I am Prompt!',
+ 'okTitle': 'ok',
+ 'cancelTitle': 'cancel'
+ }, function(result) {
+ self.toast("Click Prompt " + result);
+ });
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Toast",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "primary",
+ "value": "Toast"
+ },
+ "events": {
+ "click": "toast"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Dialog",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "success",
+ "value": "Alert"
+ },
+ "events": {
+ "click": "alert"
+ },
+ "style": {
+ "marginBottom": 20
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "primary",
+ "value": "Confirm"
+ },
+ "events": {
+ "click": "confirm"
+ },
+ "style": {
+ "marginBottom": 20
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "warning",
+ "value": "Prompt"
+ },
+ "events": {
+ "click": "prompt"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={}
+ })
+ ;__weex_bootstrap__("@weex-component/8ea70668c6413be67c175cef15957ba2", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/module/stream-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/module/stream-demo.js b/ios/playground/bundlejs/module/stream-demo.js
new file mode 100644
index 0000000..f485ea8
--- /dev/null
+++ b/ios/playground/bundlejs/module/stream-demo.js
@@ -0,0 +1,1247 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/93d7260198ac388f8dc31fa3eb8477c6", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+
+ __weex_module__.exports = {
+ data: function () {return {
+ getResult: 'loading...',
+ postResult: 'loading...'
+ }},
+ ready: function() {
+ var stream = __weex_require__('@weex-module/stream');
+ var me = this;
+ var GET_URL = 'http://httpbin.org/get';
+ var POST_URL = 'http://httpbin.org/post';
+
+ stream.sendHttp({
+ method: 'GET',
+ url: GET_URL
+ }, function(ret) {
+ console.log('get', ret);
+ me.getResult = ret;
+ });
+
+ stream.sendHttp({
+ method: 'POST',
+ url: POST_URL
+ }, function(ret) {
+ console.log('post', ret);
+ me.postResult = ret;
+ });
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "stream.sendHttp",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "method = GET"
+ },
+ "children": [
+ {
+ "type": "text",
+ "attr": {
+ "value": function () {return this.getResult}
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "method = POST"
+ },
+ "children": [
+ {
+ "type": "text",
+ "attr": {
+ "value": function () {return this.postResult}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/93d7260198ac388f8dc31fa3eb8477c6", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[30/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/match.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/match.js b/ios/playground/bundlejs/showcase/new-fashion/match.js
new file mode 100644
index 0000000..f2c58f0
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/match.js
@@ -0,0 +1,217 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/9d4c2c7c4ae424dd9960b55f7cf27378", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_750: 750,
+ NUMBER_373: 373,
+ NUMBER_240: 240,
+ NUMBER_200: 200,
+ NUMBER_4: 4
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self._initEnv();
+ self._addBannerIndex();
+ },
+ _initEnv: function () {
+ var self = this;
+ self.isTM = self._app.IS_TM;
+ },
+ _addBannerIndex: function () {
+ var self = this;
+ var ds = self.ds;
+ if (!ds || !ds.bannerItems) return;
+ for (var i = 0; i < ds.bannerItems.length; i++) {
+ ds.bannerItems[i].index = i;
+ }
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "image",
+ "shown": function () {return this.ds.floorTitle},
+ "classList": [
+ "title"
+ ],
+ "attr": {
+ "src": function () {return this.ds.floorTitle}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "tm-banner"
+ ],
+ "shown": function () {return this.ds.isShowTmSpecBanner&&this.ds.tmSpecBanner&&this.isTM},
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_750},
+ "height": function () {return this.NUMBER_200},
+ "src": function () {return this.ds.tmSpecBanner.img},
+ "href": function () {return this.ds.tmSpecBanner.url}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "repeat": function () {return this.ds.bannerItems},
+ "style": {
+ "flexDirection": "row",
+ "marginBottom": function () {return this.NUMBER_4}
+ },
+ "children": [
+ {
+ "type": "container",
+ "style": {
+ "marginRight": function () {return this.NUMBER_4}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_373},
+ "height": function () {return this.NUMBER_240},
+ "src": function () {return this.leftImg},
+ "href": function () {return this.leftUrl}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_373},
+ "height": function () {return this.NUMBER_240},
+ "src": function () {return this.rightImg},
+ "href": function () {return this.rightUrl}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ },
+ "tm-banner": {
+ "bottom": 4
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/9d4c2c7c4ae424dd9960b55f7cf27378", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/resource.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/resource.js b/ios/playground/bundlejs/showcase/new-fashion/resource.js
new file mode 100644
index 0000000..92a4051
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/resource.js
@@ -0,0 +1,252 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/8deee4229e8e47478c967d585a917549", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+ __webpack_require__(18);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_750: 750,
+ NUMBER_200: 200,
+ NUMBER_373: 373,
+ NUMBER_224:224,
+ NUMBER_4:4
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "shown": function () {return !this.ds.isHide},
+ "children": [
+ {
+ "type": "container",
+ "classList": [
+ "big-banner-container"
+ ],
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_750},
+ "height": function () {return this.NUMBER_200},
+ "src": function () {return this.ds.bigBannerImg},
+ "href": function () {return this.ds.bigBannerUrl}
+ }
+ }
+ ]
+ },
+ {
+ "type": "banners",
+ "attr": {
+ "ds": function () {return this.ds.smallBannerItems},
+ "width": function () {return this.NUMBER_373},
+ "height": function () {return this.NUMBER_224},
+ "direction": "row",
+ "space": function () {return this.NUMBER_4}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ },
+ "big-banner-container": {
+ "marginBottom": 4
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/8deee4229e8e47478c967d585a917549", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ },
+
+/***/ 18:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/banners", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ space: 0,
+ width: 0,
+ height: 0,
+ spmc:0,
+ spmdprefix:'',
+ ds: []
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ var ds = self.ds;
+ var length = ds.length;
+ for (var i = 0; i < length; i++) {
+ var item = ds[i];
+ item.index = i;
+ item.space = (i % length === 0) ? 0 : self.space;
+ }
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='row'},
+ "style": {
+ "flexDirection": "row"
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginLeft": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "shown": function () {return this.direction==='column'},
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.ds},
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "marginTop": function () {return this.space}
+ },
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.width},
+ "height": function () {return this.height},
+ "src": function () {return this.img},
+ "href": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/new-fashion/scene.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/new-fashion/scene.js b/ios/playground/bundlejs/showcase/new-fashion/scene.js
new file mode 100644
index 0000000..b9b0fb9
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/new-fashion/scene.js
@@ -0,0 +1,455 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/d7bc7177330a3072091ee5ce09d76961", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(17);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ NUMBER_186: 186,
+ NUMBER_206: 206,
+ NUMBER_373: 373,
+ NUMBER_230: 230,
+ NUMBER_170: 170,
+ NUMBER_100: 100,
+ NUMBER_750: 750,
+ NUMBER_300: 300,
+ NUMBER_340: 340,
+ smallItemBg: 'https://gw.alicdn.com/tps/TB1oBIeLVXXXXatXpXXXXXXXXXX-373-230.jpg',
+ items: [],
+ smallItems: [],
+ sceneBgs: [
+ 'https://gw.alicdn.com/tps/TB1xBT8LVXXXXbYXVXXXXXXXXXX-750-340.jpg',
+ 'https://gw.alicdn.com/tps/TB1RoEkLVXXXXaMXpXXXXXXXXXX-750-340.jpg',
+ 'https://gw.alicdn.com/tps/TB1DiEpLVXXXXa7XXXXXXXXXXXX-750-340.jpg'
+ ]
+ }},
+ methods: {
+ ready: function () {
+ var self = this;
+ self._loadData();
+ },
+
+ _loadData: function () {
+ var self = this;
+ var content = [{
+ "id": "1111",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1392&scm=1003.1.03653.SUB_1111_740603&pos=1",
+ "_s_": "d",
+ "itemImg": "https://img.alicdn.com/tps/TB1c7t.MXXXXXchXXXXXXXXXXXX-182-206.jpg",
+ "sceneCat": "50012010,50012027,50012032,50007003,50008881,50008883,1623,162116,50010850,123216004",
+ "finalScore": "10000.0",
+ "_pos_": "1",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/TB1Zgl2MXXXXXaYXFXXXXXXXXXX-170-100.png"
+ }, {
+ "id": "1396",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1396&scm=1003.1.03653.SUB_1396_740603&pos=2",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i2/TB1O1VfMXXXXXX0aXXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50010368,50011892,50011894,50013794,50010792,50010790,50010790,121434025,121396024,50010793,50010789,50010793,121386035,121392037,121458034,121392036,121482027,121392015,121368014,121418013,121392016,50011982,122690003,302910,50012010,122654005,50012019,50012825,50012027,50012042,50011744,50012906,50012907,50008881,50008883,50008882?,50012784?,50022889,50022728,50013228,50013896,50014775,50019578,50014822,50026394,50019694,50019279,50019272,50014079,50014078,50014076,50014077,50017238,121464011,121468014,50019130,50019127,50019126,50019128,50019125,50015984,50014803,50014802,50015980,50014788,50014787,50019526,50014791,50019520,50013932,50014677,50015978,50014786,50014785,50522001,50014493,50023100,121418021,121388027,121424021,121418020,121368020,50012036,50012044,50012043,50010368, 50011892, 50019274,50012044,50012048,50012043,50013228,50013238,50011726,50019279,50015984,50014803,50014802,50019526,50014791,50019520,50013932,50014677,50019526,50013314,500233
41,50016752,50016749,50016747,50016744,50016741,50016740,50016739,50016738,50016737,50016769,50016763,50016750,50007003,302910,50012010,50012032,50012033,50011745,50011746,50011894,121458034,121756003,121426033,50011982,50011979,121390006,124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,50010850,50000671,162201,50022566,50007068,50026651,50000852,162104,162116,162205,1623,123216004,162404,162401,50011412,50011411,162402,50008903,50011413,162403,50000697,1629,50011277,121412004,50008897,50008901,50008899,50013194,50008904,50008905,50008898,162103,50008900,50013196,121434004,50005065,162702,162701,162703,1636,1512,123534001,14,50008090,50012341,50132002,50012342,50012343,50012345,50012346,50013189,50010527,121394006,50013618,50010537,50012424,121452038,121484044,50010540,50010548,50024769,121450007,50013697,50010218,50005960,50005962,50012820,50012406,500236
20,50023605,50008829,50024064,50023440,50008687,124392001,50023771,50006804,50012410,124482010,121398023,50023789,50011975",
+ "finalScore": "10000.0",
+ "_pos_": "2",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i1/TB1cp4sMXXXXXbLXFXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1616",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1616&scm=1003.1.03653.SUB_1616_740603&pos=3",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i4/TB1dlEALVXXXXbxXpXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50009032,50007003,302910,1512,124688012,124986002,124942005,50023722,50010368,50011892,50011894",
+ "finalScore": "10000.0",
+ "_pos_": "3",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i3/TB1fxonLVXXXXXUaXXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "16424",
+ "sceneUrl": "https://brand.tmall.com/mobilestreet/subject.htm?id=16424&acm=03653.1003.1.740603&aldid=VyrSqx06&spm=0.0.0.0.Wv8ion&scm=1003.1.03653.SUB_16424_740603&pos=4",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i4/TB1.i2_LVXXXXbrXpXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50012043,50012036,50010850,50000671,1622,50000852,162104,50000697,162205,162116,50012027,50012032,50012028,50012033,50012042,50008882,50012772,50006846,50008881,50000436,50011123,3035,50010167,50000557,50010158,50010159,50010402,50010160,50011980,50011993,121390006,50011978,50011977,50011979,121454013,50011745",
+ "finalScore": "6.729749999999999",
+ "_pos_": "4",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i2/TB1bhH5LVXXXXapXFXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "16425",
+ "sceneUrl": "https://brand.tmall.com/mobilestreet/subject.htm?id=16360&acm=03653.1003.1.740603&aldid=VyrSqx06&spm=0.0.0.0.MttFEC&scm=1003.1.03653.SUB_16425_740603&pos=5",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i3/TB15ywbLVXXXXcdXXXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50012043,50012036,50010850,50000671,1622,50000852,162104,50000697,162205,162116,50012027,50012032,50012028,50012033,50012042,50008882,50012772,50006846,50008881,50000436,50011123,3035,50010167,50000557,50010158,50010159,50010402,50010160,50011980,50011993,121390006,50011978,50011977,50011979,121454013,50011745",
+ "finalScore": "6.729749999999999",
+ "_pos_": "5",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i1/TB1JBLYLVXXXXXlXVXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1625",
+ "sceneUrl": "https://pages.tmall.com/wow/fushi/act/gf-chaoliu?acm=03653.1003.1.740603&aldid=VyrSqx06&scm=1003.1.03653.SUB_1625_740603&pos=6",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/bao/uploaded/i2/TB1Gd21KVXXXXXZXVXXXXXXXXXX_!!0-item_pic.jpg",
+ "sceneCat": "50012043,50012036,50010850,50000671,1622,50000852,162104,50000697,162205,162116,50012027,50012032,50012028,50012033,50012042,50008882,50012772,50006846,50008881,50000436,50011123,3035,50010167,50000557,50010158,50010159,50010402,50010160,50011980,50011993,121390006,50011978,50011977,50011979,121454013,50011982,50011991,50012906,50011744,50011745,50011743,50012907,50011746,50010815,121460005,50013794,122438001,121398006,121386023,50010808",
+ "finalScore": "6.729749999999999",
+ "_pos_": "6",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i3/TB1qxXzMXXXXXcjXFXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1392",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1392&scm=1003.1.03653.SUB_1392_740603&pos=7",
+ "_s_": "d",
+ "itemImg": "https://img.alicdn.com/tps/TB1c7t.MXXXXXchXXXXXXXXXXXX-182-206.jpg",
+ "sceneCat": "50006842,50006840,50008881,50008883,50008882,50008884,50012774,50012775,50012776,50012781,5000888,50012766,50012771,50012772,50010404,50010368, 50011892, 50011894,124688012,124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,50011740,50008882,50008886,50008885,50012777,50012778,50011977,50011978,50011979,50011980,50011982,50011990,50011999,50012000,50011993,50011996,50011997,121366011,121484009,121368010,121390006,121398029,121404030,121404031,121408040,121410035,121412033,121414041,121418013,121454013,121410013,121422013,121484013,50010789,50010790,50010792,50010793,50010794,50010796,50010797,50010798,50010801,50010803,50010805,50010807,50010808,50010815,121410007,121426007,121452004,121460005,50012341,50132002,50012342,50012343,50012345,50012346,50013189,50010527,121394006,50013618,50010537,50012424,121452038,121484044,50010540,50010
548,50024769,121366037,121458036,121392038,121420035,121364028,121468026,121472031,121476036,121470042,121418032,121410036,121472032,121420032,121470040,121384032,121460028,121448028,121400030,121424024,121482025,121418031,121402028,121388035,121460029,121400028,121400029,121418030,121476034,121478031,121448029,121480030,121366035,121424025,121426030,121484030,121412031,121384033,121424023,121402027,121408039,121420033,121452028,121466040,121416029,121482028,121420034,121396046,121422052,121370037,121424031,21364043,121472040,121412045,121424032,125054002,125074007,125074008,125104003,125080003,125024006,125080004",
+ "finalScore": "4.4951428571428576",
+ "_pos_": "7",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/TB1Zgl2MXXXXXaYXFXXXXXXXXXX-170-100.png"
+ }, {
+ "id": "1395",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1395&scm=1003.1.03653.SUB_1395_740603&pos=8",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i2/TB1p4NcMXXXXXbGaXXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50008881,50008883,50008882,50008884,50012774,50012775,50012776,50012781,50008886,50012766,50012771,50012772,50010850,50000671,162201,50022566,50007068,50026651,50000852,162104,162116,162205,1623,123216004,162404,162401,50011412,50011411,16240,50012773,50006846,50010394,50008888,50008890,50008889,50012784,50012785,50012786,50012787,50008885,50012777,50012778,124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,50011740,50006843,50006842,124942005,50010368,50011892,50011894,50023751,121366037,121458036,121392038,121420035,121364028,121468026,121400029,121418030,121478031,121480030,121366035,121424025,121426030,121484030,121412031,125054002,125074007,125074008,125104003,125080003,125024006,125080004,121400030,121424024,121482025,121418031,121402028,121388035",
+ "finalScore": "4.465166666666667",
+ "_pos_": "8",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i1/TB1ySNtMXXXXXamXFXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1394",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1394&scm=1003.1.03653.SUB_1394_740603&pos=9",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i4/TB1Ns8eMXXXXXb1aXXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50010850,50000671,162201,50022566,50007068,50026651,50000852,162104,162116,162205,1623,123216004,162404,162401,50011412,50011411,162402,50008903,50011413,162403,50000697,1629,50011277,121412004,50008897,50008901,50008899,50013194,50008904,50008905,50008898,162103,50008900,50013196,121434004,50005065,162702,162701,162703,1636,124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,50011740,50006843,50006842,124986002,50010368, 50011892,50011894,121480030,121366035,121424025,121426030,121484030,121412031",
+ "finalScore": "4.309925925925926",
+ "_pos_": "9",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i3/TB1ZEXfMXXXXXapaXXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1610",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1610&scm=1003.1.03653.SUB_1610_740603&pos=10",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i3/TB1ONckLVXXXXbJaXXXKofZZpXX-182-206.jpg",
+ "sceneCat": "121484044,121452038,50012342,50012027,50012032,50006843,50010850,50000671,162104,1623,50011277,162116,123216004,50008898,121366037,121458036,121392038,121420035,121364028,121468026,121472031,121476036,121470042,121418032,121410036,121472032,121420032,121470040,121384032,121460028,121448028,121400030,121424024,121482025,121418031,121402028,121388035,121460029,121400028,121400029,121418030,121476034,121478031,121448029,121480030,121366035,121424025,121426030,121484030,121412031,121384033,121424023,121402027,121408039,121420033,121452028,121466040,121416029,121482028,121420034,121396046,121422052,121370037,121424031,21364043,121472040,121412045,121424032,125054002,125074007,125074008,125104003,125080003,125024006,125080004",
+ "finalScore": "4.293333333333334",
+ "_pos_": "10",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i2/TB1RzwFLVXXXXXsXpXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1619",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1619&scm=1003.1.03653.SUB_1619_740603&pos=11",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i3/TB1eagyLVXXXXaiXFXXKofZZpXX-182-206.jpg",
+ "sceneCat": "124730001,50001748,50011130,124730001,50001748,50011130,50011129,50010160,50011161,50011159,50010159,50010158,50011127,3035,50010167,50000557,50011123,50010402,50000436,50011153,122654005,50011740,50009032,124688012\uff0c213202,121396029,121476023,121410029,213203,50023326,213205,50022686,50023293,50466023,50024999,50016885\uff0c50011894",
+ "finalScore": "4.23",
+ "_pos_": "11",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i4/TB1j0AxLVXXXXaRXFXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1613",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1613&scm=1003.1.03653.SUB_1613_740603&pos=12",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i2/TB1WssFLVXXXXXUXpXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50023108,50022893,50022892,50022890,50013228,50019520,50017120,50019560,50017129,50017128,50017127,50017126,50017125,50017124,50017123,50017122,50017121,50020039,50020038,50017119,50019559,50017110,50017108,50017107,50017097,50017096,50017095,50017094,50017093,50017092,50012036,50012041",
+ "finalScore": "4.2186666666666675",
+ "_pos_": "12",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i1/TB1Rg.qLVXXXXbqXVXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1614",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1614&scm=1003.1.03653.SUB_1614_740603&pos=13",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i1/TB1KzUxLVXXXXajXFXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50013238,50011726,50022893,50022892,50022890,50013228,50017129,50020038,50017119,50019559,50017102,50017110,50017097,50019707,50019555,50016677,50018317,50016675,50016673,50016672,50016671,50016670,50016732,50016669,50016668,50016667,50016666,50016665,50016683,50016682,50016608,50016607,50016637,50016638,50012036,50012043",
+ "finalScore": "4.216",
+ "_pos_": "13",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i2/TB1WyouLVXXXXXcXVXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1397",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1397&scm=1003.1.03653.SUB_1397_740603&pos=14",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i4/TB1dCxvMXXXXXc1XpXXKofZZpXX-182-206.jpg",
+ "sceneCat": "122846004,50020776,50024799,50024801,50024921,50002794,50020778,50002792,50002791,50002793,50003942,50005500,50005497,50001692,50005495,50005496,50005503,50005498,50005499,50005501,50005502,50003455,50003457,122904003,50023091,50020770,50008863,50005507,121414011,50020768,50022701,50008862,121420012,50020766,50020764,121398012,121380011,50020751,50020676,50024945,50020720,50002790,50020730,50001866,50020678,121476008,121458013,50002795,121364011,50005505,121422014,50024943,50000583,50000582,50000584,213002,50005033,50000563,50008607,50006988,50008608,50024601,50024602,50012051,50001871,122854005,121458010,121452006,121416008,50008779,50002777,121394007,121386009,50010825,50013810,121434010,50001865,50008565,50008246,50017192,121404045,121368009,121462014,50019372,50008248,121418011,50008249,50017193,50008252,50008251,50000512,121364047,122846004,50020776,50024799,50024801,50024921,50002794,50020778,50002792,50002791,50002793,50003942,50005500,50005497,5000169
2,50005495,50005496,50005503,50005498,50005499,50005501,50005502,50003455,50003457,122904003,50023091,50020770,50008863,50005507,121414011,50020768,50022701,50008862,121420012,50020766,50020764,121398012,121380011,50020751,50020676,50024945,50020720,50002790,50020730,50001866,50020678,121476008,121458013,50002795,121364011,50005505,121422014,50024943,50000583,50000582,50000584,213002,50005033,50000563,50008607,50006988,50008608,50024601,50024602,50012051,50020835,50021907,121472021,50021902,50005919,50002045,122724003,122652007,121408025,122688004,50021924,50021923,50000561,50011738,122676005,121396026,121388028,50003338,50021915,50011415,50011416,50003454,50021928,50021930,50021929,50021931,50024939,121384024,121472020,50020902,50020903,50020904,50020905,50021888,50021889,50021890,50023266,122960005,50012001,50011999,50012004,50012000,50012006,121394024,121412033,121394025,121450036,121472007,121480009,121388013,121466009,121484012,121366014,121434014,121422012,121476006,121396013,
50011997,121434013,122646001,121458012,121468012,121368013,50011979,121366015,121406016,121456012,121366011,121414010,121460006,121368014,121388016,121396013,121400010,121470011,121474011,121478009,124760009,124768010,124822006,121482009,122430002,121454014,121392016\uff0c50001871,122854005,121458010,121452006,121416008,50008779,50002777,121394007,121386009,50010825,50013810,121434010,50001865,50008565,50008246,50017192,121404045,121368009,121462014,50019372,50008248,121418011,50008249,50017193,50008252,50008251,50000512,121364047,122846004,50020776,50024799,50024801,50024921,50002794,50020778,50002792,50002791,50002793,50003942,50005500,50005497,50001692,50005495,50005496,50005503,50005498,50005499,50005501,50005502,50003455,50003457,122904003,50023091,50020770,50008863,50005507,121414011,50020768,50022701,50008862,121420012,50020766,50020764,121398012,121380011,50020751,50020676,50024945,50020720,50002790,50020730,50001866,50020678,121476008,121458013,50002795,121364011,50005505,1214
22014,50024943,50000583,50000582,50000584,213002,50005033,50000563,50008607,50006988,50008608,50024601,50024602,50012051",
+ "finalScore": "3.4206666666666665",
+ "_pos_": "14",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i3/TB1ZARnMXXXXXaGXVXX3bpXTXXX-170-100.png"
+ }, {
+ "id": "1608",
+ "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1608&scm=1003.1.03653.SUB_1608_740603&pos=15",
+ "_s_": "d",
+ "itemImg": "//img.alicdn.com/tps/i3/TB1xA3jLVXXXXXqapXXKofZZpXX-182-206.jpg",
+ "sceneCat": "50012010,50012027,50012032,50007003,50008881,50008883,1623,162116,50010850,123216004",
+ "finalScore": "0.0",
+ "_pos_": "15",
+ "entityType": "SUB",
+ "benefitImg": "//img.alicdn.com/tps/i2/TB1WvoALVXXXXcdXpXX3bpXTXXX-170-100.png"
+ }]
+ self._processData(content)
+ },
+ _processData: function (content) {
+ var self = this;
+ if (!content) return;
+ var items = content.slice(0, 3);
+ var smallItems = content.slice(3);
+
+ var sceneBgs = self.sceneBgs;
+ for (var j = 0; j < items.length; j++) {
+ var item = items[j];
+ item.index = j;
+ item.bg = sceneBgs[j];
+ item.itemImgCls = j % 2 === 0 ? 'item-img' : 'right-item-img';
+ item.benifitImgCls = j % 2 === 0 ? 'benifit-img' : 'right-benifit-img';
+ }
+
+
+ for (var i = 0; i < smallItems.length; i++) {
+ var smallItem = smallItems[i];
+ smallItem.index = i;
+ smallItem.top = (i - i % 2) / 2 * (230 + 4);
+ smallItem.left = i % 2 * (373 + 4);
+ }
+ self.items = items;
+ self.smallItems = smallItems;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "container",
+ "children": [
+ {
+ "type": "image",
+ "shown": function () {return this.ds.floorTitle},
+ "classList": [
+ "title"
+ ],
+ "attr": {
+ "src": function () {return this.ds.floorTitle}
+ }
+ },
+ {
+ "type": "container",
+ "classList": [
+ "small-item-container"
+ ],
+ "style": {
+ "height": function () {return Math.round(this.smallItems.length/2)*234}
+ },
+ "children": [
+ {
+ "type": "container",
+ "repeat": function () {return this.smallItems},
+ "classList": [
+ "small-item"
+ ],
+ "style": {
+ "top": function () {return this.top},
+ "left": function () {return this.left}
+ },
+ "children": [
+ {
+ "type": "container",
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "small-item-bg"
+ ],
+ "attr": {
+ "src": function () {return this.smallItemBg}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "small-item-img"
+ ],
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_186},
+ "height": function () {return this.NUMBER_206},
+ "src": function () {return this.itemImg},
+ "href": function () {return this.sceneUrl}
+ }
+ }
+ ]
+ },
+ {
+ "type": "container",
+ "classList": [
+ "small-benifit-img"
+ ],
+ "children": [
+ {
+ "type": "banner",
+ "attr": {
+ "width": function () {return this.NUMBER_170},
+ "height": function () {return this.NUMBER_100},
+ "src": function () {return this.benefitImg},
+ "href": function () {return this.sceneUrl}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "title": {
+ "width": 750,
+ "height": 100
+ },
+ "item": {
+ "width": 750,
+ "height": 340,
+ "marginBottom": 4
+ },
+ "item-img": {
+ "position": "absolute",
+ "left": 110,
+ "top": 20
+ },
+ "right-item-img": {
+ "position": "absolute",
+ "right": 110,
+ "top": 20
+ },
+ "benifit-img": {
+ "position": "absolute",
+ "right": 5,
+ "top": 160
+ },
+ "right-benifit-img": {
+ "position": "absolute",
+ "left": 40,
+ "top": 160
+ },
+ "small-item-container": {
+ "width": 750
+ },
+ "small-item": {
+ "position": "absolute",
+ "width": 373,
+ "height": 230,
+ "flexDirection": "row"
+ },
+ "small-item-bg": {
+ "width": 373,
+ "height": 230
+ },
+ "small-item-img": {
+ "position": "absolute",
+ "left": 12,
+ "top": 12
+ },
+ "small-benifit-img": {
+ "position": "absolute",
+ "right": 0,
+ "top": 65
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/d7bc7177330a3072091ee5ce09d76961", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+
+/***/ 17:
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/banner", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ quality: 'normal',
+ width: 0,
+ height: 0,
+ src: '',
+ href: '',
+ spmc:0,
+ spmd:0
+ }},
+ methods: {
+ ready: function () {
+ },
+ _clickHandler: function () {
+ this.$call('modal', 'toast', {
+ message: 'click',
+ duration: 1
+ });
+ }
+ }
+ };
+
+ ;__weex_module__.exports.template={
+ "type": "image",
+ "style": {
+ "width": function () {return this.width},
+ "height": function () {return this.height}
+ },
+ "attr": {
+ "src": function () {return this.src},
+ "imageQuality": function () {return this.quality}
+ },
+ "events": {
+ "click": "_clickHandler"
+ }
+ }
+ })
+
+/***/ }
+
+/******/ });
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/showcase/ui.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/showcase/ui.js b/ios/playground/bundlejs/showcase/ui.js
new file mode 100644
index 0000000..7644c01
--- /dev/null
+++ b/ios/playground/bundlejs/showcase/ui.js
@@ -0,0 +1,1355 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/61cfa4c481726ebbd7c4306501946dbb", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+
+ __weex_module__.exports = {
+ data: function () {return {
+ levels: [{level: 1}, {level: 2}, {level: 3}],
+ buttons: [{type: 'default'}, {type: 'primary'}, {type: 'success'}, {type: 'info'}, {type: 'warning'}, {type: 'danger'}, {type: 'link'}],
+ panels: [{type: 'default'}, {type: 'primary'}, {type: 'success'}, {type: 'info'}, {type: 'warning'}, {type: 'danger'}],
+ tips: [{type: 'success'}, {type: 'info'}, {type: 'warning'}, {type: 'danger'}],
+ }},
+ methods: {
+ clicked: function() {
+ var $modal = __weex_require__('@weex-module/modal');
+ $modal.toast({'message': 'clicked!', duration: 0.5});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Title Levels",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-hn",
+ "repeat": function () {return this.levels},
+ "attr": {
+ "level": function () {return this.level},
+ "value": function () {return 'H' + (this.level) + ', Level ' + (this.level)}
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Buttons",
+ "type": "primary"
+ },
+ "append": "tree",
+ "children": [
+ {
+ "type": "div",
+ "style": {
+ "flexDirection": "row",
+ "marginTop": 12
+ },
+ "repeat": function () {return this.buttons},
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": function () {return this.type},
+ "size": "large",
+ "value": function () {return this.type}
+ },
+ "events": {
+ "click": "clicked"
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": function () {return this.type},
+ "size": "middle",
+ "value": function () {return this.type}
+ },
+ "events": {
+ "click": "clicked"
+ },
+ "style": {
+ "marginLeft": 5,
+ "width": 210
+ }
+ },
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": function () {return this.type},
+ "size": "small",
+ "value": function () {return this.type}
+ },
+ "events": {
+ "click": "clicked"
+ },
+ "style": {
+ "marginLeft": 5
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Panels",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "repeat": function () {return this.panels},
+ "attr": {
+ "title": function () {return 'Panels-' + (this.type)},
+ "type": function () {return this.type},
+ "border": "1"
+ },
+ "style": {
+ "marginLeft": 12,
+ "marginRight": 12
+ },
+ "children": [
+ {
+ "type": "text",
+ "attr": {
+ "value": function () {return 'Panels ' + (this.type) + ' content. Panels ' + (this.type) + ' content. Panels ' + (this.type) + ' content.'}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "List",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-list-item",
+ "repeat": function () {return this.tips},
+ "events": {
+ "click": "clicked"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "item-txt"
+ ],
+ "attr": {
+ "value": function () {return this.type}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Tips",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-tip",
+ "repeat": function () {return this.tips},
+ "style": {
+ "marginBottom": 20
+ },
+ "attr": {
+ "value": function () {return 'Panels ' + (this.type) + ' content. Panels ' + (this.type) + ' content. Panels ' + (this.type) + ' content.'}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item-txt": {
+ "fontSize": 48,
+ "color": "#555555"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/61cfa4c481726ebbd7c4306501946dbb", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[36/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/include/example-list-item.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/include/example-list-item.js b/ios/playground/bundlejs/include/example-list-item.js
new file mode 100644
index 0000000..e6414e8
--- /dev/null
+++ b/ios/playground/bundlejs/include/example-list-item.js
@@ -0,0 +1,1210 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/3ed4343ba5bb824b7462530cea48d237", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ title: '',
+ url: ''
+ }},
+ methods: {
+ redirect: function() {
+ this.$openURL(this.url);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "wxc-list-item",
+ "events": {
+ "click": "redirect"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "item-txt"
+ ],
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item-txt": {
+ "fontSize": 48,
+ "color": "#555555"
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/3ed4343ba5bb824b7462530cea48d237", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/include/example-list.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/include/example-list.js b/ios/playground/bundlejs/include/example-list.js
new file mode 100644
index 0000000..650bc73
--- /dev/null
+++ b/ios/playground/bundlejs/include/example-list.js
@@ -0,0 +1,1291 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/5ae382379e66fef0c7344f4ff2c8db10", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(15);
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ dir: 'examples', // examples, test ...
+ items: [
+ {name: 'hello', title: 'Hello World', url: ''}
+ ]
+ }},
+ created: function() {
+ var bundleUrl = this.$getConfig().bundleUrl;
+ console.log('hit', bundleUrl);
+ var nativeBase;
+ var isAndroidAssets = bundleUrl.indexOf('your_current_IP') >= 0;
+ var isiOSAssets = bundleUrl.indexOf('file:///') >= 0 && bundleUrl.indexOf('WeexDemo.app') > 0;
+ if (isAndroidAssets) {
+ nativeBase = 'file://assets/';
+ }
+ else if (isiOSAssets) {
+ // file:///var/mobile/Containers/Bundle/Application/{id}/WeexDemo.app/
+ // file:///Users/{user}/Library/Developer/CoreSimulator/Devices/{id}/data/Containers/Bundle/Application/{id}/WeexDemo.app/
+ nativeBase = bundleUrl.substring(0, bundleUrl.lastIndexOf('/') + 1);
+ }
+ else {
+ var host = 'localhost:12580';
+ var matches = /\/\/([^\/]+?)\//.exec(this.$getConfig().bundleUrl);
+ if (matches && matches.length >= 2) {
+ host = matches[1];
+ }
+ nativeBase = '//' + host + '/' + this.dir + '/build/';
+ }
+ var h5Base = './index.html?page=./' + this.dir + '/build/';
+ // in Native
+ var base = nativeBase;
+ if (typeof window === 'object') {
+ // in Browser or WebView
+ base = h5Base;
+ }
+
+ for (var i in this.items) {
+ var item = this.items[i];
+ if (!item.url) {
+ item.url = base + item.name + '.js';
+ }
+ }
+ // see log in Android Logcat
+ if (this.items.length) console.log('hit', this.items[0].url);
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "list",
+ "children": [
+ {
+ "type": "cell",
+ "append": "tree",
+ "repeat": function () {return this.items},
+ "children": [
+ {
+ "type": "example-list-item",
+ "attr": {
+ "title": function () {return this.title},
+ "url": function () {return this.url}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={}
+ })
+ ;__weex_bootstrap__("@weex-component/5ae382379e66fef0c7344f4ff2c8db10", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ },
+/* 13 */,
+/* 14 */,
+/* 15 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/example-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ title: '',
+ url: ''
+ }},
+ methods: {
+ redirect: function() {
+ this.$openURL(this.url);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "wxc-list-item",
+ "events": {
+ "click": "redirect"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "item-txt"
+ ],
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item-txt": {
+ "fontSize": 48,
+ "color": "#555555"
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[40/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/marquee-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/marquee-demo.js b/ios/playground/bundlejs/component/marquee-demo.js
new file mode 100644
index 0000000..3269507
--- /dev/null
+++ b/ios/playground/bundlejs/component/marquee-demo.js
@@ -0,0 +1,1264 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/1b86211b346eeef69a53bf28a2574cea", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+
+ __weex_module__.exports = {
+ data: function () {return {
+ marquee: {
+ height: 30,
+ duration: 1500,
+ interval: 2000,
+ list: [
+ {text: 'Introducing Bots on Messenger'},
+ {text: 'Capturing 3D 360-Stereo VR Video'},
+ {text: 'The Future of Video on Facebook'},
+ {text: 'Announcing Vue.js 2.0'},
+ {text: 'Not Your Average Virtual-DOM'},
+ {text: 'Templates, JSX, or Hyperscript?'}
+ ]
+ }
+ }},
+ ready: function() {
+ this.initMarquee('marquee');
+ },
+ methods: {
+ initMarquee: function(id) {
+ var self = this;
+
+ var $marquee = this.$vm(id);
+ $marquee.$on('change', function() {
+ console.log('marquee change');
+ });
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Marquee",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-marquee",
+ "id": "marquee",
+ "style": {
+ "width": 700,
+ "height": function () {return this.marquee.height*2},
+ "backgroundColor": "rgb(223,240,216)",
+ "borderRadius": 8,
+ "paddingLeft": 10,
+ "paddingRight": 10
+ },
+ "attr": {
+ "step": function () {return this.marquee.height*2},
+ "count": function () {return this.marquee.list.length},
+ "interval": function () {return this.marquee.interval},
+ "duration": function () {return this.marquee.duration}
+ },
+ "children": [
+ {
+ "type": "div",
+ "repeat": function () {return this.marquee.list},
+ "style": {
+ "height": function () {return this.marquee.height*this.marquee.length},
+ "paddingTop": function () {return this.marquee.height*0.5},
+ "paddingBottom": function () {return this.marquee.height*0.5},
+ "overflow": "hidden"
+ },
+ "children": [
+ {
+ "type": "text",
+ "style": {
+ "height": function () {return this.marquee.height},
+ "color": "rgb(60,118,61)",
+ "fontSize": 28
+ },
+ "attr": {
+ "value": function () {return this.text}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/1b86211b346eeef69a53bf28a2574cea", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/navigator-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/navigator-demo.js b/ios/playground/bundlejs/component/navigator-demo.js
new file mode 100644
index 0000000..862e668
--- /dev/null
+++ b/ios/playground/bundlejs/component/navigator-demo.js
@@ -0,0 +1,1313 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/3ddeb14b997751514c9466a971084868", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ navBarHeight: 88,
+ title: 'Navigator',
+ dir: 'examples',
+ baseURL: '',
+ }},
+ created: function() {
+ this.$getConfig(function (config) {
+ var env = config.env;
+ if(env.platform == 'iOS'){
+ var scale = env.scale;
+ var deviceWidth = env.deviceWidth / scale;
+ this.navBarHeight = 64.0 * 750.0 / deviceWidth;
+ }
+ }.bind(this));
+
+ this.$on('naviBar.rightItem.click',function(e){
+ duration = 2;
+ this.$call('modal', 'toast', {
+ 'message': 'naviBar.rightItem.click',
+ 'duration': duration
+ });
+ });
+
+ this.$on('naviBar.leftItem.click',function(e){
+ duration = 2;
+ this.$call('modal', 'toast', {
+ 'message': 'naviBar.leftItem.click',
+ 'duration': duration
+ });
+ });
+
+ var bundleUrl = this.$getConfig().bundleUrl;
+ bundleUrl = new String(bundleUrl);
+ console.log('hit', bundleUrl);
+ var nativeBase;
+ var isAndroidAssets = bundleUrl.indexOf('file://assets/') >= 0;
+
+ var isiOSAssets = bundleUrl.indexOf('file:///') >= 0 && bundleUrl.indexOf('.app') > 0;
+ if (isAndroidAssets) {
+ nativeBase = 'file://assets/';
+ }
+ else if (isiOSAssets) {
+ // file:///var/mobile/Containers/Bundle/Application/{id}/WeexDemo.app/
+ // file:///Users/{user}/Library/Developer/CoreSimulator/Devices/{id}/data/Containers/Bundle/Application/{id}/WeexDemo.app/
+ nativeBase = bundleUrl.substring(0, bundleUrl.indexOf('.app') + 4) + '/bundlejs/'
+ }
+ else {
+ var host = 'localhost:12580';
+ var matches = /\/\/([^\/]+?)\//.exec(this.$getConfig().bundleUrl);
+ if (matches && matches.length >= 2) {
+ host = matches[1];
+ }
+ nativeBase = 'http://' + host + '/' + this.dir + '/build/';
+ }
+ var h5Base = './index.html?page=./' + this.dir + '/build/';
+ // in Native
+ var base = nativeBase;
+ if (typeof window === 'object') {
+ // in Browser or WebView
+ base = h5Base;
+ }
+ this.baseURL = base;
+ },
+ methods: {
+ push: function() {
+ var vm = this;
+ var params = {
+ 'url': this.baseURL + 'component/navigator-demo.js?test=1',
+ 'animated' : 'true',
+ }
+ vm.$call('navigator','push',params, function () {});
+ },
+
+ pop: function() {
+ var vm = this;
+ var params = {
+ 'animated' : 'true',
+ }
+ vm.$call('navigator','pop',params, function () {});
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "wxc-navpage",
+ "attr": {
+ "dataRole": "none",
+ "height": function () {return this.navBarHeight},
+ "backgroundColor": "#ff5898",
+ "title": function () {return this.title},
+ "titleColor": "white",
+ "leftItemTitle": "More",
+ "leftItemColor": "white",
+ "rightItemSrc": "http://gtms02.alicdn.com/tps/i2/TB1ED7iMpXXXXXEXXXXWA_BHXXX-48-48.png"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "push a new page"
+ },
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "primary",
+ "size": "small",
+ "value": "push"
+ },
+ "events": {
+ "click": "push"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "pop to the last page"
+ },
+ "children": [
+ {
+ "type": "wxc-button",
+ "attr": {
+ "type": "success",
+ "size": "small",
+ "value": "pop"
+ },
+ "events": {
+ "click": "pop"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/3ddeb14b997751514c9466a971084868", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[08/50] [abbrv] incubator-weex git commit: * [doc] use doc page url
Posted by ji...@apache.org.
* [doc] use doc page url
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f90121cc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f90121cc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f90121cc
Branch: refs/heads/master
Commit: f90121cce4b6ac450962ab8b76b834f2cb0102e6
Parents: 23dd719
Author: luics <lu...@gmail.com>
Authored: Mon Jun 6 15:47:26 2016 +0800
Committer: luics <lu...@gmail.com>
Committed: Mon Jun 6 15:47:26 2016 +0800
----------------------------------------------------------------------
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f90121cc/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 604ca48..252ea36 100644
--- a/README.md
+++ b/README.md
@@ -21,8 +21,8 @@ Please ***INSTALL [Git for Windows](https://git-scm.com/download/win)*** and run
## Use Weex
-* See [Tutorial](https://github.com/alibaba/weex/blob/dev/doc/tutorial.md).
-* See [Weex Documentation](https://github.com/alibaba/weex/blob/dev/doc/INSTALL.md) for more information.
+* See [Tutorial](http://alibaba.github.io/weex/doc/tutorial.html).
+* See [Weex Documentation](http://alibaba.github.io/weex/doc/) for more information.
### Android
@@ -40,11 +40,11 @@ Please ***INSTALL [Git for Windows](https://git-scm.com/download/win)*** and run
## Scripts
-See [SCRIPTS.md](SCRIPTS.md) for more information.
+See [SCRIPTS.md](./SCRIPTS.md) for more information.
## FAQ
-See [FAQ](./doc/faq.md) for more information.
+See [FAQ](http://alibaba.github.io/weex/doc/faq.html) for more information.
## Contributing
[16/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m
new file mode 100644
index 0000000..18dae99
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m
@@ -0,0 +1,293 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXVideoComponent.h"
+#import <AVFoundation/AVPlayer.h>
+#import <AVKit/AVPlayerViewController.h>
+#import <MediaPlayer/MPMoviePlayerViewController.h>
+#import <MediaPlayer/MPMoviePlayerController.h>
+#import <AVFoundation/AVPlayerItem.h>
+
+@interface WXPlayer : NSObject
+
+@end
+
+@implementation WXPlayer
+
+@end
+
+@interface WXVideoView()
+
+@property (nonatomic, strong) UIViewController* playerViewController;
+
+@end
+
+@implementation WXVideoView
+
+- (id)init
+{
+ if (self = [super init]) {
+ if ([self greater8SysVer]){
+ _playerViewController = [AVPlayerViewController new];
+ } else {
+ _playerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:nil];
+ MPMoviePlayerViewController *MPVC = (MPMoviePlayerViewController*)_playerViewController;
+ MPVC.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
+ MPVC.moviePlayer.shouldAutoplay = NO;
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(playFinish)
+ name:MPMoviePlayerPlaybackDidFinishNotification
+ object:MPVC.moviePlayer];
+ [[NSNotificationCenter defaultCenter] addObserverForName:MPMoviePlayerPlaybackStateDidChangeNotification object:MPVC.moviePlayer queue:nil usingBlock:^(NSNotification *notification)
+ {
+ if (MPVC.moviePlayer.playbackState == MPMoviePlaybackStatePlaying) {
+ if (_playbackStateChanged)
+ _playbackStateChanged(WXPlaybackStatePlaying);
+ }
+ if (MPVC.moviePlayer.playbackState == MPMoviePlaybackStateStopped) {
+ //stopped
+ } if (MPVC.moviePlayer.playbackState == MPMoviePlaybackStatePaused) {
+ //paused
+ if (_playbackStateChanged) {
+ _playbackStateChanged(WXPlaybackStatePaused);
+ }
+ } if (MPVC.moviePlayer.playbackState == MPMoviePlaybackStateInterrupted) {
+ //interrupted
+ } if (MPVC.moviePlayer.playbackState == MPMoviePlaybackStateSeekingForward) {
+ //seeking forward
+ } if (MPVC.moviePlayer.playbackState == MPMoviePlaybackStateSeekingBackward) {
+ //seeking backward
+ }
+ }];
+ }
+
+ [self addSubview:_playerViewController.view];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ if ([self greater8SysVer]){
+ AVPlayerViewController *AVVC = (AVPlayerViewController*)_playerViewController;
+ [AVVC.player removeObserver:self forKeyPath:@"rate"];
+ [AVVC.player.currentItem removeObserver:self forKeyPath:@"status"];
+
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:AVVC.player.currentItem];
+ }
+ else {
+ MPMoviePlayerViewController *MPVC = (MPMoviePlayerViewController*)_playerViewController;
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:MPVC.moviePlayer];
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:MPVC.moviePlayer];
+ }
+}
+
+- (BOOL)greater8SysVer
+{
+ //return NO;
+ NSString *reqSysVer = @"8.0";
+ NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
+ return [currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending;
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath
+ ofObject:(id)object
+ change:(NSDictionary<NSString *,id> *)change
+ context:(void *)context
+{
+ if ([keyPath isEqualToString:@"rate"]) {
+ float rate = [change[NSKeyValueChangeNewKey] floatValue];
+ if (rate == 0.0) {
+ if (_playbackStateChanged)
+ _playbackStateChanged(WXPlaybackStatePaused);
+ } else if (rate == 1.0) {
+ if (_playbackStateChanged)
+ _playbackStateChanged(WXPlaybackStatePlaying);
+ } else if (rate == -1.0) {
+ // Reverse playback
+ }
+ }
+ else if ([keyPath isEqualToString:@"status"]) {
+ NSInteger status = [change[NSKeyValueChangeNewKey] integerValue];
+ if (status == AVPlayerStatusFailed) {
+ if (_playbackStateChanged)
+ _playbackStateChanged(WXPlaybackStateFailed);
+ }
+ }
+}
+
+- (void)setFrame:(CGRect)frame
+{
+ [super setFrame:frame];
+
+ CGRect videoFrame = frame;
+ videoFrame.origin.x = 0;
+ videoFrame.origin.y = 0;
+ [_playerViewController.view setFrame:videoFrame];
+}
+
+- (void)setURL:(NSURL *)URL
+{
+ if ([self greater8SysVer]){
+
+ AVPlayerViewController *AVVC = (AVPlayerViewController*)_playerViewController;
+ if (AVVC.player && AVVC.player.currentItem) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:AVVC.player.currentItem];
+ [AVVC.player.currentItem removeObserver:self forKeyPath:@"status"];
+ }
+ AVPlayer *player = [AVPlayer playerWithURL:URL];
+ AVVC.player = player;
+
+ [player addObserver:self
+ forKeyPath:@"rate"
+ options:NSKeyValueObservingOptionNew
+ context:NULL];
+
+ [player.currentItem addObserver:self
+ forKeyPath:@"status"
+ options:NSKeyValueObservingOptionNew
+ context:NULL];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playFinish) name:AVPlayerItemDidPlayToEndTimeNotification object:player.currentItem];
+ }
+ else {
+ MPMoviePlayerViewController *MPVC = (MPMoviePlayerViewController*)_playerViewController;
+ [MPVC moviePlayer].contentURL = URL;
+ }
+}
+
+- (void)playFinish
+{
+ if (_playbackStateChanged)
+ _playbackStateChanged(WXPlaybackStatePlayFinish);
+ if ([self greater8SysVer]) {
+ AVPlayerViewController *AVVC = (AVPlayerViewController*)_playerViewController;
+ [[AVVC player] seekToTime:CMTimeMultiply([AVVC player].currentTime, 0)];
+ } else {
+ MPMoviePlayerViewController *MPVC = (MPMoviePlayerViewController*)_playerViewController;
+ [[MPVC moviePlayer] stop];
+ }
+}
+
+- (void)play
+{
+ if ([self greater8SysVer]) {
+ AVPlayerViewController *AVVC = (AVPlayerViewController*)_playerViewController;
+
+ [[AVVC player] play];
+ } else {
+ MPMoviePlayerViewController *MPVC = (MPMoviePlayerViewController*)_playerViewController;
+ [[MPVC moviePlayer] play];
+ }
+}
+
+- (void)pause
+{
+ if ([self greater8SysVer]){
+ AVPlayerViewController *AVVC = (AVPlayerViewController*)_playerViewController;
+ [[AVVC player] pause];
+ } else {
+ MPMoviePlayerViewController *MPVC = (MPMoviePlayerViewController*)_playerViewController;
+ [[MPVC moviePlayer] pause];
+ }
+}
+
+@end
+
+@interface WXVideoComponent()
+
+@property (nonatomic, strong) WXVideoView *videoView;
+@property (nonatomic, strong) NSURL *videoURL;
+@property (nonatomic) BOOL autoPlay;
+@property (nonatomic) BOOL playStatus;
+
+@end
+
+@implementation WXVideoComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance {
+ self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance];
+ if (self) {
+ if (attributes[@"src"]) {
+ _videoURL = [NSURL URLWithString: attributes[@"src"]];
+ }
+ if (attributes[@"autoPlay"]) {
+ _autoPlay = [attributes[@"autoPlay"] boolValue];
+ }
+ if ([attributes[@"playStatus"] compare:@"play" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
+ _playStatus = true;
+ }
+ if ([attributes[@"playStatus"] compare:@"pause" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
+ _playStatus = false;
+ }
+ }
+ return self;
+}
+
+-(UIView *)loadView
+{
+ return [[WXVideoView alloc] init];
+}
+
+-(void)viewDidLoad
+{
+ _videoView = (WXVideoView *)self.view;
+ [_videoView setURL:_videoURL];
+ if (_playStatus) {
+ [_videoView play];
+ } else {
+ [_videoView pause];
+ }
+ if (_autoPlay) {
+ [_videoView play];
+ }
+ __weak __typeof__(self) weakSelf = self;
+ _videoView.playbackStateChanged = ^(WXPlaybackState state) {
+ NSString *eventType = nil;
+ switch (state) {
+ case WXPlaybackStatePlaying:
+ eventType = @"start";
+ break;
+ case WXPlaybackStatePaused:
+ eventType = @"pause";
+ break;
+ case WXPlaybackStatePlayFinish:
+ eventType = @"finish";
+ break;
+ case WXPlaybackStateFailed:
+ eventType = @"fail";
+ break;
+
+ default:
+ NSCAssert(NO, @"");
+ break;
+ }
+ [weakSelf fireEvent:eventType params:nil];
+ };
+}
+
+-(void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"src"]) {
+ _videoURL = [NSURL URLWithString: attributes[@"src"]];
+ }
+ if (attributes[@"autoPlay"]) {
+ _autoPlay = [attributes[@"autoPlay"] boolValue];
+ [_videoView play];
+ }
+ if ([attributes[@"playStatus"] compare:@"play" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
+ _playStatus = true;
+ [_videoView play];
+ }
+ if ([attributes[@"playStatus"] compare:@"pause" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
+ _playStatus = false;
+ [_videoView pause];
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.h
new file mode 100644
index 0000000..f8ed1d0
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.h
@@ -0,0 +1,21 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXWebComponent : WXComponent<UIWebViewDelegate>
+
+- (void)notifyWebview:(NSDictionary *) data;
+
+- (void)reload;
+
+- (void)goBack;
+
+- (void)goForward;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m
new file mode 100644
index 0000000..3ee5f8d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m
@@ -0,0 +1,183 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXWebComponent.h"
+#import "WXComponent_internal.h"
+#import "WXUtility.h"
+#import <JavaScriptCore/JavaScriptCore.h>
+
+@interface WXWebView : UIWebView
+
+@end
+
+@implementation WXWebView
+
+@end
+
+@interface WXWebComponent ()
+
+@property (nonatomic, strong) JSContext *jsContext;
+
+@property (nonatomic, strong) WXWebView *webview;
+
+@property (nonatomic, strong) NSString *url;
+
+@property (nonatomic, assign) BOOL startLoadEvent;
+
+@property (nonatomic, assign) BOOL finishLoadEvent;
+
+@property (nonatomic, assign) BOOL failLoadEvent;
+
+@property (nonatomic, assign) BOOL notifyEvent;
+
+@end
+
+@implementation WXWebComponent
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
+ self.url = attributes[@"src"];
+ }
+ return self;
+}
+
+- (UIView *)loadView
+{
+ return [[WXWebView alloc] init];
+}
+
+- (void)viewDidLoad
+{
+ _webview = (WXWebView *)self.view;
+ _webview.delegate = self;
+ _webview.allowsInlineMediaPlayback = YES;
+ _jsContext = [_webview valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+ __weak typeof(self) weakSelf = self;
+ _jsContext[@"$notifyWeex"] = ^(JSValue *data) {
+ if (weakSelf.notifyEvent) {
+ [weakSelf fireEvent:@"notify" params:[data toDictionary]];
+ }
+ };
+
+ if (_url) {
+ [self loadURL:_url];
+ }
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"src"]) {
+ self.url = attributes[@"src"];
+ }
+}
+
+- (void)addEvent:(NSString *)eventName
+{
+ if ([eventName isEqualToString:@"pagestart"]) {
+ _startLoadEvent = YES;
+ }
+ else if ([eventName isEqualToString:@"pagefinish"]) {
+ _finishLoadEvent = YES;
+ }
+ else if ([eventName isEqualToString:@"error"]) {
+ _failLoadEvent = YES;
+ }
+}
+
+- (void)setUrl:(NSString *)url
+{
+ if (![url isEqualToString:_url]) {
+ _url = url;
+
+ if (_url) {
+ [self loadURL:_url];
+ }
+ }
+}
+
+- (void)loadURL:(NSString *)url
+{
+ if (self.webview) {
+ NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:url]];
+ [self.webview loadRequest:request];
+ }
+}
+
+- (void)reload
+{
+ [self.webview reload];
+}
+
+- (void)goBack
+{
+ if ([self.webview canGoBack]) {
+ [self.webview goBack];
+ }
+}
+
+- (void)goForward
+{
+ if ([self.webview canGoForward]) {
+ [self.webview goForward];
+ }
+}
+
+- (void)notifyWebview:(NSDictionary *) data
+{
+ NSString *json = [WXUtility JSONString:data];
+ NSString *code = [NSString stringWithFormat:@"(function(){var evt=null;var data=%@;if(typeof CustomEvent==='function'){evt=new CustomEvent('notify',{detail:data})}else{evt=document.createEvent('CustomEvent');evt.initCustomEvent('notify',true,true,data)}document.dispatchEvent(evt)}())", json];
+ [_jsContext evaluateScript:code];
+}
+
+#pragma mark Webview Delegate
+
+- (NSMutableDictionary<NSString *, id> *)baseInfo
+{
+ NSMutableDictionary<NSString *, id> *info = [NSMutableDictionary new];
+ [info setObject:self.webview.request.URL.absoluteString ?: @"" forKey:@"url"];
+ [info setObject:[self.webview stringByEvaluatingJavaScriptFromString:@"document.title"] ?: @"" forKey:@"title"];
+ [info setObject:@(self.webview.canGoBack) forKey:@"canGoBack"];
+ [info setObject:@(self.webview.canGoForward) forKey:@"canGoForward"];
+ return info;
+}
+
+- (void)webViewDidStartLoad:(UIWebView *)webView
+{
+
+}
+
+- (void)webViewDidFinishLoad:(UIWebView *)webView
+{
+ if (_finishLoadEvent) {
+ NSDictionary *data = [self baseInfo];
+ [self fireEvent:@"pagefinish" params:data];
+ }
+}
+
+- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
+{
+ if (_failLoadEvent) {
+ NSMutableDictionary *data = [self baseInfo];
+ [data setObject:[error localizedDescription] forKey:@"errorMsg"];
+ [data setObject:[NSString stringWithFormat:@"%ld", (long)error.code] forKey:@"errorCode"];
+ [self fireEvent:@"error" params:data];
+ }
+}
+
+- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
+{
+ if (_startLoadEvent) {
+ NSMutableDictionary<NSString *, id> *data = [NSMutableDictionary new];
+ [data setObject:request.URL.absoluteString ?:@"" forKey:@"url"];
+ [self fireEvent:@"pagestart" params:data];
+ }
+ return YES;
+}
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.h b/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.h
new file mode 100644
index 0000000..dde47d1
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.h
@@ -0,0 +1,35 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+
+/**
+ * The WXBaseViewController class provides the infrastructure for managing the weex view in your app. It is
+ * responsible for creating a weex instance or rendering the weex view, for observing the lifecycle of the
+ * view such as "appear" or "disapper"\u3001"foreground" or "background" etc. You can initialize this controller by
+ * special bundle URL.
+ */
+
+@interface WXBaseViewController : UIViewController <UIGestureRecognizerDelegate>
+
+/**
+ * @abstract initializes the viewcontroller with bundle url.
+ *
+ * @param soureURL. The url of bundle rendered to a weex view.
+ *
+ * @return a object the class of WXBaseViewController.
+ *
+ */
+- (instancetype)initWithSourceURL:(NSURL *)sourceURL;
+
+/**
+ * @abstract refreshes the weex view in controller.
+ */
+- (void)refreshWeex;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.m b/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.m
new file mode 100644
index 0000000..358451c
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.m
@@ -0,0 +1,186 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXBaseViewController.h"
+#import "WXRootViewController.h"
+#import "WXSDKInstance.h"
+#import "WXSDKInstance_private.h"
+#import "WXSDKEngine.h"
+#import "WXUtility.h"
+
+@interface WXBaseViewController ()
+
+@property (nonatomic, strong) WXSDKInstance *instance;
+@property (nonatomic, strong) UIView *weexView;
+@property (nonatomic, strong) NSURL *sourceURL;
+
+@end
+
+@implementation WXBaseViewController
+
+- (void)dealloc
+{
+ [_instance destroyInstance];
+ [self _removeObservers];
+}
+
+- (instancetype)initWithSourceURL:(NSURL *)sourceURL
+{
+ if ((self = [super init])) {
+ self.sourceURL = sourceURL;
+ self.hidesBottomBarWhenPushed = YES;
+
+ [self _addObservers];
+ }
+ return self;
+}
+
+/**
+ * After setting the navbar hidden status , this function will be called automatically. In this function, we
+ * set the height of mainView equal to screen height, because there is something wrong with the layout of
+ * page content.
+ */
+
+- (void)viewWillLayoutSubviews
+{
+ [super viewWillLayoutSubviews];
+
+ if ([self.navigationController isKindOfClass:[WXRootViewController class]]) {
+ CGRect frame = self.view.frame;
+ frame.origin.y = 0;
+ frame.size.height = [UIScreen mainScreen].bounds.size.height;
+ self.view.frame = frame;
+ }
+}
+
+/**
+ * We assume that the initial state of viewController's navigitonBar is hidden. By setting the attribute of
+ * 'dataRole' equal to 'navbar', the navigationBar hidden will be NO.
+ */
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ [self addEdgePop];
+ self.view.backgroundColor = [UIColor whiteColor];
+ self.automaticallyAdjustsScrollViewInsets = NO;
+ [self _renderWithURL:_sourceURL];
+
+ if ([self.navigationController isKindOfClass:[WXRootViewController class]]) {
+ self.navigationController.navigationBarHidden = YES;
+ }
+}
+
+- (void)addEdgePop
+{
+ UIScreenEdgePanGestureRecognizer *edgePanGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(edgePanGesture:)];
+ edgePanGestureRecognizer.delegate = self;
+ edgePanGestureRecognizer.edges = UIRectEdgeLeft;
+ [self.view addGestureRecognizer:edgePanGestureRecognizer];
+}
+
+- (void)edgePanGesture:(UIScreenEdgePanGestureRecognizer*)edgePanGestureRecognizer{
+ [self.navigationController popViewControllerAnimated:YES];
+}
+
+#pragma mark- UIGestureRecognizerDelegate
+- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
+ if (!self.navigationController || [self.navigationController.viewControllers count] == 1) {
+ return NO;
+ }
+ return YES;
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+ [self _updateInstanceState:WeexInstanceAppear];
+}
+
+- (void)viewDidDisappear:(BOOL)animated
+{
+ [super viewDidDisappear:animated];
+ [self _updateInstanceState:WeexInstanceDisappear];
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ [self _updateInstanceState:WeexInstanceMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+- (void)refreshWeex
+{
+ [self _renderWithURL:_sourceURL];
+}
+
+- (void)_renderWithURL:(NSURL *)sourceURL
+{
+ if (!sourceURL) {
+ return;
+ }
+
+ [_instance destroyInstance];
+ _instance = [[WXSDKInstance alloc] init];
+ _instance.frame = CGRectMake(0.0f, 0.0f, self.view.bounds.size.width, self.view.bounds.size.height);
+ _instance.pageObject = self;
+ _instance.pageName = [sourceURL absoluteString];
+ _instance.viewController = self;
+
+ NSString *newURL = nil;
+
+ if ([sourceURL.absoluteString rangeOfString:@"?"].location != NSNotFound) {
+ newURL = [NSString stringWithFormat:@"%@&random=%d", sourceURL.absoluteString, arc4random()];
+ }
+ else {
+ newURL = [NSString stringWithFormat:@"%@?random=%d", sourceURL.absoluteString, arc4random()];
+ }
+ [_instance renderWithURL:[NSURL URLWithString:newURL] options:@{@"bundleUrl":sourceURL} data:nil];
+
+ __weak typeof(self) weakSelf = self;
+ _instance.onCreate = ^(UIView *view) {
+ [weakSelf.weexView removeFromSuperview];
+ weakSelf.weexView = view;
+ [weakSelf.view addSubview:weakSelf.weexView];
+ };
+}
+
+- (void)_updateInstanceState:(WXState)state
+{
+ if (_instance) {
+ _instance.state = state;
+ }
+}
+
+- (void)_appStateDidChange:(NSNotification *)nofity
+{
+ if ([nofity.name isEqualToString:@"UIApplicationDidBecomeActiveNotification"]) {
+ [self _updateInstanceState:WeexInstanceForeground];
+ }
+ else if([nofity.name isEqualToString:@"UIApplicationDidEnterBackgroundNotification"]) {
+ [self _updateInstanceState:WeexInstanceBackground]; ;
+ }
+}
+
+- (void)_addObservers
+{
+ for (NSString *name in @[UIApplicationDidBecomeActiveNotification,
+ UIApplicationDidEnterBackgroundNotification]) {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(_appStateDidChange:)
+ name:name
+ object:nil];
+ }
+}
+
+- (void)_removeObservers
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.h b/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.h
new file mode 100644
index 0000000..5f94c4e
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.h
@@ -0,0 +1,33 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <UIKit/UIKit.h>
+
+/**
+ * The WXRootViewController class inherited from UINavigationController class which implements a specialized
+ * view controller that manages the navigation of hierarchical content. Developing an iOS application, you
+ * need a series of customer pages which will be render by weex bundle. Sometimes, these pages are embedded in
+ * viewcontroller. This navigation controller makes it possible to present your page efficiently and makes it
+ * easier for the user to navigate that content.
+ */
+
+@interface WXRootViewController : UINavigationController
+
+/**
+ * @abstract initialize the RootViewController with bundle url.
+ *
+ * @param soureURL. The bundle url which can be render to a weex view.
+ *
+ * @return a object the class of WXRootViewController.
+ *
+ * @discussion initialize this controller in function 'application:didFinishLaunchingWithOptions', and make it as rootViewContoller of window. In the
+ * weex application, all page content can be managed by the navigation, such as push or pop.
+ */
+- (id)initWithSourceURL:(NSURL *)sourceURL;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m b/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
new file mode 100644
index 0000000..41ebbf7
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
@@ -0,0 +1,21 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXRootViewController.h"
+#import "WXBaseViewController.h"
+
+@implementation WXRootViewController
+
+- (id)initWithSourceURL:(NSURL *)sourceURL
+{
+ WXBaseViewController *baseViewController = [[WXBaseViewController alloc]initWithSourceURL:sourceURL];
+
+ return [super initWithRootViewController:baseViewController];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.h b/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.h
new file mode 100644
index 0000000..3d62aef
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.h
@@ -0,0 +1,28 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXModuleProtocol.h"
+
+@interface WXDebugTool : NSObject<WXModuleProtocol>
+
+//+ (void)showFPS;
+
++ (void)setDebug:(BOOL)isDebug;
+
++ (BOOL)isDebug;
+
++ (void)setReplacedBundleJS:(NSURL*)url;
+
++ (NSString*)getReplacedBundleJS;
+
++ (void)setReplacedJSFramework:(NSURL*)url;
+
++ (NSString*)getReplacedJSFramework;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.m b/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.m
new file mode 100644
index 0000000..e5d0b33
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.m
@@ -0,0 +1,115 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXDebugTool.h"
+//#import "WXFPSLabel.h"
+#import "WXHandlerFactory.h"
+#import "WXNetworkProtocol.h"
+#import "WXUtility.h"
+#import "WXSDKManager.h"
+#import "WXSDKEngine.h"
+
+static BOOL WXIsDebug;
+static NSString* WXDebugrepBundleJS;
+static NSString* WXDebugrepJSFramework;
+
+@implementation WXDebugTool
+
+//+ (void)showFPS
+//{
+// UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
+// WXFPSLabel *label = [[WXFPSLabel alloc] initWithFrame:CGRectMake(window.frame.size.width-135, window.frame.size.height-35, 120, 20)];
+// label.layer.zPosition = MAXFLOAT;
+// [window addSubview:label];
+//}
+
++ (void)setDebug:(BOOL)isDebug
+{
+ WXIsDebug = isDebug;
+}
+
++ (BOOL)isDebug
+{
+#ifdef DEBUG
+ return YES;
+#endif
+ return WXIsDebug;
+}
+
++ (void)setReplacedBundleJS:(NSURL*)url{
+ [self getData:url key:@"bundlejs"];
+}
+
++ (NSString*)getReplacedBundleJS{
+ return WXDebugrepBundleJS;
+}
+
++ (void)setReplacedJSFramework:(NSURL*)url{
+ [self getData:url key:@"jsframework"];
+}
+
++ (NSString*)getReplacedJSFramework{
+
+ return WXDebugrepJSFramework;
+}
+
++ (void)getData:(NSURL*)url key:(NSString*)key{
+ void(^scriptLoadFinish)(NSString*, NSString*) = ^(NSString* key, NSString* script){
+ if ([key isEqualToString:@"jsframework"]) {
+ WXDebugrepJSFramework = script;
+ [[WXSDKManager bridgeMgr] unload];
+ [WXSDKEngine initSDKEnviroment:script];
+ }else {
+ WXDebugrepBundleJS = script;
+ }
+ };
+ if ([url isFileURL]) {
+ // File URL
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ NSString *path = [url path];
+ NSData *scriptData = [[NSFileManager defaultManager] contentsAtPath:path];
+ NSString *script = [[NSString alloc] initWithData:scriptData encoding:NSUTF8StringEncoding];
+ if (!script) {
+ NSString *errorDesc = [NSString stringWithFormat:@"File read error at url: %@", url];
+ WXLogError(@"%@", errorDesc);
+ }
+ scriptLoadFinish(key, script);
+ });
+ } else {
+ // HTTP/HTTPS URL
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request setValue:[WXUtility userAgent] forHTTPHeaderField:@"User-Agent"];
+
+ id<WXNetworkProtocol> networkHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXNetworkProtocol)];
+
+ __block NSURLResponse *urlResponse;
+ [networkHandler sendRequest:request
+ withSendingData:^(int64_t bytesSent, int64_t totalBytes) {}
+ withResponse:^(NSURLResponse *response) {
+ urlResponse = response;
+ }
+ withReceiveData:^(NSData *data) {}
+ withCompeletion:^(NSData *totalData, NSError *error) {
+ if (error) {
+
+ } else {
+ if ([urlResponse isKindOfClass:[NSHTTPURLResponse class]] && ((NSHTTPURLResponse *)urlResponse).statusCode != 200) {
+ __unused NSError *error = [NSError errorWithDomain:WX_ERROR_DOMAIN
+ code:((NSHTTPURLResponse *)urlResponse).statusCode
+ userInfo:@{@"message":@"status code error."}];
+
+ return ;
+ }
+ NSString * script = [[NSString alloc] initWithData:totalData encoding:NSUTF8StringEncoding];
+ scriptLoadFinish(key, script);
+ }
+ }];
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.h b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.h
new file mode 100644
index 0000000..fccb826
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <WeexSDK/WeexSDK.h>
+
+@interface WXComponent (Display)
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m
new file mode 100644
index 0000000..1560177
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m
@@ -0,0 +1,463 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent+Display.h"
+#import "WXComponent.h"
+#import "WXComponent_internal.h"
+#import "WXLayer.h"
+#import "WXAssert.h"
+#import "WXDisplayQueue.h"
+#import "WXThreadSafeCounter.h"
+
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+
+@implementation WXComponent (Display)
+
+#pragma mark Public
+
+- (void)setNeedsDisplay
+{
+ WXAssertMainThread();
+
+ if (_compositingChild) {
+ WXComponent *supercomponent = self.supercomponent;
+ while (supercomponent) {
+ if (supercomponent->_composite) {
+ break;
+ }
+ supercomponent = supercomponent.supercomponent;
+ }
+ [supercomponent setNeedsDisplay];
+ } else {
+ [_layer setNeedsDisplay];
+ }
+}
+
+- (WXDisplayBlock)displayBlock
+{
+ WXDisplayBlock displayBlock = ^UIImage *(CGRect bounds, BOOL(^isCancelled)(void)) {
+ if (isCancelled()) {
+ return nil;
+ }
+
+ if (![self _needsDrawBorder]) {
+ return nil;
+ }
+
+ return [self _borderImage];
+ };
+
+ return displayBlock;
+}
+
+- (WXDisplayCompeletionBlock)displayCompeletionBlock
+{
+ return nil;
+}
+
+#pragma mark Private
+
+- (void)_willDisplayLayer:(CALayer *)layer
+{
+ WXAssertMainThread();
+
+ if (_compositingChild) {
+ // compsiting children need not draw layer
+ return;
+ }
+
+ CGRect displayBounds = CGRectMake(0, 0, self.calculatedFrame.size.width, self.calculatedFrame.size.height);
+
+ WXDisplayBlock displayBlock;
+ if (_composite) {
+ displayBlock = [self _compositeDisplayBlock];
+ } else {
+ displayBlock = [self displayBlock];
+ }
+ WXDisplayCompeletionBlock compeletionBlock = [self displayCompeletionBlock];
+
+ if (!displayBlock) {
+ if (compeletionBlock) {
+ compeletionBlock(layer, NO);
+ }
+ return;
+ }
+
+ if (_async) {
+ WXThreadSafeCounter *displayCounter = _displayCounter;
+ int32_t displayValue = [displayCounter increase];
+ BOOL (^isCancelled)() = ^BOOL(){
+ return displayValue != displayCounter.value;
+ };
+
+ [WXDisplayQueue addBlock:^{
+ if (isCancelled()) {
+ if (compeletionBlock) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ compeletionBlock(layer, NO);
+ });
+ }
+ return;
+ }
+
+ UIImage *image = displayBlock(displayBounds, isCancelled);
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (isCancelled()) {
+ if (compeletionBlock) {
+ compeletionBlock(layer, NO);
+ }
+ return;
+ }
+
+ layer.contents = (id)(image.CGImage);
+
+ if (compeletionBlock) {
+ compeletionBlock(layer, YES);
+ }
+ });
+
+ }];
+ } else {
+ UIImage *image = displayBlock(displayBounds, ^BOOL(){
+ return NO;
+ });
+
+ _layer.contents = (id)image.CGImage;
+
+ if (compeletionBlock) {
+ compeletionBlock(layer, YES);
+ }
+ }
+}
+
+- (WXDisplayBlock)_compositeDisplayBlock
+{
+ return ^UIImage* (CGRect bounds, BOOL(^isCancelled)(void)) {
+ if (isCancelled()) {
+ return nil;
+ }
+ NSMutableArray *displayBlocks = [NSMutableArray array];
+ [self _collectDisplayBlocks:displayBlocks isCancelled:isCancelled];
+
+ BOOL opaque = _layer.opaque && CGColorGetAlpha(_backgroundColor.CGColor) == 1.0f;
+
+ UIGraphicsBeginImageContextWithOptions(bounds.size, opaque, 0.0);
+
+ for (dispatch_block_t block in displayBlocks) {
+ if (isCancelled()) {
+ UIGraphicsEndImageContext();
+ return nil;
+ }
+ block();
+ }
+
+ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+
+ return image;
+ };
+}
+
+- (void)_collectDisplayBlocks:(NSMutableArray *)displayBlocks isCancelled:(BOOL(^)(void))isCancelled
+{
+ // compositingChild has no chance to applyPropertiesToView, so force updateNode
+ // if (_compositingChild) {
+ // if (_data) {
+ // dispatch_async(dispatch_get_main_queue(), ^{
+ // [self updateNode:_data];
+ // });
+ // }
+ // }
+
+ UIColor *backgroundColor = _backgroundColor;
+ BOOL clipsToBounds = _clipToBounds;
+ CGRect frame = self.calculatedFrame;
+ CGRect bounds = CGRectMake(0, 0, frame.size.width, frame.size.height);
+
+ if (_composite) {
+ frame.origin = CGPointMake(0, 0);
+ }
+
+ WXDisplayBlock displayBlock = [self displayBlock];
+
+ BOOL shouldDisplay = displayBlock || backgroundColor || CGPointEqualToPoint(CGPointZero, frame.origin) == NO || clipsToBounds;
+
+ if (shouldDisplay) {
+ dispatch_block_t displayBlockToPush = ^{
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ CGContextSaveGState(context);
+ CGContextTranslateCTM(context, frame.origin.x, frame.origin.y);
+
+ if (_compositingChild && clipsToBounds) {
+ [[UIBezierPath bezierPathWithRect:bounds] addClip];
+ }
+
+ CGColorRef backgroundCGColor = backgroundColor.CGColor;
+ if (backgroundColor && CGColorGetAlpha(backgroundCGColor) > 0.0) {
+ CGContextSetFillColorWithColor(context, backgroundCGColor);
+ CGContextFillRect(context, bounds);
+ }
+
+ if (displayBlock) {
+ UIImage *image = displayBlock(bounds, isCancelled);
+ if (image) {
+ [image drawInRect:bounds];
+ }
+ }
+ };
+ [displayBlocks addObject:[displayBlockToPush copy]];
+ }
+
+ for (WXComponent *component in self.subcomponents) {
+ if (!isCancelled()) {
+ [component _collectDisplayBlocks:displayBlocks isCancelled:isCancelled];
+ }
+ }
+
+ if (shouldDisplay) {
+ dispatch_block_t blockToPop = ^{
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ CGContextRestoreGState(context);
+ };
+ [displayBlocks addObject:[blockToPop copy]];
+ }
+}
+
+#pragma mark Border Drawing
+
+- (UIImage *)_borderImage
+{
+ CGSize size = self.calculatedFrame.size;
+ if (size.width <= 0 || size.height <= 0) {
+ return nil;
+ }
+
+ UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ [self _drawBorderWithContext:context size:size];
+
+ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+
+ return image;
+}
+
+- (void)_drawBorderWithContext:(CGContextRef)context size:(CGSize)size
+{
+ if (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) > 0) {
+ CGContextSetFillColorWithColor(context, _backgroundColor.CGColor);
+ UIBezierPath *bezierPath = [UIBezierPath bezierPath];
+ [bezierPath moveToPoint:CGPointMake(size.width -_borderTopRightRadius, 0)];
+ [bezierPath addLineToPoint:CGPointMake(_borderTopLeftRadius, 0)];
+ [bezierPath addArcWithCenter:CGPointMake(_borderTopLeftRadius, _borderTopLeftRadius) radius:_borderTopLeftRadius startAngle:M_PI+M_PI_2 endAngle:M_PI clockwise:0];
+ [bezierPath addLineToPoint:CGPointMake(0, size.height-_borderBottomLeftRadius)];
+ [bezierPath addArcWithCenter:CGPointMake(_borderBottomLeftRadius, size.height-_borderBottomLeftRadius) radius:_borderBottomLeftRadius startAngle: M_PI endAngle:M_PI_2 clockwise:0];
+ [bezierPath addLineToPoint:CGPointMake(size.width-_borderBottomRightRadius, size.height)];
+ [bezierPath addArcWithCenter:CGPointMake(size.width-_borderBottomRightRadius, size.height-_borderBottomRightRadius) radius:_borderBottomRightRadius startAngle: M_PI_2 endAngle:0 clockwise:0];
+ [bezierPath addLineToPoint:CGPointMake(size.width, _borderTopRightRadius)];
+ [bezierPath addArcWithCenter:CGPointMake(size.width-_borderTopRightRadius, _borderTopRightRadius) radius:_borderTopRightRadius startAngle: 0 endAngle:-M_PI_2 clockwise:0];
+ [bezierPath fill];
+ }
+
+ // TOP
+ if (_borderTopWidth > 0) {
+ if(_borderTopStyle == WXBorderStyleDashed || _borderTopStyle == WXBorderStyleDotted){
+ CGFloat lengths[2];
+ lengths[0] = lengths[1] = (_borderTopStyle == WXBorderStyleDashed ? 3 : 1) * _borderTopWidth;
+ CGContextSetLineDash(context, 0, lengths, sizeof(lengths) / sizeof(*lengths));
+ } else{
+ CGContextSetLineDash(context, 0, 0, 0);
+ }
+ CGContextSetLineWidth(context, _borderTopWidth);
+ CGContextSetStrokeColorWithColor(context, _borderTopColor.CGColor);
+ CGContextAddArc(context, size.width-_borderTopRightRadius, _borderTopRightRadius, _borderTopRightRadius-_borderTopWidth/2, -M_PI_4+(_borderRightWidth>0?0:M_PI_4), -M_PI_2, 1);
+ CGContextMoveToPoint(context, size.width-_borderTopRightRadius, _borderTopWidth/2);
+ CGContextAddLineToPoint(context, _borderTopLeftRadius, _borderTopWidth/2);
+ CGContextAddArc(context, _borderTopLeftRadius, _borderTopLeftRadius, _borderTopLeftRadius-_borderTopWidth/2, -M_PI_2, -M_PI_2-M_PI_4-(_borderLeftWidth>0?0:M_PI_4), 1);
+ CGContextStrokePath(context);
+ }
+
+ // Left
+ if (_borderLeftWidth > 0) {
+ if(_borderLeftStyle == WXBorderStyleDashed || _borderLeftStyle == WXBorderStyleDotted){
+ CGFloat lengths[2];
+ lengths[0] = lengths[1] = (_borderLeftStyle == WXBorderStyleDashed ? 3 : 1) * _borderLeftWidth;
+ CGContextSetLineDash(context, 0, lengths, sizeof(lengths) / sizeof(*lengths));
+ } else{
+ CGContextSetLineDash(context, 0, 0, 0);
+ }
+ CGContextSetLineWidth(context, _borderLeftWidth);
+ CGContextSetStrokeColorWithColor(context, _borderLeftColor.CGColor);
+ CGContextAddArc(context, _borderTopLeftRadius, _borderTopLeftRadius, _borderTopLeftRadius-_borderLeftWidth/2, -M_PI, -M_PI_2-M_PI_4+(_borderTopWidth > 0?0:M_PI_4), 0);
+ CGContextMoveToPoint(context, _borderLeftWidth/2, _borderTopLeftRadius);
+ CGContextAddLineToPoint(context, _borderLeftWidth/2, size.height-_borderBottomLeftRadius);
+ CGContextAddArc(context, _borderBottomLeftRadius, size.height-_borderBottomLeftRadius, _borderBottomLeftRadius-_borderLeftWidth/2, M_PI, M_PI-M_PI_4-(_borderBottomWidth>0?0:M_PI_4), 1);
+ CGContextStrokePath(context);
+ }
+
+ // Bottom
+ if (_borderBottomWidth > 0) {
+ if(_borderBottomStyle == WXBorderStyleDashed || _borderBottomStyle == WXBorderStyleDotted){
+ CGFloat lengths[2];
+ lengths[0] = lengths[1] = (_borderBottomStyle == WXBorderStyleDashed ? 3 : 1) * _borderBottomWidth;
+ CGContextSetLineDash(context, 0, lengths, sizeof(lengths) / sizeof(*lengths));
+ } else{
+ CGContextSetLineDash(context, 0, 0, 0);
+ }
+ CGContextSetLineWidth(context, _borderBottomWidth);
+ CGContextSetStrokeColorWithColor(context, _borderBottomColor.CGColor);
+ CGContextAddArc(context, _borderBottomLeftRadius, size.height-_borderBottomLeftRadius, _borderBottomLeftRadius-_borderBottomWidth/2, M_PI-M_PI_4+(_borderLeftWidth>0?0:M_PI_4), M_PI_2, 1);
+ CGContextMoveToPoint(context, _borderBottomLeftRadius, size.height-_borderBottomWidth/2);
+ CGContextAddLineToPoint(context, size.width-_borderBottomRightRadius, size.height-_borderBottomWidth/2);
+ CGContextAddArc(context, size.width-_borderBottomRightRadius, size.height-_borderBottomRightRadius, _borderBottomRightRadius-_borderBottomWidth/2, M_PI_2, M_PI_4-(_borderRightWidth > 0?0:M_PI_4), 1);
+ CGContextStrokePath(context);
+ }
+
+ // Right
+ if (_borderRightWidth > 0) {
+ if(_borderRightStyle == WXBorderStyleDashed || _borderRightStyle == WXBorderStyleDotted){
+ CGFloat lengths[2];
+ lengths[0] = lengths[1] = (_borderRightStyle == WXBorderStyleDashed ? 3 : 1) * _borderRightWidth;
+ CGContextSetLineDash(context, 0, lengths, sizeof(lengths) / sizeof(*lengths));
+ } else{
+ CGContextSetLineDash(context, 0, 0, 0);
+ }
+ CGContextSetLineWidth(context, _borderRightWidth);
+ CGContextSetStrokeColorWithColor(context, _borderRightColor.CGColor);
+ CGContextAddArc(context, size.width-_borderBottomRightRadius, size.height-_borderBottomRightRadius, _borderBottomRightRadius-_borderRightWidth/2, M_PI_4+(_borderBottomWidth>0?0:M_PI_4), 0, 1);
+ CGContextMoveToPoint(context, size.width-_borderRightWidth/2, size.height-_borderBottomRightRadius);
+ CGContextAddLineToPoint(context, size.width-_borderRightWidth/2, _borderTopRightRadius);
+ CGContextAddArc(context, size.width-_borderTopRightRadius, _borderTopRightRadius, _borderTopRightRadius-_borderRightWidth/2, 0, -M_PI_4-(_borderTopWidth > 0?0:M_PI_4), 1);
+ CGContextStrokePath(context);
+ }
+
+ CGContextStrokePath(context);
+}
+
+- (BOOL)_needsDrawBorder
+{
+ if (![_layer isKindOfClass:[WXLayer class]]) {
+ // Only support WXLayer
+ return NO;
+ }
+ if (_async) {
+ // Async layer always draw border
+ return YES;
+ }
+ if (!(_borderLeftStyle == _borderTopStyle &&
+ _borderTopStyle == _borderRightStyle &&
+ _borderRightStyle == _borderBottomStyle &&
+ _borderBottomStyle == WXBorderStyleSolid)
+ ) {
+ // Native border property doesn't support dashed or dotted border
+ return YES;
+ }
+
+ // user native border property only when border width & color & radius are equal;
+ BOOL widthEqual = _borderTopWidth == _borderRightWidth && _borderRightWidth == _borderBottomWidth && _borderBottomWidth == _borderLeftWidth;
+ if (!widthEqual) {
+ return YES;
+ }
+ BOOL radiusEqual = _borderTopLeftRadius == _borderTopRightRadius && _borderTopRightRadius == _borderBottomRightRadius && _borderBottomRightRadius == _borderBottomLeftRadius;
+ if (!radiusEqual) {
+ return YES;
+ }
+ BOOL colorEqual = [_borderTopColor isEqual:_borderRightColor] && [_borderRightColor isEqual:_borderBottomColor] && [_borderBottomColor isEqual:_borderLeftColor];
+ if (!colorEqual) {
+ return YES;
+ }
+
+ return NO;
+}
+
+- (void)_recomputeBorderRadius
+{
+ // prevent overlapping,
+ CGFloat topRadiusScale = (_borderTopLeftRadius + _borderTopRightRadius == 0) ? 1 : MIN(1, _calculatedFrame.size.width / (_borderTopLeftRadius + _borderTopRightRadius));
+ CGFloat leftRadiusScale = (_borderTopLeftRadius + _borderBottomLeftRadius == 0) ? 1 : MIN(1, _calculatedFrame.size.height / (_borderTopLeftRadius + _borderBottomLeftRadius));
+ CGFloat bottomRadiusScale = (_borderBottomLeftRadius + _borderBottomRightRadius == 0) ? 1 :MIN(1, _calculatedFrame.size.width / (_borderBottomLeftRadius + _borderBottomRightRadius));
+ CGFloat rightRadiusScale = (_borderTopRightRadius+ _borderBottomRightRadius == 0) ? 1 : MIN(1, _calculatedFrame.size.height / (_borderTopRightRadius+ _borderBottomRightRadius));
+ CGFloat finalScale = MIN(MIN(MIN(topRadiusScale, leftRadiusScale), bottomRadiusScale), rightRadiusScale);
+ _borderTopLeftRadius *= finalScale;
+ _borderTopRightRadius *= finalScale;
+ _borderBottomRightRadius *= finalScale;
+ _borderBottomLeftRadius *= finalScale;
+}
+
+- (void)_handleBorders:(NSDictionary *)styles isUpdating:(BOOL)updating
+{
+ if (!updating) {
+ // init with defalut value
+ _borderTopStyle = _borderRightStyle = _borderBottomStyle = _borderLeftStyle = WXBorderStyleSolid;
+ _borderTopColor = _borderLeftColor = _borderRightColor = _borderBottomColor = [UIColor blackColor];
+ _borderTopWidth = _borderLeftWidth = _borderRightWidth = _borderBottomWidth = 0;
+ _borderTopLeftRadius = _borderTopRightRadius = _borderBottomLeftRadius = _borderBottomRightRadius = 0;
+ }
+
+ BOOL previousNeedsDrawBorder = YES;
+ if (updating) {
+ previousNeedsDrawBorder = [self _needsDrawBorder];
+ }
+
+#define WX_CHECK_BORDER_PROP(prop, direction1, direction2, direction3, direction4, type, setLayerProp)\
+do {\
+ BOOL needsDisplay = NO; \
+ NSString *styleProp= WX_NSSTRING(WX_CONCAT(border, prop));\
+ if (styles[styleProp]) {\
+ _border##direction1##prop = _border##direction2##prop = _border##direction3##prop = _border##direction4##prop = [WXConvert type:styles[styleProp]];\
+ needsDisplay = YES;\
+ }\
+ NSString *styleDirection1Prop = WX_NSSTRING(WX_CONCAT_TRIPLE(border, direction1, prop));\
+ if (styles[styleDirection1Prop]) {\
+ _border##direction1##prop = [WXConvert type:styles[styleDirection1Prop]];\
+ needsDisplay = YES;\
+ }\
+ NSString *styleDirection2Prop = WX_NSSTRING(WX_CONCAT_TRIPLE(border, direction2, prop));\
+ if (styles[styleDirection2Prop]) {\
+ _border##direction2##prop = [WXConvert type:styles[styleDirection2Prop]];\
+ needsDisplay = YES;\
+ }\
+ NSString *styleDirection3Prop = WX_NSSTRING(WX_CONCAT_TRIPLE(border, direction3, prop));\
+ if (styles[styleDirection3Prop]) {\
+ _border##direction3##prop = [WXConvert type:styles[styleDirection3Prop]];\
+ needsDisplay = YES;\
+ }\
+ NSString *styleDirection4Prop = WX_NSSTRING(WX_CONCAT_TRIPLE(border, direction4, prop));\
+ if (styles[styleDirection4Prop]) {\
+ _border##direction4##prop = [WXConvert type:styles[styleDirection4Prop]];\
+ needsDisplay = YES;\
+ }\
+ if (needsDisplay && updating) {\
+ if (![self _needsDrawBorder]) {\
+ setLayerProp;\
+ }\
+ [self setNeedsDisplay];\
+ }\
+} while (0);
+
+ WX_CHECK_BORDER_PROP(Style, Top, Left, Bottom, Right, WXBorderStyle,)
+ WX_CHECK_BORDER_PROP(Color, Top, Left, Bottom, Right, UIColor,
+ _layer.borderColor = _borderTopColor.CGColor)
+ WX_CHECK_BORDER_PROP(Width, Top, Left, Bottom, Right, WXPixelType,
+ _layer.borderWidth = _borderTopWidth)
+ WX_CHECK_BORDER_PROP(Radius, TopLeft, TopRight, BottomLeft, BottomRight, WXPixelType,
+ _layer.cornerRadius = _borderTopLeftRadius)
+
+ if (updating) {
+ BOOL nowNeedsDrawBorder = [self _needsDrawBorder];
+ if (nowNeedsDrawBorder && !previousNeedsDrawBorder) {
+ _layer.cornerRadius = 0;
+ _layer.borderWidth = 0;
+ _layer.backgroundColor = NULL;
+ }
+ }
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.h b/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.h
new file mode 100644
index 0000000..28fd1c0
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.h
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+// Global queue for displaying content
+@interface WXDisplayQueue : NSObject
+
++ (void)addBlock:(void(^)())block;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.m b/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.m
new file mode 100644
index 0000000..e26b921
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Display/WXDisplayQueue.m
@@ -0,0 +1,45 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXDisplayQueue.h"
+
+#define MAX_CONCURRENT_COUNT 8
+
+static dispatch_semaphore_t WXDisplayConcurrentSemaphore;
+
+@implementation WXDisplayQueue
+
++ (dispatch_queue_t)displayQueue
+{
+ static dispatch_queue_t displayQueue = NULL;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ displayQueue = dispatch_queue_create("com.taobao.weex.displayQueue", DISPATCH_QUEUE_CONCURRENT);
+ dispatch_set_target_queue(displayQueue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));
+ });
+
+ return displayQueue;
+}
+
++ (void)addBlock:(void(^)())block
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ NSUInteger processorCount = [NSProcessInfo processInfo].activeProcessorCount;
+ NSUInteger maxConcurrentCount = processorCount <= MAX_CONCURRENT_COUNT ? processorCount : MAX_CONCURRENT_COUNT;
+ WXDisplayConcurrentSemaphore = dispatch_semaphore_create(maxConcurrentCount);
+ });
+
+ dispatch_async([self displayQueue], ^{
+ dispatch_semaphore_wait(WXDisplayConcurrentSemaphore, DISPATCH_TIME_FOREVER);
+ block();
+ dispatch_semaphore_signal(WXDisplayConcurrentSemaphore);
+ });
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Display/WXLayer.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXLayer.h b/ios/sdk/WeexSDK/Sources/Display/WXLayer.h
new file mode 100644
index 0000000..6a370b1
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Display/WXLayer.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <QuartzCore/QuartzCore.h>
+
+@interface WXLayer : CALayer
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Display/WXLayer.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXLayer.m b/ios/sdk/WeexSDK/Sources/Display/WXLayer.m
new file mode 100644
index 0000000..6929354
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Display/WXLayer.m
@@ -0,0 +1,21 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXLayer.h"
+#import "WXDefine.h"
+#import "WXComponent.h"
+#import "WXComponent_internal.h"
+
+@implementation WXLayer
+
+- (void)display
+{
+ [self.wx_component _willDisplayLayer:self];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h
new file mode 100644
index 0000000..0dc2b01
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h
@@ -0,0 +1,89 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WXSDKEngine : NSObject
+
+/**
+ * @abstract Registers a module for a given name
+ *
+ * @param name The module name to register
+ *
+ * @param clazz The module class to register
+ *
+ **/
++ (void)registerModule:(NSString *)name withClass:(Class)clazz;
+
+/**
+ * @abstract Registers a component for a given name
+ *
+ * @param name The component name to register
+ *
+ * @param clazz The WXComponent subclass to register
+ *
+ **/
++ (void)registerComponent:(NSString *)name withClass:(Class)clazz;
+
+/**
+ * @abstract Registers a component for a given name and specific properties
+ *
+ * @param name The component name to register
+ *
+ * @param clazz The WXComponent subclass to register
+ *
+ * @param properties properties to apply to the component
+ *
+ */
++ (void)registerComponent:(NSString *)name withClass:(Class)clazz withProperties:(NSDictionary *)properties;
+
+/**
+ * @abstract Registers a handler for a given handler instance and specific protocol
+ *
+ * @param handler The handler instance to register
+ *
+ * @param protocol The protocol to confirm
+ *
+ */
++ (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol;
+
+/**
+ * @abstract Initializes the global sdk enviroment
+ *
+ * @discussion Injects main.js in app bundle as default JSFramework script.
+ *
+ **/
++ (void)initSDKEnviroment;
+
+/**
+ * @abstract Initializes the enviroment with a given JSFramework script.
+ *
+ **/
++ (void)initSDKEnviroment:(NSString *)script;
+
+/**
+ * @abstract Unloads the bridge context
+ *
+ **/
++ (void)unload;
+
+/**
+ * @abstract Returns the version of SDK
+ *
+ **/
++ (NSString*)SDKEngineVersion;
+
+/**
+ * @abstract Connects to websocket for debugging
+ *
+ * @param URL The URL of websocket to connect
+ *
+ */
++ (void)connectDebugServer:(NSString*)URL;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
new file mode 100644
index 0000000..87738ae
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
@@ -0,0 +1,186 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSDKEngine.h"
+#import "WXModuleFactory.h"
+#import "WXHandlerFactory.h"
+#import "WXComponentFactory.h"
+
+#import "WXAppConfiguration.h"
+#import "WXNetworkDefaultImpl.h"
+#import "WXNavigationDefaultImpl.h"
+#import "WXSDKManager.h"
+#import "WXSDKError.h"
+#import "WXSimulatorShortcutMananger.h"
+#import "WXAssert.h"
+#import "WXLog.h"
+#import "WXUtility.h"
+
+@implementation WXSDKEngine
+
+# pragma mark Module Register
+
+// register some default modules when the engine initializes.
++ (void)_registerDefaultModules
+{
+ [self registerModule:@"dom" withClass:NSClassFromString(@"WXDomModule")];
+ [self registerModule:@"navigator" withClass:NSClassFromString(@"WXNavigatorModule")];
+ [self registerModule:@"stream" withClass:NSClassFromString(@"WXStreamModule")];
+ [self registerModule:@"animation" withClass:NSClassFromString(@"WXAnimationModule")];
+ [self registerModule:@"modal" withClass:NSClassFromString(@"WXModalUIModule")];
+ [self registerModule:@"webview" withClass:NSClassFromString(@"WXWebViewModule")];
+ [self registerModule:@"instanceWrap" withClass:NSClassFromString(@"WXInstanceWrap")];
+ [self registerModule:@"timer" withClass:NSClassFromString(@"WXTimerModule")];
+}
+
++ (void)registerModule:(NSString *)name withClass:(Class)clazz
+{
+ WXAssert(name && clazz, @"Fail to register the module, please check if the parameters are correct \uff01");
+
+ NSString *moduleName = [WXModuleFactory registerModule:name withClass:clazz];
+ NSDictionary *dict = [WXModuleFactory moduleMethodMapsWithName:moduleName];
+
+ [[WXSDKManager bridgeMgr] registerModules:dict];
+}
+
+# pragma mark Component Register
+
+// register some default components when the engine initializes.
++ (void)_registerDefaultComponents
+{
+ [self registerComponent:@"container" withClass:NSClassFromString(@"WXDivComponent") withProperties:nil];
+ [self registerComponent:@"div" withClass:NSClassFromString(@"WXComponent") withProperties:nil];
+ [self registerComponent:@"text" withClass:NSClassFromString(@"WXTextComponent") withProperties:nil];
+ [self registerComponent:@"image" withClass:NSClassFromString(@"WXImageComponent") withProperties:nil];
+ [self registerComponent:@"scroller" withClass:NSClassFromString(@"WXScrollerComponent") withProperties:nil];
+ [self registerComponent:@"list" withClass:NSClassFromString(@"WXListComponent") withProperties:nil];
+
+ [self registerComponent:@"cell" withClass:NSClassFromString(@"WXCellComponent")];
+ [self registerComponent:@"embed" withClass:NSClassFromString(@"WXEmbedComponent")];
+ [self registerComponent:@"a" withClass:NSClassFromString(@"WXAComponent")];
+
+ [self registerComponent:@"select" withClass:NSClassFromString(@"WXSelectComponent")];
+ [self registerComponent:@"switch" withClass:NSClassFromString(@"WXSwitchComponent")];
+ [self registerComponent:@"input" withClass:NSClassFromString(@"WXTextInputComponent")];
+ [self registerComponent:@"video" withClass:NSClassFromString(@"WXVideoComponent")];
+ [self registerComponent:@"indicator" withClass:NSClassFromString(@"WXIndicatorComponent")];
+ [self registerComponent:@"slider" withClass:NSClassFromString(@"WXSliderComponent")];
+ [self registerComponent:@"web" withClass:NSClassFromString(@"WXWebComponent")];
+ [self registerComponent:@"loading" withClass:NSClassFromString(@"WXLoadingComponent")];
+ [self registerComponent:@"loading-indicator" withClass:NSClassFromString(@"WXLoadingIndicator")];
+ [self registerComponent:@"refresh" withClass:NSClassFromString(@"WXRefreshComponent")];
+}
+
++ (void)registerComponent:(NSString *)name withClass:(Class)clazz
+{
+ [self registerComponent:name withClass:clazz withProperties: @{@"append":@"tree"}];
+}
+
++ (void)registerComponent:(NSString *)name withClass:(Class)clazz withProperties:(NSDictionary *)properties
+{
+ if (!name || !clazz) {
+ return;
+ }
+
+ WXAssert(name && clazz, @"Fail to register the component, please check if the parameters are correct \uff01");
+
+ [WXComponentFactory registerComponent:name withClass:clazz];
+
+ if (properties) {
+ NSMutableDictionary *props = [properties mutableCopy];
+ props[@"type"] = name;
+ [[WXSDKManager bridgeMgr] registerComponents:@[props]];
+ } else {
+ [[WXSDKManager bridgeMgr] registerComponents:@[name]];
+ }
+}
+
+# pragma mark Handler Register
+
+// register some default handlers when the engine initializes.
++ (void)_registerDefaultHandlers
+{
+ [self registerHandler:[WXNetworkDefaultImpl new] withProtocol:@protocol(WXNetworkProtocol)];
+ [self registerHandler:[WXNavigationDefaultImpl new] withProtocol:@protocol(WXNavigationProtocol)];
+}
+
++ (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol
+{
+ WXAssert(handler && protocol, @"Fail to register the handler, please check if the parameters are correct \uff01");
+
+ [WXHandlerFactory registerHandler:handler withProtocol:protocol];
+}
+
+# pragma mark SDK Initialize
+
++ (void)initSDKEnviroment
+{
+ NSString *filePath = [[NSBundle mainBundle] pathForResource:@"main" ofType:@"js"];
+ NSString *script = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
+ [WXSDKEngine initSDKEnviroment:script];
+
+#if TARGET_OS_SIMULATOR
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ [WXSimulatorShortcutMananger registerSimulatorShortcutWithKey:@"i" modifierFlags:UIKeyModifierCommand | UIKeyModifierAlternate action:^{
+ NSURL *URL = [NSURL URLWithString:@"http://localhost:8687/launchDebugger"];
+ NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+
+ NSURLSession *session = [NSURLSession sharedSession];
+ NSURLSessionDataTask *task = [session dataTaskWithRequest:request
+ completionHandler:
+ ^(NSData *data, NSURLResponse *response, NSError *error) {
+ // ...
+ }];
+
+ [task resume];
+ WXLogInfo(@"Launching browser...");
+
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ [self connectDebugServer:@"ws://localhost:8687/debugger/0/renderer"];
+ });
+
+ }];
+ });
+#endif
+}
+
++ (void)initSDKEnviroment:(NSString *)script
+{
+ if (!script || script.length <= 0) {
+ [WXSDKError monitorAlarm:NO errorCode:WX_ERR_LOAD_JSLIB msg:@"framework loading is failure!"];
+ return;
+ }
+
+ [self _registerDefaultComponents];
+ [self _registerDefaultModules];
+ [self _registerDefaultHandlers];
+
+ [[WXSDKManager bridgeMgr] executeJsFramework:script];
+
+ [WXUtility addStatTrack:[WXAppConfiguration appName]];
+}
+
++ (NSString*)SDKEngineVersion
+{
+ return WX_SDK_VERSION;
+}
+
+# pragma mark Debug
+
++ (void)unload
+{
+ [[WXSDKManager bridgeMgr] unload];
+}
+
++ (void)connectDebugServer:(NSString*)URL
+{
+ [[WXSDKManager bridgeMgr] connectToWebSocket:[NSURL URLWithString:URL]];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
new file mode 100644
index 0000000..c9831f6
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
@@ -0,0 +1,45 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXSDkInstance.h"
+
+extern NSString* const kMonitorAlarmJsBridge;
+extern NSString* const kMonitorAlarmDomModule;
+
+typedef NS_ENUM(int, WXSDKErrCode)
+{
+ WX_ERR_JSBRIAGE_START = -2001,
+ WX_ERR_LOAD_JSLIB = -2002,
+// WX_ERR_OBJECT_JSON = -2008,
+ WX_ERR_JSFUNC_PARAM = -2009,
+ WA_ERR_INVOKE_NATIVE = -2012,
+ WX_ERR_JS_EXECUTE = -2013,
+ WX_ERR_JSBRIAGE_END = -2099,
+
+ WX_ERROR_DOMMODULE_START = -2100,
+ WX_ERR_DOM_CREATEBODY = -2100,
+ WX_ERR_DOM_UPDATTR = -2101,
+ WX_ERR_DOM_UPDSTYLE = -2102,
+ WX_ERR_DOM_ADDELEMENT = -2103,
+ WX_ERR_DOM_REMOVEELEMENT = -2104,
+ WX_ERR_DOM_MOVEELEMENT = -2105,
+ WX_ERR_DOM_ADDEVENT = -2106,
+ WX_ERR_DOM_REMOVEEVENT = -2107,
+// WX_ERR_DOM_CREATEFINISH = -2108,
+// WX_ERR_DOM_RENDERFINISH = -2109,
+ WX_ERR_DOM_SCROLLTOELEMENT = -2110,
+ WX_ERROR_DOMMODULE_END = -2199,
+};
+
+@interface WXSDKError : NSObject
+
++ (void)monitorAlarm:(BOOL)success errorCode:(WXSDKErrCode)errorCode msg:(NSString *)format, ... NS_FORMAT_FUNCTION(3,4);
+
++ (void) monitorAlarm:(BOOL)success errorCode:(WXSDKErrCode)errorCode errorMessage:(NSString *)message withURL:(NSURL *)url;
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m
new file mode 100644
index 0000000..7f5dc9a
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m
@@ -0,0 +1,63 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSDKError.h"
+#import "WXAppMonitorProtocol.h"
+#import "WXHandlerFactory.h"
+#import "WXLog.h"
+
+NSString * const kMonitorAlarmJsBridge = @"jsBridge";
+NSString * const kMonitorAlarmDomModule = @"domModule";
+
+@implementation WXSDKError
+
++ (void)monitorAlarm:(BOOL)success errorCode:(WXSDKErrCode)errorCode msg:(NSString *)format, ... NS_FORMAT_FUNCTION(3,4)
+{
+ if (success) return;
+
+ va_list args;
+ va_start(args, format);
+ NSString *errorMsg = [[NSString alloc] initWithFormat:format arguments:args];
+ va_end(args);
+
+ [self monitorAlarm:success errorCode:errorCode errorMessage:errorMsg withURL:nil];
+}
+
++ (void)monitorAlarm:(BOOL)success errorCode:(WXSDKErrCode)errorCode errorMessage:(NSString *)errorMsg withURL:(NSURL *)url
+{
+ if (success) {
+ return;
+ }
+
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ if (!success) {
+ WXLogError(@"%@", errorMsg);
+ }
+
+ id<WXAppMonitorProtocol> appMonitorHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXAppMonitorProtocol)];
+ if ([appMonitorHandler respondsToSelector:@selector(commitAppMonitorAlarm:monitorPoint:success:errorCode:errorMsg:arg:)]) {
+ NSString *pointKey = nil;
+ if (errorCode <= WX_ERR_JSBRIAGE_START &&
+ errorCode >= WX_ERR_JSBRIAGE_END) {
+ pointKey = kMonitorAlarmJsBridge;
+ }
+ else if (errorCode <= WX_ERROR_DOMMODULE_START &&
+ errorCode >= WX_ERROR_DOMMODULE_END) {
+ pointKey = kMonitorAlarmDomModule;
+ } else {
+ WXLogError(@"");
+ }
+
+ NSString *errorCodeStr = [NSString stringWithFormat:@"%d", errorCode];
+
+ [appMonitorHandler commitAppMonitorAlarm:@"weex" monitorPoint:pointKey success:success errorCode:errorCodeStr errorMsg:errorMsg arg:@""];
+ }
+ });
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.h b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.h
new file mode 100644
index 0000000..11d2c88
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+
+@interface WXComponent (Events) <UIGestureRecognizerDelegate>
+
+@end
[09/50] [abbrv] incubator-weex git commit: Merge pull request #408
from alibaba/doc-feature-doc-url
Posted by ji...@apache.org.
Merge pull request #408 from alibaba/doc-feature-doc-url
* [doc] use doc page url
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/bb46720e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/bb46720e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/bb46720e
Branch: refs/heads/master
Commit: bb46720e36916836e0c5eb30d725558087031090
Parents: 23dd719 f90121c
Author: gurisxie <27...@qq.com>
Authored: Tue Jun 7 13:58:55 2016 +0800
Committer: gurisxie <27...@qq.com>
Committed: Tue Jun 7 13:58:55 2016 +0800
----------------------------------------------------------------------
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[46/50] [abbrv] incubator-weex git commit: - [ios] delete unused
performance tracker
Posted by ji...@apache.org.
- [ios] delete unused performance tracker
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6bd1255d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6bd1255d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6bd1255d
Branch: refs/heads/master
Commit: 6bd1255d07d6fd7c70b4302a94d805c09d133fb8
Parents: 363d9f8
Author: \u9690\u98ce <cx...@gmail.com>
Authored: Mon Jun 13 11:56:09 2016 +0800
Committer: \u9690\u98ce <cx...@gmail.com>
Committed: Mon Jun 13 11:56:09 2016 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6bd1255d/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index 1278187..66bebf4 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -263,8 +263,6 @@
[cellView.contentView addSubview:cell.view];
- double time = -[self.weexInstance.renderStartDate timeIntervalSinceNow] * 1000;
-
return cellView;
}
[42/50] [abbrv] incubator-weex git commit: * [ios] add bundle js
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/countdown-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/countdown-demo.js b/ios/playground/bundlejs/component/countdown-demo.js
new file mode 100644
index 0000000..b4bd2e6
--- /dev/null
+++ b/ios/playground/bundlejs/component/countdown-demo.js
@@ -0,0 +1,1398 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/1370bc36a490680787a4ec0c421ce383", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+
+ __weex_module__.exports = {
+ data: function () {return {
+ countdown1: {
+ remain: 5000,
+ time: {
+ D: '0',
+ hh: '00',
+ mm: '00',
+ ss: '00'
+ }
+ },
+ countdown2: {
+ remain: 5000,
+ time: {
+ MM: '0',
+ ss: '0'
+ }
+ }
+ }},
+ ready: function() {
+ this.initCountdown('countdown1');
+ this.initCountdown('countdown2');
+ },
+ methods: {
+ initCountdown: function(id) {
+ var self = this;
+
+ var $countdown = this.$vm(id);
+ $countdown.$on('tick', function(e) {
+ Object.assign(self[id].time, e.detail);
+ });
+
+ $countdown.$on('alarm', function(e) {
+ Object.assign(self[id].time, e.detail);
+ });
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "Countdown",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-countdown",
+ "id": "countdown1",
+ "attr": {
+ "remain": function () {return this.countdown1.remain}
+ },
+ "style": {
+ "width": 750,
+ "marginTop": 20,
+ "marginBottom": 20
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "attr": {
+ "value": function () {return this.countdown1.time.D}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "style": {
+ "backgroundColor": "#FFFFFF",
+ "color": "#AAAAAA"
+ },
+ "attr": {
+ "value": "day(s)"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "attr": {
+ "value": function () {return this.countdown1.time.hh}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "style": {
+ "backgroundColor": "#FFFFFF",
+ "color": "#AAAAAA"
+ },
+ "attr": {
+ "value": "hour(s)"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "attr": {
+ "value": function () {return this.countdown1.time.mm}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "style": {
+ "backgroundColor": "#FFFFFF",
+ "color": "#AAAAAA"
+ },
+ "attr": {
+ "value": "minute(s)"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "attr": {
+ "value": function () {return this.countdown1.time.ss}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno1"
+ ],
+ "style": {
+ "backgroundColor": "#FFFFFF",
+ "color": "#AAAAAA"
+ },
+ "attr": {
+ "value": "second(s)"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-countdown",
+ "id": "countdown2",
+ "attr": {
+ "remain": function () {return this.countdown2.remain}
+ },
+ "style": {
+ "width": 600
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "ctno2"
+ ],
+ "attr": {
+ "value": function () {return this.countdown2.time.MM}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno2"
+ ],
+ "style": {
+ "backgroundColor": "#FFFFFF",
+ "color": "#AAAAAA"
+ },
+ "attr": {
+ "value": ":"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "ctno2"
+ ],
+ "attr": {
+ "value": function () {return this.countdown2.time.ss}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "ctno1": {
+ "borderRadius": 8,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "paddingRight": 4,
+ "paddingLeft": 4,
+ "marginLeft": 2,
+ "marginRight": 2,
+ "backgroundColor": "rgb(242,222,222)",
+ "color": "rgb(169,68,66)"
+ },
+ "ctno2": {
+ "borderRadius": 8,
+ "paddingTop": 30,
+ "paddingBottom": 30,
+ "paddingLeft": 16,
+ "paddingRight": 16,
+ "backgroundColor": "rgb(217,237,247)",
+ "color": "rgb(49,112,143)",
+ "textAlign": "center",
+ "fontSize": 40
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/1370bc36a490680787a4ec0c421ce383", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4fd0820/ios/playground/bundlejs/component/image-demo.js
----------------------------------------------------------------------
diff --git a/ios/playground/bundlejs/component/image-demo.js b/ios/playground/bundlejs/component/image-demo.js
new file mode 100644
index 0000000..dff6051
--- /dev/null
+++ b/ios/playground/bundlejs/component/image-demo.js
@@ -0,0 +1,1336 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/511f99927c0898fd52f2bdba9711d9ce", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(1);
+ __weex_module__.exports = {
+ data: function () {return {
+ img: '//gw.alicdn.com/tps/i2/TB1DpsmMpXXXXabaXXX20ySQVXX-512-512.png_400x400.jpg'
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "scroller",
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "width x height",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-tip",
+ "attr": {
+ "type": "warning",
+ "value": "Weex screen width is 750"
+ },
+ "style": {
+ "marginBottom": 20
+ }
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "400 X 400"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "img"
+ ],
+ "style": {
+ "width": 400,
+ "height": 400
+ },
+ "attr": {
+ "src": function () {return this.img}
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "200 x 200"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "img"
+ ],
+ "style": {
+ "width": 200,
+ "height": 200
+ },
+ "attr": {
+ "src": function () {return this.img}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "resize",
+ "type": "primary"
+ },
+ "children": [
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "resize=stretch(default) 600 X 200"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "img"
+ ],
+ "style": {
+ "width": 600,
+ "height": 200,
+ "borderStyle": "solid",
+ "borderWidth": 1,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "src": function () {return this.img},
+ "resize": "stretch"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "resize=contain 600 X 200"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "img"
+ ],
+ "style": {
+ "width": 600,
+ "height": 200,
+ "borderStyle": "solid",
+ "borderWidth": 1,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "src": function () {return this.img},
+ "resize": "contain"
+ }
+ }
+ ]
+ },
+ {
+ "type": "wxc-panel",
+ "attr": {
+ "title": "resize=cover 600 X 200"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "img"
+ ],
+ "style": {
+ "width": 600,
+ "height": 200,
+ "borderStyle": "solid",
+ "borderWidth": 1,
+ "borderColor": "#333333"
+ },
+ "attr": {
+ "src": function () {return this.img},
+ "resize": "cover"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "img": {
+ "marginBottom": 20
+ }
+ }
+ })
+ ;__weex_bootstrap__("@weex-component/511f99927c0898fd52f2bdba9711d9ce", {
+ "transformerVersion": "0.3.1"
+ },undefined)
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/index", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __webpack_require__(2);
+ __webpack_require__(3);
+ __webpack_require__(4);
+ __webpack_require__(5);
+ __webpack_require__(6);
+ __webpack_require__(7);
+ __webpack_require__(8);
+ __webpack_require__(9);
+ __webpack_require__(10);
+ __webpack_require__(11);
+ __webpack_require__(12);
+
+ })
+
+/***/ },
+/* 2 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-button", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ size: 'large',
+ value: ''
+ }},
+ methods: {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['btn', 'btn-' + (this.type), 'btn-sz-' + (this.size)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['btn-txt', 'btn-txt-' + (this.type), 'btn-txt-sz-' + (this.size)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "btn": {
+ "marginBottom": 0,
+ "alignItems": "center",
+ "justifyContent": "center",
+ "borderWidth": 1,
+ "borderStyle": "solid",
+ "borderColor": "#333333"
+ },
+ "btn-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "borderColor": "rgb(40,96,144)"
+ },
+ "btn-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "borderColor": "rgb(76,174,76)"
+ },
+ "btn-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "borderColor": "rgb(70,184,218)"
+ },
+ "btn-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "borderColor": "rgb(238,162,54)"
+ },
+ "btn-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "borderColor": "rgb(212,63,58)"
+ },
+ "btn-link": {
+ "borderColor": "rgba(0,0,0,0)",
+ "borderRadius": 0
+ },
+ "btn-txt-default": {
+ "color": "rgb(51,51,51)"
+ },
+ "btn-txt-primary": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-success": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-info": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-warning": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-danger": {
+ "color": "rgb(255,255,255)"
+ },
+ "btn-txt-link": {
+ "color": "rgb(51,122,183)"
+ },
+ "btn-sz-large": {
+ "width": 300,
+ "height": 100,
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 40,
+ "paddingRight": 40,
+ "borderRadius": 15
+ },
+ "btn-sz-middle": {
+ "width": 240,
+ "height": 80,
+ "paddingTop": 15,
+ "paddingBottom": 15,
+ "paddingLeft": 30,
+ "paddingRight": 30,
+ "borderRadius": 10
+ },
+ "btn-sz-small": {
+ "width": 170,
+ "height": 60,
+ "paddingTop": 12,
+ "paddingBottom": 12,
+ "paddingLeft": 25,
+ "paddingRight": 25,
+ "borderRadius": 7
+ },
+ "btn-txt-sz-large": {
+ "fontSize": 45
+ },
+ "btn-txt-sz-middle": {
+ "fontSize": 35
+ },
+ "btn-txt-sz-small": {
+ "fontSize": 30
+ }
+ }
+ })
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-hn", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ level: 1,
+ value: ''
+ }},
+ methods: {}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['h' + (this.level)]},
+ "style": {
+ "justifyContent": "center"
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['txt-h' + (this.level)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "h1": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h2": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "h3": {
+ "height": 110,
+ "paddingTop": 20,
+ "paddingBottom": 20
+ },
+ "txt-h1": {
+ "fontSize": 70
+ },
+ "txt-h2": {
+ "fontSize": 52
+ },
+ "txt-h3": {
+ "fontSize": 42
+ }
+ }
+ })
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-list-item", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ bgColor: '#ffffff'
+ }},
+ methods: {
+ touchstart: function() {
+ // FIXME android touch
+ // TODO adaptive opposite bgColor
+ // this.bgColor = '#e6e6e6';
+ },
+ touchend: function() {
+ // FIXME android touchend not triggered
+ // this.bgColor = '#ffffff';
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "item"
+ ],
+ "events": {
+ "touchstart": "touchstart",
+ "touchend": "touchend"
+ },
+ "style": {
+ "backgroundColor": function () {return this.bgColor}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "item": {
+ "paddingTop": 25,
+ "paddingBottom": 25,
+ "paddingLeft": 35,
+ "paddingRight": 35,
+ "height": 160,
+ "justifyContent": "center",
+ "borderBottomWidth": 1,
+ "borderColor": "#dddddd"
+ }
+ }
+ })
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-panel", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'default',
+ title: '',
+ paddingBody: 20,
+ paddingHead: 20,
+ dataClass: '', // FIXME transfer class
+ border: 0
+ }},
+ ready: function() {
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['panel', 'panel-' + (this.type)]},
+ "style": {
+ "borderWidth": function () {return this.border}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['panel-header', 'panel-header-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingHead},
+ "paddingBottom": function () {return this.paddingHead},
+ "paddingLeft": function () {return this.paddingHead*1.5},
+ "paddingRight": function () {return this.paddingHead*1.5}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ },
+ {
+ "type": "div",
+ "classList": function () {return ['panel-body', 'panel-body-' + (this.type)]},
+ "style": {
+ "paddingTop": function () {return this.paddingBody},
+ "paddingBottom": function () {return this.paddingBody},
+ "paddingLeft": function () {return this.paddingBody*1.5},
+ "paddingRight": function () {return this.paddingBody*1.5}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "panel": {
+ "marginBottom": 20,
+ "backgroundColor": "#ffffff",
+ "borderColor": "#dddddd",
+ "borderWidth": 1
+ },
+ "panel-primary": {
+ "borderColor": "rgb(40,96,144)"
+ },
+ "panel-success": {
+ "borderColor": "rgb(76,174,76)"
+ },
+ "panel-info": {
+ "borderColor": "rgb(70,184,218)"
+ },
+ "panel-warning": {
+ "borderColor": "rgb(238,162,54)"
+ },
+ "panel-danger": {
+ "borderColor": "rgb(212,63,58)"
+ },
+ "panel-header": {
+ "backgroundColor": "#f5f5f5",
+ "fontSize": 40,
+ "color": "#333333"
+ },
+ "panel-header-primary": {
+ "backgroundColor": "rgb(40,96,144)",
+ "color": "#ffffff"
+ },
+ "panel-header-success": {
+ "backgroundColor": "rgb(92,184,92)",
+ "color": "#ffffff"
+ },
+ "panel-header-info": {
+ "backgroundColor": "rgb(91,192,222)",
+ "color": "#ffffff"
+ },
+ "panel-header-warning": {
+ "backgroundColor": "rgb(240,173,78)",
+ "color": "#ffffff"
+ },
+ "panel-header-danger": {
+ "backgroundColor": "rgb(217,83,79)",
+ "color": "#ffffff"
+ },
+ "panel-body": {}
+ }
+ })
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tip", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ type: 'success',
+ value: ''
+ }}
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": function () {return ['tip', 'tip-' + (this.type)]},
+ "children": [
+ {
+ "type": "text",
+ "classList": function () {return ['tip-txt', 'tip-txt-' + (this.type)]},
+ "attr": {
+ "value": function () {return this.value}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "tip": {
+ "paddingLeft": 36,
+ "paddingRight": 36,
+ "paddingTop": 36,
+ "paddingBottom": 36,
+ "borderRadius": 10
+ },
+ "tip-txt": {
+ "fontSize": 28
+ },
+ "tip-success": {
+ "backgroundColor": "#dff0d8",
+ "borderColor": "#d6e9c6"
+ },
+ "tip-txt-success": {
+ "color": "#3c763d"
+ },
+ "tip-info": {
+ "backgroundColor": "#d9edf7",
+ "borderColor": "#bce8f1"
+ },
+ "tip-txt-info": {
+ "color": "#31708f"
+ },
+ "tip-warning": {
+ "backgroundColor": "#fcf8e3",
+ "borderColor": "#faebcc"
+ },
+ "tip-txt-warning": {
+ "color": "#8a6d3b"
+ },
+ "tip-danger": {
+ "backgroundColor": "#f2dede",
+ "borderColor": "#ebccd1"
+ },
+ "tip-txt-danger": {
+ "color": "#a94442"
+ }
+ }
+ })
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-countdown", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ now: 0,
+ remain: 0,
+ time: {
+ elapse: 0,
+ D: '0',
+ DD: '0',
+ h: '0',
+ hh: '00',
+ H: '0',
+ HH: '0',
+ m: '0',
+ mm: '00',
+ M: '0',
+ MM: '0',
+ s: '0',
+ ss: '00',
+ S: '0',
+ SS: '0'
+ },
+ outofview: false
+ }},
+ ready: function() {
+ if (this.remain <= 0) {
+ return;
+ }
+ // this.isWeb = this.$getConfig().env.platform === 'Web';
+ this.now = Date.now();
+ this.nextTick();
+ },
+ methods: {
+ nextTick: function() {
+ if (this.outofview) {
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.time.elapse = parseInt((Date.now() - this.now) / 1000);
+
+ if (this.calc()) {
+ this.$emit('tick', Object.assign({}, this.time));
+ setTimeout(this.nextTick.bind(this), 1000);
+ } else {
+ this.$emit('alarm', Object.assign({}, this.time));
+ }
+ this._app.updateActions();
+ }
+ },
+ format: function(str) {
+ if (str.length >= 2) {
+ return str;
+ } else {
+ return '0' + str;
+ }
+ },
+ calc: function() {
+ var remain = this.remain - this.time.elapse;
+ if (remain < 0) {
+ remain = 0;
+ }
+ this.time.D = String(parseInt(remain / 86400));
+ this.time.DD = this.format(this.time.D);
+ this.time.h = String(parseInt((remain - parseInt(this.time.D) * 86400) / 3600));
+ this.time.hh = this.format(this.time.h);
+ this.time.H = String(parseInt(remain / 3600));
+ this.time.HH = this.format(this.time.H);
+ this.time.m = String(parseInt((remain - parseInt(this.time.H) * 3600) / 60));
+ this.time.mm = this.format(this.time.m);
+ this.time.M = String(parseInt(remain / 60));
+ this.time.MM = this.format(this.time.M);
+ this.time.s = String(remain - parseInt(this.time.M) * 60);
+ this.time.ss = this.format(this.time.s);
+ this.time.S = String(remain);
+ this.time.SS = this.format(this.time.S);
+ // console.log(remain, this.D, this.h, this.hh, this.H, this.HH, this.m, this.MM, this.s, this.ss, this.S, this.SS);
+ return remain > 0;
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "style": {
+ "overflow": "hidden",
+ "flexDirection": "row"
+ },
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden"
+ }
+ }
+ })
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-marquee", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ step: 0,
+ count: 0,
+ index: 1,
+ duration: 0,
+ interval: 0,
+ outofview: false
+ }},
+ ready: function () {
+ if (this.interval > 0
+ && this.step > 0
+ && this.duration > 0) {
+ this.nextTick();
+ }
+ },
+ methods: {
+ nextTick: function() {
+ var self = this;
+ if (this.outofview) {
+ setTimeout(self.nextTick.bind(self), self.interval);
+ } else {
+ setTimeout(function() {
+ self.animation(self.nextTick.bind(self));
+ }, self.interval);
+ }
+ },
+ animation: function(cb) {
+ var self = this;
+ var offset = -self.step * self.index;
+ var $animation = __weex_require__('@weex-module/animation');
+ $animation.transition(this.$el('anim'), {
+ styles: {
+ transform: 'translateY(' + String(offset) + 'px) translateZ(0)'
+ },
+ timingFunction: 'ease',
+ duration: self.duration
+ }, function() {
+ self.index = (self.index + 1) % (self.count);
+ self.$emit('change', {
+ index: self.index,
+ count: self.count
+ });
+ cb && cb();
+ });
+ },
+ appeared: function() {
+ this.outofview = false;
+ },
+ disappeared: function() {
+ this.outofview = true;
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrap"
+ ],
+ "events": {
+ "appear": "appeared",
+ "disappear": "disappeared"
+ },
+ "children": [
+ {
+ "type": "div",
+ "id": "anim",
+ "classList": [
+ "anim"
+ ],
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrap": {
+ "overflow": "hidden",
+ "position": "relative"
+ },
+ "anim": {
+ "flexDirection": "column",
+ "position": "absolute",
+ "transform": "translateY(0) translateZ(0)"
+ }
+ }
+ })
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-navbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ dataRole: 'navbar',
+
+ //\u5bfc\u822a\u6761\u80cc\u666f\u8272
+ backgroundColor: 'black',
+
+ //\u5bfc\u822a\u6761\u9ad8\u5ea6
+ height: 88,
+
+ //\u5bfc\u822a\u6761\u6807\u9898
+ title: "",
+
+ //\u5bfc\u822a\u6761\u6807\u9898\u989c\u8272
+ titleColor: 'black',
+
+ //\u53f3\u4fa7\u6309\u94ae\u56fe\u7247
+ rightItemSrc: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898
+ rightItemTitle: '',
+
+ //\u53f3\u4fa7\u6309\u94ae\u6807\u9898\u989c\u8272
+ rightItemColor: 'black',
+
+ //\u5de6\u4fa7\u6309\u94ae\u56fe\u7247
+ leftItemSrc: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u6807\u9898
+ leftItemTitle: '',
+
+ //\u5de6\u4fa7\u6309\u94ae\u989c\u8272
+ leftItemColor: 'black',
+ }},
+ methods: {
+ onclickrightitem: function (e) {
+ this.$dispatch('naviBar.rightItem.click', {});
+ },
+ onclickleftitem: function (e) {
+ this.$dispatch('naviBar.leftItem.click', {});
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "attr": {
+ "dataRole": function () {return this.dataRole}
+ },
+ "children": [
+ {
+ "type": "text",
+ "classList": [
+ "right-text"
+ ],
+ "style": {
+ "color": function () {return this.rightItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "right",
+ "value": function () {return this.rightItemTitle}
+ },
+ "shown": function () {return !this.rightItemSrc},
+ "events": {
+ "click": "onclickrigthitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "right-image"
+ ],
+ "attr": {
+ "naviItemPosition": "right",
+ "src": function () {return this.rightItemSrc}
+ },
+ "shown": function () {return this.rightItemSrc},
+ "events": {
+ "click": "onclickrightitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "left-text"
+ ],
+ "style": {
+ "color": function () {return this.leftItemColor}
+ },
+ "attr": {
+ "naviItemPosition": "left",
+ "value": function () {return this.leftItemTitle}
+ },
+ "shown": function () {return !this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "left-image"
+ ],
+ "attr": {
+ "naviItemPosition": "left",
+ "src": function () {return this.leftItemSrc}
+ },
+ "shown": function () {return this.leftItemSrc},
+ "events": {
+ "click": "onclickleftitem"
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "center-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "naviItemPosition": "center",
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "width": 750
+ },
+ "right-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "right": 32,
+ "textAlign": "right",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "left-text": {
+ "position": "absolute",
+ "bottom": 28,
+ "left": 32,
+ "textAlign": "left",
+ "fontSize": 32,
+ "fontFamily": "'Open Sans', sans-serif"
+ },
+ "center-text": {
+ "position": "absolute",
+ "bottom": 25,
+ "left": 172,
+ "right": 172,
+ "textAlign": "center",
+ "fontSize": 36,
+ "fontWeight": "bold"
+ },
+ "left-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "left": 28,
+ "width": 50,
+ "height": 50
+ },
+ "right-image": {
+ "position": "absolute",
+ "bottom": 20,
+ "right": 28,
+ "width": 50,
+ "height": 50
+ }
+ }
+ })
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-navpage", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(9);
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "wxc-navbar",
+ "attr": {
+ "dataRole": function () {return this.dataRole},
+ "height": function () {return this.height},
+ "backgroundColor": function () {return this.backgroundColor},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor},
+ "leftItemSrc": function () {return this.leftItemSrc},
+ "leftItemTitle": function () {return this.leftItemTitle},
+ "leftItemColor": function () {return this.leftItemColor},
+ "rightItemSrc": function () {return this.rightItemSrc},
+ "rightItemTitle": function () {return this.rightItemTitle},
+ "rightItemColor": function () {return this.rightItemColor}
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "style": {
+ "marginTop": function () {return this.height}
+ },
+ "children": [
+ {
+ "type": "content"
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "width": 750
+ }
+ }
+ })
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;__weex_define__("@weex-component/wxc-tabbar", [], function(__weex_require__, __weex_exports__, __weex_module__){
+ __webpack_require__(12);
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ tabItems: [ ],
+ selectedIndex: 0,
+ selectedColor: '#ff0000',
+ unselectedColor: '#000000',
+ }},
+ created: function () {
+ this.selected(this.selectedIndex);
+
+ this.$on('tabItem.onClick',function(e){
+ var detail= e.detail;
+ this.selectedIndex = detail.index;
+ this.selected(detail.index);
+
+ var params = {
+ index: detail.index
+ };
+ this.$dispatch('tabBar.onClick', params);
+ });
+ },
+ methods: {
+ selected: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "wrapper"
+ ],
+ "children": [
+ {
+ "type": "embed",
+ "classList": [
+ "content"
+ ],
+ "style": {
+ "visibility": function () {return this.visibility}
+ },
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "src": function () {return this.src},
+ "type": "weex"
+ }
+ },
+ {
+ "type": "div",
+ "classList": [
+ "tabbar"
+ ],
+ "append": "tree",
+ "children": [
+ {
+ "type": "wxc-tabitem",
+ "repeat": function () {return this.tabItems},
+ "attr": {
+ "index": function () {return this.index},
+ "icon": function () {return this.icon},
+ "title": function () {return this.title},
+ "titleColor": function () {return this.titleColor}
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "wrapper": {
+ "width": 750,
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0
+ },
+ "content": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "bottom": 0,
+ "marginTop": 0,
+ "marginBottom": 88
+ },
+ "tabbar": {
+ "flexDirection": "row",
+ "position": "fixed",
+ "bottom": 0,
+ "left": 0,
+ "right": 0,
+ "height": 88
+ }
+ }
+ })
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ ;__weex_define__("@weex-component/wxc-tabitem", [], function(__weex_require__, __weex_exports__, __weex_module__){
+
+ ;
+ __weex_module__.exports = {
+ data: function () {return {
+ index: 0,
+ title: '',
+ titleColor: '#000000',
+ icon: '',
+ backgroundColor: '#ffffff',
+ }},
+ methods: {
+ onclickitem: function (e) {
+ var vm = this;
+ var params = {
+ index: vm.index
+ };
+ vm.$dispatch('tabItem.onClick', params);
+ }
+ }
+ }
+
+ ;__weex_module__.exports.template={
+ "type": "div",
+ "classList": [
+ "container"
+ ],
+ "style": {
+ "backgroundColor": function () {return this.backgroundColor}
+ },
+ "events": {
+ "click": "onclickitem"
+ },
+ "children": [
+ {
+ "type": "image",
+ "classList": [
+ "top-line"
+ ],
+ "attr": {
+ "src": "http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ }
+ },
+ {
+ "type": "image",
+ "classList": [
+ "tab-icon"
+ ],
+ "attr": {
+ "src": function () {return this.icon}
+ }
+ },
+ {
+ "type": "text",
+ "classList": [
+ "tab-text"
+ ],
+ "style": {
+ "color": function () {return this.titleColor}
+ },
+ "attr": {
+ "value": function () {return this.title}
+ }
+ }
+ ]
+ }
+ ;__weex_module__.exports.style={
+ "container": {
+ "flex": 1,
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "height": 88
+ },
+ "top-line": {
+ "position": "absolute",
+ "top": 0,
+ "left": 0,
+ "right": 0,
+ "height": 2
+ },
+ "tab-icon": {
+ "marginTop": 5,
+ "width": 40,
+ "height": 40
+ },
+ "tab-text": {
+ "marginTop": 5,
+ "textAlign": "center",
+ "fontSize": 20
+ }
+ }
+ })
+
+/***/ }
+/******/ ]);
\ No newline at end of file
[06/50] [abbrv] incubator-weex git commit: * [doc] fix gitbook version
Posted by ji...@apache.org.
* [doc] fix gitbook version
the old gitbook version will generate a error http:/xx.jpg link for img and can't render by browser if you use nginx server the book html
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/25efd051
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/25efd051
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/25efd051
Branch: refs/heads/master
Commit: 25efd05185602d2f711b532f906e325ae0099ca7
Parents: d77c0d0
Author: Noman <no...@798.space>
Authored: Sun Jun 5 03:14:47 2016 +0800
Committer: Noman <no...@798.space>
Committed: Sun Jun 5 03:14:47 2016 +0800
----------------------------------------------------------------------
doc/book.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/25efd051/doc/book.json
----------------------------------------------------------------------
diff --git a/doc/book.json b/doc/book.json
index adcae3f..de78e78 100644
--- a/doc/book.json
+++ b/doc/book.json
@@ -1,5 +1,5 @@
{
-"gitbook":"3.0.0-pre.15",
+"gitbook":"3.0.3",
"plugins": [
"theme-default"
]
[45/50] [abbrv] incubator-weex git commit: - [ios] delete unused logs
Posted by ji...@apache.org.
- [ios] delete unused logs
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/363d9f8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/363d9f8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/363d9f8c
Branch: refs/heads/master
Commit: 363d9f8ce536359836b5a6b640703e354492c5e0
Parents: bd962e7
Author: \u9690\u98ce <cx...@gmail.com>
Authored: Mon Jun 13 11:55:11 2016 +0800
Committer: \u9690\u98ce <cx...@gmail.com>
Committed: Mon Jun 13 11:55:11 2016 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/363d9f8c/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index f4fbfd9..1278187 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -264,7 +264,6 @@
[cellView.contentView addSubview:cell.view];
double time = -[self.weexInstance.renderStartDate timeIntervalSinceNow] * 1000;
- WXLogInfo(@"View Create Finish...%ld, %f", (long)indexPath.row, time);
return cellView;
}
[14/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Layout/Layout.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/Layout.h b/ios/sdk/WeexSDK/Sources/Layout/Layout.h
new file mode 100644
index 0000000..1df5822
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Layout/Layout.h
@@ -0,0 +1,177 @@
+/**
+ * Copyright (c) 2014, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#ifndef __LAYOUT_H
+#define __LAYOUT_H
+
+#include <math.h>
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+// Not defined in MSVC++
+#ifndef NAN
+static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
+#define NAN (*(const float *)__nan)
+#endif
+
+#define CSS_UNDEFINED NAN
+
+typedef enum {
+ CSS_DIRECTION_INHERIT = 0,
+ CSS_DIRECTION_LTR,
+ CSS_DIRECTION_RTL
+} css_direction_t;
+
+typedef enum {
+ CSS_FLEX_DIRECTION_COLUMN = 0,
+ CSS_FLEX_DIRECTION_COLUMN_REVERSE,
+ CSS_FLEX_DIRECTION_ROW,
+ CSS_FLEX_DIRECTION_ROW_REVERSE
+} css_flex_direction_t;
+
+typedef enum {
+ CSS_JUSTIFY_FLEX_START = 0,
+ CSS_JUSTIFY_CENTER,
+ CSS_JUSTIFY_FLEX_END,
+ CSS_JUSTIFY_SPACE_BETWEEN,
+ CSS_JUSTIFY_SPACE_AROUND
+} css_justify_t;
+
+// Note: auto is only a valid value for alignSelf. It is NOT a valid value for
+// alignItems.
+typedef enum {
+ CSS_ALIGN_AUTO = 0,
+ CSS_ALIGN_FLEX_START,
+ CSS_ALIGN_CENTER,
+ CSS_ALIGN_FLEX_END,
+ CSS_ALIGN_STRETCH
+} css_align_t;
+
+typedef enum {
+ CSS_POSITION_RELATIVE = 0,
+ CSS_POSITION_ABSOLUTE
+} css_position_type_t;
+
+typedef enum {
+ CSS_NOWRAP = 0,
+ CSS_WRAP
+} css_wrap_type_t;
+
+// Note: left and top are shared between position[2] and position[4], so
+// they have to be before right and bottom.
+typedef enum {
+ CSS_LEFT = 0,
+ CSS_TOP,
+ CSS_RIGHT,
+ CSS_BOTTOM,
+ CSS_START,
+ CSS_END,
+ CSS_POSITION_COUNT
+} css_position_t;
+
+typedef enum {
+ CSS_MEASURE_MODE_UNDEFINED = 0,
+ CSS_MEASURE_MODE_EXACTLY,
+ CSS_MEASURE_MODE_AT_MOST
+} css_measure_mode_t;
+
+typedef enum {
+ CSS_WIDTH = 0,
+ CSS_HEIGHT
+} css_dimension_t;
+
+typedef struct {
+ float position[4];
+ float dimensions[2];
+ css_direction_t direction;
+
+ // Instead of recomputing the entire layout every single time, we
+ // cache some information to break early when nothing changed
+ bool should_update;
+ float last_requested_dimensions[2];
+ float last_parent_max_width;
+ float last_parent_max_height;
+ float last_dimensions[2];
+ float last_position[2];
+ css_direction_t last_direction;
+} css_layout_t;
+
+typedef struct {
+ float dimensions[2];
+} css_dim_t;
+
+typedef struct {
+ css_direction_t direction;
+ css_flex_direction_t flex_direction;
+ css_justify_t justify_content;
+ css_align_t align_content;
+ css_align_t align_items;
+ css_align_t align_self;
+ css_position_type_t position_type;
+ css_wrap_type_t flex_wrap;
+ float flex;
+ float margin[6];
+ float position[4];
+ /**
+ * You should skip all the rules that contain negative values for the
+ * following attributes. For example:
+ * {padding: 10, paddingLeft: -5}
+ * should output:
+ * {left: 10 ...}
+ * the following two are incorrect:
+ * {left: -5 ...}
+ * {left: 0 ...}
+ */
+ float padding[6];
+ float border[6];
+ float dimensions[2];
+ float minDimensions[2];
+ float maxDimensions[2];
+} css_style_t;
+
+typedef struct css_node css_node_t;
+struct css_node {
+ css_style_t style;
+ css_layout_t layout;
+ int children_count;
+ int line_index;
+
+ css_node_t *next_absolute_child;
+ css_node_t *next_flex_child;
+
+ css_dim_t (*measure)(void *context, float width, css_measure_mode_t widthMode, float height, css_measure_mode_t heightMode);
+ void (*print)(void *context);
+ struct css_node* (*get_child)(void *context, int i);
+ bool (*is_dirty)(void *context);
+ void *context;
+};
+
+// Lifecycle of nodes and children
+css_node_t *new_css_node(void);
+void init_css_node(css_node_t *node);
+void free_css_node(css_node_t *node);
+
+// Print utilities
+typedef enum {
+ CSS_PRINT_LAYOUT = 1,
+ CSS_PRINT_STYLE = 2,
+ CSS_PRINT_CHILDREN = 4,
+} css_print_options_t;
+void print_css_node(css_node_t *node, css_print_options_t options);
+
+bool isUndefined(float value);
+
+// Function that computes the layout!
+void layoutNode(css_node_t *node, float maxWidth, float maxHeight, css_direction_t parentDirection);
+
+// Reset the calculated layout values for a given node. You should call this before `layoutNode`.
+void resetNodeLayout(css_node_t *node);
+
+#endif
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
new file mode 100644
index 0000000..d8e7b6f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
@@ -0,0 +1,13 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <WeexSDK/WeexSDK.h>
+
+@interface WXComponent (Layout)
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
new file mode 100644
index 0000000..68b5edc
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
@@ -0,0 +1,296 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent+Layout.h"
+#import "WXComponent_internal.h"
+#import "WXTransform.h"
+#import "WXAssert.h"
+
+@implementation WXComponent (Layout)
+
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+
+#pragma mark Public
+
+- (CGRect)calculatedFrame
+{
+ return _calculatedFrame;
+}
+
+- (CGPoint)absolutePosition
+{
+ return _absolutePosition;
+}
+
+- (css_node_t *)cssNode
+{
+ return _cssNode;
+}
+
+- (void)setNeedsLayout
+{
+ _isLayoutDirty = YES;
+ WXComponent *supercomponent = [self supercomponent];
+ if(supercomponent){
+ [supercomponent setNeedsLayout];
+ }
+}
+
+- (BOOL)needsLayout
+{
+ return _isLayoutDirty;
+}
+
+- (CGSize (^)(CGSize))measureBlock
+{
+ return nil;
+}
+
+- (void)layoutDidFinish
+{
+ WXAssertMainThread();
+}
+
+#pragma mark Private
+
+- (void)_initCSSNodeWithStyles:(NSDictionary *)styles
+{
+ _cssNode = new_css_node();
+
+ _cssNode->print = cssNodePrint;
+ _cssNode->get_child = cssNodeGetChild;
+ _cssNode->is_dirty = cssNodeIsDirty;
+ if ([self measureBlock]) {
+ _cssNode->measure = cssNodeMeasure;
+ }
+ _cssNode->context = (__bridge void *)self;
+
+
+
+ [self _recomputeCSSNodeChildren];
+ [self _fillCSSNode:styles];
+
+ // TODO: JS Default flex:1 on root, not here
+ if ([self.ref isEqualToString:WX_SDK_ROOT_REF] && isUndefined(_cssNode->style.dimensions[CSS_HEIGHT])) {
+ _cssNode->style.flex = 1.0;
+ }
+}
+
+- (void)_updateCSSNodeStyles:(NSDictionary *)styles
+{
+ [self _fillCSSNode:styles];
+}
+
+- (void)_recomputeCSSNodeChildren
+{
+ _cssNode->children_count = (int)[self _childrenCountForLayout];
+}
+
+- (NSUInteger)_childrenCountForLayout
+{
+ NSUInteger count = self.subcomponents.count;
+ for (WXComponent *component in self.subcomponents) {
+ if (!component->_isNeedJoinLayoutSystem) {
+ count--;
+ }
+ }
+ return (int)(count);
+}
+
+- (void)_calculatedFrameDidChange
+{
+ WXAssertComponentThread();
+}
+
+- (void)_calculateFrameWithSuperAbsolutePosition:(CGPoint)superAbsolutePosition
+ gatherDirtyComponents:(NSMutableSet<WXComponent *> *)dirtyComponents
+{
+ WXAssertComponentThread();
+
+ if (!_cssNode->layout.should_update) {
+ return;
+ }
+ _cssNode->layout.should_update = false;
+ _isLayoutDirty = NO;
+
+ CGRect newFrame = CGRectMake(WXRoundPixelValue(_cssNode->layout.position[CSS_LEFT]),
+ WXRoundPixelValue(_cssNode->layout.position[CSS_TOP]),
+ WXRoundPixelValue(_cssNode->layout.dimensions[CSS_WIDTH]),
+ WXRoundPixelValue(_cssNode->layout.dimensions[CSS_HEIGHT]));
+
+ if (!CGRectEqualToRect(newFrame, _calculatedFrame)) {
+ _calculatedFrame = newFrame;
+ [self _recomputeBorderRadius];
+ [self _calculatedFrameDidChange];
+ [dirtyComponents addObject:self];
+ }
+
+ CGPoint newAboslutePosition = CGPointMake(WXRoundPixelValue(superAbsolutePosition.x + _cssNode->layout.position[CSS_LEFT]),
+ WXRoundPixelValue(superAbsolutePosition.y + _cssNode->layout.position[CSS_TOP]));
+
+ if(!CGPointEqualToPoint(_absolutePosition, newAboslutePosition)){
+ _absolutePosition = newAboslutePosition;
+ }
+
+ _cssNode->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
+ _cssNode->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
+ _cssNode->layout.position[CSS_LEFT] = 0;
+ _cssNode->layout.position[CSS_TOP] = 0;
+
+ for (WXComponent *subcomponent in self.subcomponents) {
+ [subcomponent _calculateFrameWithSuperAbsolutePosition:newAboslutePosition gatherDirtyComponents:dirtyComponents];
+ }
+}
+
+- (void)_layoutDidFinish
+{
+ WXAssertMainThread();
+
+ if ([self isViewLoaded] && !CGRectEqualToRect(_calculatedFrame, self.view.frame)) {
+ self.view.frame = _calculatedFrame;
+ // transform does not belong to layout, move it to other place hopefully
+ if (_transform) {
+ _layer.transform = [[WXTransform new] getTransform:_transform withView:self.view withOrigin:_transformOrigin];
+ }
+ [_layer setNeedsDisplay];
+ }
+
+ if (_positionType == WXPositionTypeSticky) {
+ [self.ancestorScroller adjustSticky];
+ }
+
+ [self layoutDidFinish];
+}
+
+#define WX_STYLE_FILL_CSS_NODE(key, cssProp, type)\
+do {\
+ id value = styles[@#key];\
+ if (value) {\
+ _cssNode->style.cssProp = (typeof(_cssNode->style.cssProp))[WXConvert type:value];\
+ [self setNeedsLayout];\
+ }\
+} while(0);
+
+#define WX_STYLE_FILL_CSS_NODE_ALL_DIRECTION(key, cssProp, type) \
+do {\
+ WX_STYLE_FILL_CSS_NODE(key, cssProp[CSS_TOP], type)\
+ WX_STYLE_FILL_CSS_NODE(key, cssProp[CSS_LEFT], type)\
+ WX_STYLE_FILL_CSS_NODE(key, cssProp[CSS_RIGHT], type)\
+ WX_STYLE_FILL_CSS_NODE(key, cssProp[CSS_BOTTOM], type)\
+} while(0);
+
+- (void)_fillCSSNode:(NSDictionary *)styles;
+{
+ // flex
+ WX_STYLE_FILL_CSS_NODE(flex, flex, CGFloat)
+ WX_STYLE_FILL_CSS_NODE(flexDirection, flex_direction, css_flex_direction_t)
+ WX_STYLE_FILL_CSS_NODE(alignItems, align_items, css_align_t)
+ WX_STYLE_FILL_CSS_NODE(alignSelf, align_self, css_align_t)
+ WX_STYLE_FILL_CSS_NODE(flexWrap, flex_wrap, css_wrap_type_t)
+ WX_STYLE_FILL_CSS_NODE(justifyContent, justify_content, css_justify_t)
+
+ // position
+ WX_STYLE_FILL_CSS_NODE(position, position_type, css_position_type_t)
+ WX_STYLE_FILL_CSS_NODE(top, position[CSS_TOP], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(left, position[CSS_LEFT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(right, position[CSS_RIGHT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(bottom, position[CSS_BOTTOM], WXPixelType)
+
+ // dimension
+ WX_STYLE_FILL_CSS_NODE(width, dimensions[CSS_WIDTH], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(height, dimensions[CSS_HEIGHT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(minWidth, minDimensions[CSS_WIDTH], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(minHeight, minDimensions[CSS_HEIGHT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(maxWidth, maxDimensions[CSS_WIDTH], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(maxHeight, maxDimensions[CSS_HEIGHT], WXPixelType)
+
+ // margin
+ WX_STYLE_FILL_CSS_NODE_ALL_DIRECTION(margin, margin, WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(marginTop, margin[CSS_TOP], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(marginLeft, margin[CSS_LEFT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(marginRight, margin[CSS_RIGHT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(marginBottom, margin[CSS_BOTTOM], WXPixelType)
+
+ // border
+ WX_STYLE_FILL_CSS_NODE_ALL_DIRECTION(borderWidth, border, WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(borderTopWidth, border[CSS_TOP], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(borderLeftWidth, border[CSS_LEFT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(borderRightWidth, border[CSS_RIGHT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(borderBottomWidth, border[CSS_BOTTOM], WXPixelType)
+
+ // padding
+ WX_STYLE_FILL_CSS_NODE_ALL_DIRECTION(padding, padding, WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(paddingTop, padding[CSS_TOP], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(paddingLeft, padding[CSS_LEFT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(paddingRight, padding[CSS_RIGHT], WXPixelType)
+ WX_STYLE_FILL_CSS_NODE(paddingBottom, padding[CSS_BOTTOM], WXPixelType)
+}
+
+- (void)_fillAbsolutePositions
+{
+ CGPoint absolutePostion = self.absolutePosition;
+ for (WXComponent *subcomponent in self.subcomponents) {
+ subcomponent.absolutePosition = CGPointMake(absolutePostion.x + subcomponent.calculatedFrame.origin.x, absolutePostion.y + subcomponent.calculatedFrame.origin.y);
+ [subcomponent _fillAbsolutePositions];
+ }
+}
+
+#pragma mark CSS Node Override
+
+static void cssNodePrint(void *context)
+{
+ WXComponent *component = (__bridge WXComponent *)context;
+ // TODO:
+ printf("%s:%s ", component.ref.UTF8String, component->_type.UTF8String);
+}
+
+static css_node_t * cssNodeGetChild(void *context, int i)
+{
+ WXComponent *component = (__bridge WXComponent *)context;
+
+ for (int j = 0; j <= i && j < component.subcomponents.count; j++) {
+ WXComponent *child = component.subcomponents[j];
+ if (!child->_isNeedJoinLayoutSystem) {
+ i++;
+ }
+ }
+
+ if(i >= 0 && i < component.subcomponents.count){
+ WXComponent *child = component.subcomponents[i];
+ return child->_cssNode;
+ }
+
+ return NULL;
+}
+
+static bool cssNodeIsDirty(void *context)
+{
+ WXAssertComponentThread();
+
+ WXComponent *component = (__bridge WXComponent *)context;
+ BOOL needsLayout = [component needsLayout];
+
+ return needsLayout;
+}
+
+static css_dim_t cssNodeMeasure(void *context, float width, css_measure_mode_t widthMode, float height, css_measure_mode_t heightMode)
+{
+ WXComponent *component = (__bridge WXComponent *)context;
+ CGSize (^measureBlock)(CGSize) = [component measureBlock];
+
+ if (!measureBlock) {
+ return (css_dim_t){NAN, NAN};
+ }
+
+ CGSize constrainedSize = CGSizeMake(width, height);
+ CGSize resultSize = measureBlock(constrainedSize);
+
+ return (css_dim_t){resultSize.width, resultSize.height};
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h
new file mode 100644
index 0000000..cf2d330
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h
@@ -0,0 +1,119 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXBridgeMethod.h"
+
+@interface WXBridgeManager : NSObject
+
+/**
+ * Create Instance Method
+ * @param instance : instance id
+ * @param template : template data
+ * @param options : parameters
+ * @param data : external data
+ **/
+- (void)createInstance:(NSString *)instance
+ template:(NSString *)temp
+ options:(NSDictionary *)options
+ data:(id)data;
+
+/**
+ * Destroy Instance Method
+ * @param instance : instance id
+ **/
+- (void)destroyInstance:(NSString *)instance;
+
+/**
+ * Refresh Instance Method
+ * @param instance : instance id
+ * @param data : external data
+ **/
+- (void)refreshInstance:(NSString *)instance
+ data:(id)data;
+
+- (void)unload;
+
+/**
+ * Update Instacne State Method
+ * @param instance : instance id
+ * @param data : parameters
+ **/
+- (void)updateState:(NSString *)instance
+ data:(id)data;
+
+/**
+ * Execute JSFramework Script
+ * @param script : script code
+ **/
+- (void)executeJsFramework:(NSString *)script;
+
+/**
+ * Execute JS Method
+ * @param method : object of bridge method
+ **/
+- (void)executeJsMethod:(WXBridgeMethod *)method;
+
+/**
+ * Register Modules Method
+ * @param modules : module list
+ **/
+- (void)registerModules:(NSDictionary *)modules;
+
+/**
+ * Register Components Method
+ * @param components: component list
+ **/
+- (void)registerComponents:(NSArray* )components;
+
+/**
+ * FireEvent
+ * @param instanceId: instance id
+ * @param ref : node reference
+ * @param type : event type
+ * @param params : parameters
+ **/
+- (void)fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params;
+
+/**
+ * callBack
+ *
+ * @param instanceId instanceId
+ * @param funcId funcId
+ * @param params params
+ * @param iflast indicate that whether this func will be reused
+ */
+- (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(NSString *)params keepAlive:(BOOL)keepAlive;
+
+/**
+ * CallBack
+ * @param instanceId: instance id
+ * @param funcId : callback id
+ * @param params : parameters
+ **/
+- (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(NSString *)params;
+
+/**
+ * Connect To WebSocket
+ * @param url : url to connect
+ **/
+- (void)connectToWebSocket:(NSURL *)url;
+
+/**
+ * Log To WebSocket
+ * @param flag : the tag to indentify
+ * @param message : message to output
+ **/
+- (void)logToWebSocket:(NSString *)flag message:(NSString *)message;
+
+/**
+ * Reset Environment
+ **/
+- (void)resetEnvironment;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
new file mode 100644
index 0000000..474bd92
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
@@ -0,0 +1,239 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXBridgeManager.h"
+#import "WXBridgeContext.h"
+#import "WXLog.h"
+#import "WXAssert.h"
+
+@interface WXBridgeManager ()
+
+@property (nonatomic, strong) WXBridgeContext *bridgeCtx;
+@property (nonatomic, strong) NSThread *jsThread;
+@property (nonatomic, assign) BOOL stopRunning;
+
+@end
+
+static NSThread *WXBridgeThread;
+
+@implementation WXBridgeManager
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ _bridgeCtx = [[WXBridgeContext alloc] init];
+
+ _jsThread = [[NSThread alloc] initWithTarget:self selector:@selector(_runLoopThread) object:nil];
+ [_jsThread setName: WX_BRIDGE_THREAD_NAME];
+
+ if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
+ [_jsThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
+ } else {
+ [_jsThread setThreadPriority:[[NSThread mainThread] threadPriority]];
+ }
+
+ [_jsThread start];
+ }
+ return self;
+}
+
+- (void)unload
+{
+ if (_bridgeCtx) {
+ _bridgeCtx = [[WXBridgeContext alloc] init];
+ }
+}
+
+#pragma mark Thread Management
+
+- (void)_runLoopThread
+{
+ [[NSRunLoop currentRunLoop] addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
+
+ while (!_stopRunning) {
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
+ }
+}
+
+#define WXPerformBlockOnBridgeThread(block) \
+do{\
+ dispatch_block_t pBlock = block; \
+ [self _performBlockOnBridgeThread:pBlock];\
+}while(0)
+
+- (void)_performBlockOnBridgeThread:(void (^)())block
+{
+ if ([NSThread currentThread] == _jsThread) {
+ block();
+ } else {
+ [self performSelector:@selector(_performBlockOnBridgeThread:)
+ onThread:_jsThread
+ withObject:[block copy]
+ waitUntilDone:NO];
+ }
+}
+
+#pragma mark JSBridge Management
+
+- (void)createInstance:(NSString *)instance
+ template:(NSString *)temp
+ options:(NSDictionary *)options
+ data:(id)data
+{
+ if (!instance || !temp) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx createInstance:instance
+ template:temp
+ options:options
+ data:data];
+ });
+}
+
+- (void)destroyInstance:(NSString *)instance
+{
+ if (!instance) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx destroyInstance:instance];
+ });
+}
+
+- (void)refreshInstance:(NSString *)instance
+ data:(NSDictionary *)data
+{
+ if (!instance) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx refreshInstance:instance data:data];
+ });
+}
+
+- (void)updateState:(NSString *)instance data:(id)data
+{
+ if (!instance) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx updateState:instance data:data];
+ });
+}
+
+- (void)executeJsFramework:(NSString *)script
+{
+ if (!script) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx executeJsFramework:script];
+ });
+}
+
+- (void)executeJsMethod:(WXBridgeMethod *)method
+{
+ if (!method) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx executeJsMethod:method];
+ });
+}
+
+- (void)registerModules:(NSDictionary *)modules
+{
+ if (!modules) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx registerModules:modules];
+ });
+}
+
+- (void)registerComponents:(NSArray *)components
+{
+ if (!components) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx registerComponents:components];
+ });
+}
+
+- (void)fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params
+{
+ if (!type || !ref) {
+ WXLogError(@"Event type and component ref should not be nil");
+ return;
+ }
+
+ NSArray *args = nil;
+ if (params) {
+ args = @[ref, type, params];
+ } else {
+ args = @[ref, type];
+ }
+ NSMutableDictionary *methodDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ @"fireEvent", @"method",
+ args, @"args", nil];
+ WXBridgeMethod *method = [[WXBridgeMethod alloc] initWithInstance:instanceId data:methodDict];
+ [self executeJsMethod:method];
+}
+
+- (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(NSString *) params keepAlive:(BOOL)keepAlive {
+ NSArray *args = nil;
+ if (keepAlive) {
+ args = @[[funcId copy], params? [params copy]:@"\"{}\"", @true];
+ }else {
+ args = @[[funcId copy], params? [params copy]:@"\"{}\""];
+ }
+ NSMutableDictionary *methodDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ @"callback", @"method",
+ @"jsBridge",@"module",
+ args, @"args", nil];
+
+ WXBridgeMethod *method = [[WXBridgeMethod alloc] initWithInstance:instanceId data:methodDict];
+
+ [self executeJsMethod:method];
+}
+
+- (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(NSString *)params
+{
+ [self callBack:instanceId funcId:funcId params:params keepAlive:NO];
+}
+
+- (void)connectToWebSocket:(NSURL *)url
+{
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx connectToWebSocket:url];
+ });
+}
+
+- (void)logToWebSocket:(NSString *)flag message:(NSString *)message
+{
+ if (!message) return;
+
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx logToWebSocket:flag message:message];
+ });
+}
+
+- (void)resetEnvironment
+{
+ __weak typeof(self) weakSelf = self;
+ WXPerformBlockOnBridgeThread(^(){
+ [weakSelf.bridgeCtx resetEnvironment];
+ });
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h
new file mode 100644
index 0000000..43be42f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h
@@ -0,0 +1,35 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WXComponentFactory : NSObject
+
+/**
+ * @abstract Register a component for a given name
+ *
+ * @param name The component name to register;
+ * @param clazz The WXComponent subclass to register
+ */
++ (void)registerComponent:(NSString *)name withClass:(Class)clazz;
+
+/**
+ * @abstract Register a list of components
+ * @param components The components array to register, every element in array should be a dictionary, in the form of @{@"name": @"xxx", @"class":@"yyy"}, which specifies the name and class of the component
+ */
++ (void)registerComponents:(NSArray *)components;
+
+/**
+ * @abstract Returns the class with a given component name.
+ * @param name The component's name
+ * @return The component's class
+ */
++ (Class)classWithComponentName:(NSString *)name;
+
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m
new file mode 100644
index 0000000..43bfc0f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m
@@ -0,0 +1,139 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponentFactory.h"
+#import "WXAssert.h"
+#import "WXLog.h"
+
+@interface WXComponentConfig : NSObject
+
+@property (nonatomic, strong) NSString *name;
+@property (nonatomic, strong) NSString *clazz;
+
+- (instancetype)initWithName:(NSString *)name class:(NSString *)clazz;
+
+@end
+
+@implementation WXComponentConfig
+
+- (instancetype)initWithName:(NSString *)name class:(NSString *)clazz
+{
+ if (self = [super init]) {
+ _name = name;
+ _clazz = clazz;
+ }
+
+ return self;
+}
+
+@end
+
+@implementation WXComponentFactory
+{
+ NSMutableDictionary *_componentConfigs;
+ NSLock *_configLock;
+}
+
+#pragma mark Life Cycle
+
++ (instancetype)sharedInstance {
+ static id _sharedInstance = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedInstance = [[self alloc] init];
+ });
+ return _sharedInstance;
+}
+
+- (instancetype)init
+{
+ if(self = [super init]){
+ _componentConfigs = [NSMutableDictionary dictionary];
+ _configLock = [[NSLock alloc] init];
+ }
+ return self;
+}
+
+#pragma mark Public
+
++ (Class)classWithComponentName:(NSString *)name
+{
+ return [[self sharedInstance] classWithComponentName:name];
+}
+
++ (void)registerComponent:(NSString *)name withClass:(Class)clazz
+{
+ [[self sharedInstance] registerComponent:name withClass:clazz];
+}
+
++ (void)registerComponents:(NSArray *)components
+{
+ [[self sharedInstance] registerComponents:components];
+}
+
+#pragma mark Private
+
+- (Class)classWithComponentName:(NSString *)name
+{
+ WXAssert(name, @"Can not find class for a nil component name");
+
+ WXComponentConfig *config = nil;
+
+ [_configLock lock];
+ config = [_componentConfigs objectForKey:name];
+ if (!config) {
+ WXLogWarning(@"No component config for name:%@, use default config", name);
+ config = [_componentConfigs objectForKey:@"div"];
+ }
+ [_configLock unlock];
+
+ if(!config || !config.clazz) {
+ return nil;
+ }
+
+ return NSClassFromString(config.clazz);
+}
+
+- (void)registerComponent:(NSString *)name withClass:(Class)clazz
+{
+ WXAssert(name && clazz, @"name or clazz must not be nil for registering component.");
+
+ WXComponentConfig *config = nil;
+ [_configLock lock];
+ config = [_componentConfigs objectForKey:name];
+
+ if(config){
+ WXLogInfo(@"Overrider component name:%@ class:%@, to name:%@ class:%@",
+ config.name, config.class, name, clazz);
+ }
+
+ config = [[WXComponentConfig alloc] initWithName:name class:NSStringFromClass(clazz)];
+ [_componentConfigs setValue:config forKey:name];
+ [_configLock unlock];
+}
+
+
+- (void)registerComponents:(NSArray *)components
+{
+ WXAssert(components, @"components array must not be nil for registering component.");
+
+ [_configLock lock];
+ for(NSDictionary *dict in components){
+ NSString *name = dict[@"name"];
+ NSString *clazz = dict[@"class"];
+ WXAssert(name && clazz, @"name or clazz must not be nil for registering components.");
+
+ WXComponentConfig *config = [[WXComponentConfig alloc] initWithName:name class:clazz];
+ if(config){
+ [_componentConfigs setValue:config forKey:name];
+ }
+ }
+ [_configLock unlock];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h
new file mode 100644
index 0000000..d329247
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h
@@ -0,0 +1,138 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+@class WXSDKInstance;
+@class WXComponent;
+
+extern void WXPerformBlockOnComponentThread(void (^block)());
+
+
+@interface WXComponentManager : NSObject
+
+@property (nonatomic, readonly, weak) WXSDKInstance *weexInstance;
+
+/**
+ * @abstract initialize with weex instance
+ **/
+- (instancetype)initWithWeexInstance:(WXSDKInstance *)weexInstance;
+
+/**
+ * @abstract return the component thread
+ **/
++ (NSThread *)componentThread;
+
+/**
+ * @abstract starting component tasks
+ **/
+- (void)startComponentTasks;
+
+///--------------------------------------
+/// @name Component Tree Building
+///--------------------------------------
+
+/**
+ * @abstract create root of component tree
+ **/
+- (void)createRoot:(NSDictionary *)data;
+
+/**
+ * @abstract add component
+ **/
+- (void)addComponent:(NSDictionary *)componentData toSupercomponent:(NSString *)superRef atIndex:(NSInteger)index appendingInTree:(BOOL)appendingInTree;
+
+/**
+ * @abstract remove component
+ **/
+- (void)removeComponent:(NSString *)ref;
+
+/**
+ * @abstract move component
+ **/
+- (void)moveComponent:(NSString *)ref toSuper:(NSString *)superRef atIndex:(NSInteger)index;
+
+/**
+ * @abstract return component for specific ref
+ */
+- (WXComponent *)componentForRef:(NSString *)ref;
+
+
+///--------------------------------------
+/// @name Updating
+///--------------------------------------
+
+/**
+ * @abstract update styles
+ **/
+- (void)updateStyles:(NSDictionary *)styles forComponent:(NSString *)ref;
+
+/**
+ * @abstract update attributes
+ **/
+- (void)updateAttributes:(NSDictionary *)attributes forComponent:(NSString *)ref;
+
+/**
+ * @abstract add event
+ **/
+- (void)addEvent:(NSString *)event toComponent:(NSString *)ref;
+
+/**
+ * @abstract remove event
+ **/
+- (void)removeEvent:(NSString *)event fromComponent:(NSString *)ref;
+
+/**
+ * @abstract scroll to specific component
+ **/
+- (void)scrollToComponent:(NSString *)ref options:(NSDictionary *)options;
+
+
+///--------------------------------------
+/// @name Life Cycle
+///--------------------------------------
+
+/**
+ * @abstract called when all doms are created
+ **/
+- (void)createFinish;
+
+/**
+ * @abstract called when all doms are refreshed
+ **/
+- (void)refreshFinish;
+
+/**
+ * @abstract called when all doms are updated
+ **/
+- (void)updateFinish;
+
+/**
+ * @abstract unload
+ **/
+- (void)unload;
+
+
+///--------------------------------------
+/// @name Fixed
+///--------------------------------------
+
+/**
+ * @abstract add a component which has a fixed position
+ *
+ * @param component
+ */
+- (void)addFixedComponent:(WXComponent *)fixComponent;
+
+/**
+ * @abstract remove a component which has a fixed position
+ *
+ * @param component
+ */
+- (void)removeFixedComponent:(WXComponent *)fixComponent;
+
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
new file mode 100644
index 0000000..49bac6f
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
@@ -0,0 +1,545 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponentManager.h"
+#import "WXComponent.h"
+#import "WXComponent_internal.h"
+#import "WXComponentFactory.h"
+#import "WXDefine.h"
+#import "NSArray+Weex.h"
+#import "WXSDKInstance.h"
+#import "WXAssert.h"
+#import "WXUtility.h"
+#import "WXScrollerProtocol.h"
+
+static NSThread *WXComponentThread;
+
+#define WXAssertComponentExist(component) WXAssert(component, @"component not exists")
+
+@implementation WXComponentManager
+{
+ __weak WXSDKInstance *_weexInstance;
+
+ BOOL _stopRunning;
+ NSUInteger _noTaskTickCount;
+
+ // access only on component thread
+ NSMapTable<NSString *, WXComponent *> *_indexDict;
+ NSMutableArray<dispatch_block_t> *_uiTaskQueue;
+
+ WXComponent *_rootComponent;
+ NSMutableArray *_fixedComponents;
+
+ css_node_t *_rootCSSNode;
+ CADisplayLink *_displayLink;
+}
+
++ (instancetype)sharedManager
+{
+ static id _sharedInstance = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedInstance = [[self alloc] init];
+ });
+ return _sharedInstance;
+}
+
+- (instancetype)initWithWeexInstance:(id)weexInstance
+{
+ if (self = [self init]) {
+ _weexInstance = weexInstance;
+
+ _indexDict = [NSMapTable strongToWeakObjectsMapTable];
+ _fixedComponents = [NSMutableArray wx_mutableArrayUsingWeakReferences];
+ _uiTaskQueue = [NSMutableArray array];
+
+ [self _startDisplayLink];
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+}
+
+#pragma mark Thread Management
+
++ (NSThread *)componentThread
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ WXComponentThread = [[NSThread alloc] initWithTarget:[self sharedManager] selector:@selector(_runLoopThread) object:nil];
+ [WXComponentThread setName:WX_COMPONENT_THREAD_NAME];
+ if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
+ [WXComponentThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
+ } else {
+ [WXComponentThread setThreadPriority:[[NSThread mainThread] threadPriority]];
+ }
+
+ [WXComponentThread start];
+ });
+
+ return WXComponentThread;
+}
+
+- (void)_runLoopThread
+{
+ [[NSRunLoop currentRunLoop] addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
+
+ while (!_stopRunning) {
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
+ }
+}
+
++ (void)_performBlockOnComponentThread:(void (^)())block
+{
+ if([NSThread currentThread] == [self componentThread]){
+ block();
+ } else {
+ [self performSelector:@selector(_performBlockOnComponentThread:)
+ onThread:WXComponentThread
+ withObject:[block copy]
+ waitUntilDone:NO];
+ }
+}
+
+- (void)startComponentTasks
+{
+ [self _awakeDisplayLink];
+}
+
+- (void)_addUITask:(void (^)())block
+{
+ [_uiTaskQueue addObject:block];
+}
+
+#pragma mark Component Tree Building
+
+- (void)createRoot:(NSDictionary *)data
+{
+ WXAssertComponentThread();
+ WXAssertParam(data);
+
+ WXComponent *rootComponent = [self _buildComponentForData:data];
+ _rootComponent = rootComponent;
+ WXSDKInstance *instance = self.weexInstance;
+ instance.rootView.wx_component = rootComponent;
+
+ _rootCSSNode = new_css_node();
+ _rootCSSNode->style.position[CSS_LEFT] = instance.frame.origin.x;
+ _rootCSSNode->style.position[CSS_TOP] = instance.frame.origin.y;
+ _rootCSSNode->style.dimensions[CSS_WIDTH] = instance.frame.size.width;
+ _rootCSSNode->style.dimensions[CSS_HEIGHT] = instance.frame.size.height;
+ _rootCSSNode->style.flex_wrap = CSS_NOWRAP;
+ _rootCSSNode->is_dirty = rootNodeIsDirty;
+ _rootCSSNode->get_child = rootNodeGetChild;
+ _rootCSSNode->context = (__bridge void *)(self);
+ _rootCSSNode->children_count = 1;
+
+
+ [self _addUITask:^{
+ [instance.rootView addSubview:rootComponent.view];
+ }];
+}
+
+static bool rootNodeIsDirty(void *context)
+{
+ WXComponentManager *mananger = (__bridge WXComponentManager *)(context);
+ return [mananger->_rootComponent needsLayout];
+}
+
+static css_node_t * rootNodeGetChild(void *context, int i)
+{
+ WXComponentManager *mananger = (__bridge WXComponentManager *)(context);
+ if (i == 0) {
+ return mananger->_rootComponent.cssNode;
+ } else if(mananger->_fixedComponents.count > 0) {
+ return ((WXComponent *)((mananger->_fixedComponents)[i-1])).cssNode;
+ }
+
+ return NULL;
+}
+
+- (void)addComponent:(NSDictionary *)componentData toSupercomponent:(NSString *)superRef atIndex:(NSInteger)index appendingInTree:(BOOL)appendingInTree
+{
+ WXAssertComponentThread();
+ WXAssertParam(componentData);
+ WXAssertParam(superRef);
+
+ WXComponent *supercomponent = [_indexDict objectForKey:superRef];
+ WXAssertComponentExist(supercomponent);
+
+ [self _recursivelyAddComponent:componentData toSupercomponent:supercomponent atIndex:index appendingInTree:appendingInTree];
+}
+
+- (void)_recursivelyAddComponent:(NSDictionary *)componentData toSupercomponent:(WXComponent *)supercomponent atIndex:(NSInteger)index appendingInTree:(BOOL)appendingInTree
+{
+ WXComponent *component = [self _buildComponentForData:componentData];
+
+ index = (index == -1 ? supercomponent.subcomponents.count : index);
+
+ [supercomponent _insertSubcomponent:component atIndex:index];
+
+ [self _addUITask:^{
+ [supercomponent insertSubview:component atIndex:index];
+ }];
+
+ NSArray *subcomponentsData = [componentData valueForKey:@"children"];
+
+ BOOL appendTree = !appendingInTree && [component.attributes[@"append"] isEqualToString:@"tree"];
+ // if ancestor is appending tree, child should not be laid out again even it is appending tree.
+ for(NSDictionary *subcomponentData in subcomponentsData){
+ [self _recursivelyAddComponent:subcomponentData toSupercomponent:component atIndex:-1 appendingInTree:appendTree || appendingInTree];
+ }
+ if (appendTree) {
+ // If appending tree\uff0cforce layout in case of too much tasks piling up in syncQueue
+ [self _layoutAndSyncUI];
+ }
+}
+
+- (void)moveComponent:(NSString *)ref toSuper:(NSString *)superRef atIndex:(NSInteger)index
+{
+ WXAssertComponentThread();
+ WXAssertParam(ref);
+ WXAssertParam(superRef);
+
+ WXComponent *component = [_indexDict objectForKey:ref];
+ WXComponent *newSupercomponent = [_indexDict objectForKey:superRef];
+ WXAssertComponentExist(component);
+ WXAssertComponentExist(newSupercomponent);
+
+ if (component.supercomponent == newSupercomponent && [newSupercomponent.subcomponents indexOfObject:component] < index) {
+ // if the supercomponent moved to is the same as original supercomponent,
+ // unify it into the index after removing.
+ index--;
+ }
+
+ [component _moveToSupercomponent:newSupercomponent atIndex:index];
+
+ [self _addUITask:^{
+ [component moveToSuperview:newSupercomponent atIndex:index];
+ }];
+}
+
+- (void)removeComponent:(NSString *)ref
+{
+ WXAssertComponentThread();
+ WXAssertParam(ref);
+
+ WXComponent *component = [_indexDict objectForKey:ref];
+ WXAssertComponentExist(component);
+
+ [component _removeFromSupercomponent];
+
+ [_indexDict removeObjectForKey:ref];
+
+ [self _addUITask:^{
+ [component removeFromSuperview];
+ }];
+}
+
+- (WXComponent *)componentForRef:(NSString *)ref
+{
+ NSDictionary *dict = [_indexDict copy];
+ return [dict objectForKey:ref];
+}
+
+
+- (WXComponent *)_buildComponentForData:(NSDictionary *)data
+{
+ NSString *ref = data[@"ref"];
+ NSString *type = data[@"type"];
+ NSDictionary *styles = data[@"style"];
+ NSDictionary *attributes = data[@"attr"];
+ NSArray *events = data[@"event"];
+
+ Class clazz = [WXComponentFactory classWithComponentName:type];
+ WXComponent *component = [[clazz alloc] initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:self.weexInstance];
+ WXAssert(component, @"Component build failed for data:%@", data);
+
+ [_indexDict setObject:component forKey:component.ref];
+
+ return component;
+}
+
+#pragma mark Updating
+
+- (void)updateStyles:(NSDictionary *)styles forComponent:(NSString *)ref
+{
+ WXAssertParam(styles);
+ WXAssertParam(ref);
+
+ WXComponent *component = [_indexDict objectForKey:ref];
+ WXAssertComponentExist(component);
+
+ [component _updateStylesOnComponentThread:styles];
+ [self _addUITask:^{
+ [component _updateStylesOnMainThread:styles];
+ }];
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes forComponent:(NSString *)ref
+{
+ WXAssertParam(attributes);
+ WXAssertParam(ref);
+
+ WXComponent *component = [_indexDict objectForKey:ref];
+ WXAssertComponentExist(component);
+
+ [component _updateAttributesOnComponentThread:attributes];
+ [self _addUITask:^{
+ [component _updateAttributesOnMainThread:attributes];
+ }];
+}
+
+- (void)addEvent:(NSString *)eventName toComponent:(NSString *)ref
+{
+ WXAssertComponentThread();
+ WXAssertParam(eventName);
+ WXAssertParam(ref);
+
+ WXComponent *component = [_indexDict objectForKey:ref];
+ WXAssertComponentExist(component);
+
+ [component _addEventOnComponentThread:eventName];
+
+ [self _addUITask:^{
+ [component _addEventOnMainThread:eventName];
+ }];
+}
+
+- (void)removeEvent:(NSString *)eventName fromComponent:(NSString *)ref
+{
+ WXAssertComponentThread();
+ WXAssertParam(eventName);
+ WXAssertParam(ref);
+
+ WXComponent *component = [_indexDict objectForKey:ref];
+ WXAssertComponentExist(component);
+
+ [component _removeEventOnComponentThread:eventName];
+
+ [self _addUITask:^{
+ [component _removeEventOnMainThread:eventName];
+ }];
+}
+
+- (void)scrollToComponent:(NSString *)ref options:(NSDictionary *)options
+{
+ WXAssertComponentThread();
+ WXAssertParam(ref);
+
+ WXComponent *toComponent = [_indexDict objectForKey:ref];
+ WXAssertComponentExist(toComponent);
+
+ id<WXScrollerProtocol> scrollerComponent = toComponent.ancestorScroller;
+ if (!scrollerComponent) {
+ return;
+ }
+
+ CGFloat offset = [[options objectForKey:@"offset"] floatValue];
+
+ [self _addUITask:^{
+ [scrollerComponent scrollToComponent:toComponent withOffset:offset];
+ }];
+}
+
+#pragma mark Life Cycle
+
+- (void)createFinish
+{
+ WXAssertComponentThread();
+
+ WXComponent *root = [_indexDict objectForKey:WX_SDK_ROOT_REF];
+ WXSDKInstance *instance = self.weexInstance;
+ [self _addUITask:^{
+ UIView *rootView = root.view;
+ [instance finishPerformance];
+
+ if(instance.renderFinish){
+ instance.renderFinish(rootView);
+ }
+ }];
+}
+
+- (void)updateFinish
+{
+ WXAssertComponentThread();
+
+ WXSDKInstance *instance = self.weexInstance;
+ WXComponent *root = [_indexDict objectForKey:WX_SDK_ROOT_REF];
+
+ [self _addUITask:^{
+ if(instance.updateFinish){
+ instance.updateFinish(root.view);
+ }
+ }];
+}
+
+- (void)refreshFinish
+{
+ WXAssertComponentThread();
+
+ WXSDKInstance *instance = self.weexInstance;
+ WXComponent *root = [_indexDict objectForKey:WX_SDK_ROOT_REF];
+
+ [self _addUITask:^{
+ if(instance.refreshFinish){
+ instance.refreshFinish(root.view);
+ }
+ }];
+}
+
+- (void)unload
+{
+ WXAssertComponentThread();
+
+ for (NSString *key in _indexDict) {
+ WXComponent *component = [_indexDict objectForKey:key];;
+ [self _addUITask:^{
+ [component _unloadView];
+ }];
+ }
+
+ [_indexDict removeAllObjects];
+ [_uiTaskQueue removeAllObjects];
+ _rootComponent = nil;
+
+ [self _stopDisplayLink];
+}
+
+#pragma mark Layout Batch
+
+- (void)_startDisplayLink
+{
+ WXAssertComponentThread();
+
+ if(!_displayLink){
+ _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(_handleDisplayLink)];
+ [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+ }
+}
+
+- (void)_stopDisplayLink
+{
+ WXAssertComponentThread();
+
+ if(_displayLink){
+ [_displayLink invalidate];
+ _displayLink = nil;
+ }
+}
+
+- (void)_suspendDisplayLink
+{
+ WXAssertComponentThread();
+
+ if(_displayLink && !_displayLink.paused) {
+ _displayLink.paused = YES;
+ }
+}
+
+- (void)_awakeDisplayLink
+{
+ WXAssertComponentThread();
+
+ if(_displayLink && _displayLink.paused) {
+ _displayLink.paused = NO;
+ }
+}
+
+- (void)_handleDisplayLink
+{
+ WXAssertComponentThread();
+
+ [self _layoutAndSyncUI];
+}
+
+- (void)_layoutAndSyncUI
+{
+ [self _layout];
+
+ if(_uiTaskQueue.count > 0){
+ [self _syncUITasks];
+ _noTaskTickCount = 0;
+ } else {
+ // suspend display link when there's no task for 1 second, in order to save CPU time.
+ _noTaskTickCount ++;
+ if (_noTaskTickCount > 60) {
+ [self _suspendDisplayLink];
+ }
+ }
+}
+
+- (void)_layout
+{
+ BOOL needsLayout = NO;
+ for (NSString *ref in _indexDict) {
+ WXComponent *component = [_indexDict objectForKey:ref];
+
+ if ([component needsLayout]) {
+ needsLayout = YES;
+ }
+ }
+
+ if (!needsLayout) {
+ return;
+ }
+
+ layoutNode(_rootCSSNode, _rootCSSNode->style.dimensions[CSS_WIDTH], _rootCSSNode->style.dimensions[CSS_HEIGHT], CSS_DIRECTION_INHERIT);
+ //
+ // if ([WXLog logLevel] >= WXLogLevelVerbose) {
+ // print_css_node_NSLog(_cssNode);
+ // }
+
+ if ([_rootComponent needsLayout]) {
+// print_css_node(_rootCSSNode, CSS_PRINT_LAYOUT | CSS_PRINT_STYLE | CSS_PRINT_CHILDREN);
+ }
+
+ NSMutableSet<WXComponent *> *dirtyComponents = [NSMutableSet set];
+ [_rootComponent _calculateFrameWithSuperAbsolutePosition:CGPointZero gatherDirtyComponents:dirtyComponents];
+
+ for (WXComponent *dirtyComponent in dirtyComponents) {
+ [self _addUITask:^{
+ [dirtyComponent _layoutDidFinish];
+ }];
+ }
+}
+
+- (void)_syncUITasks
+{
+ NSArray<dispatch_block_t> *blocks = _uiTaskQueue;
+ _uiTaskQueue = [NSMutableArray array];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ for(dispatch_block_t block in blocks) {
+ block();
+ }
+ });
+}
+
+#pragma mark Fixed
+
+- (void)addFixedComponent:(WXComponent *)fixComponent
+{
+ [_fixedComponents addObject:fixComponent];
+ _rootCSSNode->children_count = (int)[_fixedComponents count] + 1;
+}
+
+- (void)removeFixedComponent:(WXComponent *)fixComponent
+{
+ [_fixedComponents removeObject:fixComponent];
+ _rootCSSNode->children_count = (int)[_fixedComponents count] + 1;
+}
+
+@end
+
+void WXPerformBlockOnComponentThread(void (^block)())
+{
+ [WXComponentManager _performBlockOnComponentThread:block];
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.h b/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.h
new file mode 100644
index 0000000..7ad2182
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.h
@@ -0,0 +1,29 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WXHandlerFactory : NSObject
+
+/**
+ * @abstract Register a handler for a given handler instance and specific protocol
+ *
+ * @param handler The handler instance to register
+ *
+ * @param protocol The protocol to confirm
+ *
+ */
++ (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol;
+
+/**
+ * @abstract Returns the handler for a given protocol
+ *
+ **/
++ (id)handlerForProtocol:(Protocol *)protocol;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.m b/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.m
new file mode 100644
index 0000000..54a5811
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.m
@@ -0,0 +1,49 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXHandlerFactory.h"
+#import "WXThreadSafeMutableDictionary.h"
+#import "WXNetworkDefaultImpl.h"
+#import "WXNavigationDefaultImpl.h"
+#import "WXAssert.h"
+
+@interface WXHandlerFactory ()
+
+@property (nonatomic, strong) WXThreadSafeMutableDictionary *handlers;
+
+@end
+
+@implementation WXHandlerFactory
+
++ (instancetype)sharedInstance {
+ static WXHandlerFactory* _sharedInstance = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedInstance = [[self alloc] init];
+ _sharedInstance.handlers = [[WXThreadSafeMutableDictionary alloc] init];
+ });
+ return _sharedInstance;
+}
+
++ (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol
+{
+ WXAssert(handler && protocol, @"Handler or protocol for registering can not be nil.");
+ WXAssertProtocol(handler, protocol);
+
+ [[WXHandlerFactory sharedInstance].handlers setObject:handler forKey:NSStringFromProtocol(protocol)];
+}
+
++ (id)handlerForProtocol:(Protocol *)protocol
+{
+ WXAssert(protocol, @"Can not find handler for a nil protocol");
+
+ id handler = [[WXHandlerFactory sharedInstance].handlers objectForKey:NSStringFromProtocol(protocol)];
+ return handler;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.h b/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.h
new file mode 100644
index 0000000..0881cdd
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.h
@@ -0,0 +1,49 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WXModuleFactory : NSObject
+
+/**
+ * @abstract Returns the class of specific module
+ *
+ * @param name The module name
+ *
+ **/
++ (Class)classWithModuleName:(NSString *)name;
+
+/**
+ * @abstract Returns the instance method implemented by the module
+ *
+ * @param name The module name
+ *
+ * @param method The module method
+ *
+ **/
++ (SEL)methodWithModuleName:(NSString *)name withMethod:(NSString *)method;
+
+/**
+ * @abstract Registers a module for a given name and the implemented class
+ *
+ * @param module The module name to register
+ *
+ * @param clazz The module class to register
+ *
+ **/
++ (NSString *)registerModule:(NSString *)name withClass:(Class)clazz;
+
+/**
+ * @abstract Returns the export methods in the specific module
+ *
+ * @param name The module name
+ **/
++ (NSMutableDictionary *)moduleMethodMapsWithName:(NSString *)name;
+
+@end
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.m b/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.m
new file mode 100644
index 0000000..3bfa24d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.m
@@ -0,0 +1,225 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleFactory.h"
+#import "WXAssert.h"
+#import "WXLog.h"
+#import <objc/runtime.h>
+#import <objc/message.h>
+
+/************************************************************************************************/
+
+@interface WXModuleConfig : NSObject
+/**
+ * The module name
+ **/
+@property (nonatomic, strong) NSString *name;
+/**
+ * The module class
+ **/
+@property (nonatomic, strong) NSString *clazz;
+/**
+ * The methods map
+ **/
+@property (nonatomic, strong) NSMutableDictionary *methods;
+
+@end
+
+@implementation WXModuleConfig
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ _methods = [NSMutableDictionary dictionary];
+ }
+ return self;
+}
+
+- (void)registerModuleMethods
+{
+ Class currentClass = NSClassFromString(_clazz);
+
+ if (!currentClass) {
+ WXLogWarning(@"The module class [%@] doesn't exit\uff01", _clazz);
+ return;
+ }
+
+ while (currentClass != [NSObject class]) {
+ unsigned int methodCount = 0;
+ Method *methodList = class_copyMethodList(object_getClass(currentClass), &methodCount);
+ for (unsigned int i = 0; i < methodCount; i++) {
+ NSString *selStr = [NSString stringWithCString:sel_getName(method_getName(methodList[i])) encoding:NSUTF8StringEncoding];
+
+ if (![selStr hasPrefix:@"wx_export_method_"]) continue;
+
+ NSString *name = nil, *method = nil;
+ SEL selector = NSSelectorFromString(selStr);
+ if ([currentClass respondsToSelector:selector]) {
+ method = ((NSString* (*)(id, SEL))[currentClass methodForSelector:selector])(currentClass, selector);
+ }
+
+ if (method.length <= 0) {
+ WXLogWarning(@"The module class [%@] doesn't has any method\uff01", _clazz);
+ continue;
+ }
+
+ NSRange range = [method rangeOfString:@":"];
+ if (range.location != NSNotFound) {
+ name = [method substringToIndex:range.location];
+ } else {
+ name = method;
+ }
+
+ [_methods setObject:method forKey:name];
+ }
+
+ free(methodList);
+ currentClass = class_getSuperclass(currentClass);
+
+ }
+}
+
+@end
+
+@interface WXModuleFactory ()
+
+@property (nonatomic, strong) NSMutableDictionary *moduleMap;
+@property (nonatomic, strong) NSLock *moduleLock;
+
+@end
+
+@implementation WXModuleFactory
+
+static WXModuleFactory *_sharedInstance = nil;
+
+#pragma mark Private Methods
+
++ (WXModuleFactory *)_sharedInstance
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ if (!_sharedInstance) {
+ _sharedInstance = [[self alloc] init];
+ }
+ });
+ return _sharedInstance;
+}
+
++ (instancetype)allocWithZone:(struct _NSZone *)zone
+{
+ if (!_sharedInstance) {
+ _sharedInstance = [super allocWithZone:zone];
+ }
+ return _sharedInstance;
+}
+
+- (instancetype)init
+{
+ @synchronized(self) {
+ self = [super init];
+ if (self) {
+ _moduleMap = [NSMutableDictionary dictionary];
+ _moduleLock = [[NSLock alloc] init];
+ }
+ }
+ return self;
+}
+
+- (Class)_classWithModuleName:(NSString *)name
+{
+ WXAssert(name, @"Fail to find class with module name, please check if the parameter are correct \uff01");
+
+ WXModuleConfig *config = nil;
+
+ [_moduleLock lock];
+ config = [_moduleMap objectForKey:name];
+ [_moduleLock unlock];
+
+ if (!config || !config.clazz) return nil;
+
+ return NSClassFromString(config.clazz);
+}
+
+- (SEL)_methodWithModuleName:(NSString *)name withMethod:(NSString *)method
+{
+ WXAssert(name && method, @"Fail to find selector with module name and method, please check if the parameters are correct \uff01");
+
+ NSString *selStr = nil; SEL selector = nil;
+ WXModuleConfig *config = nil;
+
+ [_moduleLock lock];
+ config = [_moduleMap objectForKey:name];
+ if (config.methods) {
+ selStr = [config.methods objectForKey:method];
+ }
+ if (selStr) {
+ selector = NSSelectorFromString(selStr);
+ }
+ [_moduleLock unlock];
+
+ return selector;
+}
+
+- (NSString *)_registerModule:(NSString *)name withClass:(Class)clazz
+{
+ WXAssert(name && clazz, @"Fail to register the module, please check if the parameters are correct \uff01");
+
+ [_moduleLock lock];
+ //allow to register module with the same name;
+ WXModuleConfig *config = [[WXModuleConfig alloc] init];
+ config.name = name;
+ config.clazz = NSStringFromClass(clazz);
+ [config registerModuleMethods];
+ [_moduleMap setValue:config forKey:name];
+ [_moduleLock unlock];
+
+ return name;
+}
+
+- (NSMutableDictionary *)_moduleMethodMapsWithName:(NSString *)name
+{
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+ NSMutableArray *methods = [NSMutableArray array];
+
+ [_moduleLock lock];
+ [dict setValue:methods forKey:name];
+
+ WXModuleConfig *config = _moduleMap[name];
+ void (^mBlock)(id, id, BOOL *) = ^(id mKey, id mObj, BOOL * mStop) {
+ [methods addObject:mKey];
+ };
+ [config.methods enumerateKeysAndObjectsUsingBlock:mBlock];
+ [_moduleLock unlock];
+
+ return dict;
+}
+
+#pragma mark Public Methods
+
++ (Class)classWithModuleName:(NSString *)name
+{
+ return [[self _sharedInstance] _classWithModuleName:name];
+}
+
++ (SEL)methodWithModuleName:(NSString *)name withMethod:(NSString *)method
+{
+ return [[self _sharedInstance] _methodWithModuleName:name withMethod:method];
+}
+
++ (NSString *)registerModule:(NSString *)name withClass:(Class)clazz
+{
+ return [[self _sharedInstance] _registerModule:name withClass:clazz];
+}
+
++ (NSMutableDictionary *)moduleMethodMapsWithName:(NSString *)name
+{
+ return [[self _sharedInstance] _moduleMethodMapsWithName:name];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.h b/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.h
new file mode 100644
index 0000000..4e66665
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.h
@@ -0,0 +1,16 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXBridgeMethod.h"
+
+@interface WXModuleManager : NSObject
+
+- (void)dispatchMethod:(WXBridgeMethod *)method;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.m
new file mode 100644
index 0000000..27cfd1d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXModuleManager.m
@@ -0,0 +1,139 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXModuleManager.h"
+#import "WXModuleProtocol.h"
+#import "WXUtility.h"
+#import "WXModuleFactory.h"
+#import "WXSDKError.h"
+#import "WXSDKManager.h"
+#import "WXThreadSafeMutableDictionary.h"
+#import <objc/message.h>
+
+@interface WXModuleManager ()
+
+@property (nonatomic, strong) WXThreadSafeMutableDictionary *indexDict;
+
+@end
+
+@implementation WXModuleManager
+
+- (instancetype)init
+{
+ self = [super init];
+ if(self){
+ _indexDict = [[WXThreadSafeMutableDictionary alloc]init];
+ }
+ return self;
+}
+
+#pragma mark Private Methods
+
+- (void)_executeModuleThead:(NSThread *)thread withBlock:(dispatch_block_t)block
+{
+ if (!thread || !block) return;
+
+ if ([NSThread currentThread] == thread) {
+ block();
+ } else {
+ [self performSelector:@selector(_executeModuleBlock:)
+ onThread:thread
+ withObject:[block copy]
+ waitUntilDone:NO];
+ }
+}
+
+- (void)_executeModuleBlock:(dispatch_block_t)block
+{
+ if (block) block();
+}
+
+- (void)_executeModuleMethod:(id)module withMethod:(WXBridgeMethod *)method
+{
+ if (!module) return;
+
+ SEL selector = [WXModuleFactory methodWithModuleName:method.module withMethod:method.method];
+ NSArray *arguments = method.arguments;
+
+ NSMethodSignature *signature = [module methodSignatureForSelector:selector];
+ if (!signature) {
+ [WXSDKError monitorAlarm:NO errorCode:WA_ERR_INVOKE_NATIVE msg:@"Module:%@, method\uff1a%@ doesn't exist \uff01", method.module, method.method];
+ return;
+ }
+
+ if (signature.numberOfArguments - 2 != method.arguments.count) {
+ [WXSDKError monitorAlarm:NO errorCode:WA_ERR_INVOKE_NATIVE msg:@"Module:%@, the parameters in calling method [%@] and registered method [%@] are not consistent\uff01", method.module, method.method, NSStringFromSelector(selector)];
+ return;
+ }
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ invocation.target = module;
+ invocation.selector = selector;
+
+ void **freeList = NULL;
+ WX_ALLOC_FLIST(freeList, arguments.count);
+
+ for (int i = 0; i < arguments.count; i++) {
+ id obj = arguments[i];
+ const char *parameterType = [signature getArgumentTypeAtIndex:i + 2];
+ static const char *blockType = @encode(typeof(^{}));
+ id argument;
+ if (!strcmp(parameterType, blockType)) {
+ // callback
+ argument = [^void(NSString *result) {
+ NSString* instanceId = method.instance;
+ [[WXSDKManager bridgeMgr] callBack:instanceId funcId:(NSString *)obj params:result];
+ } copy];
+ CFBridgingRetain(argument);
+ [invocation setArgument:&argument atIndex:i + 2];
+ } else {
+ argument = obj;
+ WX_ARGUMENTS_SET(invocation, signature, i, argument, freeList);
+ }
+ }
+ [invocation retainArguments];
+ [invocation invoke];
+
+ WX_FREE_FLIST(freeList, arguments.count);
+
+ [WXSDKError monitorAlarm:YES errorCode:WA_ERR_INVOKE_NATIVE msg:@""];
+}
+
+#pragma mark Public Methods
+
+- (void)dispatchMethod:(WXBridgeMethod *)method
+{
+ if (!method) return;
+
+ Class module = [WXModuleFactory classWithModuleName:method.module];
+ if (!module) {
+ [WXSDKError monitorAlarm:NO errorCode:WA_ERR_INVOKE_NATIVE msg:@"Module\uff1a%@ doesn't exist\uff01", method.module];
+ return;
+ }
+
+// WXLogDebug(@"execute\uff1a[module %@], [method %@], [parameter %@]", method.module, method.method, method.arguments);
+
+ WXSDKInstance *weexInstance = [WXSDKManager instanceForID:method.instance];
+ id<WXModuleProtocol> moduleInstance = [weexInstance moduleForClass:module];
+
+ // attach target thread
+ NSThread *targetThread = nil;
+ if([moduleInstance respondsToSelector:@selector(targetExecuteThread)]){
+ targetThread = [moduleInstance targetExecuteThread];
+ } else {
+ targetThread = [NSThread mainThread];
+ }
+
+ //execute module method
+ __weak typeof(self) weakSelf = self;
+ dispatch_block_t dipatchMethodBlock = ^ (){
+ [weakSelf _executeModuleMethod:moduleInstance withMethod:method];
+ };
+ [self _executeModuleThead:targetThread withBlock:dipatchMethodBlock];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.h b/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.h
new file mode 100644
index 0000000..1f345a4
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.h
@@ -0,0 +1,41 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+#import "WXBridgeManager.h"
+#import "WXModuleManager.h"
+#import "WXSDKInstance.h"
+
+@interface WXSDKManager : NSObject
+
+/**
+ * @abstract Returns bridge manager
+ **/
++ (WXBridgeManager *)bridgeMgr;
+
+/**
+ * @abstract Returns module manager
+ **/
++ (WXModuleManager *)moduleMgr;
+
+/**
+ * @abstract Returns weex instance for specific identifier
+ **/
++ (WXSDKInstance *)instanceForID:(NSString *)identifier;
+
+/**
+ * @abstract Returns weex instance for specific identifier
+ **/
++ (void)storeInstance:(WXSDKInstance *)instance forID:(NSString *)identifier;
+
+/**
+ * @abstract Returns weex instance for specific identifier
+ **/
++ (void)removeInstanceforID:(NSString *)identifier;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.m
new file mode 100644
index 0000000..fcebce2
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.m
@@ -0,0 +1,73 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXSDKManager.h"
+#import "WXThreadSafeMutableDictionary.h"
+
+@interface WXSDKManager ()
+
+@property (nonatomic, strong) WXBridgeManager *bridgeMgr;
+
+@property (nonatomic, strong) WXModuleManager *moduleMgr;
+
+@property (nonatomic, strong) WXThreadSafeMutableDictionary *instanceDict;
+
+@end
+
+@implementation WXSDKManager
+
+static WXSDKManager *_sharedInstance = nil;
+
++ (WXSDKManager *)sharedInstance
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ if (!_sharedInstance) {
+ _sharedInstance = [[self alloc] init];
+ _sharedInstance.instanceDict = [[WXThreadSafeMutableDictionary alloc] init];
+ }
+ });
+ return _sharedInstance;
+}
+
++ (WXBridgeManager *)bridgeMgr
+{
+ WXBridgeManager *bridgeMgr = [self sharedInstance].bridgeMgr;
+ if (!bridgeMgr) {
+ bridgeMgr = [[WXBridgeManager alloc] init];
+ [self sharedInstance].bridgeMgr = bridgeMgr;
+ }
+ return bridgeMgr;
+}
+
++ (WXModuleManager *)moduleMgr
+{
+ WXModuleManager *moduleMgr = [self sharedInstance].moduleMgr;
+ if (!moduleMgr) {
+ moduleMgr = [[WXModuleManager alloc] init];
+ [self sharedInstance].moduleMgr = moduleMgr;
+ }
+ return moduleMgr;
+}
+
++ (id)instanceForID:(NSString *)identifier
+{
+ return [[self sharedInstance].instanceDict objectForKey:identifier];
+}
+
++ (void)storeInstance:(WXSDKInstance *)instance forID:(NSString *)identifier
+{
+ [[self sharedInstance].instanceDict setObject:instance forKey:identifier];
+}
+
++ (void)removeInstanceforID:(NSString *)identifier
+{
+ [[self sharedInstance].instanceDict removeObjectForKey:identifier];
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.h b/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.h
new file mode 100644
index 0000000..c3ba7b2
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.h
@@ -0,0 +1,24 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WXBridgeMethod : NSObject
+
+@property (nonatomic, strong) NSString *instance;
+@property (nonatomic, strong) NSString *module;
+@property (nonatomic, strong) NSString *method;
+@property (nonatomic, strong) NSArray *arguments;
+
+- (instancetype)initWihData:(NSDictionary *)data;
+
+- (instancetype)initWithInstance:(NSString *)instance data:(NSMutableDictionary *)data;
+
+- (NSDictionary *)dataDesc;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.m b/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.m
new file mode 100644
index 0000000..ae473e9
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXBridgeMethod.m
@@ -0,0 +1,41 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXBridgeMethod.h"
+
+@implementation WXBridgeMethod
+
+- (instancetype)initWihData:(NSDictionary *)data
+{
+ self = [super init];
+ if(self){
+ _module = [data valueForKey:@"module"];
+ _method = [data valueForKey:@"method"];
+ _arguments = [data valueForKey:@"args"];
+ }
+ return self;
+}
+
+- (instancetype)initWithInstance:(NSString *)instance data:(NSMutableDictionary *)data
+{
+ self = [self initWihData:data];
+ if (self) {
+ _instance = instance;
+ }
+ return self;
+}
+
+- (NSDictionary *)dataDesc
+{
+ NSString *module = _module ? : @"";
+ NSString *method = _method ? : @"";
+ NSArray *arguments = _arguments ? : @[];
+ return @{@"module":module, @"method":method, @"args":arguments};
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.h b/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.h
new file mode 100644
index 0000000..f3af407
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.h
@@ -0,0 +1,22 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent.h"
+#import "WXNavigationProtocol.h"
+
+@interface WXComponent (Navigation)
+
+- (void)setNavigationBarHidden:(BOOL)hidden;
+
+- (void)setNavigationBackgroundColor:(UIColor *)backgroundColor;
+
+- (void)setNavigationItemWithParam:(NSDictionary *)param position:(WXNavigationItemPosition)position;
+
+- (void)setNavigationWithStyles:(NSDictionary *)styles;
+
+@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.m b/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.m
new file mode 100644
index 0000000..7313e4d
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent+Navigation.m
@@ -0,0 +1,178 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
+ */
+
+#import "WXComponent+Navigation.h"
+#import "WXComponent_internal.h"
+#import "WXSDKInstance_private.h"
+#import "WXBaseViewController.h"
+#import "WXHandlerFactory.h"
+#import "WXConvert.h"
+#import "WXUtility.h"
+
+#define kBarTintColor @"barTintColor"
+#define kBarItemText @"title"
+#define kBarItemTextColor @"titleColor"
+#define kBarItemIcon @"icon"
+
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+
+@implementation WXComponent (Navigation)
+
+- (id<WXNavigationProtocol>)navigator
+{
+ id<WXNavigationProtocol> navigator = [WXHandlerFactory handlerForProtocol:@protocol(WXNavigationProtocol)];
+ return navigator;
+}
+
+// navigtion configuration
+- (void)_setupNavBarWithStyles:(NSMutableDictionary *)styles attributes:(NSMutableDictionary *)attributes
+{
+ NSString *dataRole = attributes[@"dataRole"];
+ if (dataRole && [dataRole isEqualToString:@"navbar"]) {
+ styles[@"visibility"] = @"hidden";
+ styles[@"position"] = @"fixed";
+
+ self.weexInstance.naviBarStyles = [NSMutableDictionary new];
+
+ [self setNavigationBarHidden:NO];
+
+ NSString *backgroundColor = styles[@"backgroundColor"];
+ [self setNavigationBackgroundColor:[WXConvert UIColor:backgroundColor]];
+ }
+
+ NSString *position = attributes[@"naviItemPosition"];
+ if (position) {
+ NSMutableDictionary *data = [NSMutableDictionary new];
+ [data setObject:_type forKey:@"type"];
+ [data setObject:styles forKey:@"style"];
+ [data setObject:attributes forKey:@"attr"];
+
+ if ([position isEqualToString:@"left"]) {
+ [self setNavigationItemWithParam:data position:WXNavigationItemPositionLeft];
+ }
+ else if ([position isEqualToString:@"right"]) {
+ [self setNavigationItemWithParam:data position:WXNavigationItemPositionRight];
+ }
+ else if ([position isEqualToString:@"center"]) {
+ [self setNavigationItemWithParam:data position:WXNavigationItemPositionCenter];
+ }
+ }
+}
+
+- (void)_updateNavBarAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"data-role"]) {
+ NSString *dataRole = attributes[@"data-role"];
+ if ([dataRole isEqualToString:@"navbar"]) {
+ [self setNavigationBarHidden:NO];
+
+ NSDictionary *style = self.styles[@"style"];
+ NSString *backgroundColor = style[@"backgroundColor"];
+ [self setNavigationBackgroundColor:[WXConvert UIColor:backgroundColor]];
+ }
+ }
+}
+
+
+- (void)setNavigationBarHidden:(BOOL)hidden
+{
+ UIViewController *container = self.weexInstance.viewController;
+ id<WXNavigationProtocol> navigator = [self navigator];
+
+ WXPerformBlockOnMainThread(^{
+ [navigator setNavigationBarHidden:hidden animated:NO withContainer:container];
+ });
+}
+
+- (void)setNavigationBackgroundColor:(UIColor *)backgroundColor
+{
+ if (!backgroundColor) return;
+
+ NSMutableDictionary *styles = self.weexInstance.naviBarStyles;
+ [styles setObject:backgroundColor forKey:kBarTintColor];
+
+ UIViewController *container = self.weexInstance.viewController;
+ id<WXNavigationProtocol> navigator = [self navigator];
+
+ WXPerformBlockOnMainThread(^{
+ [navigator setNavigationBackgroundColor:backgroundColor withContainer:container];
+ });
+}
+
+- (void)setNavigationItemWithParam:(NSDictionary *)param position:(WXNavigationItemPosition)position
+{
+ if (!param) return;
+
+ __weak __block typeof(WXComponent) *weakSelf = self;
+
+ NSArray *array = @[@"center",@"right",@"left",@"more"];
+
+ [self _parse:param resultBlock:^(NSDictionary *dict) {
+ NSMutableDictionary *styles = weakSelf.weexInstance.naviBarStyles;
+ [styles setObject:dict forKey: array[position]];
+
+ UIViewController *container = weakSelf.weexInstance.viewController;
+ id<WXNavigationProtocol> navigator = [weakSelf navigator];
+
+ WXPerformBlockOnMainThread(^{
+ [navigator setNavigationItemWithParam:dict position:position completion:nil withContainer:container];
+ });
+ }];
+}
+
+- (void)setNavigationWithStyles:(NSDictionary *)styles
+{
+ UIViewController *container = self.weexInstance.viewController;
+ id<WXNavigationProtocol> navigator = [self navigator];
+
+ if (styles) {
+ [navigator setNavigationBarHidden:NO animated:NO withContainer:container];
+ [navigator setNavigationBackgroundColor:styles[kBarTintColor] withContainer:container];
+
+ NSArray *array = @[@"center",@"right",@"left",@"more"];
+ [array enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+ [navigator setNavigationItemWithParam:styles[obj] position:idx completion:nil withContainer:container];
+ }];
+ }
+ else {
+ [navigator setNavigationBarHidden:YES animated:NO withContainer:container];
+ }
+}
+
+- (void)_parse:(NSDictionary *)param resultBlock:(void(^)(NSDictionary *))result
+{
+ NSMutableDictionary *dict = [NSMutableDictionary new];
+ NSString *type = param[@"type"];
+
+ [dict setObject:self.weexInstance.instanceId forKey:@"instanceId"];
+ [dict setObject:self.ref forKey:@"nodeRef"];
+
+ if ([type isEqualToString:@"text"]) {
+ NSDictionary *attr = param[@"attr"];
+ NSString *title = attr[@"value"];
+ if (title) {
+ [dict setObject:title forKey:kBarItemText];
+ }
+
+ NSDictionary *style = param[@"style"];
+ NSString *color = style[@"color"];
+ if (color) {
+ [dict setObject:color forKey:kBarItemTextColor];
+ }
+ }
+ else if ([type isEqualToString:@"image"]) {
+ NSDictionary *attr = param[@"attr"];
+ NSString *src = attr[@"src"];
+ if (src) {
+ [dict setObject:src forKey:kBarItemIcon];
+ }
+ }
+ result(dict);
+}
+
+@end
[21/50] [abbrv] incubator-weex git commit: + [ios] iOS init.
Posted by ji...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/185fe55c/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..9519d4d
--- /dev/null
+++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
@@ -0,0 +1,1400 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 2A1F57B71C75C6A600B58017 /* WXTextInputComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A1F57B51C75C6A600B58017 /* WXTextInputComponent.h */; };
+ 2A1F57B81C75C6A600B58017 /* WXTextInputComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1F57B61C75C6A600B58017 /* WXTextInputComponent.m */; };
+ 2A42AF881C23B33E00818EA6 /* WeexSDK_MTL.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 2A42AF871C23B33E00818EA6 /* WeexSDK_MTL.h */; };
+ 2A42AF8A1C23B33E00818EA6 /* WeexSDK_MTL.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A42AF891C23B33E00818EA6 /* WeexSDK_MTL.m */; };
+ 2A4445BF1CA8FD56009E7C6D /* WXTextComponentProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A4445BE1CA8FD56009E7C6D /* WXTextComponentProtocol.h */; };
+ 2A44AB111C1AD5B00067A7EA /* WXSliderComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A44AB0F1C1AD5B00067A7EA /* WXSliderComponent.h */; };
+ 2A60CE9C1C91733E00857B9F /* WXSwitchComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A60CE9A1C91733E00857B9F /* WXSwitchComponent.h */; };
+ 2A60CE9D1C91733E00857B9F /* WXSwitchComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A60CE9B1C91733E00857B9F /* WXSwitchComponent.m */; };
+ 2A837AB21CD9DE9200AEDF03 /* WXLoadingComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A837AAC1CD9DE9200AEDF03 /* WXLoadingComponent.h */; };
+ 2A837AB31CD9DE9200AEDF03 /* WXLoadingComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A837AAD1CD9DE9200AEDF03 /* WXLoadingComponent.m */; };
+ 2A837AB41CD9DE9200AEDF03 /* WXLoadingIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A837AAE1CD9DE9200AEDF03 /* WXLoadingIndicator.h */; };
+ 2A837AB51CD9DE9200AEDF03 /* WXLoadingIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A837AAF1CD9DE9200AEDF03 /* WXLoadingIndicator.m */; };
+ 2A837AB61CD9DE9200AEDF03 /* WXRefreshComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A837AB01CD9DE9200AEDF03 /* WXRefreshComponent.h */; };
+ 2A837AB71CD9DE9200AEDF03 /* WXRefreshComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A837AB11CD9DE9200AEDF03 /* WXRefreshComponent.m */; };
+ 2A8E658A1C7C7AA20025C7B7 /* WXVideoComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A8E65881C7C7AA20025C7B7 /* WXVideoComponent.h */; };
+ 2A8E658B1C7C7AA20025C7B7 /* WXVideoComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A8E65891C7C7AA20025C7B7 /* WXVideoComponent.m */; };
+ 2AAFC1B61C48DFF70026D2FE /* WXSDKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAFC1B41C48DFF70026D2FE /* WXSDKError.h */; };
+ 2AAFC1B71C48DFF70026D2FE /* WXSDKError.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AAFC1B51C48DFF70026D2FE /* WXSDKError.m */; };
+ 2AC750241C7565690041D390 /* WXIndicatorComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC750221C7565690041D390 /* WXIndicatorComponent.h */; };
+ 2AC750251C7565690041D390 /* WXIndicatorComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AC750231C7565690041D390 /* WXIndicatorComponent.m */; };
+ 2AE5B7521CAB7DBD0082FDDB /* WXAComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AE5B7501CAB7DBD0082FDDB /* WXAComponent.h */; };
+ 2AE5B7531CAB7DBD0082FDDB /* WXAComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE5B7511CAB7DBD0082FDDB /* WXAComponent.m */; };
+ 2AE5B7561CABA04E0082FDDB /* WXEventModuleProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AE5B7551CABA04E0082FDDB /* WXEventModuleProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2AFEB17B1C747139000507FA /* WXInstanceWrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AFEB1791C747139000507FA /* WXInstanceWrap.h */; };
+ 2AFEB17C1C747139000507FA /* WXInstanceWrap.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AFEB17A1C747139000507FA /* WXInstanceWrap.m */; };
+ 594C28921CF9E61A009793A4 /* WXAnimationModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 594C28901CF9E61A009793A4 /* WXAnimationModule.m */; };
+ 594C28931CF9E61A009793A4 /* WXAnimationModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 594C28911CF9E61A009793A4 /* WXAnimationModule.h */; };
+ 59A582D41CF481110081FD3E /* WXAppMonitorProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A582D31CF481110081FD3E /* WXAppMonitorProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 59A582FC1CF5B17B0081FD3E /* WXBridgeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A582FA1CF5B17B0081FD3E /* WXBridgeContext.h */; };
+ 59A582FD1CF5B17B0081FD3E /* WXBridgeContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A582FB1CF5B17B0081FD3E /* WXBridgeContext.m */; };
+ 59A583081CF5B2FD0081FD3E /* WXNavigationDefaultImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A583041CF5B2FD0081FD3E /* WXNavigationDefaultImpl.h */; };
+ 59A583091CF5B2FD0081FD3E /* WXNavigationDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A583051CF5B2FD0081FD3E /* WXNavigationDefaultImpl.m */; };
+ 59A5830A1CF5B2FD0081FD3E /* WXNetworkDefaultImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A583061CF5B2FD0081FD3E /* WXNetworkDefaultImpl.h */; };
+ 59A5830B1CF5B2FD0081FD3E /* WXNetworkDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A583071CF5B2FD0081FD3E /* WXNetworkDefaultImpl.m */; };
+ 59A596191CB630E50012CD52 /* WXNavigationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A596171CB630E50012CD52 /* WXNavigationProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 59A5961C1CB630F10012CD52 /* WXComponent+Navigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A5961A1CB630F10012CD52 /* WXComponent+Navigation.h */; };
+ 59A5961D1CB630F10012CD52 /* WXComponent+Navigation.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A5961B1CB630F10012CD52 /* WXComponent+Navigation.m */; };
+ 59A596221CB6311F0012CD52 /* WXNavigatorModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A5961E1CB6311F0012CD52 /* WXNavigatorModule.h */; };
+ 59A596231CB6311F0012CD52 /* WXNavigatorModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A5961F1CB6311F0012CD52 /* WXNavigatorModule.m */; };
+ 59A596241CB6311F0012CD52 /* WXStorageModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A596201CB6311F0012CD52 /* WXStorageModule.h */; };
+ 59A596251CB6311F0012CD52 /* WXStorageModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A596211CB6311F0012CD52 /* WXStorageModule.m */; };
+ 59A5962F1CB632050012CD52 /* WXBaseViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A5962B1CB632050012CD52 /* WXBaseViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 59A596301CB632050012CD52 /* WXBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A5962C1CB632050012CD52 /* WXBaseViewController.m */; };
+ 59A596311CB632050012CD52 /* WXRootViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A5962D1CB632050012CD52 /* WXRootViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 59A596321CB632050012CD52 /* WXRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A5962E1CB632050012CD52 /* WXRootViewController.m */; };
+ 59CE27E81CC387DB000BE37A /* WXEmbedComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 59CE27E61CC387DB000BE37A /* WXEmbedComponent.h */; };
+ 59CE27E91CC387DB000BE37A /* WXEmbedComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 59CE27E71CC387DB000BE37A /* WXEmbedComponent.m */; };
+ 59D3CA401CF9ED57008835DC /* Layout.c in Sources */ = {isa = PBXBuildFile; fileRef = 59D3CA3E1CF9ED57008835DC /* Layout.c */; };
+ 59D3CA411CF9ED57008835DC /* Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 59D3CA3F1CF9ED57008835DC /* Layout.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 59D3CA471CFC3CC0008835DC /* WXSliderComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 59D3CA461CFC3CC0008835DC /* WXSliderComponent.m */; };
+ 59D3CA4A1CFC3CE1008835DC /* NSTimer+Weex.h in Headers */ = {isa = PBXBuildFile; fileRef = 59D3CA481CFC3CE1008835DC /* NSTimer+Weex.h */; };
+ 59D3CA4B1CFC3CE1008835DC /* NSTimer+Weex.m in Sources */ = {isa = PBXBuildFile; fileRef = 59D3CA491CFC3CE1008835DC /* NSTimer+Weex.m */; };
+ 59D3CA681D00544B008835DC /* WeexSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 59D3CA671D00544B008835DC /* WeexSDK.h */; };
+ 7408C48E1CFB345D000BCCD0 /* WXComponent+Events.h in Headers */ = {isa = PBXBuildFile; fileRef = 7408C48C1CFB345D000BCCD0 /* WXComponent+Events.h */; };
+ 7408C48F1CFB345D000BCCD0 /* WXComponent+Events.m in Sources */ = {isa = PBXBuildFile; fileRef = 7408C48D1CFB345D000BCCD0 /* WXComponent+Events.m */; };
+ 7410811F1CED585A001BC6E5 /* WXComponentManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7410811D1CED585A001BC6E5 /* WXComponentManager.h */; };
+ 741081201CED585A001BC6E5 /* WXComponentManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7410811E1CED585A001BC6E5 /* WXComponentManager.m */; };
+ 741081231CED6756001BC6E5 /* WXComponentFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 741081211CED6756001BC6E5 /* WXComponentFactory.h */; };
+ 741081241CED6756001BC6E5 /* WXComponentFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 741081221CED6756001BC6E5 /* WXComponentFactory.m */; };
+ 741081261CEDB4EC001BC6E5 /* WXComponent_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 741081251CEDB4EC001BC6E5 /* WXComponent_internal.h */; };
+ 7423899B1C3174EB00D748CA /* WXWeakObjectWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 742389991C3174EB00D748CA /* WXWeakObjectWrapper.h */; };
+ 7423899C1C3174EB00D748CA /* WXWeakObjectWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 7423899A1C3174EB00D748CA /* WXWeakObjectWrapper.m */; };
+ 7423899F1C32733800D748CA /* WXType.h in Headers */ = {isa = PBXBuildFile; fileRef = 7423899D1C32733800D748CA /* WXType.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 743933B41C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.h in Headers */ = {isa = PBXBuildFile; fileRef = 743933B21C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.h */; };
+ 743933B51C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.m in Sources */ = {isa = PBXBuildFile; fileRef = 743933B31C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.m */; };
+ 744BEA551D05178F00452B5D /* WXComponent+Display.h in Headers */ = {isa = PBXBuildFile; fileRef = 744BEA531D05178F00452B5D /* WXComponent+Display.h */; };
+ 744BEA561D05178F00452B5D /* WXComponent+Display.m in Sources */ = {isa = PBXBuildFile; fileRef = 744BEA541D05178F00452B5D /* WXComponent+Display.m */; };
+ 744BEA591D0520F300452B5D /* WXComponent+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 744BEA571D0520F300452B5D /* WXComponent+Layout.h */; };
+ 744BEA5A1D0520F300452B5D /* WXComponent+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 744BEA581D0520F300452B5D /* WXComponent+Layout.m */; };
+ 744BEA5D1D052A4F00452B5D /* WXComponent+ViewManangement.h in Headers */ = {isa = PBXBuildFile; fileRef = 744BEA5B1D052A4F00452B5D /* WXComponent+ViewManangement.h */; };
+ 744BEA5E1D052A4F00452B5D /* WXComponent+ViewManangement.m in Sources */ = {isa = PBXBuildFile; fileRef = 744BEA5C1D052A4F00452B5D /* WXComponent+ViewManangement.m */; };
+ 745ED2DA1C5F2C7E002DB5A8 /* WXView.h in Headers */ = {isa = PBXBuildFile; fileRef = 745ED2D61C5F2C7E002DB5A8 /* WXView.h */; };
+ 745ED2DB1C5F2C7E002DB5A8 /* WXView.m in Sources */ = {isa = PBXBuildFile; fileRef = 745ED2D71C5F2C7E002DB5A8 /* WXView.m */; };
+ 7461F8901CFB373100F62D44 /* WXDisplayQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7461F88C1CFB373100F62D44 /* WXDisplayQueue.h */; };
+ 7461F8911CFB373100F62D44 /* WXDisplayQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7461F88D1CFB373100F62D44 /* WXDisplayQueue.m */; };
+ 7461F8921CFB373100F62D44 /* WXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7461F88E1CFB373100F62D44 /* WXLayer.h */; };
+ 7461F8931CFB373100F62D44 /* WXLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7461F88F1CFB373100F62D44 /* WXLayer.m */; };
+ 7461F8A81CFC33A800F62D44 /* WXThreadSafeMutableArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7461F8A61CFC33A800F62D44 /* WXThreadSafeMutableArray.h */; };
+ 7461F8A91CFC33A800F62D44 /* WXThreadSafeMutableArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 7461F8A71CFC33A800F62D44 /* WXThreadSafeMutableArray.m */; };
+ 746319021C60AFC100EFEBD4 /* WXThreadSafeCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 746319001C60AFC100EFEBD4 /* WXThreadSafeCounter.h */; };
+ 746319031C60AFC100EFEBD4 /* WXThreadSafeCounter.m in Sources */ = {isa = PBXBuildFile; fileRef = 746319011C60AFC100EFEBD4 /* WXThreadSafeCounter.m */; };
+ 746319291C71B92600EFEBD4 /* WXModalUIModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 746319271C71B92600EFEBD4 /* WXModalUIModule.h */; };
+ 7463192A1C71B92600EFEBD4 /* WXModalUIModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 746319281C71B92600EFEBD4 /* WXModalUIModule.m */; };
+ 7469869A1C4DEAB80054A57E /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A27E7D81C3E360B00D7A552 /* SRWebSocket.m */; };
+ 7469869C1C4DEAC20054A57E /* libicucore.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 7469869B1C4DEAC20054A57E /* libicucore.tbd */; };
+ 7469869F1C4E2C000054A57E /* NSArray+Weex.h in Headers */ = {isa = PBXBuildFile; fileRef = 7469869D1C4E2C000054A57E /* NSArray+Weex.h */; };
+ 746986A01C4E2C010054A57E /* NSArray+Weex.m in Sources */ = {isa = PBXBuildFile; fileRef = 7469869E1C4E2C000054A57E /* NSArray+Weex.m */; };
+ 748B25181C44A6F9005D491E /* WXSDKInstance_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 748B25161C44A6F9005D491E /* WXSDKInstance_private.h */; };
+ 74915F471C8EB02B00BEBCC0 /* WXAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 74915F451C8EB02B00BEBCC0 /* WXAssert.h */; };
+ 74915F481C8EB02B00BEBCC0 /* WXAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 74915F461C8EB02B00BEBCC0 /* WXAssert.m */; };
+ 74A4BA5B1CABBBD000195969 /* WXDebugTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BA591CABBBD000195969 /* WXDebugTool.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 74A4BA5C1CABBBD000195969 /* WXDebugTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 74A4BA5A1CABBBD000195969 /* WXDebugTool.m */; };
+ 74A4BA851CAD453400195969 /* WXNetworkProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BA841CAD453400195969 /* WXNetworkProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 74A4BA961CB365D100195969 /* WXAppConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BA941CB365D100195969 /* WXAppConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 74A4BA971CB365D100195969 /* WXAppConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 74A4BA951CB365D100195969 /* WXAppConfiguration.m */; };
+ 74A4BA9A1CB3BAA100195969 /* WXThreadSafeMutableDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BA981CB3BAA100195969 /* WXThreadSafeMutableDictionary.h */; };
+ 74A4BA9B1CB3BAA100195969 /* WXThreadSafeMutableDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 74A4BA991CB3BAA100195969 /* WXThreadSafeMutableDictionary.m */; };
+ 74A4BA9E1CB3C0A100195969 /* WXHandlerFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BA9C1CB3C0A100195969 /* WXHandlerFactory.h */; };
+ 74A4BA9F1CB3C0A100195969 /* WXHandlerFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 74A4BA9D1CB3C0A100195969 /* WXHandlerFactory.m */; };
+ 74A4BAA61CB4F98300195969 /* WXStreamModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BAA41CB4F98300195969 /* WXStreamModule.h */; };
+ 74A4BAA71CB4F98300195969 /* WXStreamModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 74A4BAA51CB4F98300195969 /* WXStreamModule.m */; };
+ 74B80E6C1C3FB32C00239FB9 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 74B80E6B1C3FB32C00239FB9 /* main.js */; };
+ 74CC7A1C1C2BC5F800829368 /* WXCellComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 74CC7A1A1C2BC5F800829368 /* WXCellComponent.h */; };
+ 74CC7A1D1C2BC5F800829368 /* WXCellComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 74CC7A1B1C2BC5F800829368 /* WXCellComponent.m */; };
+ 74CC7A201C2BF9DC00829368 /* WXListComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 74CC7A1E1C2BF9DC00829368 /* WXListComponent.h */; };
+ 74CC7A211C2BF9DC00829368 /* WXListComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 74CC7A1F1C2BF9DC00829368 /* WXListComponent.m */; };
+ 74FD6E041C7C0E9600DBEB6D /* WXScrollerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 74FD6E031C7C0E9600DBEB6D /* WXScrollerProtocol.h */; };
+ 775BEE4E1C16F993008D1629 /* WXDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 775BEE4D1C16F993008D1629 /* WXDefine.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 775BEE6E1C1BD8F4008D1629 /* WXImgLoaderProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 775BEE6C1C1BD8F4008D1629 /* WXImgLoaderProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 775BEE711C1BD977008D1629 /* WXModuleProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 775BEE701C1BD977008D1629 /* WXModuleProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 77D161081C02DBE70010B15B /* WeexSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77D160FD1C02DBE70010B15B /* WeexSDK.framework */; };
+ 77D1610D1C02DBE70010B15B /* WeexSDKTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D1610C1C02DBE70010B15B /* WeexSDKTests.m */; };
+ 77D161201C02DDB40010B15B /* WXSDKEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D1611E1C02DDB40010B15B /* WXSDKEngine.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 77D161211C02DDB40010B15B /* WXSDKEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D1611F1C02DDB40010B15B /* WXSDKEngine.m */; };
+ 77D161241C02DDD10010B15B /* WXSDKInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161221C02DDD10010B15B /* WXSDKInstance.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 77D161251C02DDD10010B15B /* WXSDKInstance.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D161231C02DDD10010B15B /* WXSDKInstance.m */; };
+ 77D161281C02DE1A0010B15B /* WXSDKManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161261C02DE1A0010B15B /* WXSDKManager.h */; };
+ 77D161291C02DE1A0010B15B /* WXSDKManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D161271C02DE1A0010B15B /* WXSDKManager.m */; };
+ 77D161301C02DE4E0010B15B /* WXComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D1612E1C02DE4E0010B15B /* WXComponent.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 77D161311C02DE4E0010B15B /* WXComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D1612F1C02DE4E0010B15B /* WXComponent.m */; };
+ 77D161381C02DE940010B15B /* WXBridgeManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161361C02DE940010B15B /* WXBridgeManager.h */; };
+ 77D161391C02DE940010B15B /* WXBridgeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D161371C02DE940010B15B /* WXBridgeManager.m */; };
+ 77D1613C1C02DEA60010B15B /* WXJSCoreBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D1613A1C02DEA60010B15B /* WXJSCoreBridge.h */; };
+ 77D1613D1C02DEA60010B15B /* WXJSCoreBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D1613B1C02DEA60010B15B /* WXJSCoreBridge.m */; };
+ 77D161401C02DEB50010B15B /* WXWebSocketBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D1613E1C02DEB50010B15B /* WXWebSocketBridge.h */; };
+ 77D161411C02DEB50010B15B /* WXWebSocketBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D1613F1C02DEB50010B15B /* WXWebSocketBridge.m */; };
+ 77D161431C02DEE40010B15B /* WXBridgeProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161421C02DEE40010B15B /* WXBridgeProtocol.h */; };
+ 77D1614B1C02E3790010B15B /* WXConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161491C02E3790010B15B /* WXConvert.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 77D1614C1C02E3790010B15B /* WXConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D1614A1C02E3790010B15B /* WXConvert.m */; };
+ 77D1614F1C02E3880010B15B /* WXUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D1614D1C02E3880010B15B /* WXUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 77D161501C02E3880010B15B /* WXUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D1614E1C02E3880010B15B /* WXUtility.m */; };
+ 77D161621C02ED790010B15B /* WXLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161601C02ED790010B15B /* WXLog.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 77D161631C02ED790010B15B /* WXLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 77D161611C02ED790010B15B /* WXLog.m */; };
+ 77E659DA1C07F594008B8775 /* WXDomModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E659D81C07F594008B8775 /* WXDomModule.h */; };
+ 77E659DB1C07F594008B8775 /* WXDomModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E659D91C07F594008B8775 /* WXDomModule.m */; };
+ 77E659F11C0C3612008B8775 /* WXModuleFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E659EF1C0C3612008B8775 /* WXModuleFactory.h */; };
+ 77E659F21C0C3612008B8775 /* WXModuleFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E659F01C0C3612008B8775 /* WXModuleFactory.m */; };
+ 77E659FA1C0EE579008B8775 /* WXBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E659F81C0EE579008B8775 /* WXBridgeMethod.h */; };
+ 77E659FB1C0EE579008B8775 /* WXBridgeMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E659F91C0EE579008B8775 /* WXBridgeMethod.m */; };
+ 77E65A061C10507B008B8775 /* WXModuleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E65A041C10507B008B8775 /* WXModuleManager.h */; };
+ 77E65A071C10507B008B8775 /* WXModuleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E65A051C10507B008B8775 /* WXModuleManager.m */; };
+ 77E65A0D1C155E99008B8775 /* WXDivComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E65A0B1C155E99008B8775 /* WXDivComponent.h */; };
+ 77E65A0E1C155E99008B8775 /* WXDivComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E65A0C1C155E99008B8775 /* WXDivComponent.m */; };
+ 77E65A111C155EA8008B8775 /* WXImageComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E65A0F1C155EA8008B8775 /* WXImageComponent.h */; };
+ 77E65A121C155EA8008B8775 /* WXImageComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E65A101C155EA8008B8775 /* WXImageComponent.m */; };
+ 77E65A151C155EB5008B8775 /* WXTextComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E65A131C155EB5008B8775 /* WXTextComponent.h */; };
+ 77E65A161C155EB5008B8775 /* WXTextComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E65A141C155EB5008B8775 /* WXTextComponent.m */; };
+ 77E65A191C155F25008B8775 /* WXScrollerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E65A171C155F25008B8775 /* WXScrollerComponent.h */; };
+ 77E65A1A1C155F25008B8775 /* WXScrollerComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E65A181C155F25008B8775 /* WXScrollerComponent.m */; };
+ 77E65A1D1C156268008B8775 /* WeexENVTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E65A1C1C156268008B8775 /* WeexENVTests.m */; };
+ 77E65A1F1C156460008B8775 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77E65A1E1C156460008B8775 /* JavaScriptCore.framework */; };
+ 77E65A201C156846008B8775 /* weex-test.js in Resources */ = {isa = PBXBuildFile; fileRef = 77E65A081C119CC1008B8775 /* weex-test.js */; };
+ 77E65A221C158139008B8775 /* test.js in Resources */ = {isa = PBXBuildFile; fileRef = 77E65A211C158139008B8775 /* test.js */; };
+ D312CE3B1C730DEB00046D68 /* WXWebComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = D312CE391C730DEB00046D68 /* WXWebComponent.h */; };
+ D312CE3C1C730DEB00046D68 /* WXWebComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = D312CE3A1C730DEB00046D68 /* WXWebComponent.m */; };
+ D317338C1C57257000BB7539 /* WXTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = D317338A1C57257000BB7539 /* WXTransform.h */; };
+ D317338D1C57257000BB7539 /* WXTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = D317338B1C57257000BB7539 /* WXTransform.m */; };
+ D362F94F1C83EDA20003F546 /* WXWebViewModule.h in Headers */ = {isa = PBXBuildFile; fileRef = D362F94D1C83EDA20003F546 /* WXWebViewModule.h */; };
+ D362F9501C83EDA20003F546 /* WXWebViewModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D362F94E1C83EDA20003F546 /* WXWebViewModule.m */; };
+ D3FC0DF71C508B2A002B9E31 /* WXTimerModule.h in Headers */ = {isa = PBXBuildFile; fileRef = D3FC0DF51C508B2A002B9E31 /* WXTimerModule.h */; };
+ D3FC0DF81C508B2A002B9E31 /* WXTimerModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D3FC0DF61C508B2A002B9E31 /* WXTimerModule.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 77D161091C02DBE70010B15B /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 77D160F41C02DBE70010B15B /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 77D160FC1C02DBE70010B15B;
+ remoteInfo = WeexSDK;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 2A42AF831C23B33E00818EA6 /* Copy Files */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "include/$(PRODUCT_NAME)";
+ dstSubfolderSpec = 16;
+ files = (
+ 2A42AF881C23B33E00818EA6 /* WeexSDK_MTL.h in Copy Files */,
+ );
+ name = "Copy Files";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 2A1BE5011C23AB0500F141D6 /* WeexSDK_xcode7.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WeexSDK_xcode7.h; sourceTree = "<group>"; };
+ 2A1BE5031C23AB0500F141D6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 2A1F57B51C75C6A600B58017 /* WXTextInputComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTextInputComponent.h; sourceTree = "<group>"; };
+ 2A1F57B61C75C6A600B58017 /* WXTextInputComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTextInputComponent.m; sourceTree = "<group>"; };
+ 2A27E7D71C3E360B00D7A552 /* SRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SRWebSocket.h; path = dependency/SRWebSocket.h; sourceTree = "<group>"; };
+ 2A27E7D81C3E360B00D7A552 /* SRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SRWebSocket.m; path = dependency/SRWebSocket.m; sourceTree = "<group>"; };
+ 2A42AF851C23B33E00818EA6 /* libWeexSDK_MTL.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWeexSDK_MTL.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 2A42AF871C23B33E00818EA6 /* WeexSDK_MTL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WeexSDK_MTL.h; sourceTree = "<group>"; };
+ 2A42AF891C23B33E00818EA6 /* WeexSDK_MTL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WeexSDK_MTL.m; sourceTree = "<group>"; };
+ 2A4445BE1CA8FD56009E7C6D /* WXTextComponentProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTextComponentProtocol.h; sourceTree = "<group>"; };
+ 2A44AB0F1C1AD5B00067A7EA /* WXSliderComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSliderComponent.h; sourceTree = "<group>"; };
+ 2A60CE9A1C91733E00857B9F /* WXSwitchComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSwitchComponent.h; sourceTree = "<group>"; };
+ 2A60CE9B1C91733E00857B9F /* WXSwitchComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSwitchComponent.m; sourceTree = "<group>"; };
+ 2A837AAC1CD9DE9200AEDF03 /* WXLoadingComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXLoadingComponent.h; sourceTree = "<group>"; };
+ 2A837AAD1CD9DE9200AEDF03 /* WXLoadingComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXLoadingComponent.m; sourceTree = "<group>"; };
+ 2A837AAE1CD9DE9200AEDF03 /* WXLoadingIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXLoadingIndicator.h; sourceTree = "<group>"; };
+ 2A837AAF1CD9DE9200AEDF03 /* WXLoadingIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXLoadingIndicator.m; sourceTree = "<group>"; };
+ 2A837AB01CD9DE9200AEDF03 /* WXRefreshComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXRefreshComponent.h; sourceTree = "<group>"; };
+ 2A837AB11CD9DE9200AEDF03 /* WXRefreshComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXRefreshComponent.m; sourceTree = "<group>"; };
+ 2A8E65881C7C7AA20025C7B7 /* WXVideoComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXVideoComponent.h; sourceTree = "<group>"; };
+ 2A8E65891C7C7AA20025C7B7 /* WXVideoComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXVideoComponent.m; sourceTree = "<group>"; };
+ 2AAFC1B41C48DFF70026D2FE /* WXSDKError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSDKError.h; sourceTree = "<group>"; };
+ 2AAFC1B51C48DFF70026D2FE /* WXSDKError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSDKError.m; sourceTree = "<group>"; };
+ 2AC750221C7565690041D390 /* WXIndicatorComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXIndicatorComponent.h; sourceTree = "<group>"; };
+ 2AC750231C7565690041D390 /* WXIndicatorComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXIndicatorComponent.m; sourceTree = "<group>"; };
+ 2AE5B7501CAB7DBD0082FDDB /* WXAComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAComponent.h; sourceTree = "<group>"; };
+ 2AE5B7511CAB7DBD0082FDDB /* WXAComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXAComponent.m; sourceTree = "<group>"; };
+ 2AE5B7551CABA04E0082FDDB /* WXEventModuleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXEventModuleProtocol.h; sourceTree = "<group>"; };
+ 2AFEB1791C747139000507FA /* WXInstanceWrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXInstanceWrap.h; sourceTree = "<group>"; };
+ 2AFEB17A1C747139000507FA /* WXInstanceWrap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXInstanceWrap.m; sourceTree = "<group>"; };
+ 594C28901CF9E61A009793A4 /* WXAnimationModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXAnimationModule.m; sourceTree = "<group>"; };
+ 594C28911CF9E61A009793A4 /* WXAnimationModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAnimationModule.h; sourceTree = "<group>"; };
+ 59A582D31CF481110081FD3E /* WXAppMonitorProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAppMonitorProtocol.h; sourceTree = "<group>"; };
+ 59A582FA1CF5B17B0081FD3E /* WXBridgeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXBridgeContext.h; sourceTree = "<group>"; };
+ 59A582FB1CF5B17B0081FD3E /* WXBridgeContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXBridgeContext.m; sourceTree = "<group>"; };
+ 59A583041CF5B2FD0081FD3E /* WXNavigationDefaultImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXNavigationDefaultImpl.h; sourceTree = "<group>"; };
+ 59A583051CF5B2FD0081FD3E /* WXNavigationDefaultImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXNavigationDefaultImpl.m; sourceTree = "<group>"; };
+ 59A583061CF5B2FD0081FD3E /* WXNetworkDefaultImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXNetworkDefaultImpl.h; sourceTree = "<group>"; };
+ 59A583071CF5B2FD0081FD3E /* WXNetworkDefaultImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXNetworkDefaultImpl.m; sourceTree = "<group>"; };
+ 59A596171CB630E50012CD52 /* WXNavigationProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXNavigationProtocol.h; sourceTree = "<group>"; };
+ 59A5961A1CB630F10012CD52 /* WXComponent+Navigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WXComponent+Navigation.h"; sourceTree = "<group>"; };
+ 59A5961B1CB630F10012CD52 /* WXComponent+Navigation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WXComponent+Navigation.m"; sourceTree = "<group>"; };
+ 59A5961E1CB6311F0012CD52 /* WXNavigatorModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXNavigatorModule.h; sourceTree = "<group>"; };
+ 59A5961F1CB6311F0012CD52 /* WXNavigatorModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXNavigatorModule.m; sourceTree = "<group>"; };
+ 59A596201CB6311F0012CD52 /* WXStorageModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXStorageModule.h; sourceTree = "<group>"; };
+ 59A596211CB6311F0012CD52 /* WXStorageModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXStorageModule.m; sourceTree = "<group>"; };
+ 59A5962B1CB632050012CD52 /* WXBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXBaseViewController.h; sourceTree = "<group>"; };
+ 59A5962C1CB632050012CD52 /* WXBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXBaseViewController.m; sourceTree = "<group>"; };
+ 59A5962D1CB632050012CD52 /* WXRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXRootViewController.h; sourceTree = "<group>"; };
+ 59A5962E1CB632050012CD52 /* WXRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXRootViewController.m; sourceTree = "<group>"; };
+ 59CE27E61CC387DB000BE37A /* WXEmbedComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXEmbedComponent.h; sourceTree = "<group>"; };
+ 59CE27E71CC387DB000BE37A /* WXEmbedComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXEmbedComponent.m; sourceTree = "<group>"; };
+ 59D3CA3E1CF9ED57008835DC /* Layout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Layout.c; path = Layout/Layout.c; sourceTree = "<group>"; };
+ 59D3CA3F1CF9ED57008835DC /* Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Layout.h; path = Layout/Layout.h; sourceTree = "<group>"; };
+ 59D3CA461CFC3CC0008835DC /* WXSliderComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSliderComponent.m; sourceTree = "<group>"; };
+ 59D3CA481CFC3CE1008835DC /* NSTimer+Weex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+Weex.h"; sourceTree = "<group>"; };
+ 59D3CA491CFC3CE1008835DC /* NSTimer+Weex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+Weex.m"; sourceTree = "<group>"; };
+ 59D3CA671D00544B008835DC /* WeexSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeexSDK.h; sourceTree = "<group>"; };
+ 7408C48C1CFB345D000BCCD0 /* WXComponent+Events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WXComponent+Events.h"; sourceTree = "<group>"; };
+ 7408C48D1CFB345D000BCCD0 /* WXComponent+Events.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WXComponent+Events.m"; sourceTree = "<group>"; };
+ 7410811D1CED585A001BC6E5 /* WXComponentManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXComponentManager.h; sourceTree = "<group>"; };
+ 7410811E1CED585A001BC6E5 /* WXComponentManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXComponentManager.m; sourceTree = "<group>"; };
+ 741081211CED6756001BC6E5 /* WXComponentFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXComponentFactory.h; sourceTree = "<group>"; };
+ 741081221CED6756001BC6E5 /* WXComponentFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXComponentFactory.m; sourceTree = "<group>"; };
+ 741081251CEDB4EC001BC6E5 /* WXComponent_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXComponent_internal.h; sourceTree = "<group>"; };
+ 742389991C3174EB00D748CA /* WXWeakObjectWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXWeakObjectWrapper.h; sourceTree = "<group>"; };
+ 7423899A1C3174EB00D748CA /* WXWeakObjectWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXWeakObjectWrapper.m; sourceTree = "<group>"; };
+ 7423899D1C32733800D748CA /* WXType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXType.h; sourceTree = "<group>"; };
+ 743933B21C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSimulatorShortcutMananger.h; sourceTree = "<group>"; };
+ 743933B31C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSimulatorShortcutMananger.m; sourceTree = "<group>"; };
+ 744BEA531D05178F00452B5D /* WXComponent+Display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WXComponent+Display.h"; sourceTree = "<group>"; };
+ 744BEA541D05178F00452B5D /* WXComponent+Display.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WXComponent+Display.m"; sourceTree = "<group>"; };
+ 744BEA571D0520F300452B5D /* WXComponent+Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "WXComponent+Layout.h"; path = "Layout/WXComponent+Layout.h"; sourceTree = "<group>"; };
+ 744BEA581D0520F300452B5D /* WXComponent+Layout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "WXComponent+Layout.m"; path = "Layout/WXComponent+Layout.m"; sourceTree = "<group>"; };
+ 744BEA5B1D052A4F00452B5D /* WXComponent+ViewManangement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WXComponent+ViewManangement.h"; sourceTree = "<group>"; };
+ 744BEA5C1D052A4F00452B5D /* WXComponent+ViewManangement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WXComponent+ViewManangement.m"; sourceTree = "<group>"; };
+ 745ED2D61C5F2C7E002DB5A8 /* WXView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXView.h; sourceTree = "<group>"; };
+ 745ED2D71C5F2C7E002DB5A8 /* WXView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXView.m; sourceTree = "<group>"; };
+ 7461F88C1CFB373100F62D44 /* WXDisplayQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDisplayQueue.h; sourceTree = "<group>"; };
+ 7461F88D1CFB373100F62D44 /* WXDisplayQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDisplayQueue.m; sourceTree = "<group>"; };
+ 7461F88E1CFB373100F62D44 /* WXLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXLayer.h; sourceTree = "<group>"; };
+ 7461F88F1CFB373100F62D44 /* WXLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXLayer.m; sourceTree = "<group>"; };
+ 7461F8A61CFC33A800F62D44 /* WXThreadSafeMutableArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXThreadSafeMutableArray.h; sourceTree = "<group>"; };
+ 7461F8A71CFC33A800F62D44 /* WXThreadSafeMutableArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXThreadSafeMutableArray.m; sourceTree = "<group>"; };
+ 746319001C60AFC100EFEBD4 /* WXThreadSafeCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXThreadSafeCounter.h; sourceTree = "<group>"; };
+ 746319011C60AFC100EFEBD4 /* WXThreadSafeCounter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXThreadSafeCounter.m; sourceTree = "<group>"; };
+ 746319271C71B92600EFEBD4 /* WXModalUIModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXModalUIModule.h; sourceTree = "<group>"; };
+ 746319281C71B92600EFEBD4 /* WXModalUIModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXModalUIModule.m; sourceTree = "<group>"; };
+ 7469869B1C4DEAC20054A57E /* libicucore.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libicucore.tbd; path = usr/lib/libicucore.tbd; sourceTree = SDKROOT; };
+ 7469869D1C4E2C000054A57E /* NSArray+Weex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Weex.h"; sourceTree = "<group>"; };
+ 7469869E1C4E2C000054A57E /* NSArray+Weex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Weex.m"; sourceTree = "<group>"; };
+ 748B25161C44A6F9005D491E /* WXSDKInstance_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSDKInstance_private.h; sourceTree = "<group>"; };
+ 74915F451C8EB02B00BEBCC0 /* WXAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAssert.h; sourceTree = "<group>"; };
+ 74915F461C8EB02B00BEBCC0 /* WXAssert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXAssert.m; sourceTree = "<group>"; };
+ 74A4BA591CABBBD000195969 /* WXDebugTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDebugTool.h; sourceTree = "<group>"; };
+ 74A4BA5A1CABBBD000195969 /* WXDebugTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDebugTool.m; sourceTree = "<group>"; };
+ 74A4BA841CAD453400195969 /* WXNetworkProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXNetworkProtocol.h; sourceTree = "<group>"; };
+ 74A4BA941CB365D100195969 /* WXAppConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAppConfiguration.h; sourceTree = "<group>"; };
+ 74A4BA951CB365D100195969 /* WXAppConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXAppConfiguration.m; sourceTree = "<group>"; };
+ 74A4BA981CB3BAA100195969 /* WXThreadSafeMutableDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXThreadSafeMutableDictionary.h; sourceTree = "<group>"; };
+ 74A4BA991CB3BAA100195969 /* WXThreadSafeMutableDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXThreadSafeMutableDictionary.m; sourceTree = "<group>"; };
+ 74A4BA9C1CB3C0A100195969 /* WXHandlerFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHandlerFactory.h; sourceTree = "<group>"; };
+ 74A4BA9D1CB3C0A100195969 /* WXHandlerFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHandlerFactory.m; sourceTree = "<group>"; };
+ 74A4BAA41CB4F98300195969 /* WXStreamModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXStreamModule.h; sourceTree = "<group>"; };
+ 74A4BAA51CB4F98300195969 /* WXStreamModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXStreamModule.m; sourceTree = "<group>"; };
+ 74B80E6B1C3FB32C00239FB9 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.js; sourceTree = "<group>"; };
+ 74C27A011CEC441D004E488E /* WeexSDK-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WeexSDK-Prefix.pch"; sourceTree = "<group>"; };
+ 74CC7A1A1C2BC5F800829368 /* WXCellComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXCellComponent.h; sourceTree = "<group>"; };
+ 74CC7A1B1C2BC5F800829368 /* WXCellComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXCellComponent.m; sourceTree = "<group>"; };
+ 74CC7A1E1C2BF9DC00829368 /* WXListComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXListComponent.h; sourceTree = "<group>"; };
+ 74CC7A1F1C2BF9DC00829368 /* WXListComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXListComponent.m; sourceTree = "<group>"; };
+ 74FD6E031C7C0E9600DBEB6D /* WXScrollerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXScrollerProtocol.h; sourceTree = "<group>"; };
+ 775381078098E52B9E1D5612 /* Pods-WeexSDK.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexSDK.release.xcconfig"; path = "Pods/Target Support Files/Pods-WeexSDK/Pods-WeexSDK.release.xcconfig"; sourceTree = "<group>"; };
+ 775BEE4D1C16F993008D1629 /* WXDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDefine.h; sourceTree = "<group>"; };
+ 775BEE6C1C1BD8F4008D1629 /* WXImgLoaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXImgLoaderProtocol.h; sourceTree = "<group>"; };
+ 775BEE701C1BD977008D1629 /* WXModuleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXModuleProtocol.h; sourceTree = "<group>"; };
+ 77D160FD1C02DBE70010B15B /* WeexSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WeexSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 77D161021C02DBE70010B15B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../../Info.plist; sourceTree = "<group>"; };
+ 77D161071C02DBE70010B15B /* WeexSDKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WeexSDKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 77D1610C1C02DBE70010B15B /* WeexSDKTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WeexSDKTests.m; sourceTree = "<group>"; };
+ 77D1610E1C02DBE70010B15B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 77D1611E1C02DDB40010B15B /* WXSDKEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSDKEngine.h; sourceTree = "<group>"; };
+ 77D1611F1C02DDB40010B15B /* WXSDKEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSDKEngine.m; sourceTree = "<group>"; };
+ 77D161221C02DDD10010B15B /* WXSDKInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSDKInstance.h; sourceTree = "<group>"; };
+ 77D161231C02DDD10010B15B /* WXSDKInstance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSDKInstance.m; sourceTree = "<group>"; };
+ 77D161261C02DE1A0010B15B /* WXSDKManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSDKManager.h; sourceTree = "<group>"; };
+ 77D161271C02DE1A0010B15B /* WXSDKManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSDKManager.m; sourceTree = "<group>"; };
+ 77D1612E1C02DE4E0010B15B /* WXComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXComponent.h; path = ../Model/WXComponent.h; sourceTree = "<group>"; };
+ 77D1612F1C02DE4E0010B15B /* WXComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXComponent.m; path = ../Model/WXComponent.m; sourceTree = "<group>"; };
+ 77D161361C02DE940010B15B /* WXBridgeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXBridgeManager.h; sourceTree = "<group>"; };
+ 77D161371C02DE940010B15B /* WXBridgeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXBridgeManager.m; sourceTree = "<group>"; };
+ 77D1613A1C02DEA60010B15B /* WXJSCoreBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXJSCoreBridge.h; sourceTree = "<group>"; };
+ 77D1613B1C02DEA60010B15B /* WXJSCoreBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXJSCoreBridge.m; sourceTree = "<group>"; };
+ 77D1613E1C02DEB50010B15B /* WXWebSocketBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXWebSocketBridge.h; sourceTree = "<group>"; };
+ 77D1613F1C02DEB50010B15B /* WXWebSocketBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXWebSocketBridge.m; sourceTree = "<group>"; };
+ 77D161421C02DEE40010B15B /* WXBridgeProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXBridgeProtocol.h; sourceTree = "<group>"; };
+ 77D161491C02E3790010B15B /* WXConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXConvert.h; sourceTree = "<group>"; };
+ 77D1614A1C02E3790010B15B /* WXConvert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXConvert.m; sourceTree = "<group>"; };
+ 77D1614D1C02E3880010B15B /* WXUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXUtility.h; sourceTree = "<group>"; };
+ 77D1614E1C02E3880010B15B /* WXUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXUtility.m; sourceTree = "<group>"; };
+ 77D161601C02ED790010B15B /* WXLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXLog.h; sourceTree = "<group>"; };
+ 77D161611C02ED790010B15B /* WXLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXLog.m; sourceTree = "<group>"; };
+ 77E659D81C07F594008B8775 /* WXDomModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDomModule.h; sourceTree = "<group>"; };
+ 77E659D91C07F594008B8775 /* WXDomModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDomModule.m; sourceTree = "<group>"; };
+ 77E659EF1C0C3612008B8775 /* WXModuleFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXModuleFactory.h; sourceTree = "<group>"; };
+ 77E659F01C0C3612008B8775 /* WXModuleFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXModuleFactory.m; sourceTree = "<group>"; };
+ 77E659F81C0EE579008B8775 /* WXBridgeMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXBridgeMethod.h; sourceTree = "<group>"; };
+ 77E659F91C0EE579008B8775 /* WXBridgeMethod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXBridgeMethod.m; sourceTree = "<group>"; };
+ 77E65A041C10507B008B8775 /* WXModuleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXModuleManager.h; sourceTree = "<group>"; };
+ 77E65A051C10507B008B8775 /* WXModuleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXModuleManager.m; sourceTree = "<group>"; };
+ 77E65A081C119CC1008B8775 /* weex-test.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "weex-test.js"; sourceTree = "<group>"; };
+ 77E65A0B1C155E99008B8775 /* WXDivComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDivComponent.h; sourceTree = "<group>"; };
+ 77E65A0C1C155E99008B8775 /* WXDivComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDivComponent.m; sourceTree = "<group>"; };
+ 77E65A0F1C155EA8008B8775 /* WXImageComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXImageComponent.h; sourceTree = "<group>"; };
+ 77E65A101C155EA8008B8775 /* WXImageComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXImageComponent.m; sourceTree = "<group>"; };
+ 77E65A131C155EB5008B8775 /* WXTextComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTextComponent.h; sourceTree = "<group>"; };
+ 77E65A141C155EB5008B8775 /* WXTextComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTextComponent.m; sourceTree = "<group>"; };
+ 77E65A171C155F25008B8775 /* WXScrollerComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXScrollerComponent.h; sourceTree = "<group>"; };
+ 77E65A181C155F25008B8775 /* WXScrollerComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXScrollerComponent.m; sourceTree = "<group>"; };
+ 77E65A1C1C156268008B8775 /* WeexENVTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeexENVTests.m; sourceTree = "<group>"; };
+ 77E65A1E1C156460008B8775 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
+ 77E65A211C158139008B8775 /* test.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = test.js; sourceTree = "<group>"; };
+ 887889C6DF75CD0525C74F87 /* Pods-WeexSDK.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexSDK.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WeexSDK/Pods-WeexSDK.debug.xcconfig"; sourceTree = "<group>"; };
+ D312CE391C730DEB00046D68 /* WXWebComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXWebComponent.h; sourceTree = "<group>"; };
+ D312CE3A1C730DEB00046D68 /* WXWebComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXWebComponent.m; sourceTree = "<group>"; };
+ D317338A1C57257000BB7539 /* WXTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTransform.h; sourceTree = "<group>"; };
+ D317338B1C57257000BB7539 /* WXTransform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTransform.m; sourceTree = "<group>"; };
+ D362F94D1C83EDA20003F546 /* WXWebViewModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXWebViewModule.h; sourceTree = "<group>"; };
+ D362F94E1C83EDA20003F546 /* WXWebViewModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXWebViewModule.m; sourceTree = "<group>"; };
+ D3FC0DF51C508B2A002B9E31 /* WXTimerModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTimerModule.h; sourceTree = "<group>"; };
+ D3FC0DF61C508B2A002B9E31 /* WXTimerModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTimerModule.m; sourceTree = "<group>"; };
+ DAB176F008F516E4F9391C61 /* libPods-WeexSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WeexSDK.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 2A42AF821C23B33E00818EA6 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 77D160F91C02DBE70010B15B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 77D161041C02DBE70010B15B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7469869C1C4DEAC20054A57E /* libicucore.tbd in Frameworks */,
+ 77E65A1F1C156460008B8775 /* JavaScriptCore.framework in Frameworks */,
+ 77D161081C02DBE70010B15B /* WeexSDK.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 2A1BE5001C23AB0500F141D6 /* WeexSDK_xcode7 */ = {
+ isa = PBXGroup;
+ children = (
+ 2A1BE5011C23AB0500F141D6 /* WeexSDK_xcode7.h */,
+ 2A1BE5031C23AB0500F141D6 /* Info.plist */,
+ );
+ path = WeexSDK_xcode7;
+ sourceTree = "<group>";
+ };
+ 2A27E7D61C3E360400D7A552 /* dependency */ = {
+ isa = PBXGroup;
+ children = (
+ 2A27E7D71C3E360B00D7A552 /* SRWebSocket.h */,
+ 2A27E7D81C3E360B00D7A552 /* SRWebSocket.m */,
+ );
+ name = dependency;
+ sourceTree = "<group>";
+ };
+ 2A42AF861C23B33E00818EA6 /* WeexSDK_MTL */ = {
+ isa = PBXGroup;
+ children = (
+ 2A42AF871C23B33E00818EA6 /* WeexSDK_MTL.h */,
+ 2A42AF891C23B33E00818EA6 /* WeexSDK_MTL.m */,
+ );
+ path = WeexSDK_MTL;
+ sourceTree = "<group>";
+ };
+ 2AF626C61C191E2200E71A38 /* Layout */ = {
+ isa = PBXGroup;
+ children = (
+ 59D3CA3E1CF9ED57008835DC /* Layout.c */,
+ 59D3CA3F1CF9ED57008835DC /* Layout.h */,
+ 744BEA571D0520F300452B5D /* WXComponent+Layout.h */,
+ 744BEA581D0520F300452B5D /* WXComponent+Layout.m */,
+ );
+ name = Layout;
+ sourceTree = "<group>";
+ };
+ 59A583031CF5B2FD0081FD3E /* Handler */ = {
+ isa = PBXGroup;
+ children = (
+ 59A583041CF5B2FD0081FD3E /* WXNavigationDefaultImpl.h */,
+ 59A583051CF5B2FD0081FD3E /* WXNavigationDefaultImpl.m */,
+ 59A583061CF5B2FD0081FD3E /* WXNetworkDefaultImpl.h */,
+ 59A583071CF5B2FD0081FD3E /* WXNetworkDefaultImpl.m */,
+ );
+ path = Handler;
+ sourceTree = "<group>";
+ };
+ 59A5962A1CB632050012CD52 /* Controller */ = {
+ isa = PBXGroup;
+ children = (
+ 59A5962B1CB632050012CD52 /* WXBaseViewController.h */,
+ 59A5962C1CB632050012CD52 /* WXBaseViewController.m */,
+ 59A5962D1CB632050012CD52 /* WXRootViewController.h */,
+ 59A5962E1CB632050012CD52 /* WXRootViewController.m */,
+ );
+ path = Controller;
+ sourceTree = "<group>";
+ };
+ 7408C48B1CFB345D000BCCD0 /* Events */ = {
+ isa = PBXGroup;
+ children = (
+ 7408C48C1CFB345D000BCCD0 /* WXComponent+Events.h */,
+ 7408C48D1CFB345D000BCCD0 /* WXComponent+Events.m */,
+ );
+ path = Events;
+ sourceTree = "<group>";
+ };
+ 745ED2D31C5F2C7E002DB5A8 /* View */ = {
+ isa = PBXGroup;
+ children = (
+ 745ED2D61C5F2C7E002DB5A8 /* WXView.h */,
+ 745ED2D71C5F2C7E002DB5A8 /* WXView.m */,
+ 744BEA5B1D052A4F00452B5D /* WXComponent+ViewManangement.h */,
+ 744BEA5C1D052A4F00452B5D /* WXComponent+ViewManangement.m */,
+ );
+ path = View;
+ sourceTree = "<group>";
+ };
+ 7461F88B1CFB373100F62D44 /* Display */ = {
+ isa = PBXGroup;
+ children = (
+ 7461F88C1CFB373100F62D44 /* WXDisplayQueue.h */,
+ 7461F88D1CFB373100F62D44 /* WXDisplayQueue.m */,
+ 7461F88E1CFB373100F62D44 /* WXLayer.h */,
+ 7461F88F1CFB373100F62D44 /* WXLayer.m */,
+ 744BEA531D05178F00452B5D /* WXComponent+Display.h */,
+ 744BEA541D05178F00452B5D /* WXComponent+Display.m */,
+ );
+ path = Display;
+ sourceTree = "<group>";
+ };
+ 74A4BA581CABBBA300195969 /* Debug */ = {
+ isa = PBXGroup;
+ children = (
+ 74A4BA591CABBBD000195969 /* WXDebugTool.h */,
+ 74A4BA5A1CABBBD000195969 /* WXDebugTool.m */,
+ );
+ path = Debug;
+ sourceTree = "<group>";
+ };
+ 74C27A001CEC4371004E488E /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 77D161021C02DBE70010B15B /* Info.plist */,
+ 74C27A011CEC441D004E488E /* WeexSDK-Prefix.pch */,
+ );
+ path = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 77D160F31C02DBE70010B15B = {
+ isa = PBXGroup;
+ children = (
+ 77D160FF1C02DBE70010B15B /* WeexSDK */,
+ 77D1610B1C02DBE70010B15B /* WeexSDKTests */,
+ 2A1BE5001C23AB0500F141D6 /* WeexSDK_xcode7 */,
+ 2A42AF861C23B33E00818EA6 /* WeexSDK_MTL */,
+ 77D160FE1C02DBE70010B15B /* Products */,
+ 9F5C4B2D523F51D4F2D3491E /* Pods */,
+ A5818E244F9E235722E3B938 /* Frameworks */,
+ );
+ sourceTree = "<group>";
+ };
+ 77D160FE1C02DBE70010B15B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 77D160FD1C02DBE70010B15B /* WeexSDK.framework */,
+ 77D161071C02DBE70010B15B /* WeexSDKTests.xctest */,
+ 2A42AF851C23B33E00818EA6 /* libWeexSDK_MTL.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 77D160FF1C02DBE70010B15B /* WeexSDK */ = {
+ isa = PBXGroup;
+ children = (
+ 2A27E7D61C3E360400D7A552 /* dependency */,
+ 77D161171C02DCB90010B15B /* Resources */,
+ 77D161181C02DCB90010B15B /* Sources */,
+ );
+ path = WeexSDK;
+ sourceTree = "<group>";
+ };
+ 77D1610B1C02DBE70010B15B /* WeexSDKTests */ = {
+ isa = PBXGroup;
+ children = (
+ 77E65A1E1C156460008B8775 /* JavaScriptCore.framework */,
+ 77D1610C1C02DBE70010B15B /* WeexSDKTests.m */,
+ 77E65A1C1C156268008B8775 /* WeexENVTests.m */,
+ 77D1610E1C02DBE70010B15B /* Info.plist */,
+ 77E65A081C119CC1008B8775 /* weex-test.js */,
+ 77E65A211C158139008B8775 /* test.js */,
+ );
+ path = WeexSDKTests;
+ sourceTree = "<group>";
+ };
+ 77D161171C02DCB90010B15B /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 74B80E6B1C3FB32C00239FB9 /* main.js */,
+ );
+ path = Resources;
+ sourceTree = "<group>";
+ };
+ 77D161181C02DCB90010B15B /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 59D3CA671D00544B008835DC /* WeexSDK.h */,
+ 2AF626C61C191E2200E71A38 /* Layout */,
+ 7408C48B1CFB345D000BCCD0 /* Events */,
+ 7461F88B1CFB373100F62D44 /* Display */,
+ 74A4BA581CABBBA300195969 /* Debug */,
+ 745ED2D31C5F2C7E002DB5A8 /* View */,
+ 59A5962A1CB632050012CD52 /* Controller */,
+ 77E65A0A1C155E6E008B8775 /* Component */,
+ 59A583031CF5B2FD0081FD3E /* Handler */,
+ 77E659D71C07F585008B8775 /* Module */,
+ 77D161481C02E3670010B15B /* Utility */,
+ 77D1611D1C02DDA40010B15B /* Engine */,
+ 77D161191C02DD3C0010B15B /* Bridge */,
+ 77D1611A1C02DD3C0010B15B /* Manager */,
+ 77D1611B1C02DD3C0010B15B /* Model */,
+ 77D1611C1C02DD3C0010B15B /* Protocol */,
+ 74C27A001CEC4371004E488E /* Supporting Files */,
+ );
+ path = Sources;
+ sourceTree = "<group>";
+ };
+ 77D161191C02DD3C0010B15B /* Bridge */ = {
+ isa = PBXGroup;
+ children = (
+ 59A582FA1CF5B17B0081FD3E /* WXBridgeContext.h */,
+ 59A582FB1CF5B17B0081FD3E /* WXBridgeContext.m */,
+ 77D1613A1C02DEA60010B15B /* WXJSCoreBridge.h */,
+ 77D1613B1C02DEA60010B15B /* WXJSCoreBridge.m */,
+ 77D1613E1C02DEB50010B15B /* WXWebSocketBridge.h */,
+ 77D1613F1C02DEB50010B15B /* WXWebSocketBridge.m */,
+ );
+ path = Bridge;
+ sourceTree = "<group>";
+ };
+ 77D1611A1C02DD3C0010B15B /* Manager */ = {
+ isa = PBXGroup;
+ children = (
+ 77D161261C02DE1A0010B15B /* WXSDKManager.h */,
+ 77D161271C02DE1A0010B15B /* WXSDKManager.m */,
+ 77D161361C02DE940010B15B /* WXBridgeManager.h */,
+ 77D161371C02DE940010B15B /* WXBridgeManager.m */,
+ 77E65A041C10507B008B8775 /* WXModuleManager.h */,
+ 77E65A051C10507B008B8775 /* WXModuleManager.m */,
+ 77E659EF1C0C3612008B8775 /* WXModuleFactory.h */,
+ 77E659F01C0C3612008B8775 /* WXModuleFactory.m */,
+ 74A4BA9C1CB3C0A100195969 /* WXHandlerFactory.h */,
+ 74A4BA9D1CB3C0A100195969 /* WXHandlerFactory.m */,
+ 7410811D1CED585A001BC6E5 /* WXComponentManager.h */,
+ 7410811E1CED585A001BC6E5 /* WXComponentManager.m */,
+ 741081211CED6756001BC6E5 /* WXComponentFactory.h */,
+ 741081221CED6756001BC6E5 /* WXComponentFactory.m */,
+ );
+ path = Manager;
+ sourceTree = "<group>";
+ };
+ 77D1611B1C02DD3C0010B15B /* Model */ = {
+ isa = PBXGroup;
+ children = (
+ 59A5961A1CB630F10012CD52 /* WXComponent+Navigation.h */,
+ 59A5961B1CB630F10012CD52 /* WXComponent+Navigation.m */,
+ 748B25161C44A6F9005D491E /* WXSDKInstance_private.h */,
+ 77D161221C02DDD10010B15B /* WXSDKInstance.h */,
+ 77D161231C02DDD10010B15B /* WXSDKInstance.m */,
+ 77E659F81C0EE579008B8775 /* WXBridgeMethod.h */,
+ 77E659F91C0EE579008B8775 /* WXBridgeMethod.m */,
+ );
+ path = Model;
+ sourceTree = "<group>";
+ };
+ 77D1611C1C02DD3C0010B15B /* Protocol */ = {
+ isa = PBXGroup;
+ children = (
+ 59A596171CB630E50012CD52 /* WXNavigationProtocol.h */,
+ 2AE5B7551CABA04E0082FDDB /* WXEventModuleProtocol.h */,
+ 2A4445BE1CA8FD56009E7C6D /* WXTextComponentProtocol.h */,
+ 775BEE701C1BD977008D1629 /* WXModuleProtocol.h */,
+ 77D161421C02DEE40010B15B /* WXBridgeProtocol.h */,
+ 775BEE6C1C1BD8F4008D1629 /* WXImgLoaderProtocol.h */,
+ 74FD6E031C7C0E9600DBEB6D /* WXScrollerProtocol.h */,
+ 74A4BA841CAD453400195969 /* WXNetworkProtocol.h */,
+ 59A582D31CF481110081FD3E /* WXAppMonitorProtocol.h */,
+ );
+ path = Protocol;
+ sourceTree = "<group>";
+ };
+ 77D1611D1C02DDA40010B15B /* Engine */ = {
+ isa = PBXGroup;
+ children = (
+ 77D1611E1C02DDB40010B15B /* WXSDKEngine.h */,
+ 77D1611F1C02DDB40010B15B /* WXSDKEngine.m */,
+ 2AAFC1B41C48DFF70026D2FE /* WXSDKError.h */,
+ 2AAFC1B51C48DFF70026D2FE /* WXSDKError.m */,
+ );
+ path = Engine;
+ sourceTree = "<group>";
+ };
+ 77D161481C02E3670010B15B /* Utility */ = {
+ isa = PBXGroup;
+ children = (
+ 59D3CA481CFC3CE1008835DC /* NSTimer+Weex.h */,
+ 59D3CA491CFC3CE1008835DC /* NSTimer+Weex.m */,
+ 77D161491C02E3790010B15B /* WXConvert.h */,
+ 77D1614A1C02E3790010B15B /* WXConvert.m */,
+ 77D1614D1C02E3880010B15B /* WXUtility.h */,
+ 77D1614E1C02E3880010B15B /* WXUtility.m */,
+ 77D161601C02ED790010B15B /* WXLog.h */,
+ 77D161611C02ED790010B15B /* WXLog.m */,
+ 775BEE4D1C16F993008D1629 /* WXDefine.h */,
+ 742389991C3174EB00D748CA /* WXWeakObjectWrapper.h */,
+ 7423899A1C3174EB00D748CA /* WXWeakObjectWrapper.m */,
+ 7423899D1C32733800D748CA /* WXType.h */,
+ 7469869D1C4E2C000054A57E /* NSArray+Weex.h */,
+ 7469869E1C4E2C000054A57E /* NSArray+Weex.m */,
+ 746319001C60AFC100EFEBD4 /* WXThreadSafeCounter.h */,
+ 746319011C60AFC100EFEBD4 /* WXThreadSafeCounter.m */,
+ 743933B21C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.h */,
+ 743933B31C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.m */,
+ 74915F451C8EB02B00BEBCC0 /* WXAssert.h */,
+ 74915F461C8EB02B00BEBCC0 /* WXAssert.m */,
+ 74A4BA941CB365D100195969 /* WXAppConfiguration.h */,
+ 74A4BA951CB365D100195969 /* WXAppConfiguration.m */,
+ 74A4BA981CB3BAA100195969 /* WXThreadSafeMutableDictionary.h */,
+ 74A4BA991CB3BAA100195969 /* WXThreadSafeMutableDictionary.m */,
+ 7461F8A61CFC33A800F62D44 /* WXThreadSafeMutableArray.h */,
+ 7461F8A71CFC33A800F62D44 /* WXThreadSafeMutableArray.m */,
+ );
+ path = Utility;
+ sourceTree = "<group>";
+ };
+ 77E659D71C07F585008B8775 /* Module */ = {
+ isa = PBXGroup;
+ children = (
+ 59A5961E1CB6311F0012CD52 /* WXNavigatorModule.h */,
+ 59A5961F1CB6311F0012CD52 /* WXNavigatorModule.m */,
+ 59A596201CB6311F0012CD52 /* WXStorageModule.h */,
+ 59A596211CB6311F0012CD52 /* WXStorageModule.m */,
+ 74A4BAA41CB4F98300195969 /* WXStreamModule.h */,
+ 74A4BAA51CB4F98300195969 /* WXStreamModule.m */,
+ 594C28911CF9E61A009793A4 /* WXAnimationModule.h */,
+ 594C28901CF9E61A009793A4 /* WXAnimationModule.m */,
+ 2AFEB1791C747139000507FA /* WXInstanceWrap.h */,
+ 2AFEB17A1C747139000507FA /* WXInstanceWrap.m */,
+ 77E659D81C07F594008B8775 /* WXDomModule.h */,
+ 77E659D91C07F594008B8775 /* WXDomModule.m */,
+ D3FC0DF51C508B2A002B9E31 /* WXTimerModule.h */,
+ D3FC0DF61C508B2A002B9E31 /* WXTimerModule.m */,
+ 746319271C71B92600EFEBD4 /* WXModalUIModule.h */,
+ 746319281C71B92600EFEBD4 /* WXModalUIModule.m */,
+ D362F94D1C83EDA20003F546 /* WXWebViewModule.h */,
+ D362F94E1C83EDA20003F546 /* WXWebViewModule.m */,
+ );
+ path = Module;
+ sourceTree = "<group>";
+ };
+ 77E65A0A1C155E6E008B8775 /* Component */ = {
+ isa = PBXGroup;
+ children = (
+ 2A837AAC1CD9DE9200AEDF03 /* WXLoadingComponent.h */,
+ 2A837AAD1CD9DE9200AEDF03 /* WXLoadingComponent.m */,
+ 2A837AAE1CD9DE9200AEDF03 /* WXLoadingIndicator.h */,
+ 2A837AAF1CD9DE9200AEDF03 /* WXLoadingIndicator.m */,
+ 2A837AB01CD9DE9200AEDF03 /* WXRefreshComponent.h */,
+ 2A837AB11CD9DE9200AEDF03 /* WXRefreshComponent.m */,
+ 59CE27E61CC387DB000BE37A /* WXEmbedComponent.h */,
+ 59CE27E71CC387DB000BE37A /* WXEmbedComponent.m */,
+ 2A8E65881C7C7AA20025C7B7 /* WXVideoComponent.h */,
+ 2A8E65891C7C7AA20025C7B7 /* WXVideoComponent.m */,
+ 77D1612E1C02DE4E0010B15B /* WXComponent.h */,
+ 77D1612F1C02DE4E0010B15B /* WXComponent.m */,
+ 77E65A0B1C155E99008B8775 /* WXDivComponent.h */,
+ 77E65A0C1C155E99008B8775 /* WXDivComponent.m */,
+ 77E65A0F1C155EA8008B8775 /* WXImageComponent.h */,
+ 77E65A101C155EA8008B8775 /* WXImageComponent.m */,
+ 77E65A131C155EB5008B8775 /* WXTextComponent.h */,
+ 77E65A141C155EB5008B8775 /* WXTextComponent.m */,
+ 77E65A171C155F25008B8775 /* WXScrollerComponent.h */,
+ 77E65A181C155F25008B8775 /* WXScrollerComponent.m */,
+ 2A44AB0F1C1AD5B00067A7EA /* WXSliderComponent.h */,
+ 59D3CA461CFC3CC0008835DC /* WXSliderComponent.m */,
+ 74CC7A1A1C2BC5F800829368 /* WXCellComponent.h */,
+ 74CC7A1B1C2BC5F800829368 /* WXCellComponent.m */,
+ 74CC7A1E1C2BF9DC00829368 /* WXListComponent.h */,
+ 74CC7A1F1C2BF9DC00829368 /* WXListComponent.m */,
+ 2AC750221C7565690041D390 /* WXIndicatorComponent.h */,
+ 2AC750231C7565690041D390 /* WXIndicatorComponent.m */,
+ 2A1F57B51C75C6A600B58017 /* WXTextInputComponent.h */,
+ 2A1F57B61C75C6A600B58017 /* WXTextInputComponent.m */,
+ D317338A1C57257000BB7539 /* WXTransform.h */,
+ D317338B1C57257000BB7539 /* WXTransform.m */,
+ D312CE391C730DEB00046D68 /* WXWebComponent.h */,
+ D312CE3A1C730DEB00046D68 /* WXWebComponent.m */,
+ 2A60CE9A1C91733E00857B9F /* WXSwitchComponent.h */,
+ 2A60CE9B1C91733E00857B9F /* WXSwitchComponent.m */,
+ 2AE5B7501CAB7DBD0082FDDB /* WXAComponent.h */,
+ 2AE5B7511CAB7DBD0082FDDB /* WXAComponent.m */,
+ 741081251CEDB4EC001BC6E5 /* WXComponent_internal.h */,
+ );
+ path = Component;
+ sourceTree = "<group>";
+ };
+ 9F5C4B2D523F51D4F2D3491E /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 887889C6DF75CD0525C74F87 /* Pods-WeexSDK.debug.xcconfig */,
+ 775381078098E52B9E1D5612 /* Pods-WeexSDK.release.xcconfig */,
+ );
+ name = Pods;
+ sourceTree = "<group>";
+ };
+ A5818E244F9E235722E3B938 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 7469869B1C4DEAC20054A57E /* libicucore.tbd */,
+ DAB176F008F516E4F9391C61 /* libPods-WeexSDK.a */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 77D160FA1C02DBE70010B15B /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7408C48E1CFB345D000BCCD0 /* WXComponent+Events.h in Headers */,
+ 775BEE711C1BD977008D1629 /* WXModuleProtocol.h in Headers */,
+ 7469869F1C4E2C000054A57E /* NSArray+Weex.h in Headers */,
+ 74CC7A201C2BF9DC00829368 /* WXListComponent.h in Headers */,
+ 74FD6E041C7C0E9600DBEB6D /* WXScrollerProtocol.h in Headers */,
+ 77D161201C02DDB40010B15B /* WXSDKEngine.h in Headers */,
+ 745ED2DA1C5F2C7E002DB5A8 /* WXView.h in Headers */,
+ 59D3CA411CF9ED57008835DC /* Layout.h in Headers */,
+ 2AE5B7521CAB7DBD0082FDDB /* WXAComponent.h in Headers */,
+ 77D1614F1C02E3880010B15B /* WXUtility.h in Headers */,
+ 743933B41C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.h in Headers */,
+ 74915F471C8EB02B00BEBCC0 /* WXAssert.h in Headers */,
+ 2A8E658A1C7C7AA20025C7B7 /* WXVideoComponent.h in Headers */,
+ 59A5961C1CB630F10012CD52 /* WXComponent+Navigation.h in Headers */,
+ 775BEE6E1C1BD8F4008D1629 /* WXImgLoaderProtocol.h in Headers */,
+ 7410811F1CED585A001BC6E5 /* WXComponentManager.h in Headers */,
+ 59A583081CF5B2FD0081FD3E /* WXNavigationDefaultImpl.h in Headers */,
+ 775BEE4E1C16F993008D1629 /* WXDefine.h in Headers */,
+ 77D161241C02DDD10010B15B /* WXSDKInstance.h in Headers */,
+ 74A4BAA61CB4F98300195969 /* WXStreamModule.h in Headers */,
+ 744BEA591D0520F300452B5D /* WXComponent+Layout.h in Headers */,
+ 74A4BA5B1CABBBD000195969 /* WXDebugTool.h in Headers */,
+ 2A837AB41CD9DE9200AEDF03 /* WXLoadingIndicator.h in Headers */,
+ 77E65A061C10507B008B8775 /* WXModuleManager.h in Headers */,
+ 77E659FA1C0EE579008B8775 /* WXBridgeMethod.h in Headers */,
+ 744BEA5D1D052A4F00452B5D /* WXComponent+ViewManangement.h in Headers */,
+ 2AE5B7561CABA04E0082FDDB /* WXEventModuleProtocol.h in Headers */,
+ D362F94F1C83EDA20003F546 /* WXWebViewModule.h in Headers */,
+ 77D161381C02DE940010B15B /* WXBridgeManager.h in Headers */,
+ 77D161281C02DE1A0010B15B /* WXSDKManager.h in Headers */,
+ 59D3CA681D00544B008835DC /* WeexSDK.h in Headers */,
+ 59CE27E81CC387DB000BE37A /* WXEmbedComponent.h in Headers */,
+ 2A837AB21CD9DE9200AEDF03 /* WXLoadingComponent.h in Headers */,
+ 7423899F1C32733800D748CA /* WXType.h in Headers */,
+ 59A582FC1CF5B17B0081FD3E /* WXBridgeContext.h in Headers */,
+ 77D161621C02ED790010B15B /* WXLog.h in Headers */,
+ 77D1614B1C02E3790010B15B /* WXConvert.h in Headers */,
+ 59A596221CB6311F0012CD52 /* WXNavigatorModule.h in Headers */,
+ 77E659DA1C07F594008B8775 /* WXDomModule.h in Headers */,
+ 2A1F57B71C75C6A600B58017 /* WXTextInputComponent.h in Headers */,
+ 74A4BA9A1CB3BAA100195969 /* WXThreadSafeMutableDictionary.h in Headers */,
+ 74A4BA9E1CB3C0A100195969 /* WXHandlerFactory.h in Headers */,
+ 7423899B1C3174EB00D748CA /* WXWeakObjectWrapper.h in Headers */,
+ 59A596191CB630E50012CD52 /* WXNavigationProtocol.h in Headers */,
+ 59A5962F1CB632050012CD52 /* WXBaseViewController.h in Headers */,
+ 74A4BA961CB365D100195969 /* WXAppConfiguration.h in Headers */,
+ 7461F8921CFB373100F62D44 /* WXLayer.h in Headers */,
+ 594C28931CF9E61A009793A4 /* WXAnimationModule.h in Headers */,
+ D3FC0DF71C508B2A002B9E31 /* WXTimerModule.h in Headers */,
+ D312CE3B1C730DEB00046D68 /* WXWebComponent.h in Headers */,
+ 741081261CEDB4EC001BC6E5 /* WXComponent_internal.h in Headers */,
+ 77E65A191C155F25008B8775 /* WXScrollerComponent.h in Headers */,
+ 2AC750241C7565690041D390 /* WXIndicatorComponent.h in Headers */,
+ 748B25181C44A6F9005D491E /* WXSDKInstance_private.h in Headers */,
+ 77E65A0D1C155E99008B8775 /* WXDivComponent.h in Headers */,
+ 7461F8901CFB373100F62D44 /* WXDisplayQueue.h in Headers */,
+ 77E659F11C0C3612008B8775 /* WXModuleFactory.h in Headers */,
+ 77D161431C02DEE40010B15B /* WXBridgeProtocol.h in Headers */,
+ 59A582D41CF481110081FD3E /* WXAppMonitorProtocol.h in Headers */,
+ 2A44AB111C1AD5B00067A7EA /* WXSliderComponent.h in Headers */,
+ 2A837AB61CD9DE9200AEDF03 /* WXRefreshComponent.h in Headers */,
+ 59A596311CB632050012CD52 /* WXRootViewController.h in Headers */,
+ 77E65A151C155EB5008B8775 /* WXTextComponent.h in Headers */,
+ 74CC7A1C1C2BC5F800829368 /* WXCellComponent.h in Headers */,
+ 59A596241CB6311F0012CD52 /* WXStorageModule.h in Headers */,
+ 74A4BA851CAD453400195969 /* WXNetworkProtocol.h in Headers */,
+ 7461F8A81CFC33A800F62D44 /* WXThreadSafeMutableArray.h in Headers */,
+ 77E65A111C155EA8008B8775 /* WXImageComponent.h in Headers */,
+ 2A60CE9C1C91733E00857B9F /* WXSwitchComponent.h in Headers */,
+ 2A4445BF1CA8FD56009E7C6D /* WXTextComponentProtocol.h in Headers */,
+ 746319021C60AFC100EFEBD4 /* WXThreadSafeCounter.h in Headers */,
+ 77D1613C1C02DEA60010B15B /* WXJSCoreBridge.h in Headers */,
+ 59A5830A1CF5B2FD0081FD3E /* WXNetworkDefaultImpl.h in Headers */,
+ 77D161401C02DEB50010B15B /* WXWebSocketBridge.h in Headers */,
+ 2AAFC1B61C48DFF70026D2FE /* WXSDKError.h in Headers */,
+ D317338C1C57257000BB7539 /* WXTransform.h in Headers */,
+ 77D161301C02DE4E0010B15B /* WXComponent.h in Headers */,
+ 2AFEB17B1C747139000507FA /* WXInstanceWrap.h in Headers */,
+ 744BEA551D05178F00452B5D /* WXComponent+Display.h in Headers */,
+ 741081231CED6756001BC6E5 /* WXComponentFactory.h in Headers */,
+ 59D3CA4A1CFC3CE1008835DC /* NSTimer+Weex.h in Headers */,
+ 746319291C71B92600EFEBD4 /* WXModalUIModule.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 2A42AF841C23B33E00818EA6 /* WeexSDK_MTL */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 2A42AF8B1C23B33E00818EA6 /* Build configuration list for PBXNativeTarget "WeexSDK_MTL" */;
+ buildPhases = (
+ 2A42AF811C23B33E00818EA6 /* Sources */,
+ 2A42AF821C23B33E00818EA6 /* Frameworks */,
+ 2A42AF831C23B33E00818EA6 /* Copy Files */,
+ 2A42AF8E1C23B35900818EA6 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = WeexSDK_MTL;
+ productName = WeexSDK_MTL;
+ productReference = 2A42AF851C23B33E00818EA6 /* libWeexSDK_MTL.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 77D160FC1C02DBE70010B15B /* WeexSDK */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 77D161111C02DBE70010B15B /* Build configuration list for PBXNativeTarget "WeexSDK" */;
+ buildPhases = (
+ 59D3CA601D003832008835DC /* Generate WeexSDK.h */,
+ 77D160F81C02DBE70010B15B /* Sources */,
+ 77D160F91C02DBE70010B15B /* Frameworks */,
+ 77D160FA1C02DBE70010B15B /* Headers */,
+ 77D160FB1C02DBE70010B15B /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = WeexSDK;
+ productName = WeexSDK;
+ productReference = 77D160FD1C02DBE70010B15B /* WeexSDK.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+ 77D161061C02DBE70010B15B /* WeexSDKTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 77D161141C02DBE70010B15B /* Build configuration list for PBXNativeTarget "WeexSDKTests" */;
+ buildPhases = (
+ 77D161031C02DBE70010B15B /* Sources */,
+ 77D161041C02DBE70010B15B /* Frameworks */,
+ 77D161051C02DBE70010B15B /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 77D1610A1C02DBE70010B15B /* PBXTargetDependency */,
+ );
+ name = WeexSDKTests;
+ productName = WeexSDKTests;
+ productReference = 77D161071C02DBE70010B15B /* WeexSDKTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 77D160F41C02DBE70010B15B /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0720;
+ ORGANIZATIONNAME = taobao;
+ TargetAttributes = {
+ 2A42AF841C23B33E00818EA6 = {
+ CreatedOnToolsVersion = 7.1.1;
+ };
+ 77D160FC1C02DBE70010B15B = {
+ CreatedOnToolsVersion = 7.1.1;
+ };
+ 77D161061C02DBE70010B15B = {
+ CreatedOnToolsVersion = 7.1.1;
+ };
+ };
+ };
+ buildConfigurationList = 77D160F71C02DBE70010B15B /* Build configuration list for PBXProject "WeexSDK" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 77D160F31C02DBE70010B15B;
+ productRefGroup = 77D160FE1C02DBE70010B15B /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 77D160FC1C02DBE70010B15B /* WeexSDK */,
+ 77D161061C02DBE70010B15B /* WeexSDKTests */,
+ 2A42AF841C23B33E00818EA6 /* WeexSDK_MTL */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 77D160FB1C02DBE70010B15B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 74B80E6C1C3FB32C00239FB9 /* main.js in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 77D161051C02DBE70010B15B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 77E65A221C158139008B8775 /* test.js in Resources */,
+ 77E65A201C156846008B8775 /* weex-test.js in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 2A42AF8E1C23B35900818EA6 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Sets the target folders and the final framework product.\n# \u5982\u679c\u5de5\u7a0b\u540d\u79f0\u548cFramework\u7684Target\u540d\u79f0\u4e0d\u4e00\u6837\u7684\u8bdd\uff0c\u8981\u81ea\u5b9a\u4e49FMKNAME\nFMK_NAME=${PROJECT_NAME}\n# Install dir will be the final output to the framework.\n# The following line create it in the root folder of the current project.\nINSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework\n# Working dir will be deleted after the framework creation.\nWRK_DIR=build\nDEVICE_DIR=${WRK_DIR}/Release-iphoneos/${FMK_NAME}.framework\nSIMULATOR_DIR=${WRK_DIR}/Release-iphonesimulator/${FMK_NAME}.framework\n# -configuration ${CONFIGURATION}\n# Clean and Building both architectures.\necho xcodebuild -configuration \"Release\" -target \"${FMK_NAME}\" -sdk iphoneos \"CODE_SIGN_IDENTITY=${CODE_SIGN_IDENTITY}\" clean build\nxcodebuild -configuration \"Release\" -target \"${FMK_NAME}\" -sdk iphoneos \"CODE_SIGN_IDENTITY=${CODE_SIGN_IDENTITY}\" clean build\nif [ \"$?\" != \"0\" ]; then\nexit 1\nfi\necho xcodebuild -
configuration \"Release\" -target \"${FMK_NAME}\" -sdk iphonesimulator \"CODE_SIGN_IDENTITY=${CODE_SIGN_IDENTITY}\" clean build\nxcodebuild -configuration \"Release\" -target \"${FMK_NAME}\" -sdk iphonesimulator \"CODE_SIGN_IDENTITY=${CODE_SIGN_IDENTITY}\" clean build\nif [ \"$?\" != \"0\" ]; then\nexit 1\nfi\n# Cleaning the oldest.\nif [ -d \"${INSTALL_DIR}\" ]\nthen\nrm -rf \"${INSTALL_DIR}\"\nfi\nmkdir -p \"${INSTALL_DIR}\"\ncp -R \"${SIMULATOR_DIR}/\" \"${INSTALL_DIR}/\"\n# \u79fb\u9664\u7b7e\u540d\u8d44\u6e90\u548c Info.plist\nrm \"${INSTALL_DIR}/Info.plist\"\nrm -rf \"${INSTALL_DIR}/_CodeSignature\"\n# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.\nlipo -create \"${DEVICE_DIR}/${FMK_NAME}\" \"${SIMULATOR_DIR}/${FMK_NAME}\" -output \"${INSTALL_DIR}/${FMK_NAME}\"\nrm -r \"${WRK_DIR}\"";
+ };
+ 59D3CA601D003832008835DC /* Generate WeexSDK.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Generate WeexSDK.h";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = ". \"${PROJECT_DIR}/buildScripts.sh\"\n\ngenerateSDKHeader 'WeexSDK'";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 2A42AF811C23B33E00818EA6 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2A42AF8A1C23B33E00818EA6 /* WeexSDK_MTL.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 77D160F81C02DBE70010B15B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 77E65A071C10507B008B8775 /* WXModuleManager.m in Sources */,
+ 77D161291C02DE1A0010B15B /* WXSDKManager.m in Sources */,
+ 7461F8911CFB373100F62D44 /* WXDisplayQueue.m in Sources */,
+ 746986A01C4E2C010054A57E /* NSArray+Weex.m in Sources */,
+ 77E65A0E1C155E99008B8775 /* WXDivComponent.m in Sources */,
+ 2A60CE9D1C91733E00857B9F /* WXSwitchComponent.m in Sources */,
+ 2A837AB71CD9DE9200AEDF03 /* WXRefreshComponent.m in Sources */,
+ 74A4BA9B1CB3BAA100195969 /* WXThreadSafeMutableDictionary.m in Sources */,
+ 77E65A1A1C155F25008B8775 /* WXScrollerComponent.m in Sources */,
+ 2A837AB51CD9DE9200AEDF03 /* WXLoadingIndicator.m in Sources */,
+ 59D3CA401CF9ED57008835DC /* Layout.c in Sources */,
+ 59A5830B1CF5B2FD0081FD3E /* WXNetworkDefaultImpl.m in Sources */,
+ 77D161311C02DE4E0010B15B /* WXComponent.m in Sources */,
+ 77E659DB1C07F594008B8775 /* WXDomModule.m in Sources */,
+ D3FC0DF81C508B2A002B9E31 /* WXTimerModule.m in Sources */,
+ 594C28921CF9E61A009793A4 /* WXAnimationModule.m in Sources */,
+ 59A5961D1CB630F10012CD52 /* WXComponent+Navigation.m in Sources */,
+ 77D161631C02ED790010B15B /* WXLog.m in Sources */,
+ 744BEA5A1D0520F300452B5D /* WXComponent+Layout.m in Sources */,
+ 59A582FD1CF5B17B0081FD3E /* WXBridgeContext.m in Sources */,
+ 743933B51C7ED9AA00773BB7 /* WXSimulatorShortcutMananger.m in Sources */,
+ 744BEA5E1D052A4F00452B5D /* WXComponent+ViewManangement.m in Sources */,
+ 741081201CED585A001BC6E5 /* WXComponentManager.m in Sources */,
+ D312CE3C1C730DEB00046D68 /* WXWebComponent.m in Sources */,
+ D317338D1C57257000BB7539 /* WXTransform.m in Sources */,
+ 7461F8A91CFC33A800F62D44 /* WXThreadSafeMutableArray.m in Sources */,
+ 2AC750251C7565690041D390 /* WXIndicatorComponent.m in Sources */,
+ 59D3CA4B1CFC3CE1008835DC /* NSTimer+Weex.m in Sources */,
+ 59A596321CB632050012CD52 /* WXRootViewController.m in Sources */,
+ 2A8E658B1C7C7AA20025C7B7 /* WXVideoComponent.m in Sources */,
+ 77E65A161C155EB5008B8775 /* WXTextComponent.m in Sources */,
+ 746319031C60AFC100EFEBD4 /* WXThreadSafeCounter.m in Sources */,
+ 74A4BAA71CB4F98300195969 /* WXStreamModule.m in Sources */,
+ 77E659F21C0C3612008B8775 /* WXModuleFactory.m in Sources */,
+ 59CE27E91CC387DB000BE37A
<TRUNCATED>