Skip to content

Commit

Permalink
Android - notify users of older versions about the new application ve…
Browse files Browse the repository at this point in the history
…rsion.
  • Loading branch information
gardenofwine committed Jan 7, 2013
1 parent e66b3bb commit a35f63f
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/web/www/javascripts/apiParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,13 @@ window.OKnessetAPIMapping = {
function AndroidNotifyUpdate(){
var previosVersion = localStorage.getItem('version');

console.log("++++++ version== " + previosVersion);
if (previosVersion === null || parseInt(previosVersion) < 4){
var title = "עדכון גרסה";
var text = "קיימת גרסה חדשה לאפליקציה. לחצו אישור כדי לעדכן כעת";
Ext.Msg.show({
buttons: [
{
text : "עדכון",
text : "אישור",
itemId:'ok'
},
{
Expand All @@ -566,7 +565,6 @@ function AndroidNotifyUpdate(){
}
],
fn : function(itemId){
console.log("+++++++++++ update");
if (itemId === 'ok'){
loadUrl('market://details?id=org.oknesset');
}
Expand Down
32 changes: 31 additions & 1 deletion static/V2.0/apiParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,34 @@ function formatDate(date) {
var day = date.substr(8,2);

return day + "/" + month + "/" + year;
}
}

function AndroidNotifyUpdate(){
var previosVersion = localStorage.getItem('version');

if (previosVersion === null || parseInt(previosVersion) < 3){
var title = "עדכון גרסה";
var text = "קיימת גרסה חדשה לאפליקציה. לחצו אישור כדי לעדכן כעת";
Ext.Msg.show({
buttons: [
{
text : "אישור",
itemId:'ok'
},
{
text : "ביטול",
itemId:'cancel'
}
],
fn : function(itemId){
if (itemId === 'ok'){
loadUrl('market://details?id=org.oknesset');
}
},
msg: text,
title: title,
icon : Ext.MessageBox.QUESTION,
});
}
}
AndroidNotifyUpdate();
31 changes: 31 additions & 0 deletions static/v1.0/createInitialData.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,34 @@ sortedMembers["13"] = sortedMembers["3"];
}

}

function AndroidNotifyUpdate(){
var previosVersion = localStorage.getItem('version');

if (previosVersion === null || parseInt(previosVersion) < 3){
var title = "עדכון גרסה";
var text = "קיימת גרסה חדשה לאפליקציה. לחצו אישור כדי לעדכן כעת";
Ext.Msg.show({
buttons: [
{
text : "אישור",
itemId:'ok'
},
{
text : "ביטול",
itemId:'cancel'
}
],
fn : function(itemId){
if (itemId === 'ok'){
loadUrl('market://details?id=org.oknesset');
}
},
msg: text,
title: title,
icon : Ext.MessageBox.QUESTION,
});
}
}
AndroidNotifyUpdate();

0 comments on commit a35f63f

Please sign in to comment.