Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 42abd3d

Browse files
author
Pat Patterson
committed
Updated jQuery Mobile to latest
1 parent 254b010 commit 42abd3d

File tree

2 files changed

+29
-32
lines changed

2 files changed

+29
-32
lines changed

mobileapp.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ function addClickListeners() {
4848
$('#deletebtn').click(function(e) {
4949
// Delete the account
5050
e.preventDefault();
51-
$.mobile.pageLoading();
51+
$.mobile.loading('show');
5252
client.del('Account', $('#accountdetail').find('#Id').val()
5353
,
5454
function(response) {
5555
getAccounts(function() {
56-
$.mobile.pageLoading(true);
56+
$.mobile.loading('hide');
5757
$.mobile.changePage('#mainpage', "slide", true, true);
5858
});
5959
}, errorCallback);
@@ -62,7 +62,7 @@ function addClickListeners() {
6262
$('#editbtn').click(function(e) {
6363
// Get account fields and show the 'Edit Account' form
6464
e.preventDefault();
65-
$.mobile.pageLoading();
65+
$.mobile.loading('show');
6666
client.retrieve("Account", $('#accountdetail').find('#Id').val()
6767
, "Name,Id,Industry,TickerSymbol",
6868
function(response) {
@@ -74,7 +74,7 @@ function addClickListeners() {
7474
$('#actionbtn')
7575
.unbind('click.btn')
7676
.bind('click.btn', updateHandler);
77-
$.mobile.pageLoading(true);
77+
$.mobile.loading('hide');
7878
$.mobile.changePage('#editpage', "slide", false, true);
7979
}, errorCallback);
8080
});
@@ -94,7 +94,7 @@ function getAccounts(callback) {
9494
.append('<a href="#"><h2>' + this.Name + '</h2></a>')
9595
.click(function(e) {
9696
e.preventDefault();
97-
$.mobile.pageLoading();
97+
$.mobile.loading('show');
9898
// We could do this more efficiently by adding Industry and
9999
// TickerSymbol to the fields in the SELECT, but we want to
100100
// show dynamic use of the retrieve function...
@@ -105,7 +105,7 @@ function getAccounts(callback) {
105105
$('#Industry').text(response.Industry);
106106
$('#TickerSymbol').text(response.TickerSymbol);
107107
$('#Id').val(response.Id);
108-
$.mobile.pageLoading(true);
108+
$.mobile.loading('hide');
109109
$.mobile.changePage('#detailpage', "slide", false, true);
110110
}, errorCallback);
111111
})
@@ -132,11 +132,11 @@ function createHandler(e) {
132132
fields[child.attr("name")] = child.val();
133133
}
134134
});
135-
$.mobile.pageLoading();
135+
$.mobile.loading('show');
136136
client.create('Account', fields,
137137
function(response) {
138138
getAccounts(function() {
139-
$.mobile.pageLoading(true);
139+
$.mobile.loading('hide');
140140
$.mobile.changePage('#mainpage', "slide", true, true);
141141
});
142142
}, errorCallback);
@@ -153,12 +153,12 @@ function updateHandler(e) {
153153
fields[child.attr("name")] = child.val();
154154
}
155155
});
156-
$.mobile.pageLoading();
156+
$.mobile.loading('show');
157157
client.update('Account', accountform.find('#Id').val(), fields
158158
,
159159
function(response) {
160160
getAccounts(function() {
161-
$.mobile.pageLoading(true);
161+
$.mobile.loading('hide');
162162
$.mobile.changePage('#mainpage', "slide", true, true);
163163
});
164164
}, errorCallback);

phonegap.html

+19-22
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
from the CDN, but then the device needs to be online for the app to
4949
be functional.
5050
-->
51-
<link rel="stylesheet" href="css/jquery.mobile-1.0a4.1.min.css" />
52-
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
53-
<script type="text/javascript" src="js/jquery.mobile-1.0a4.1.min.js"></script>
51+
<link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" />
52+
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
53+
<script type="text/javascript" src="js/jquery.mobile-1.4.5.min.js"></script>
5454
<script type="text/javascript" src="js/forcetk.js"></script>
5555
<script type="text/javascript" src="js/mobileapp.js"></script>
5656
<script type="text/javascript" src="cordova.js"></script>
@@ -90,7 +90,7 @@
9090
function() {
9191
client.setRefreshToken(null);
9292
$.mobile.changePage('#loginpage', "slide", false, true);
93-
$.mobile.pageLoading();
93+
$.mobile.loading('show');
9494
var ref = window.open(getAuthorizeUrl(loginUrl, clientId, redirectUri), '_blank', 'location=no,toolbar=no');
9595
ref.addEventListener('loadstop', function(evt) {
9696
if (evt.url.startsWith(redirectUri)) {
@@ -105,9 +105,9 @@
105105
});
106106

107107
$.mobile.changePage('#mainpage', "slide", false, true);
108-
$.mobile.pageLoading();
108+
$.mobile.loading('show');
109109
getAccounts(function() {
110-
$.mobile.pageLoading(true);
110+
$.mobile.loading('hide');
111111
});
112112
}
113113

@@ -152,7 +152,7 @@
152152
keychain = new Keychain();
153153
keychain.getForKey(
154154
function(value) {
155-
$.mobile.pageLoading();
155+
$.mobile.loading('show');
156156
client.setRefreshToken(value);
157157
client.refreshAccessToken(sessionCallback,
158158
function(jqXHR, textStatus, errorThrown) {
@@ -173,7 +173,7 @@
173173
</script>
174174
</head>
175175
<body>
176-
<div data-role="page" data-theme="b" id="loginpage">
176+
<div data-role="page" data-theme="a" id="loginpage">
177177
<div data-role="header">
178178
<h1>Login</h1>
179179
</div>
@@ -184,16 +184,15 @@ <h1>Login</h1>
184184
<h4>Force.com</h4>
185185
</div>
186186
</div>
187-
<div data-role="page" data-theme="b" id="mainpage">
188-
<div data-role="header" data-backbtn="false">
187+
<div data-role="page" data-theme="a" id="mainpage">
188+
<div data-role="header">
189189
<h1>Account List</h1>
190190
</div>
191191
<div data-role="content">
192192
<form>
193193
<button data-role="button" id="newbtn">New</button>
194194
</form>
195-
<ul id="accountlist" data-inset="true" data-role="listview"
196-
data-theme="c" data-dividertheme="b">
195+
<ul id="accountlist" data-inset="true" data-role="listview">
197196
</ul>
198197
<form>
199198
<button data-role="button" id="logoutbtn">Logout</button>
@@ -203,8 +202,8 @@ <h1>Account List</h1>
203202
<h4>Force.com</h4>
204203
</div>
205204
</div>
206-
<div data-role="page" data-theme="b" id="detailpage">
207-
<div data-role="header">
205+
<div data-role="page" data-theme="a" id="detailpage">
206+
<div data-role="header" data-add-back-btn="true">
208207
<h1>Account Detail</h1>
209208
</div>
210209
<div data-role="content">
@@ -217,15 +216,15 @@ <h1>Account Detail</h1>
217216
<input type="hidden" name="Id" id="Id" />
218217
<button data-role="button" id="editbtn">Edit</button>
219218
<button data-role="button" id="deletebtn" data-icon="delete"
220-
data-theme="e">Delete</button>
219+
data-theme="b">Delete</button>
221220
</form>
222221
</div>
223222
<div data-role="footer">
224223
<h4>Force.com</h4>
225224
</div>
226225
</div>
227-
<div data-role="page" data-theme="b" id="editpage">
228-
<div data-role="header">
226+
<div data-role="page" data-theme="a" id="editpage">
227+
<div data-role="header" data-add-back-btn="true">
229228
<h1 id="accformheader">New Account</h1>
230229
</div>
231230
<div data-role="content">
@@ -234,17 +233,15 @@ <h1 id="accformheader">New Account</h1>
234233
<table>
235234
<tr>
236235
<td>Account Name:</td>
237-
<td><input name="Name" id="Name" data-theme="c"/></td>
236+
<td><input name="Name" id="Name" /></td>
238237
</tr>
239238
<tr>
240239
<td>Industry:</td>
241-
<td><input name="Industry" id="Industry"
242-
data-theme="c"/></td>
240+
<td><input name="Industry" id="Industry" /></td>
243241
</tr>
244242
<tr>
245243
<td>Ticker Symbol:</td>
246-
<td><input name="TickerSymbol" id="TickerSymbol"
247-
data-theme="c"/></td>
244+
<td><input name="TickerSymbol" id="TickerSymbol" /></td>
248245
</tr>
249246
</table>
250247
<button data-role="button" id="actionbtn">Action</button>

0 commit comments

Comments
 (0)