Index: chrome/browser/resources/file_manager/slideshow.html |
=================================================================== |
--- chrome/browser/resources/file_manager/slideshow.html (revision 82141) |
+++ chrome/browser/resources/file_manager/slideshow.html (working copy) |
@@ -45,7 +45,7 @@ |
} |
#prevbutton > div { |
- background: url('shared/images/mediaplayer_prev.png'); |
+ background: url('chrome://resources/images/mediaplayer_prev.png'); |
background-repeat: no-repeat; |
background-position: 4px 8px; |
width: 100%; |
@@ -75,7 +75,7 @@ |
} |
#nextbutton > div { |
- background: url('shared/images/mediaplayer_next.png'); |
+ background: url('chrome://resources/images/mediaplayer_next.png'); |
background-repeat: no-repeat; |
background-position: 4px 8px; |
width: 100%; |
@@ -99,8 +99,8 @@ |
} |
</style> |
-<script src="shared/js/local_strings.js"></script> |
-<script src="shared/js/media_common.js"></script> |
+<script src="chrome://resources/js/local_strings.js"></script> |
+<script src="chrome://resources/js/media_common.js"></script> |
<script> |
document.addEventListener('DOMContentLoaded', load); |
@@ -146,7 +146,7 @@ |
}, 10); |
} |
-function transitionTo(path, fromTheRight) { |
+function transitionTo(fileEntry, fromTheRight) { |
if (currentPicture) { |
if (prevPicture) { |
$('main').removeChild(prevPicture); |
@@ -166,20 +166,16 @@ |
lastimg = image; |
image.onload = loadedPicture; |
image.onerror = loadedPicture; |
- document.location.hash = path; |
- image.src = 'file://' + path; |
+ image.src = 'filesystem:' + |
+ chrome.extension.getURL('/external/' + fileEntry.fullPath); |
currentPicture.appendChild(image); |
moveRight = fromTheRight; |
} |
-function browseFileResult(info, results) { |
- filelist = results; |
- if (info.currentOffset) { |
- currentFileOffset = info.currentOffset; |
- } else { |
- currentFileOffset = 0; |
- } |
- transitionTo(filelist[currentFileOffset].path, true); |
+function browseFileResult() { |
+ filelist = chrome.extension.getBackgroundPage().getLastFileEntries(); |
+ currentFileOffset = 0; |
+ transitionTo(filelist[currentFileOffset], true); |
zel
2011/04/20 16:51:21
you should test filelist.lenght here
serya%chromium.org
2011/04/21 14:05:31
Done.
|
} |
function keyPressed(e) { |
@@ -187,14 +183,14 @@ |
if (e.keyCode == 37) { |
if (currentFileOffset > 0) { |
currentFileOffset--; |
- transitionTo(filelist[currentFileOffset].path, false); |
+ transitionTo(filelist[currentFileOffset], false); |
} |
} |
// Right Pressed |
if (e.keyCode == 39) { |
if (currentFileOffset < (filelist.length - 1)) { |
currentFileOffset++; |
- transitionTo(filelist[currentFileOffset].path, true); |
+ transitionTo(filelist[currentFileOffset], true); |
} |
} |
} |
@@ -202,34 +198,25 @@ |
function load() { |
localStrings = new LocalStrings(); |
- document.onkeydown = keyPressed; |
- if (document.location.href.indexOf('#') != -1) { |
- var currentpathArray = document.location.href.split('#'); |
- var path = currentpathArray[1]; |
- chrome.send('getChildren', [path]); |
- } |
+ browseFileResult(); |
} |
function prevButtonClick() { |
if (currentFileOffset > 0) { |
currentFileOffset--; |
- transitionTo(filelist[currentFileOffset].path, false); |
+ transitionTo(filelist[currentFileOffset], false); |
} |
} |
function nextButtonClick() { |
zel
2011/04/20 16:51:21
The slideshow is now looping through the list of s
serya%chromium.org
2011/04/21 14:05:31
Will do separately since it's a new feature.
|
if (currentFileOffset < (filelist.length - 1)) { |
currentFileOffset++; |
- transitionTo(filelist[currentFileOffset].path, true); |
+ transitionTo(filelist[currentFileOffset], true); |
} |
} |
-function toggleFullscreen() { |
- chrome.send('toggleFullscreen', ['']); |
-} |
- |
</script> |
-<body> |
+<body onkeydown="keyPressed(event)"> |
<div id="main"></div> |
<div id="glow"></div> |
<div id="playercontrols"> |