Merge lp:~knitzsche/qtcreator-plugin-ubuntu/qtcreator-plugin-ubuntu-bug234822 into lp:qtcreator-plugin-ubuntu

Proposed by Kyle Nitzsche
Status: Merged
Approved by: Alexandre Abreu
Approved revision: 52
Merged at revision: 49
Proposed branch: lp:~knitzsche/qtcreator-plugin-ubuntu/qtcreator-plugin-ubuntu-bug234822
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 201 lines (+83/-78)
3 files modified
share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/app.js (+27/-0)
share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/css/index.css (+0/-58)
share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/index.html (+56/-20)
To merge this branch: bzr merge lp:~knitzsche/qtcreator-plugin-ubuntu/qtcreator-plugin-ubuntu-bug234822
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+189137@code.launchpad.net

Description of the change

Convert default SDK cordova app to use Ubuntu HTML5 per LP: #1234822

To post a comment you must log in.
50. By Kyle Nitzsche

revert leading spaces in license to 4

51. By Kyle Nitzsche

revert to two spaces after period in license text

52. By Kyle Nitzsche

reverting another two spaces after period

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/app.js'
2--- share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/app.js 1970-01-01 00:00:00 +0000
3+++ share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/app.js 2013-10-03 17:19:50 +0000
4@@ -0,0 +1,27 @@
5+/* Create UI instance */
6+
7+var UI = new UbuntuUI();
8+
9+/* Initializatino after window load */
10+window.onload = function () {
11+ /* REQUIRED: initialize UI */
12+ UI.init();
13+
14+ /* Start pagestack with main page */
15+ UI.pagestack.push("main");
16+
17+ /* GUI intial state: show loading dialog (is removed on deviceready event) */
18+ UI.dialog("loading").show();
19+
20+ /* Connect button to function */
21+ UI.button("devicereadyOK").click(function() {
22+ UI.dialog("deviceready").hide();
23+ });
24+
25+};
26+
27+/* Respond to deviceready event */
28+document.addEventListener("deviceready", function() {
29+ UI.dialog("loading").hide();
30+ UI.dialog("deviceready").show();
31+ }, false);
32
33=== modified file 'share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/css/index.css'
34--- share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/css/index.css 2013-08-08 07:26:20 +0000
35+++ share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/css/index.css 2013-10-03 17:19:50 +0000
36@@ -44,59 +44,6 @@
37 text-transform:uppercase;
38 width:100%;
39 }
40-
41-/* Portrait layout (default) */
42-.app {
43- background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
44- position:absolute; /* position in the center of the screen */
45- left:50%;
46- top:50%;
47- height:50px; /* text area height */
48- width:225px; /* text area width */
49- text-align:center;
50- padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
51- margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
52- /* offset horizontal: half of text area width */
53-}
54-
55-/* Landscape layout (with min-width) */
56-@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
57- .app {
58- background-position:left center;
59- padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
60- margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
61- /* offset horizontal: half of image width and text area width */
62- }
63-}
64-
65-h1 {
66- font-size:24px;
67- font-weight:normal;
68- margin:0px;
69- overflow:visible;
70- padding:0px;
71- text-align:center;
72-}
73-
74-.event {
75- border-radius:4px;
76- -webkit-border-radius:4px;
77- color:#FFFFFF;
78- font-size:12px;
79- margin:0px 30px;
80- padding:2px 0px;
81-}
82-
83-.event.listening {
84- background-color:#333333;
85- display:block;
86-}
87-
88-.event.received {
89- background-color:#4B946A;
90- display:none;
91-}
92-
93 @keyframes fade {
94 from { opacity: 1.0; }
95 50% { opacity: 0.4; }
96@@ -108,8 +55,3 @@
97 50% { opacity: 0.4; }
98 to { opacity: 1.0; }
99 }
100-
101-.blink {
102- animation:fade 3000ms infinite;
103- -webkit-animation:fade 3000ms infinite;
104-}
105
106=== modified file 'share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/index.html'
107--- share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/index.html 2013-08-08 07:26:20 +0000
108+++ share/qtcreator/templates/wizards/ubuntu/cordovaubuntu/index.html 2013-10-03 17:19:50 +0000
109@@ -13,7 +13,7 @@
110 Unless required by applicable law or agreed to in writing,
111 software distributed under the License is distributed on an
112 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
113- KIND, either express or implied. See the License for the
114+ KIND, either express or implied. See the License for the
115 specific language governing permissions and limitations
116 under the License.
117 -->
118@@ -23,29 +23,65 @@
119 <meta name="format-detection" content="telephone=no" />
120 <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" />
121 <link rel="stylesheet" type="text/css" href="css/index.css" />
122- <title>Hello World</title>
123+
124+ <!-- Use Ubuntu Cordova -->
125+ <script language="javascript" type="text/javascript" src="file:///usr/share/cordova-ubuntu-2.8/www/cordova-2.8.js"></script>
126+
127+ <!-- Ubuntu UI Style imports - Ambiance theme -->
128+ <link href="/usr/share/ubuntu-html5-theme/0.1/ambiance/css/appTemplate.css" rel="stylesheet" type="text/css" />
129+
130+ <!-- Ubuntu UI javascript imports - Ambiance theme -->
131+ <script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/fast-buttons.js"></script>
132+ <script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/core.js"></script>
133+ <script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/buttons.js"></script>
134+ <script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/dialogs.js"></script>
135+ <script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/pagestacks.js"></script>
136+
137+ <!-- Application script -->
138+ <script src="app.js"></script>
139+
140+ <title>Hello World Cordova</title>
141 </head>
142+
143 <body>
144- <div class="app">
145- <h1>Apache Cordova</h1>
146- <div id="deviceready" class="blink">
147- <p class="event listening">Connecting to Device</p>
148- <p class="event received">Device is Ready</p>
149+
150+ <div data-role="page">
151+
152+ <header data-role="header">
153+ <nav data-role="navbar" class="tabs" >
154+ <div class="tabs-inner">
155+ <ul>
156+ <li class="active" role="tab">
157+ <a href="#item1" class="tab-item">HTML5/Cordova</a>
158+ </li>
159+ </ul>
160+ </div>
161+ </nav>
162+ </header>
163+
164+ <div data-role="content">
165+ <div data-role="pagestack">
166+ <div data-role="page" id="main">
167+ <h1>Apache Cordova Loaded</h1>
168+ <img src="img/logo.png"/>
169+ </div>
170+ </div>
171+ </div>
172+
173+ <div data-role="dialog" id="loading">
174+ <section>
175+ <h1>Apache Cordova Loading</h1>
176+ <progress></progress>
177+ </section>
178+ </div>
179+
180+ <div data-role="dialog" id="deviceready">
181+ <section>
182+ <h1>Deviceready event received</h1>
183+ <button data-role="button" id="devicereadyOK" class="success">OK</button>
184+ </section>
185 </div>
186 </div>
187-
188- <script language="javascript" type="text/javascript" src="file:///usr/share/cordova-ubuntu-2.8/www/cordova-2.8.js"></script>
189- <script language="javascript" type="text/javascript">
190- document.addEventListener("deviceready", function() {
191- var parentElement = document.getElementById("deviceready");
192- var listeningElement = parentElement.querySelector('.listening');
193- var receivedElement = parentElement.querySelector('.received');
194-
195- listeningElement.setAttribute('style', 'display:none;');
196- receivedElement.setAttribute('style', 'display:block;');
197- }, false);
198- </script>
199-
200 </body>
201 </html>
202

Subscribers

People subscribed via source and target branches

to all changes: