summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 22:14:59 +0000
committerdhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 22:14:59 +0000
commit21116a3982fa6a87189cdd0333315e8f74b36acc (patch)
tree9b0a057f53e53cbdad408dcef5fba927b9cce613
parent9829efd0c87eab5bf281a8799511d7f9ef42c1d1 (diff)
downloadchromium_src-21116a3982fa6a87189cdd0333315e8f74b36acc.zip
chromium_src-21116a3982fa6a87189cdd0333315e8f74b36acc.tar.gz
chromium_src-21116a3982fa6a87189cdd0333315e8f74b36acc.tar.bz2
Removing fwd button, make back button take you back up to the root.
BUG=chromium-os:2558 TEST=none Review URL: http://codereview.chromium.org/2723002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49457 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_resources.grd2
-rw-r--r--chrome/browser/resources/filebrowse.html100
2 files changed, 22 insertions, 80 deletions
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index c14c9be..e53f4d9 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This comment is only here because changes to resources are not picked up
-without changes to the corresponding grd file. tiiittttrrrr -->
+without changes to the corresponding grd file. weeetsa -->
<grit latest_public_release="0" current_release="1">
<outputs>
<output filename="grit/browser_resources.h" type="rc_header">
diff --git a/chrome/browser/resources/filebrowse.html b/chrome/browser/resources/filebrowse.html
index beccc57..3155dbf 100644
--- a/chrome/browser/resources/filebrowse.html
+++ b/chrome/browser/resources/filebrowse.html
@@ -348,19 +348,11 @@ div.iconmusic {
}
div.backbutton {
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
+ border-radius: 4px;
left: 6px;
top: 3px
}
-div.fwdbutton {
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- left: 31px;
- top: 3px;
-}
-
div.playbackcontainer {
top: 0;
left: 0;
@@ -592,7 +584,7 @@ function partial(fn, var_args) {
};
}
-var pathArray = [];
+var currentSavedPath = '';
var currentNode = -1;
var menus = [];
var currentImageMenu = '';
@@ -618,10 +610,18 @@ var kPauseDownload;
var kResumeDownload;
function goBackInList() {
- if (currentNode > 0) {
- currentNode--;
- getDataForPath(pathArray[currentNode]);
+ currentNode--;
+ if (currentSavedPath == localStrings.getString('downloadpath')) {
+ currentSavedPath = 'roots'
+ } else {
+ var lastDirArray = currentSavedPath.split('/');
+ lastDirArray.splice(lastDirArray.length-1, 1);
+ currentSavedPath = lastDirArray.join('/');
+ }
+ if (currentSavedPath == localStrings.getString('mediapath')) {
+ currentSavedPath = 'roots';
}
+ getDataForPath(currentSavedPath);
}
function toggleFullscreen() {
@@ -634,13 +634,6 @@ function toggleFullscreen() {
}
}
-function goForwardInList() {
- if (currentNode < (pathArray.length - 1)) {
- currentNode++;
- getDataForPath(pathArray[currentNode]);
- }
-}
-
var lastScrollLeft = 0;
function animateScrollRight() {
@@ -723,29 +716,6 @@ function moveScrollLeft() {
main.scrollLeft += 10;
}
-function setUpForPlayback(path) {
- var mediapath = 'file://' + path;
- var header = $('header');
- document.body.removeChild(header);
- var main = mainColumn;
- main.className = 'playbackcontainer';
- var elementType;
- if (pathIsVideoFile(path)) {
- elementType = 'video';
- } else if (pathIsAudioFile(path)) {
- elementType = 'audio';
- } else {
- // close because we can't deal with this.
- return;
- }
- var element = document.createElement(elementType);
- element.className = 'mediacontainer';
- element.autoplay = true;
- element.controls = true;
- element.src = mediapath;
- main.appendChild(element);
-}
-
function getClassForPath(path, isDirectory) {
if (isDirectory) {
return 'icon iconfolder';
@@ -811,7 +781,7 @@ function dialogCancelClick() {
function dialogSaveClick() {
var filenameInput = $('filename');
var filename = filenameInput.value;
- var currentPath = pathArray[pathArray.length - 1];
+ var currentPath = currentSavedPath;
if (currentPath == 'roots') {
return;
}
@@ -849,7 +819,7 @@ function createNewFormItem(initialName, isDirectory, id, blurcallback, keypressc
};
function createFolder(elementId) {
- var currentPath = pathArray[pathArray.length - 1];
+ var currentPath = currentSavedPath;
var element = $('newfoldername');
if (element) {
element.id = '';
@@ -1194,7 +1164,6 @@ function load() {
main.appendChild(innerContainer);
inFullMode = true;
$('back').style.display = 'none';
- $('fwd').style.display = 'none';
}
if (document.location.href.indexOf('#') != -1) {
@@ -1202,16 +1171,14 @@ function load() {
var path = currentpathArray[1];
if (path == 'scanningdevice') {
setUpForScanning();
- } else if (pathIsVideoFile(path) || pathIsAudioFile(path)) {
- setUpForPlayback(path);
} else {
currentNode++;
- pathArray.push(path);
+ currentSavedPath = path;
getDataForPath(path);
}
} else {
currentNode++;
- pathArray.push('roots');
+ currentSavedPath = 'roots';
getDataForPath('roots');
}
chrome.send("getDownloads", []);
@@ -1233,16 +1200,13 @@ function jumpToNode(nodeNumber) {
}
function descend(path, nodeNumber) {
- if (pathArray.length <currentNode) {
- pathArray = pathArray.slice(0, currentNode);
- }
jumpToNode(nodeNumber);
currentNode++;
if (selectFolder) {
currentlySelectedPaths = [];
currentlySelectedPaths.push(path);
}
- pathArray.push(path);
+ currentSavedPath = path;
getDataForPath(path);
}
@@ -1259,26 +1223,8 @@ function clearPreviewPane() {
}
function playMediaFile(path) {
- if (inFullMode) {
- if (videoPlaybackElement == null) {
- videoPlaybackElement = document.createElement('video');
- videoPlaybackElement.className = 'playbackelement';
- videoPlaybackElement.autoplay = true;
- videoPlaybackElement.controls = true;
- videoPlaybackElement.src = 'file://' + path;
- var toggleButton = document.createElement('div');
- toggleButton.className = 'fullscreentoggle';
- toggleButton.id = 'fullscreentoggle';
- toggleButton.onclick = toggleFullscreen;
- document.body.appendChild(toggleButton);
- document.body.appendChild(videoPlaybackElement);
- } else {
- videoPlaybackElement.src = 'file://' + path;
- }
- } else {
- var newPath = 'file://' + path;
- chrome.send('playMediaFile', [newPath]);
- }
+ var newPath = 'file://' + path;
+ chrome.send('playMediaFile', [newPath]);
}
function enqueueMediaFile(path) {
@@ -1306,7 +1252,6 @@ function showText(path) {
}
function clearMenus() {
-
if (currentMenu) {
currentMenu.firstChild.style.display = 'none';
currentMenu.style.opacity = '';
@@ -1465,7 +1410,7 @@ function createNewItem(title, path, isDirectory) {
element.appendChild(link);
// Setup Menu
- var currentPath = pathArray[pathArray.length - 1];
+ var currentPath = currentSavedPath;
if (currentPath != 'roots') {
var menuicon = document.createElement('div');
var menu = document.createElement('div');
@@ -1563,9 +1508,6 @@ function createNewList(title, results, main, path) {
<div id='back' class='backbutton controlbutton' onclick='goBackInList();return false;'>
<img src="../../app/theme/filebrowse_back.png" width='100%' height='100%'>
</div>
- <div id='fwd' class='fwdbutton controlbutton' onclick='goForwardInList();return false;'>
- <img src="../../app/theme/filebrowse_forward.png" width='100%' height='100%'>
- </div>
<div id='currenttitle' class=''></div>
</div><br>
<div id='main' class='container'></div>