You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by da...@apache.org on 2017/04/06 10:07:32 UTC

[1/3] incubator-weex git commit: call C++ timer instead of WxTimerModule with in week jsfm

Repository: incubator-weex
Updated Branches:
  refs/heads/0.12-dev b0a11a261 -> 5e0515ac7


 call  C++ timer instead of  WxTimerModule with in week jsfm


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b10d4243
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b10d4243
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b10d4243

Branch: refs/heads/0.12-dev
Commit: b10d4243864d69e461a0da7f848fb36011140724
Parents: 41c8ef6
Author: kaifeng.ly <ka...@alibaba-inc.com>
Authored: Thu Apr 6 16:41:02 2017 +0800
Committer: kaifeng.ly <ka...@alibaba-inc.com>
Committed: Thu Apr 6 16:41:02 2017 +0800

----------------------------------------------------------------------
 html5/frameworks/legacy/app/ctrl/init.js | 42 +++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b10d4243/html5/frameworks/legacy/app/ctrl/init.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/ctrl/init.js b/html5/frameworks/legacy/app/ctrl/init.js
index 2a2a4ff..6971199 100644
--- a/html5/frameworks/legacy/app/ctrl/init.js
+++ b/html5/frameworks/legacy/app/ctrl/init.js
@@ -88,21 +88,51 @@ export function init (app, code, data, services) {
         const handler = function () {
           args[0](...args.slice(2))
         }
-        timer.setTimeout(handler, args[1])
-        return app.doc.taskCenter.callbackManager.lastCallbackId.toString()
+
+        var timerId, callbackId;
+
+        if( global.setTimeoutWeex && (typeof global.setTimeoutWeex === 'function')){
+            callbackId = app.doc.taskCenter.normalize(handler);
+            timerId = global.setTimeoutWeex(app.id, callbackId, args[1]);
+            return timerId;
+        }else{
+          timer.setTimeout(handler, args[1]);
+          return app.doc.taskCenter.callbackManager.lastCallbackId.toString();
+        }
+
       },
       setInterval: (...args) => {
         const handler = function () {
           args[0](...args.slice(2))
         }
-        timer.setInterval(handler, args[1])
-        return app.doc.taskCenter.callbackManager.lastCallbackId.toString()
+
+        var timerId, callbackId;
+        
+        if( global.setIntervalWeex && (typeof global.setIntervalWeex === 'function')){
+          callbackId = app.doc.taskCenter.normalize(handler);
+          timerId = global.setIntervalWeex(app.id, callbackId, args[1]);
+          return timerId;
+        }else{
+          timer.setInterval(handler, args[1]);
+          return app.doc.taskCenter.callbackManager.lastCallbackId.toString();
+        }
+        
       },
       clearTimeout: (n) => {
-        timer.clearTimeout(n)
+        
+        if( global.clearTimeoutWeex && (typeof global.clearTimeoutWeex === 'function')){
+          global.clearTimeoutWeex(n);
+        }else{
+          timer.clearTimeout(n)
+        }
       },
       clearInterval: (n) => {
-        timer.clearInterval(n)
+        
+        if( global.clearIntervalWeex && (typeof global.clearIntervalWeex === 'function')){
+          global.clearIntervalWeex(n);
+        }else{
+          timer.clearInterval(n);
+        }
       }
     })
   }


[2/3] incubator-weex git commit: eslint warning

Posted by da...@apache.org.
eslint warning


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/86bacfb3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/86bacfb3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/86bacfb3

Branch: refs/heads/0.12-dev
Commit: 86bacfb3399ecdad72002a630ad719e76a0bbf7c
Parents: b10d424
Author: kaifeng.ly <ka...@alibaba-inc.com>
Authored: Thu Apr 6 17:29:23 2017 +0800
Committer: kaifeng.ly <ka...@alibaba-inc.com>
Committed: Thu Apr 6 17:29:23 2017 +0800

