You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2012/09/05 02:08:53 UTC
[3/3] updating hello world app to latest
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/css/index.css
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/css/index.css b/samples/hello-cordova/css/index.css
index c869f87..f1f9d76 100644
--- a/samples/hello-cordova/css/index.css
+++ b/samples/hello-cordova/css/index.css
@@ -1,16 +1,30 @@
-html,
-body {
- height:100%;
- font-size:12px;
- width:100%;
-}
-
-html {
- display:table;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+* {
+ -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
+ -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
+ -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+ -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
body {
- background-color:#A7A7A7;
+ background-color:#E4E4E4;
background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
@@ -21,46 +35,65 @@ body {
color-stop(0, #A7A7A7),
color-stop(0.51, #E4E4E4)
);
- display:table-cell;
+ background-attachment:fixed;
font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+ font-size:12px;
+ height:100%;
+ margin:0px;
+ padding:0px;
text-transform:uppercase;
- vertical-align:middle;
+ width:100%;
}
+/* Portrait layout (default) */
.app {
- background-image:url(../img/cordova.png);
- background-repeat:no-repeat;
- margin:0px auto;
- width:275px;
+ background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+ position:absolute; /* position in the center of the screen */
+ left:50%;
+ top:50%;
+ height:50px; /* text area height */
+ width:225px; /* text area width */
+ text-align:center;
+ padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
+ margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
+ /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+ .app {
+ background-position:left center;
+ padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
+ margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
+ /* offset horizontal: half of image width and text area width */
+ }
}
h1 {
- font-size:2em;
- font-weight:300;
+ font-size:24px;
+ font-weight:normal;
margin:0px;
overflow:visible;
padding:0px;
text-align:center;
}
-.status {
- background-color:#333333;
+.event {
border-radius:4px;
-webkit-border-radius:4px;
color:#FFFFFF;
- font-size:1em;
- margin:0px auto;
- padding:2px 10px;
- text-align:center;
- width:100%;
- max-width:175px;
+ font-size:12px;
+ margin:0px 30px;
+ padding:2px 0px;
}
-.status.complete {
- background-color:#4B946A;
+.event.listening {
+ background-color:#333333;
+ display:block;
}
-.hide {
+.event.received {
+ background-color:#4B946A;
display:none;
}
@@ -80,21 +113,3 @@ h1 {
animation:fade 3000ms infinite;
-webkit-animation:fade 3000ms infinite;
}
-
-/* portrait */
-/* @media screen and (max-aspect-ratio: 1/1) */
-.app {
- background-position:center top;
- height:100px; /* adds enough room for text */
- padding:180px 0px 0px 0px; /* background height - shadow offset */
-}
-
-/* lanscape (when wide enough) */
-@media screen and (min-aspect-ratio: 1/1) and (min-width:445px) {
- .app {
- background-position:left center;
- height:140px; /* height + padding = background image size */
- padding-left:170px; /* background width */
- padding-top:60px; /* center the text */
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/icon.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/icon.png b/samples/hello-cordova/icon.png
deleted file mode 100755
index eef3cd9..0000000
Binary files a/samples/hello-cordova/icon.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/img/cordova.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/img/cordova.png b/samples/hello-cordova/img/cordova.png
deleted file mode 100644
index e8169cf..0000000
Binary files a/samples/hello-cordova/img/cordova.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/img/logo.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/img/logo.png b/samples/hello-cordova/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/samples/hello-cordova/img/logo.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/index.html
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/index.html b/samples/hello-cordova/index.html
index fc9dd1d..92484ad 100644
--- a/samples/hello-cordova/index.html
+++ b/samples/hello-cordova/index.html
@@ -1,21 +1,39 @@
<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <meta name = "format-detection" content = "telephone=no"/>
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width;" />
+ <meta name="format-detection" content="telephone=no" />
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
- <title>Hello Cordova</title>
+ <title>Hello World</title>
</head>
<body>
<div class="app">
<h1>Apache Cordova</h1>
- <div id="deviceready">
- <p class="status pending blink">Connecting to Device</p>
- <p class="status complete blink hide">Device is Ready</p>
+ <div id="deviceready" class="blink">
+ <p class="event listening">Connecting to Device</p>
+ <p class="event received">Device is Ready</p>
</div>
</div>
- <script type="text/javascript" src="cordova-2.0.0.js"></script>
+ <script type="text/javascript" src="cordova-2.1.0.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/js/index.js
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/js/index.js b/samples/hello-cordova/js/index.js
index 6140331..31d9064 100644
--- a/samples/hello-cordova/js/index.js
+++ b/samples/hello-cordova/js/index.js
@@ -1,20 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
var app = {
+ // Application Constructor
initialize: function() {
- this.bind();
+ this.bindEvents();
},
- bind: function() {
- document.addEventListener('deviceready', this.deviceready, false);
+ // Bind Event Listeners
+ //
+ // Bind any events that are required on startup. Common events are:
+ // 'load', 'deviceready', 'offline', and 'online'.
+ bindEvents: function() {
+ document.addEventListener('deviceready', this.onDeviceReady, false);
},
- deviceready: function() {
- // note that this is an event handler so the scope is that of the event
- // so we need to call app.report(), and not this.report()
- app.report('deviceready');
+ // deviceready Event Handler
+ //
+ // The scope of 'this' is the event. In order to call the 'receivedEvent'
+ // function, we must explicity call 'app.receivedEvent(...);'
+ onDeviceReady: function() {
+ app.receivedEvent('deviceready');
},
- report: function(id) {
- console.log("report:" + id);
- // hide the .pending <p> and show the .complete <p>
- document.querySelector('#' + id + ' .pending').className += ' hide';
- var completeElem = document.querySelector('#' + id + ' .complete');
- completeElem.className = completeElem.className.split('hide').join('');
+ // Update DOM on a Received Event
+ receivedEvent: function(id) {
+ var parentElement = document.getElementById(id);
+ var listeningElement = parentElement.querySelector('.listening');
+ var receivedElement = parentElement.querySelector('.received');
+
+ listeningElement.setAttribute('style', 'display:none;');
+ receivedElement.setAttribute('style', 'display:block;');
+
+ console.log('Received Event: ' + id);
}
};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/android/icon-36-ldpi.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/android/icon-36-ldpi.png b/samples/hello-cordova/res/icon/android/icon-36-ldpi.png
new file mode 100644
index 0000000..cd5032a
Binary files /dev/null and b/samples/hello-cordova/res/icon/android/icon-36-ldpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/android/icon-48-mdpi.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/android/icon-48-mdpi.png b/samples/hello-cordova/res/icon/android/icon-48-mdpi.png
new file mode 100644
index 0000000..e79c606
Binary files /dev/null and b/samples/hello-cordova/res/icon/android/icon-48-mdpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/android/icon-72-hdpi.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/android/icon-72-hdpi.png b/samples/hello-cordova/res/icon/android/icon-72-hdpi.png
new file mode 100644
index 0000000..4d27634
Binary files /dev/null and b/samples/hello-cordova/res/icon/android/icon-72-hdpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/android/icon-96-xhdpi.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/android/icon-96-xhdpi.png b/samples/hello-cordova/res/icon/android/icon-96-xhdpi.png
new file mode 100644
index 0000000..ec7ffbf
Binary files /dev/null and b/samples/hello-cordova/res/icon/android/icon-96-xhdpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/bada-wac/icon-48-type5.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/bada-wac/icon-48-type5.png b/samples/hello-cordova/res/icon/bada-wac/icon-48-type5.png
new file mode 100644
index 0000000..8ad8bac
Binary files /dev/null and b/samples/hello-cordova/res/icon/bada-wac/icon-48-type5.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/bada-wac/icon-50-type3.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/bada-wac/icon-50-type3.png b/samples/hello-cordova/res/icon/bada-wac/icon-50-type3.png
new file mode 100644
index 0000000..c6ddf84
Binary files /dev/null and b/samples/hello-cordova/res/icon/bada-wac/icon-50-type3.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/bada-wac/icon-80-type4.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/bada-wac/icon-80-type4.png b/samples/hello-cordova/res/icon/bada-wac/icon-80-type4.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/samples/hello-cordova/res/icon/bada-wac/icon-80-type4.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/bada/icon-128.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/bada/icon-128.png b/samples/hello-cordova/res/icon/bada/icon-128.png
new file mode 100644
index 0000000..3516df3
Binary files /dev/null and b/samples/hello-cordova/res/icon/bada/icon-128.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/blackberry/icon-80.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/blackberry/icon-80.png b/samples/hello-cordova/res/icon/blackberry/icon-80.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/samples/hello-cordova/res/icon/blackberry/icon-80.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/ios/icon-57-2x.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/ios/icon-57-2x.png b/samples/hello-cordova/res/icon/ios/icon-57-2x.png
new file mode 100644
index 0000000..efd9c37
Binary files /dev/null and b/samples/hello-cordova/res/icon/ios/icon-57-2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/ios/icon-57.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/ios/icon-57.png b/samples/hello-cordova/res/icon/ios/icon-57.png
new file mode 100644
index 0000000..c795fc4
Binary files /dev/null and b/samples/hello-cordova/res/icon/ios/icon-57.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/ios/icon-72-2x.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/ios/icon-72-2x.png b/samples/hello-cordova/res/icon/ios/icon-72-2x.png
new file mode 100644
index 0000000..dd819da
Binary files /dev/null and b/samples/hello-cordova/res/icon/ios/icon-72-2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/ios/icon-72.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/ios/icon-72.png b/samples/hello-cordova/res/icon/ios/icon-72.png
new file mode 100644
index 0000000..b1cfde7
Binary files /dev/null and b/samples/hello-cordova/res/icon/ios/icon-72.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/webos/icon-64.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/webos/icon-64.png b/samples/hello-cordova/res/icon/webos/icon-64.png
new file mode 100644
index 0000000..03b3849
Binary files /dev/null and b/samples/hello-cordova/res/icon/webos/icon-64.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/windows-phone/icon-173-tile.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/windows-phone/icon-173-tile.png b/samples/hello-cordova/res/icon/windows-phone/icon-173-tile.png
new file mode 100644
index 0000000..4f15e20
Binary files /dev/null and b/samples/hello-cordova/res/icon/windows-phone/icon-173-tile.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/windows-phone/icon-48.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/windows-phone/icon-48.png b/samples/hello-cordova/res/icon/windows-phone/icon-48.png
new file mode 100644
index 0000000..8ad8bac
Binary files /dev/null and b/samples/hello-cordova/res/icon/windows-phone/icon-48.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/icon/windows-phone/icon-62-tile.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/icon/windows-phone/icon-62-tile.png b/samples/hello-cordova/res/icon/windows-phone/icon-62-tile.png
new file mode 100644
index 0000000..aab6061
Binary files /dev/null and b/samples/hello-cordova/res/icon/windows-phone/icon-62-tile.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-hdpi-landscape.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-hdpi-landscape.png b/samples/hello-cordova/res/screen/android/screen-hdpi-landscape.png
new file mode 100644
index 0000000..a61e2b1
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-hdpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-hdpi-portrait.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-hdpi-portrait.png b/samples/hello-cordova/res/screen/android/screen-hdpi-portrait.png
new file mode 100644
index 0000000..5d6a28a
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-hdpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-ldpi-landscape.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-ldpi-landscape.png b/samples/hello-cordova/res/screen/android/screen-ldpi-landscape.png
new file mode 100644
index 0000000..f3934cd
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-ldpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-ldpi-portrait.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-ldpi-portrait.png b/samples/hello-cordova/res/screen/android/screen-ldpi-portrait.png
new file mode 100644
index 0000000..65ad163
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-ldpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-mdpi-landscape.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-mdpi-landscape.png b/samples/hello-cordova/res/screen/android/screen-mdpi-landscape.png
new file mode 100644
index 0000000..a1b697c
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-mdpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-mdpi-portrait.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-mdpi-portrait.png b/samples/hello-cordova/res/screen/android/screen-mdpi-portrait.png
new file mode 100644
index 0000000..ea15693
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-mdpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-xhdpi-landscape.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-xhdpi-landscape.png b/samples/hello-cordova/res/screen/android/screen-xhdpi-landscape.png
new file mode 100644
index 0000000..79f2f09
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-xhdpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/android/screen-xhdpi-portrait.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/android/screen-xhdpi-portrait.png b/samples/hello-cordova/res/screen/android/screen-xhdpi-portrait.png
new file mode 100644
index 0000000..c2e8042
Binary files /dev/null and b/samples/hello-cordova/res/screen/android/screen-xhdpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/bada-wac/screen-type3.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/bada-wac/screen-type3.png b/samples/hello-cordova/res/screen/bada-wac/screen-type3.png
new file mode 100755
index 0000000..ea15693
Binary files /dev/null and b/samples/hello-cordova/res/screen/bada-wac/screen-type3.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/bada-wac/screen-type4.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/bada-wac/screen-type4.png b/samples/hello-cordova/res/screen/bada-wac/screen-type4.png
new file mode 100755
index 0000000..5d6a28a
Binary files /dev/null and b/samples/hello-cordova/res/screen/bada-wac/screen-type4.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/bada-wac/screen-type5.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/bada-wac/screen-type5.png b/samples/hello-cordova/res/screen/bada-wac/screen-type5.png
new file mode 100755
index 0000000..bd64f76
Binary files /dev/null and b/samples/hello-cordova/res/screen/bada-wac/screen-type5.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/bada/screen-portrait.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/bada/screen-portrait.png b/samples/hello-cordova/res/screen/bada/screen-portrait.png
new file mode 100644
index 0000000..5d6a28a
Binary files /dev/null and b/samples/hello-cordova/res/screen/bada/screen-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/blackberry/screen-225.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/blackberry/screen-225.png b/samples/hello-cordova/res/screen/blackberry/screen-225.png
new file mode 100644
index 0000000..29873e9
Binary files /dev/null and b/samples/hello-cordova/res/screen/blackberry/screen-225.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-ipad-landscape-2x.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-ipad-landscape-2x.png b/samples/hello-cordova/res/screen/ios/screen-ipad-landscape-2x.png
new file mode 100644
index 0000000..95c542d
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-ipad-landscape-2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-ipad-landscape.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-ipad-landscape.png b/samples/hello-cordova/res/screen/ios/screen-ipad-landscape.png
new file mode 100644
index 0000000..04be5ac
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-ipad-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-ipad-portrait-2x.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-ipad-portrait-2x.png b/samples/hello-cordova/res/screen/ios/screen-ipad-portrait-2x.png
new file mode 100644
index 0000000..aae1862
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-ipad-portrait-2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-ipad-portrait.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-ipad-portrait.png b/samples/hello-cordova/res/screen/ios/screen-ipad-portrait.png
new file mode 100644
index 0000000..41e839d
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-ipad-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-iphone-landscape-2x.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-iphone-landscape-2x.png b/samples/hello-cordova/res/screen/ios/screen-iphone-landscape-2x.png
new file mode 100644
index 0000000..0165669
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-iphone-landscape-2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-iphone-landscape.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-iphone-landscape.png b/samples/hello-cordova/res/screen/ios/screen-iphone-landscape.png
new file mode 100644
index 0000000..d154883
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-iphone-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-iphone-portrait-2x.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-iphone-portrait-2x.png b/samples/hello-cordova/res/screen/ios/screen-iphone-portrait-2x.png
new file mode 100644
index 0000000..bd24886
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-iphone-portrait-2x.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/ios/screen-iphone-portrait.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/ios/screen-iphone-portrait.png b/samples/hello-cordova/res/screen/ios/screen-iphone-portrait.png
new file mode 100644
index 0000000..6fcba56
Binary files /dev/null and b/samples/hello-cordova/res/screen/ios/screen-iphone-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/webos/screen-64.png
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/webos/screen-64.png b/samples/hello-cordova/res/screen/webos/screen-64.png
new file mode 100644
index 0000000..03b3849
Binary files /dev/null and b/samples/hello-cordova/res/screen/webos/screen-64.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/res/screen/windows-phone/screen-portrait.jpg
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/res/screen/windows-phone/screen-portrait.jpg b/samples/hello-cordova/res/screen/windows-phone/screen-portrait.jpg
new file mode 100644
index 0000000..479d3e4
Binary files /dev/null and b/samples/hello-cordova/res/screen/windows-phone/screen-portrait.jpg differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/spec.html
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/spec.html b/samples/hello-cordova/spec.html
index 83d7d2e..71f00de 100644
--- a/samples/hello-cordova/spec.html
+++ b/samples/hello-cordova/spec.html
@@ -1,4 +1,22 @@
<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
<html>
<head>
<title>Jasmine Spec Runner</title>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/spec/helper.js
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/spec/helper.js b/samples/hello-cordova/spec/helper.js
index 9f99445..929f776 100644
--- a/samples/hello-cordova/spec/helper.js
+++ b/samples/hello-cordova/spec/helper.js
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
afterEach(function() {
document.getElementById('stage').innerHTML = '';
});
@@ -7,5 +25,9 @@ var helper = {
var e = document.createEvent('Event');
e.initEvent(name, true, true);
obj.dispatchEvent(e);
+ },
+ getComputedStyle: function(querySelector, property) {
+ var element = document.querySelector(querySelector);
+ return window.getComputedStyle(element).getPropertyValue(property);
}
};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/d821fca9/samples/hello-cordova/spec/index.js
----------------------------------------------------------------------
diff --git a/samples/hello-cordova/spec/index.js b/samples/hello-cordova/spec/index.js
index 121cf63..20f8be5 100644
--- a/samples/hello-cordova/spec/index.js
+++ b/samples/hello-cordova/spec/index.js
@@ -1,49 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
describe('app', function() {
describe('initialize', function() {
it('should bind deviceready', function() {
runs(function() {
- spyOn(app, 'deviceready');
+ spyOn(app, 'onDeviceReady');
app.initialize();
helper.trigger(window.document, 'deviceready');
});
waitsFor(function() {
- return (app.deviceready.calls.length > 0);
- }, 'deviceready should be called once', 500);
+ return (app.onDeviceReady.calls.length > 0);
+ }, 'onDeviceReady should be called once', 500);
runs(function() {
- expect(app.deviceready).toHaveBeenCalled();
+ expect(app.onDeviceReady).toHaveBeenCalled();
});
});
});
- describe('deviceready', function() {
+ describe('onDeviceReady', function() {
it('should report that it fired', function() {
- spyOn(app, 'report');
- app.deviceready();
- expect(app.report).toHaveBeenCalledWith('deviceready');
+ spyOn(app, 'receivedEvent');
+ app.onDeviceReady();
+ expect(app.receivedEvent).toHaveBeenCalledWith('deviceready');
});
});
- describe('report', function() {
+ describe('receivedEvent', function() {
beforeEach(function() {
var el = document.getElementById('stage');
el.innerHTML = ['<div id="deviceready">',
- ' <p class="status pending">Pending</p>',
- ' <p class="status complete hide">Complete</p>',
+ ' <p class="event listening">Listening</p>',
+ ' <p class="event received">Received</p>',
'</div>'].join('\n');
});
- it('should show the completion state', function() {
- app.report('deviceready');
- var el = document.querySelector('#deviceready .complete:not(.hide)');
- expect(el).toBeTruthy();
+ it('should hide the listening element', function() {
+ app.receivedEvent('deviceready');
+ var displayStyle = helper.getComputedStyle('#deviceready .listening', 'display');
+ expect(displayStyle).toEqual('none');
});
- it('should hide the pending state', function() {
- app.report('deviceready');
- var el = document.querySelector('#deviceready .pending.hide');
- expect(el).toBeTruthy();
+ it('should show the received element', function() {
+ app.receivedEvent('deviceready');
+ var displayStyle = helper.getComputedStyle('#deviceready .received', 'display');
+ expect(displayStyle).toEqual('block');
});
});
});