Skip to content

Commit

Permalink
updated example page
Browse files Browse the repository at this point in the history
  • Loading branch information
purplecabbage committed Dec 14, 2013
1 parent 8a09f25 commit 49bd58f
Showing 1 changed file with 44 additions and 32 deletions.
76 changes: 44 additions & 32 deletions docs/liveTilesExample.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <!-- ISO-8859-1 -->
<title>Live Tiles</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen"/>


<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
<script type="text/javascript" charset="utf-8" src="liveTiles.js"></script>

<script type="text/javascript" charset="utf-8">
<style>

button {
width:300px;
height:36px;
margin:4px 0px;
}

var secondaryTile = 'www/liveTiles.html';
</style>

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">

/**
* Function called when page has finished loading.
*/
function init() {

}
var secondaryTile = 'www/liveTiles.html';

function updateAppTile() {
console.log('Update app tile');
Expand All @@ -35,7 +33,7 @@
console.log("Error occurred: " + e);
document.getElementById('res').innerHTML = "Error occurred: " + e;
};
navigator.plugins.liveTiles.updateAppTile(success,fail,{title:document.getElementById('title').value, image:'Images/appbar.next.rest.png', count: document.getElementById('count').value, backTitle: 'Back title', backContent:'Back side', backImage : 'Images/appbar.close.rest.png'});
LiveTiles.updateAppTile(success,fail,{title:document.getElementById('title').value, image:'Images/appbar.next.rest.png', count: document.getElementById('count').value, backTitle: 'Back title', backContent:'Back side', backImage : 'Images/appbar.close.rest.png'});
};

function createSecondaryTile() {
Expand All @@ -50,7 +48,7 @@
console.log("Error occurred: " + e);
document.getElementById('res').innerHTML = "Error occurred: " + e;
};
navigator.plugins.liveTiles.createSecondaryTile(success, fail, { title: document.getElementById('title').value, image: 'Images/appbar.save.rest.png', count: document.getElementById('count').value, secondaryTileUri: secondaryTile,backTitle:'back'});
LiveTiles.createSecondaryTile(success, fail, { title: document.getElementById('title').value, image: 'Images/appbar.save.rest.png', count: document.getElementById('count').value, secondaryTileUri: secondaryTile,backTitle:'back'});
};

function updateSecondaryTile() {
Expand All @@ -65,7 +63,7 @@
console.log("Error occurred: " + e);
document.getElementById('res').innerHTML = "Error occurred: " + e;
};
navigator.plugins.liveTiles.updateSecondaryTile(success, fail, { title: document.getElementById('title').value, count: document.getElementById('count').value, secondaryTileUri: secondaryTile });
LiveTiles.updateSecondaryTile(success, fail, { title: document.getElementById('title').value, count: document.getElementById('count').value, secondaryTileUri: secondaryTile });
};

function deleteSecondaryTile() {
Expand All @@ -81,29 +79,43 @@
document.getElementById('res').innerHTML = "Error occurred: " + e;
};

navigator.plugins.liveTiles.deleteSecondaryTile(success, fail, { secondaryTileUri: secondaryTile });
LiveTiles.deleteSecondaryTile(success, fail, { secondaryTileUri: secondaryTile });
};

</script>
</script>

</head>
<body onLoad="init();" id="stage" class="theme">

<body>

<h1>Live tile</h1>
<div id="info">
<b>New title:</b> <span id="Span1"></span><br/>
<h1>Live Tile</h1>

<div id="info">
<div>
<strong>New title:</strong>
<div id="Span1"></div>
</div>

<input type="text" id="title" value="new title" style="width:250px;height:20px;"/>
<br/>
<b>New count:</b> <span id="Span2"></span><br/>

<div>
<strong>New count:</strong>
<div id="Span2"></div>
</div>

<input type="text" id="count" value="10" style="width:250px;height:20px;"/>
<br/>
<b>Result:</b> <span id="res"></span>

<div>
<strong>Result:</strong>
<div id="res"></div>
</div>
</div>

<h2>Action</h2>
<a href="#" class="btn large" onclick="updateAppTile();">Update application tile</a>
<a href="#" class="btn large" onclick="createSecondaryTile();">Create secondary tile </br>(will open this page)</a>
<a href="#" class="btn large" onclick="updateSecondaryTile();">Update secondary tile</a>
<a href="#" class="btn large" onclick="deleteSecondaryTile();">Delete secondary tile</a>
<h2>&nbsp;</h2><a href="index.html" class="backBtn">Back</a>
<button onclick="updateAppTile();">Update application tile</button>
<button onclick="createSecondaryTile();">Create secondary tile (will open this page)</button>
<button onclick="updateSecondaryTile();">Update secondary tile</button>
<button onclick="deleteSecondaryTile();">Delete secondary tile</button>

</body>
</html>

0 comments on commit 49bd58f

Please sign in to comment.