[HybridWebApp] updated HybridWebApp sources
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Fri, 2 Aug 2013 11:10:33 +0000 (13:10 +0200)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Fri, 2 Aug 2013 11:10:33 +0000 (13:10 +0200)
Change-Id: Ida8e5ae0a72c1d3396e9995cc511706537ba75e2

css/style.css
index.html
js/main.js

index 9c5a4cd..26ea359 100755 (executable)
@@ -5,3 +5,16 @@ body {
 .ui-tabbar-margin-back {
        margin-right:0 !important;
 }
+
+#alert-popup {
+       padding: 10px 0;
+}
+
+#alert-popup #message {
+       margin: 0 0 10px 0;
+       padding: 0;
+}
+
+#alert-popup #button a {
+       width: 100px;
+}
\ No newline at end of file
index 31b3fdd..f3749c0 100644 (file)
                        <div data-role="content" id="history">
                                <ul id="logs" data-role="listview">
                                </ul>
+
+                               <div id="alert-popup" data-role="popup">
+                                       <p id="message"></p>
+                                       <div id="button">
+                                               <a href="#" data-role="button" data-inline="true" data-rel="back">OK</a>
+                                       </div>
+                               </div>
                        </div>
                        <div data-role="footer" data-position="fixed">
                                <div data-role="tabbar" data-style="toolbar">
index b5afcd0..a8d569e 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 var app = tizen.application.getCurrentApplication();
-var gServiceAppId = "r9vrpxzuyp.HybridServiceApp";
+var gServiceAppId = app.appInfo.packageId + ".HybridServiceApp";
 var gServicePortName = "SAMPLE_PORT";
 var gLocalMessagePortName = "SAMPLE_PORT_REPLY";
 
@@ -30,9 +30,9 @@ $(document).delegate("#main", "pageinit", function() {
        $("#btn-start").bind("vclick", function(){
 
                if(gLocalMessagePort) {
-                       alert("Already running.");
+                       showAlert("Already running.");
                } else if(isStarting){
-                       alert("Now starting...");
+                       showAlert("Now starting...");
                } else {
                        isStarting = true;
                        start();
@@ -43,7 +43,7 @@ $(document).delegate("#main", "pageinit", function() {
                if(gRemoteMessagePort) {
                        sendCommand("stop");
                } else {
-                       alert("Not running.");
+                       showAlert("Not running.");
                }
                return false;
        });
@@ -194,13 +194,19 @@ function launchServiceApp() {
        function onError(err) {
                console.log("Service Applaunch failed");
                isStarting = false;
-               alert("Failed to launch HybridServiceApp!");
+               showAlert("Failed to launch HybridServiceApp!");
        }
 
        try {
                console.log("Launching [" + gServiceAppId + "] ...");
                tizen.application.launch(gServiceAppId, onSuccess, onError);
        } catch (exc) {
-               alert("launch exc:" + exc.message);
+               showAlert("launch exc:" + exc.message);
        }
 }
+
+function showAlert(message) {
+       var alertPopup = $("#alert-popup");
+       alertPopup.find("#message").text(message);
+       alertPopup.popup("open", {positionTo: "window"});
+}
\ No newline at end of file