----------------------------------------------------------------------
 html5/frameworks/legacy/app/ctrl/init.js | 58 +++++++++++++--------------
 1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/86bacfb3/html5/frameworks/legacy/app/ctrl/init.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/ctrl/init.js b/html5/frameworks/legacy/app/ctrl/init.js
index 6971199..df58ed8 100644
--- a/html5/frameworks/legacy/app/ctrl/init.js
+++ b/html5/frameworks/legacy/app/ctrl/init.js
@@ -89,49 +89,49 @@ export function init (app, code, data, services) {
           args[0](...args.slice(2))
         }
 
-        var timerId, callbackId;
-
-        if( global.setTimeoutWeex && (typeof global.setTimeoutWeex === 'function')){
-            callbackId = app.doc.taskCenter.normalize(handler);
-            timerId = global.setTimeoutWeex(app.id, callbackId, args[1]);
-            return timerId;
-        }else{
-          timer.setTimeout(handler, args[1]);
-          return app.doc.taskCenter.callbackManager.lastCallbackId.toString();
-        }
+        let timerId, callbackId
 
+        if (global.setTimeoutWeex && (typeof global.setTimeoutWeex === 'function')) {
+          callbackId = app.doc.taskCenter.normalize(handler)
+          timerId = global.setTimeoutWeex(app.id, callbackId, args[1])
+          return timerId
+        }
+        else {
+          timer.setTimeout(handler, args[1])
+          return app.doc.taskCenter.callbackManager.lastCallbackId.toString()
+        }
       },
       setInterval: (...args) => {
         const handler = function () {
           args[0](...args.slice(2))
         }
 
-        var timerId, callbackId;
-        
-        if( global.setIntervalWeex && (typeof global.setIntervalWeex === 'function')){
-          callbackId = app.doc.taskCenter.normalize(handler);
-          timerId = global.setIntervalWeex(app.id, callbackId, args[1]);
-          return timerId;
-        }else{
-          timer.setInterval(handler, args[1]);
-          return app.doc.taskCenter.callbackManager.lastCallbackId.toString();
+        let timerId, callbackId
+
+        if (global.setIntervalWeex && (typeof global.setIntervalWeex === 'function')) {
+          callbackId = app.doc.taskCenter.normalize(handler)
+          timerId = global.setIntervalWeex(app.id, callbackId, args[1])
+          return timerId
+        }
+        else {
+          timer.setInterval(handler, args[1])
+          return app.doc.taskCenter.callbackManager.lastCallbackId.toString()
         }
-        
       },
       clearTimeout: (n) => {
-        
-        if( global.clearTimeoutWeex && (typeof global.clearTimeoutWeex === 'function')){
-          global.clearTimeoutWeex(n);
-        }else{
+        if (global.clearTimeoutWeex && (typeof global.clearTimeoutWeex === 'function')) {
+          global.clearTimeoutWeex(n)
+        }
+        else {
           timer.clearTimeout(n)
         }
       },
       clearInterval: (n) => {
-        
-        if( global.clearIntervalWeex && (typeof global.clearIntervalWeex === 'function')){
-          global.clearIntervalWeex(n);
-        }else{
-          timer.clearInterval(n);
+        if (global.clearIntervalWeex && (typeof global.clearIntervalWeex === 'function')) {
+          global.clearIntervalWeex(n)
+        }
+        else {
+          timer.clearInterval(n)
         }
       }
     })


[3/3] incubator-weex git commit: Merge branch '0.12-dev' of https://github.com/lycool/incubator-weex into 0.12-dev

Posted by da...@apache.org.
Merge branch '0.12-dev' of https://github.com/lycool/incubator-weex into 0.12-dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5e0515ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5e0515ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5e0515ac

Branch: refs/heads/0.12-dev
Commit: 5e0515ac78087a0a8ad83ac43cf2dbf6fb5eeb18
Parents: b0a11a2 86bacfb
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Apr 6 18:07:22 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Apr 6 18:07:22 2017 +0800

----------------------------------------------------------------------
 html5/frameworks/legacy/app/ctrl/init.js | 42 +++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------