Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #19994 from JerryShih/bug-1008026-wallpaper-flicke…
Browse files Browse the repository at this point in the history
…ring-1.3

Bug 1008026 - show thumbnail instead of full size image, r=djf
  • Loading branch information
huchengtw-moz committed Jun 13, 2014
2 parents 335f616 + b9e4e73 commit 8d6bd6c
Show file tree
Hide file tree
Showing 56 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions apps/wallpaper/js/pick.js
@@ -1,5 +1,8 @@
var wallpaperPath = '/resources/320x480/';
var wallpaperThumbnailPath = wallpaperPath + 'thumbnails/';

var Wallpaper = {
wallpapersUrl: '/resources/320x480/list.json',
wallpapersUrl: wallpaperPath + 'list.json',

init: function wallpaper_init() {
var self = this;
Expand Down Expand Up @@ -29,7 +32,8 @@ var Wallpaper = {
xhr.response.forEach(function(wallpaper) {
var div = document.createElement('div');
div.classList.add('wallpaper');
div.style.backgroundImage = 'url(resources/320x480/' + wallpaper + ')';
div.style.backgroundImage = 'url(' + wallpaperThumbnailPath +
wallpaper + ')';
self.wallpapers.appendChild(div);
});
if (cb) {
Expand All @@ -48,6 +52,9 @@ var Wallpaper = {
// Identify the wallpaper
var backgroundImage = e.target.style.backgroundImage;
var src = backgroundImage.match(/url\([\"']?([^\s\"']*)[\"']?\)/)[1];
// Get the wallpaper file name
var array = src.split('/');
src = array.length > 1 ? wallpaperPath + array.pop() : '';
// Ignore clicks that are not on one of the images
if (src == '')
return;
Expand Down
Empty file modified apps/wallpaper/resources/320x480/leaves@1.5x.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified apps/wallpaper/resources/320x480/water@1.5x.png 100755 → 100644
4 changes: 2 additions & 2 deletions apps/wallpaper/test/unit/pick_test.js
Expand Up @@ -21,9 +21,9 @@ suite('wallpaper/pick', function() {
done(function() {
var wallpapers = document.getElementById('wallpapers');
assert.equal(2, wallpapers.children.length);
assert.equal('url("resources/320x480/test_1.png")',
assert.equal('url("/resources/320x480/thumbnails/test_1.png")',
wallpapers.children[0].style.backgroundImage);
assert.equal('url("resources/320x480/test_2.png")',
assert.equal('url("/resources/320x480/thumbnails/test_2.png")',
wallpapers.children[1].style.backgroundImage);
});
});
Expand Down

0 comments on commit 8d6bd6c

Please sign in to comment.