[HybridWebApp] updated HybridWebApp sources
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Thu, 29 Aug 2013 09:45:13 +0000 (11:45 +0200)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Thu, 29 Aug 2013 09:45:13 +0000 (11:45 +0200)
Change-Id: I4f17845375a414c9d1f116f090b06c6249ee4475

js/main.js

index a204526..bb0befd 100644 (file)
@@ -30,9 +30,9 @@ $(document).delegate("#main", "pageinit", function() {
        $("#btn-start").bind("vclick", function(){
 
                if(gLocalMessagePort) {
-                       showAlert("Already running.");
+                       showAlert("Cannot start:<br>already running");
                } else if(isStarting){
-                       showAlert("Now starting...");
+                       showAlert("Cannot start:<br>service is starting");
                } else {
                        isStarting = true;
                        start();
@@ -40,10 +40,12 @@ $(document).delegate("#main", "pageinit", function() {
                return false;
        });
        $("#btn-stop").bind("vclick", function(){
-               if(gRemoteMessagePort) {
+               if(isStarting) {
+                       showAlert("Cannot stop:<br>service is starting");
+               } else if(gRemoteMessagePort) {
                        sendCommand("stop");
                } else {
-                       showAlert("Not running.");
+                       showAlert("Cannot stop:<br>not running");
                }
                return false;
        });
@@ -201,12 +203,13 @@ function launchServiceApp() {
                console.log("Launching [" + gServiceAppId + "] ...");
                tizen.application.launch(gServiceAppId, onSuccess, onError);
        } catch (exc) {
-               showAlert("launch exc:" + exc.message);
+               console.log("Exception while launching HybridServiceApp: " + exc.message);
+               showAlert("Exception while launching HybridServiceApp:<br>" + exc.message);
        }
 }
 
 function showAlert(message) {
        var alertPopup = $("#alert-popup");
-       alertPopup.find("#message").text(message);
+       alertPopup.find("#message").html(message);
        alertPopup.popup("open", {positionTo: "window"});
 }
\ No newline at end of file