You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by he...@apache.org on 2012/08/31 20:56:18 UTC
webos commit: update hello world example app for 2.1
Updated Branches:
refs/heads/master 70eebbb52 -> 3ace50049
update hello world example app for 2.1
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/commit/3ace5004
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/tree/3ace5004
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/diff/3ace5004
Branch: refs/heads/master
Commit: 3ace50049a99e767867e9f81a491fbfaae50e9bc
Parents: 70eebbb
Author: hermwong <he...@gmail.com>
Authored: Fri Aug 31 11:50:18 2012 -0700
Committer: hermwong <he...@gmail.com>
Committed: Fri Aug 31 11:51:21 2012 -0700
----------------------------------------------------------------------
framework/css/index.css | 109 ++++++++------
framework/img/cordova.png | Bin 19932 -> 0 bytes
framework/img/logo.png | Bin 0 -> 21814 bytes
framework/index.html | 30 +++-
framework/js/index.js | 55 ++++++--
framework/res/icon/cordova_128.png | Bin 11401 -> 0 bytes
framework/res/icon/cordova_16.png | Bin 1699 -> 0 bytes
framework/res/icon/cordova_24.png | Bin 2215 -> 0 bytes
framework/res/icon/cordova_256.png | Bin 27408 -> 0 bytes
framework/res/icon/cordova_32.png | Bin 2843 -> 0 bytes
framework/res/icon/cordova_48.png | Bin 4111 -> 0 bytes
framework/res/icon/cordova_512.png | Bin 39830 -> 0 bytes
framework/res/icon/cordova_64.png | Bin 5463 -> 0 bytes
framework/res/icon/cordova_android_36.png | Bin 3096 -> 0 bytes
framework/res/icon/cordova_android_48.png | Bin 4090 -> 0 bytes
framework/res/icon/cordova_android_72.png | Bin 6080 -> 0 bytes
framework/res/icon/cordova_android_96.png | Bin 7685 -> 0 bytes
framework/res/icon/cordova_bb_80.png | Bin 7287 -> 0 bytes
framework/res/icon/cordova_ios_114.png | Bin 7869 -> 0 bytes
framework/res/icon/cordova_ios_144.png | Bin 11706 -> 0 bytes
framework/res/icon/cordova_ios_57.png | Bin 3908 -> 0 bytes
framework/res/icon/cordova_ios_72.png | Bin 4944 -> 0 bytes
framework/res/icon/webos/icon-64.png | Bin 0 -> 5463 bytes
framework/res/screen/android_hdpi_landscape.png | Bin 218302 -> 0 bytes
framework/res/screen/android_hdpi_portrait.png | Bin 222148 -> 0 bytes
framework/res/screen/android_ldpi_landscape.png | Bin 42616 -> 0 bytes
framework/res/screen/android_ldpi_portrait.png | Bin 42034 -> 0 bytes
framework/res/screen/android_mdpi_landscape.png | Bin 92347 -> 0 bytes
framework/res/screen/android_mdpi_portrait.png | Bin 90555 -> 0 bytes
framework/res/screen/android_xhdpi_landscape.png | Bin 489604 -> 0 bytes
framework/res/screen/android_xhdpi_portrait.png | Bin 504508 -> 0 bytes
.../res/screen/blackberry_transparent_300.png | Bin 15823 -> 0 bytes
.../res/screen/blackberry_transparent_400.png | Bin 11001 -> 0 bytes
framework/res/screen/ipad_landscape.png | Bin 407370 -> 0 bytes
framework/res/screen/ipad_portrait.png | Bin 422441 -> 0 bytes
framework/res/screen/ipad_retina_landscape.png | Bin 1534088 -> 0 bytes
framework/res/screen/ipad_retina_portrait.png | Bin 1610434 -> 0 bytes
framework/res/screen/iphone_landscape.png | Bin 92301 -> 0 bytes
framework/res/screen/iphone_portrait.png | Bin 93897 -> 0 bytes
framework/res/screen/iphone_retina_landscape.png | Bin 339639 -> 0 bytes
framework/res/screen/iphone_retina_portrait.png | Bin 350593 -> 0 bytes
framework/res/screen/webos/screen-64.png | Bin 0 -> 5463 bytes
framework/res/screen/windows_phone_portrait.jpg | Bin 11483 -> 0 bytes
framework/spec.html | 18 +++
framework/spec/helper.js | 22 +++
framework/spec/index.js | 56 +++++---
46 files changed, 205 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/css/index.css
----------------------------------------------------------------------
diff --git a/framework/css/index.css b/framework/css/index.css
index c869f87..f1f9d76 100644
--- a/framework/css/index.css
+++ b/framework/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-webos/blob/3ace5004/framework/img/cordova.png
----------------------------------------------------------------------
diff --git a/framework/img/cordova.png b/framework/img/cordova.png
deleted file mode 100644
index e8169cf..0000000
Binary files a/framework/img/cordova.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/img/logo.png
----------------------------------------------------------------------
diff --git a/framework/img/logo.png b/framework/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/framework/img/logo.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/index.html
----------------------------------------------------------------------
diff --git a/framework/index.html b/framework/index.html
index 854e7ac..92484ad 100644
--- a/framework/index.html
+++ b/framework/index.html
@@ -1,18 +1,36 @@
<!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.1.0.js"></script>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/js/index.js
----------------------------------------------------------------------
diff --git a/framework/js/index.js b/framework/js/index.js
index 6140331..3b75d3f 100644
--- a/framework/js/index.js
+++ b/framework/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-webos/blob/3ace5004/framework/res/icon/cordova_128.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_128.png b/framework/res/icon/cordova_128.png
deleted file mode 100644
index 3516df3..0000000
Binary files a/framework/res/icon/cordova_128.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_16.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_16.png b/framework/res/icon/cordova_16.png
deleted file mode 100644
index 54e19c5..0000000
Binary files a/framework/res/icon/cordova_16.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_24.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_24.png b/framework/res/icon/cordova_24.png
deleted file mode 100644
index c7d43ad..0000000
Binary files a/framework/res/icon/cordova_24.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_256.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_256.png b/framework/res/icon/cordova_256.png
deleted file mode 100644
index e1cd0e6..0000000
Binary files a/framework/res/icon/cordova_256.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_32.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_32.png b/framework/res/icon/cordova_32.png
deleted file mode 100644
index 734fffc..0000000
Binary files a/framework/res/icon/cordova_32.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_48.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_48.png b/framework/res/icon/cordova_48.png
deleted file mode 100644
index 8ad8bac..0000000
Binary files a/framework/res/icon/cordova_48.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_512.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_512.png b/framework/res/icon/cordova_512.png
deleted file mode 100644
index c9465f3..0000000
Binary files a/framework/res/icon/cordova_512.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_64.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_64.png b/framework/res/icon/cordova_64.png
deleted file mode 100644
index 03b3849..0000000
Binary files a/framework/res/icon/cordova_64.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_android_36.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_android_36.png b/framework/res/icon/cordova_android_36.png
deleted file mode 100644
index cd5032a..0000000
Binary files a/framework/res/icon/cordova_android_36.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_android_48.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_android_48.png b/framework/res/icon/cordova_android_48.png
deleted file mode 100644
index e79c606..0000000
Binary files a/framework/res/icon/cordova_android_48.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_android_72.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_android_72.png b/framework/res/icon/cordova_android_72.png
deleted file mode 100644
index 4d27634..0000000
Binary files a/framework/res/icon/cordova_android_72.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_android_96.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_android_96.png b/framework/res/icon/cordova_android_96.png
deleted file mode 100644
index ec7ffbf..0000000
Binary files a/framework/res/icon/cordova_android_96.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_bb_80.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_bb_80.png b/framework/res/icon/cordova_bb_80.png
deleted file mode 100644
index f86a27a..0000000
Binary files a/framework/res/icon/cordova_bb_80.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_ios_114.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_ios_114.png b/framework/res/icon/cordova_ios_114.png
deleted file mode 100644
index efd9c37..0000000
Binary files a/framework/res/icon/cordova_ios_114.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_ios_144.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_ios_144.png b/framework/res/icon/cordova_ios_144.png
deleted file mode 100644
index dd819da..0000000
Binary files a/framework/res/icon/cordova_ios_144.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_ios_57.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_ios_57.png b/framework/res/icon/cordova_ios_57.png
deleted file mode 100644
index c795fc4..0000000
Binary files a/framework/res/icon/cordova_ios_57.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/cordova_ios_72.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/cordova_ios_72.png b/framework/res/icon/cordova_ios_72.png
deleted file mode 100644
index b1cfde7..0000000
Binary files a/framework/res/icon/cordova_ios_72.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/icon/webos/icon-64.png
----------------------------------------------------------------------
diff --git a/framework/res/icon/webos/icon-64.png b/framework/res/icon/webos/icon-64.png
new file mode 100644
index 0000000..03b3849
Binary files /dev/null and b/framework/res/icon/webos/icon-64.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_hdpi_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_hdpi_landscape.png b/framework/res/screen/android_hdpi_landscape.png
deleted file mode 100644
index a61e2b1..0000000
Binary files a/framework/res/screen/android_hdpi_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_hdpi_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_hdpi_portrait.png b/framework/res/screen/android_hdpi_portrait.png
deleted file mode 100644
index 5d6a28a..0000000
Binary files a/framework/res/screen/android_hdpi_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_ldpi_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_ldpi_landscape.png b/framework/res/screen/android_ldpi_landscape.png
deleted file mode 100644
index f3934cd..0000000
Binary files a/framework/res/screen/android_ldpi_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_ldpi_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_ldpi_portrait.png b/framework/res/screen/android_ldpi_portrait.png
deleted file mode 100644
index 65ad163..0000000
Binary files a/framework/res/screen/android_ldpi_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_mdpi_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_mdpi_landscape.png b/framework/res/screen/android_mdpi_landscape.png
deleted file mode 100644
index a1b697c..0000000
Binary files a/framework/res/screen/android_mdpi_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_mdpi_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_mdpi_portrait.png b/framework/res/screen/android_mdpi_portrait.png
deleted file mode 100644
index ea15693..0000000
Binary files a/framework/res/screen/android_mdpi_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_xhdpi_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_xhdpi_landscape.png b/framework/res/screen/android_xhdpi_landscape.png
deleted file mode 100644
index 79f2f09..0000000
Binary files a/framework/res/screen/android_xhdpi_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/android_xhdpi_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/android_xhdpi_portrait.png b/framework/res/screen/android_xhdpi_portrait.png
deleted file mode 100644
index c2e8042..0000000
Binary files a/framework/res/screen/android_xhdpi_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/blackberry_transparent_300.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/blackberry_transparent_300.png b/framework/res/screen/blackberry_transparent_300.png
deleted file mode 100644
index b548bdc..0000000
Binary files a/framework/res/screen/blackberry_transparent_300.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/blackberry_transparent_400.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/blackberry_transparent_400.png b/framework/res/screen/blackberry_transparent_400.png
deleted file mode 100644
index 3facdf9..0000000
Binary files a/framework/res/screen/blackberry_transparent_400.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/ipad_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/ipad_landscape.png b/framework/res/screen/ipad_landscape.png
deleted file mode 100644
index 04be5ac..0000000
Binary files a/framework/res/screen/ipad_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/ipad_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/ipad_portrait.png b/framework/res/screen/ipad_portrait.png
deleted file mode 100644
index 41e839d..0000000
Binary files a/framework/res/screen/ipad_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/ipad_retina_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/ipad_retina_landscape.png b/framework/res/screen/ipad_retina_landscape.png
deleted file mode 100644
index 95c542d..0000000
Binary files a/framework/res/screen/ipad_retina_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/ipad_retina_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/ipad_retina_portrait.png b/framework/res/screen/ipad_retina_portrait.png
deleted file mode 100644
index aae1862..0000000
Binary files a/framework/res/screen/ipad_retina_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/iphone_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/iphone_landscape.png b/framework/res/screen/iphone_landscape.png
deleted file mode 100644
index d154883..0000000
Binary files a/framework/res/screen/iphone_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/iphone_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/iphone_portrait.png b/framework/res/screen/iphone_portrait.png
deleted file mode 100644
index 6fcba56..0000000
Binary files a/framework/res/screen/iphone_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/iphone_retina_landscape.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/iphone_retina_landscape.png b/framework/res/screen/iphone_retina_landscape.png
deleted file mode 100644
index 0165669..0000000
Binary files a/framework/res/screen/iphone_retina_landscape.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/iphone_retina_portrait.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/iphone_retina_portrait.png b/framework/res/screen/iphone_retina_portrait.png
deleted file mode 100644
index bd24886..0000000
Binary files a/framework/res/screen/iphone_retina_portrait.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/webos/screen-64.png
----------------------------------------------------------------------
diff --git a/framework/res/screen/webos/screen-64.png b/framework/res/screen/webos/screen-64.png
new file mode 100644
index 0000000..03b3849
Binary files /dev/null and b/framework/res/screen/webos/screen-64.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/res/screen/windows_phone_portrait.jpg
----------------------------------------------------------------------
diff --git a/framework/res/screen/windows_phone_portrait.jpg b/framework/res/screen/windows_phone_portrait.jpg
deleted file mode 100644
index 9f95387..0000000
Binary files a/framework/res/screen/windows_phone_portrait.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/3ace5004/framework/spec.html
----------------------------------------------------------------------
diff --git a/framework/spec.html b/framework/spec.html
index 83d7d2e..71f00de 100644
--- a/framework/spec.html
+++ b/framework/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-webos/blob/3ace5004/framework/spec/helper.js
----------------------------------------------------------------------
diff --git a/framework/spec/helper.js b/framework/spec/helper.js
index 9f99445..929f776 100644
--- a/framework/spec/helper.js
+++ b/framework/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-webos/blob/3ace5004/framework/spec/index.js
----------------------------------------------------------------------
diff --git a/framework/spec/index.js b/framework/spec/index.js
index 121cf63..20f8be5 100644
--- a/framework/spec/index.js
+++ b/framework/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');
});
});
});