From 9ebd08f69ba9075b810ec6a0dedacd9c7ad86a8f Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Tue, 19 Nov 2013 12:43:12 +0200 Subject: [PATCH 1/7] Add tentative Tizen implementation. --- plugin.xml | 7 ++++++- src/tizen/SplashScreenProxy.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/tizen/SplashScreenProxy.js diff --git a/plugin.xml b/plugin.xml index 5500ad3..3a9ae5e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -37,7 +37,7 @@ - + @@ -80,4 +80,9 @@ + + + + + diff --git a/src/tizen/SplashScreenProxy.js b/src/tizen/SplashScreenProxy.js new file mode 100644 index 0000000..8d630f2 --- /dev/null +++ b/src/tizen/SplashScreenProxy.js @@ -0,0 +1,14 @@ +var exec = require('cordova/exec'); + +module.exports = { + splashscreen: { + show = function() { + exec(null, null, "SplashScreen", "show", []); + }, + hide = function() { + exec(null, null, "SplashScreen", "hide", []); + } + } +}; + +require("cordova/tizen/commandProxy").add("SplashScreen", module.exports); From 3a1810baa51b64dee93332365c7cb5592f0baf6e Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Tue, 19 Nov 2013 12:55:35 +0200 Subject: [PATCH 2/7] Native Tizen implementation of SplashScreen API. --- src/tizen/SplashScreenProxy.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tizen/SplashScreenProxy.js b/src/tizen/SplashScreenProxy.js index 8d630f2..cd76a82 100644 --- a/src/tizen/SplashScreenProxy.js +++ b/src/tizen/SplashScreenProxy.js @@ -2,11 +2,15 @@ var exec = require('cordova/exec'); module.exports = { splashscreen: { + win: null, + show = function() { - exec(null, null, "SplashScreen", "show", []); + win= window.open('splashscreen.html'); }, + hide = function() { - exec(null, null, "SplashScreen", "hide", []); + win.close(); + win = null; } } }; From c368b63f0a310bbb04da5576ef7cba75357c10fa Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Tue, 19 Nov 2013 13:04:30 +0200 Subject: [PATCH 3/7] Fix typo. --- plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index 3a9ae5e..76613ae 100644 --- a/plugin.xml +++ b/plugin.xml @@ -84,5 +84,5 @@ - + From cf7c35d39950b3e0de7a3592335d19287331938b Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Tue, 19 Nov 2013 13:11:32 +0200 Subject: [PATCH 4/7] Fix syntax errors. --- src/tizen/SplashScreenProxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tizen/SplashScreenProxy.js b/src/tizen/SplashScreenProxy.js index cd76a82..3e90443 100644 --- a/src/tizen/SplashScreenProxy.js +++ b/src/tizen/SplashScreenProxy.js @@ -4,11 +4,11 @@ module.exports = { splashscreen: { win: null, - show = function() { + show: function() { win= window.open('splashscreen.html'); }, - hide = function() { + hide: function() { win.close(); win = null; } From 9f3b52f4b9653039e5774e773addf6554987451a Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Tue, 19 Nov 2013 13:11:59 +0200 Subject: [PATCH 5/7] Fix path of Tizen's SplashScreenProxy file. --- plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index 76613ae..cd4be3a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -82,7 +82,7 @@ - + From 8aa0b244810ff8c1ff653a479b3efd9a99cc09d2 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Tue, 19 Nov 2013 14:01:13 +0200 Subject: [PATCH 6/7] plugin.xml: Make sure splashscreen proxy is executed. --- plugin.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.xml b/plugin.xml index cd4be3a..6fd986e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -83,6 +83,7 @@ + From 8dc057b796b34150de611314f27800da70df690a Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Tue, 19 Nov 2013 14:01:31 +0200 Subject: [PATCH 7/7] Proxy: Correct structure, and only ever create one splashscreen window. --- src/tizen/SplashScreenProxy.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/tizen/SplashScreenProxy.js b/src/tizen/SplashScreenProxy.js index 3e90443..5222b6b 100644 --- a/src/tizen/SplashScreenProxy.js +++ b/src/tizen/SplashScreenProxy.js @@ -1,14 +1,16 @@ -var exec = require('cordova/exec'); +( function() { + +win = null; module.exports = { - splashscreen: { - win: null, + show: function() { + if ( win === null ) { + win = window.open('splashscreen.html'); + } + }, - show: function() { - win= window.open('splashscreen.html'); - }, - - hide: function() { + hide: function() { + if ( win !== null ) { win.close(); win = null; } @@ -16,3 +18,5 @@ module.exports = { }; require("cordova/tizen/commandProxy").add("SplashScreen", module.exports); + +})();