Skip to content

Commit

Permalink
Updated jQuery Mobile to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Patterson committed Apr 1, 2015
1 parent 254b010 commit 42abd3d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 32 deletions.
20 changes: 10 additions & 10 deletions mobileapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ function addClickListeners() {
$('#deletebtn').click(function(e) {
// Delete the account
e.preventDefault();
$.mobile.pageLoading();
$.mobile.loading('show');
client.del('Account', $('#accountdetail').find('#Id').val()
,
function(response) {
getAccounts(function() {
$.mobile.pageLoading(true);
$.mobile.loading('hide');
$.mobile.changePage('#mainpage', "slide", true, true);
});
}, errorCallback);
Expand All @@ -62,7 +62,7 @@ function addClickListeners() {
$('#editbtn').click(function(e) {
// Get account fields and show the 'Edit Account' form
e.preventDefault();
$.mobile.pageLoading();
$.mobile.loading('show');
client.retrieve("Account", $('#accountdetail').find('#Id').val()
, "Name,Id,Industry,TickerSymbol",
function(response) {
Expand All @@ -74,7 +74,7 @@ function addClickListeners() {
$('#actionbtn')
.unbind('click.btn')
.bind('click.btn', updateHandler);
$.mobile.pageLoading(true);
$.mobile.loading('hide');
$.mobile.changePage('#editpage', "slide", false, true);
}, errorCallback);
});
Expand All @@ -94,7 +94,7 @@ function getAccounts(callback) {
.append('<a href="#"><h2>' + this.Name + '</h2></a>')
.click(function(e) {
e.preventDefault();
$.mobile.pageLoading();
$.mobile.loading('show');
// We could do this more efficiently by adding Industry and
// TickerSymbol to the fields in the SELECT, but we want to
// show dynamic use of the retrieve function...
Expand All @@ -105,7 +105,7 @@ function getAccounts(callback) {
$('#Industry').text(response.Industry);
$('#TickerSymbol').text(response.TickerSymbol);
$('#Id').val(response.Id);
$.mobile.pageLoading(true);
$.mobile.loading('hide');
$.mobile.changePage('#detailpage', "slide", false, true);
}, errorCallback);
})
Expand All @@ -132,11 +132,11 @@ function createHandler(e) {
fields[child.attr("name")] = child.val();
}
});
$.mobile.pageLoading();
$.mobile.loading('show');
client.create('Account', fields,
function(response) {
getAccounts(function() {
$.mobile.pageLoading(true);
$.mobile.loading('hide');
$.mobile.changePage('#mainpage', "slide", true, true);
});
}, errorCallback);
Expand All @@ -153,12 +153,12 @@ function updateHandler(e) {
fields[child.attr("name")] = child.val();
}
});
$.mobile.pageLoading();
$.mobile.loading('show');
client.update('Account', accountform.find('#Id').val(), fields
,
function(response) {
getAccounts(function() {
$.mobile.pageLoading(true);
$.mobile.loading('hide');
$.mobile.changePage('#mainpage', "slide", true, true);
});
}, errorCallback);
Expand Down
41 changes: 19 additions & 22 deletions phonegap.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
from the CDN, but then the device needs to be online for the app to
be functional.
-->
<link rel="stylesheet" href="css/jquery.mobile-1.0a4.1.min.css" />
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.0a4.1.min.js"></script>
<link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" />
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.4.5.min.js"></script>
<script type="text/javascript" src="js/forcetk.js"></script>
<script type="text/javascript" src="js/mobileapp.js"></script>
<script type="text/javascript" src="cordova.js"></script>
Expand Down Expand Up @@ -90,7 +90,7 @@
function() {
client.setRefreshToken(null);
$.mobile.changePage('#loginpage', "slide", false, true);
$.mobile.pageLoading();
$.mobile.loading('show');
var ref = window.open(getAuthorizeUrl(loginUrl, clientId, redirectUri), '_blank', 'location=no,toolbar=no');
ref.addEventListener('loadstop', function(evt) {
if (evt.url.startsWith(redirectUri)) {
Expand All @@ -105,9 +105,9 @@
});

$.mobile.changePage('#mainpage', "slide", false, true);
$.mobile.pageLoading();
$.mobile.loading('show');
getAccounts(function() {
$.mobile.pageLoading(true);
$.mobile.loading('hide');
});
}

Expand Down Expand Up @@ -152,7 +152,7 @@
keychain = new Keychain();
keychain.getForKey(
function(value) {
$.mobile.pageLoading();
$.mobile.loading('show');
client.setRefreshToken(value);
client.refreshAccessToken(sessionCallback,
function(jqXHR, textStatus, errorThrown) {
Expand All @@ -173,7 +173,7 @@
</script>
</head>
<body>
<div data-role="page" data-theme="b" id="loginpage">
<div data-role="page" data-theme="a" id="loginpage">
<div data-role="header">
<h1>Login</h1>
</div>
Expand All @@ -184,16 +184,15 @@ <h1>Login</h1>
<h4>Force.com</h4>
</div>
</div>
<div data-role="page" data-theme="b" id="mainpage">
<div data-role="header" data-backbtn="false">
<div data-role="page" data-theme="a" id="mainpage">
<div data-role="header">
<h1>Account List</h1>
</div>
<div data-role="content">
<form>
<button data-role="button" id="newbtn">New</button>
</form>
<ul id="accountlist" data-inset="true" data-role="listview"
data-theme="c" data-dividertheme="b">
<ul id="accountlist" data-inset="true" data-role="listview">
</ul>
<form>
<button data-role="button" id="logoutbtn">Logout</button>
Expand All @@ -203,8 +202,8 @@ <h1>Account List</h1>
<h4>Force.com</h4>
</div>
</div>
<div data-role="page" data-theme="b" id="detailpage">
<div data-role="header">
<div data-role="page" data-theme="a" id="detailpage">
<div data-role="header" data-add-back-btn="true">
<h1>Account Detail</h1>
</div>
<div data-role="content">
Expand All @@ -217,15 +216,15 @@ <h1>Account Detail</h1>
<input type="hidden" name="Id" id="Id" />
<button data-role="button" id="editbtn">Edit</button>
<button data-role="button" id="deletebtn" data-icon="delete"
data-theme="e">Delete</button>
data-theme="b">Delete</button>
</form>
</div>
<div data-role="footer">
<h4>Force.com</h4>
</div>
</div>
<div data-role="page" data-theme="b" id="editpage">
<div data-role="header">
<div data-role="page" data-theme="a" id="editpage">
<div data-role="header" data-add-back-btn="true">
<h1 id="accformheader">New Account</h1>
</div>
<div data-role="content">
Expand All @@ -234,17 +233,15 @@ <h1 id="accformheader">New Account</h1>
<table>
<tr>
<td>Account Name:</td>
<td><input name="Name" id="Name" data-theme="c"/></td>
<td><input name="Name" id="Name" /></td>
</tr>
<tr>
<td>Industry:</td>
<td><input name="Industry" id="Industry"
data-theme="c"/></td>
<td><input name="Industry" id="Industry" /></td>
</tr>
<tr>
<td>Ticker Symbol:</td>
<td><input name="TickerSymbol" id="TickerSymbol"
data-theme="c"/></td>
<td><input name="TickerSymbol" id="TickerSymbol" /></td>
</tr>
</table>
<button data-role="button" id="actionbtn">Action</button>
Expand Down

0 comments on commit 42abd3d

Please sign in to comment.