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

Commit

Permalink
Indentation Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Quacky2200 committed Jan 14, 2017
1 parent 7372c55 commit d3587fc
Show file tree
Hide file tree
Showing 16 changed files with 609 additions and 626 deletions.
104 changes: 52 additions & 52 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,42 @@ App = (function(){
class App {
constructor(){
this.settings = require('./app-settings')(
`${App.paths.home}/preferences.json`,
{
CloseToTray: true,
CloseToController: false,
ShowApplicationMenu: true,
ShowTray: true,
TrayIcon: 'lime',
Notifications: {
ShowTrackChange: true,
ShowPlaybackPlaying: true,
ShowPlaybackPaused: true,
ShowPlaybackStopped: true,
OnlyWhenFocused: true
},
NavBar: {
Follow: true,
User: true,
Radio: true,
YourMusic: true,
Browse: true,
Settings: true,
Search: true,
Sing: true
},
AlbumCacheDisabled: false,
Theme: 'dark',
StartOnLogin: false,
StartHidden: false,
lastURL: null
}
);
this.settings.open((err, data) => {
if(err){
`${App.paths.home}/preferences.json`,
{
CloseToTray: true,
CloseToController: false,
ShowApplicationMenu: true,
ShowTray: true,
TrayIcon: 'lime',
Notifications: {
ShowTrackChange: true,
ShowPlaybackPlaying: true,
ShowPlaybackPaused: true,
ShowPlaybackStopped: true,
OnlyWhenFocused: true
},
NavBar: {
Follow: true,
User: true,
Radio: true,
YourMusic: true,
Browse: true,
Settings: true,
Search: true,
Sing: true
},
AlbumCacheDisabled: false,
Theme: 'dark',
StartOnLogin: false,
StartHidden: false,
lastURL: null
}
);
this.settings.open((err, data) => {
if(err){
console.log("The settings are corrupt, cannot continue.");
process.exit(-1);
}
}
});
this.dbus = require('./dbus')(App.names.process);
require('./plugins')(app);
Expand All @@ -75,27 +75,27 @@ App = (function(){
_spotify = new Spotify();
});
app.on('quit', () => {
console.log('Exiting...');
console.log('Exiting...');
});
//Make sure we only run one instance of the application
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
// Someone tried to run a second instance, we should focus our window.
if (_spotify) {
if (_spotify.isMinimized()) _spotify.restore();
_spotify.show();
_spotify.focus();
}
// Someone tried to run a second instance, we should focus our window.
if (_spotify) {
if (_spotify.isMinimized()) _spotify.restore();
_spotify.show();
_spotify.focus();
}
});
//Quit if we're trying to run another instance
if (shouldQuit) {
console.log('An instance is already running, exiting...');
app.quit();
return;
console.log('An instance is already running, exiting...');
app.quit();
return;
}
//Let's support OS X anyways.
app.on('activate', function () {
_spotify.show();
_spotify.unmaximize();
_spotify.show();
_spotify.unmaximize();
});
}
get VERSION(){
Expand Down Expand Up @@ -205,12 +205,12 @@ App = (function(){
}
clearCache(){
_spotify.loadURL("about:blank");
_spotify.webContents.session.clearCache(() => {
_spotify.webContents.session.clearStorageData(() => {
console.log("Cleared session and cache.");
_spotify.loadURL(this.HOST);
});
});
_spotify.webContents.session.clearCache(() => {
_spotify.webContents.session.clearStorageData(() => {
console.log("Cleared session and cache.");
_spotify.loadURL(this.HOST);
});
});
}
}
return App;
Expand Down
15 changes: 6 additions & 9 deletions dbus.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ module.exports = function(appName){
class DBusMediaKeys extends EventEmitter{
constructor(bus){
super();

bus.getInterface('org.gnome.SettingsDaemon', '/org/gnome/SettingsDaemon/MediaKeys', 'org.gnome.SettingsDaemon.MediaKeys', (err, iface) => {
if(err) return console.log(err);
iface.on('MediaPlayerKeyPressed', (n, value) => {
this.emit(value);
});
iface.on('MediaPlayerKeyPressed', (n, value) => this.emit(value));
iface.GrabMediaPlayerKeys(0, 'org.gnome.SettingsDaemon.MediaKeys');
});
}
Expand All @@ -31,11 +28,11 @@ module.exports = function(appName){
constructor(appName) {
super();
this._player = Player({
name: appName,
identity: appName,
supportedUriSchemes: ['http'],
supportedMimeTypes: ['application/www-url'],
desktopEntry: appName
name: appName,
identity: appName,
supportedUriSchemes: ['http'],
supportedMimeTypes: ['application/www-url'],
desktopEntry: appName
});
}
on(name, func){
Expand Down
18 changes: 9 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ if (typeof electron == 'string'){
console.log(`Starting up app with Electron found at "${electron}"`);

ls.stdout.on('data', function(data) {
console.log(data.toString());
});
console.log(data.toString());
});

ls.stderr.on('data', function(data) {
console.log(data.toString());
ls.stderr.on('data', function(data) {
console.log(data.toString());
});

ls.on('close', function(code) {
console.log(`child process exited with code ${code}`);
});
ls.on('close', function(code) {
console.log(`child process exited with code ${code}`);
});
//process.exit(0);
} else if (typeof electron == 'object' && electron.app){
require('./app');
} else {
console.log('Cannot start up. Exiting...');
console.log('Cannot start up. Exiting...');
process.exit(-1);
}
}
18 changes: 9 additions & 9 deletions windows/about/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<html>
<head>
<style>
body{font-family: 'Open Sans', sans-serif, arial; overflow-x: hidden; -webkit-user-select: none;}
a{text-decoration: none;}
img {width: 350px;display: block; margin: 0 auto;padding: 20px 0;}
p{margin: 0px;}
div{padding: 0 20px;text-align: justify}
div > p{margin: 10px;}
body{font-family: 'Open Sans', sans-serif, arial; overflow-x: hidden; -webkit-user-select: none;}
a{text-decoration: none;}
img {width: 350px;display: block; margin: 0 auto;padding: 20px 0;}
p{margin: 0px;}
div{padding: 0 20px;text-align: justify}
div > p{margin: 10px;}
</style>
</head>
<body class='about'>
<img id='logo'/>
<p align='center' id='app_title_and_version'>Spotify Web Player for Linux</p>
<div id='libraries'></div>
<img id='logo'/>
<p align='center' id='app_title_and_version'>Spotify Web Player for Linux</p>
<div id='libraries'></div>
</body>
</html>
3 changes: 1 addition & 2 deletions windows/about/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ document.onreadystatechange = function(){
$('#libraries').html(html);
//For all clicks, open externally
$('a').click(click);
};

};
52 changes: 26 additions & 26 deletions windows/facebook/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ var popup = remote.getCurrentWindow();
//Thanks to http://stackoverflow.com/questions/12049620/how-to-get-get-variables-value-in-javascript
var uriQuery = {};
if(document.location.toString().indexOf('?') !== -1) {
var query = document.location
.toString()
// get the query string
.replace(/^.*?\?/, '')
// and remove any existing hash string (thanks, @vrijdenker)
.replace(/#.*$/, '')
.split('&');
var query = document.location
.toString()
// get the query string
.replace(/^.*?\?/, '')
// and remove any existing hash string (thanks, @vrijdenker)
.replace(/#.*$/, '')
.split('&');

for(var i=0, l=query.length; i<l; i++) {
var aux = decodeURIComponent(query[i]).split('=');
uriQuery[aux[0]] = aux[1];
}
for(var i=0, l=query.length; i<l; i++) {
var aux = decodeURIComponent(query[i]).split('=');
uriQuery[aux[0]] = aux[1];
}
}
//Check if we're trying to authenticate with FB.
if(window.location.href.indexOf("oauth?") >= 0){
if(!!uriQuery.app_id){
//Click the button again to make FB check the authentication with our newly created cookie
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
//Close the FB window, we don't need it anymore
popup.close();
} else if (!!uriQuery.redirect_uri){
popup.hide();
props.spotify.loadURL(props.HOST + '/?');
props.spotify.webContents.once('dom-ready', function(){
//Click the button again to make FB check the authentication with our newly created cookie
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
//Close the FB window, we don't need it anymore
popup.close();
});
}
if(!!uriQuery.app_id){
//Click the button again to make FB check the authentication with our newly created cookie
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
//Close the FB window, we don't need it anymore
popup.close();
} else if (!!uriQuery.redirect_uri){
popup.hide();
props.spotify.loadURL(props.HOST + '/?');
props.spotify.webContents.once('dom-ready', function(){
//Click the button again to make FB check the authentication with our newly created cookie
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
//Close the FB window, we don't need it anymore
popup.close();
});
}
}
Loading

0 comments on commit d3587fc

Please sign in to comment.