Skip to content

Commit

Permalink
API 호환문제 수정.
Browse files Browse the repository at this point in the history
  • Loading branch information
sinhyeok committed Aug 29, 2013
1 parent 7ce0354 commit b3908f1
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
1 change: 0 additions & 1 deletion IndexedDB/manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"128": "/img/icons/icon-128.png"
},
"installs_allowed_from": ["*"],
"appcache_path": "/cache.manifest",
"default_locale": "en"
}
Binary file added NetworkInformation.zip
Binary file not shown.
10 changes: 7 additions & 3 deletions NetworkInformation/connection_bandwidth.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
</head>
<body>
<button onclick="goBack();">Back</button>
<br />
<br />
<br />
<br />
<img id='pony' alt="An image showing a pony" title="My precious!">
<script>
Expand All @@ -14,10 +17,11 @@

var i = document.getElementById('pony');

if (navigator.connection.bandwidth > 2) {
i.src = "images/pony_hd.jpg";
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
if (connection.bandwidth > 2) {
i.src = "images/pony.jpg";
} else {
i.src = "images/pony_sd.jpg";
i.src = "images/turtle.jpg";
}
</script>
</body>
Expand Down
7 changes: 4 additions & 3 deletions NetworkInformation/connection_metered.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
var gIntervalId;

function poll() {
// poll stuff
alert("Polling!");
}

navigator.connection.addEventListener('change', function() {

var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
connection.addEventListener('change', function() {
if (gPreviousMetered == navigator.connection.metered) {
return;
}
Expand Down
Binary file added NetworkInformation/images/pony.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed NetworkInformation/images/pony_hd.jpg
Binary file not shown.
Binary file removed NetworkInformation/images/pony_sd.jpg
Binary file not shown.
Binary file added NetworkInformation/images/turtle.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 4 additions & 8 deletions NetworkInformation/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"version": "0.1",
"name": "NetworkInformation",
"description": "Network Information API Example App",
"launch_path": "/index.html",
"icons": {
"16": "/img/icons/icon-16.png",
"48": "/img/icons/icon-48.png",
"128": "/img/icons/icon-128.png"
},
"installs_allowed_from": ["*"],
"appcache_path": "/cache.manifest",
"default_locale": "en"
"16": "img/icon-16.png",
"48": "img/icon-48.png",
"128": "img/icon-128.png"
}
}

0 comments on commit b3908f1

Please sign in to comment.