Skip to content

Commit

Permalink
0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
opus1269 committed Mar 16, 2015
1 parent 59e520a commit d9e1124
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
38 changes: 23 additions & 15 deletions dist/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ function processState(key) {
// create the screen saver window
window.showScreenSaver = function () {
chrome.windows.create({url: 'screensaver.html',
left: 0,
top: 0,
width: screen.width,
height: screen.height,
focused: true,
type: 'popup'},
function (win) {
left: 0,
top: 0,
width: screen.width,
height: screen.height,
focused: true,
type: 'popup'},
function (win) {
localStorage.windowID = win.id;
chrome.windows.update(win.id, {state: 'fullscreen'});
});
Expand All @@ -130,11 +130,20 @@ window.showScreenSaver = function () {
function onIdleStateChanged(state) {
var win = parseInt(localStorage.windowID, 10);

if ((state === 'idle') && (win === -1) && JSON.parse(localStorage.enabled)) {
showScreenSaver();
}
else if((win !== -1) && !JSON.parse(localStorage.isPreview)) {
chrome.windows.remove(win);
if (!JSON.parse(localStorage.isPreview)) {
if ((state === 'idle') && JSON.parse(localStorage.enabled)) {
showScreenSaver();
}
else if (win !== -1) {
localStorage.windowID = '-1';
localStorage.isPreview = 'false';
try {
chrome.windows.remove(win);
}
catch (e) {

}
}
}
}

Expand All @@ -150,14 +159,13 @@ function onInstalled() {
initData();

processState(null);

/*

// preload the chromecast images
localStorage.removeItem('badCCImages');
if(JSON.parse(localStorage.useChromecast)) {
chromeCast.preloadImages();
}
*/


/*
// preload the author images
Expand Down
23 changes: 11 additions & 12 deletions dist/google_photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function authenticatedXhr(method, url, callback) {
var retry = true;
(function getTokenAndXhr() {
chrome.identity.getAuthToken({ 'interactive': true },
function (access_token) {
function (access_token) {
if (chrome.runtime.lastError) {
callback(chrome.runtime.lastError);
return;
Expand All @@ -20,7 +20,7 @@ function authenticatedXhr(method, url, callback) {
var xhr = new XMLHttpRequest();
xhr.open(method, url);
xhr.setRequestHeader('Authorization',
'Bearer ' + access_token);
'Bearer ' + access_token);
xhr.send();
xhr.onload = function () {
if (this.status === 401 && retry) {
Expand Down Expand Up @@ -148,16 +148,15 @@ function loadDriveAlbumList(albumList,callback) {
ct++;
val = getAlbumByID(albumList,id);
if(!val) {
album = {};
album.index = -1;
album.type = 'drive';
album.name = 'unknown';
album.id = id;
album.ct = 1;
album.thumb = item.thumbnailLink;
album.checked = false;
// album.photos = photos;
albumList.push(album);
album = {};
album.index = -1;
album.type = 'drive';
album.name = 'unknown';
album.id = id;
album.ct = 1;
album.thumb = item.thumbnailLink;
album.checked = false;
albumList.push(album);
}
else {
val.ct = val.ct + 1;
Expand Down
2 changes: 1 addition & 1 deletion dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Photo Screen Saver",
"short_name": "Photo Screen Saver",
"description": "A Screen Saver With Customizable Photo Sources",
"version": "0.0.2",
"version": "0.0.3",
"minimum_chrome_version": "38",
"icons": {
"19": "assets/icon_19.png",
Expand Down
Binary file modified dist/store.zip
Binary file not shown.

0 comments on commit d9e1124

Please sign in to comment.