OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html i18n-values="dir:textdirection;"> | 2 <html i18n-values="dir:textdirection;"> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <title i18n-content="title"></title> | 5 <title i18n-content="title"></title> |
6 <style type="text/css"> | 6 <style type="text/css"> |
7 div.header { | 7 div.header { |
8 border-bottom: 1px solid #7289E2; | 8 border-bottom: 1px solid #7289E2; |
9 padding: 8px; | 9 padding: 8px; |
10 margin: 0; | 10 margin: 0; |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 function partial(fn, var_args) { | 570 function partial(fn, var_args) { |
571 var args = Array.prototype.slice.call(arguments, 1); | 571 var args = Array.prototype.slice.call(arguments, 1); |
572 return function() { | 572 return function() { |
573 // Prepend the bound arguments to the current arguments. | 573 // Prepend the bound arguments to the current arguments. |
574 var newArgs = Array.prototype.slice.call(arguments); | 574 var newArgs = Array.prototype.slice.call(arguments); |
575 newArgs.unshift.apply(newArgs, args); | 575 newArgs.unshift.apply(newArgs, args); |
576 return fn.apply(this, newArgs); | 576 return fn.apply(this, newArgs); |
577 }; | 577 }; |
578 } | 578 } |
579 | 579 |
| 580 function supportsPdf() { |
| 581 return 'application/pdf' in navigator.mimeTypes; |
| 582 } |
| 583 |
580 var currentSavedPath = ''; | 584 var currentSavedPath = ''; |
581 var currentNode = -1; | 585 var currentNode = -1; |
582 var menus = []; | 586 var menus = []; |
583 var currentImageMenu = ''; | 587 var currentImageMenu = ''; |
584 var inFullMode = false; | 588 var inFullMode = false; |
585 var inSelectMode = false; | 589 var inSelectMode = false; |
586 var videoPlaybackElement = null; | 590 var videoPlaybackElement = null; |
587 var photoPreviewElement = null; | 591 var photoPreviewElement = null; |
588 var numColumns = 0; | 592 var numColumns = 0; |
589 var divArray = []; | 593 var divArray = []; |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 photoPreviewElement.src = 'file://' + path; | 1257 photoPreviewElement.src = 'file://' + path; |
1254 document.body.appendChild(photoPreviewElement); | 1258 document.body.appendChild(photoPreviewElement); |
1255 } else { | 1259 } else { |
1256 photoPreviewElement.src = 'file://' + path; | 1260 photoPreviewElement.src = 'file://' + path; |
1257 } | 1261 } |
1258 } else { | 1262 } else { |
1259 chrome.send('openNewFullWindow', ['chrome://slideshow#' + path]); | 1263 chrome.send('openNewFullWindow', ['chrome://slideshow#' + path]); |
1260 } | 1264 } |
1261 } | 1265 } |
1262 | 1266 |
1263 function showText(path) { | 1267 function showPath(path) { |
1264 chrome.send('openNewFullWindow', ['file://' + path]); | 1268 chrome.send('openNewFullWindow', ['file://' + path]); |
1265 } | 1269 } |
1266 | 1270 |
1267 function clearMenus() { | 1271 function clearMenus() { |
1268 if (currentMenu) { | 1272 if (currentMenu) { |
1269 currentMenu.firstChild.style.display = 'none'; | 1273 currentMenu.firstChild.style.display = 'none'; |
1270 currentMenu.style.opacity = ''; | 1274 currentMenu.style.opacity = ''; |
1271 currentMenu = null; | 1275 currentMenu = null; |
1272 } | 1276 } |
1273 }; | 1277 }; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 playMediaFile(path); | 1386 playMediaFile(path); |
1383 }; | 1387 }; |
1384 } | 1388 } |
1385 if (pathIsImageFile(path)) { | 1389 if (pathIsImageFile(path)) { |
1386 return function() { | 1390 return function() { |
1387 showImage(path); | 1391 showImage(path); |
1388 } | 1392 } |
1389 } | 1393 } |
1390 if (pathIsHtmlFile(path)) { | 1394 if (pathIsHtmlFile(path)) { |
1391 return function() { | 1395 return function() { |
1392 showText(path); | 1396 showPath(path); |
1393 } | 1397 } |
1394 } | 1398 } |
| 1399 if (pathIsPdfFile(path) && supportsPdf()) { |
| 1400 return function() { |
| 1401 showPath(path); |
| 1402 } |
| 1403 } |
| 1404 |
1395 return getUnknownFileTypeHandler(); | 1405 return getUnknownFileTypeHandler(); |
1396 } | 1406 } |
1397 | 1407 |
1398 /** | 1408 /** |
1399 * Double click handler for items. | 1409 * Double click handler for items. |
1400 * | 1410 * |
1401 * @param {string} path The file path of the item. | 1411 * @param {string} path The file path of the item. |
1402 * @param {string} id The id for this item. | 1412 * @param {string} id The id for this item. |
1403 * @param {boolean} isDirectory Whether this item is a directory. | 1413 * @param {boolean} isDirectory Whether this item is a directory. |
1404 * @return {Function} The function to handle the double click. | 1414 * @return {Function} The function to handle the double click. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 flickritem.textContent = localStrings.getString('flickr'); | 1469 flickritem.textContent = localStrings.getString('flickr'); |
1460 emailitem.textContent = localStrings.getString('email'); | 1470 emailitem.textContent = localStrings.getString('email'); |
1461 picasaitem.className = 'menuitem'; | 1471 picasaitem.className = 'menuitem'; |
1462 flickritem.className = 'menuitemdisabled'; | 1472 flickritem.className = 'menuitemdisabled'; |
1463 emailitem.className = 'menuitemdisabled'; | 1473 emailitem.className = 'menuitemdisabled'; |
1464 picasaitem.onclick = partial(uploadImage, path); | 1474 picasaitem.onclick = partial(uploadImage, path); |
1465 menu.appendChild(picasaitem); | 1475 menu.appendChild(picasaitem); |
1466 menu.appendChild(flickritem); | 1476 menu.appendChild(flickritem); |
1467 menu.appendChild(emailitem); | 1477 menu.appendChild(emailitem); |
1468 } | 1478 } |
1469 if ((pathIsVideoFile(path) || pathIsAudioFile(path)) && | 1479 if ((pathIsVideoFile(path) || pathIsAudioFile(path)) && |
1470 mediaPlayerEnabled) { | 1480 mediaPlayerEnabled) { |
1471 var enqueueitem = document.createElement('div'); | 1481 var enqueueitem = document.createElement('div'); |
1472 enqueueitem.textContent = localStrings.getString('enqueue'); | 1482 enqueueitem.textContent = localStrings.getString('enqueue'); |
1473 enqueueitem.className = 'menuitem'; | 1483 enqueueitem.className = 'menuitem'; |
1474 enqueueitem.onclick = partial(enqueueMediaFile, path); | 1484 enqueueitem.onclick = partial(enqueueMediaFile, path); |
1475 menu.appendChild(enqueueitem); | 1485 menu.appendChild(enqueueitem); |
1476 } | 1486 } |
1477 var deleteitem = document.createElement('div'); | 1487 var deleteitem = document.createElement('div'); |
1478 deleteitem.textContent = localStrings.getString('delete'); | 1488 deleteitem.textContent = localStrings.getString('delete'); |
1479 deleteitem.className = 'menuitem'; | 1489 deleteitem.className = 'menuitem'; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 <div id='header' class=''> | 1554 <div id='header' class=''> |
1545 <div id='back' class='backbutton controlbutton' onclick='goBackInList();return
false;'> | 1555 <div id='back' class='backbutton controlbutton' onclick='goBackInList();return
false;'> |
1546 <img src="shared/images/filebrowse_back.png" width='100%' height='100%'> | 1556 <img src="shared/images/filebrowse_back.png" width='100%' height='100%'> |
1547 </div> | 1557 </div> |
1548 <div id='currenttitle' class=''></div> | 1558 <div id='currenttitle' class=''></div> |
1549 </div><br> | 1559 </div><br> |
1550 <div id='main' class='container'></div> | 1560 <div id='main' class='container'></div> |
1551 <div id='status' class='status'></div> | 1561 <div id='status' class='status'></div> |
1552 </body> | 1562 </body> |
1553 </html> | 1563 </html> |
OLD | NEW |