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

Commit d3587fc

Browse files
committed
Indentation Fixes
1 parent 7372c55 commit d3587fc

File tree

16 files changed

+609
-626
lines changed

16 files changed

+609
-626
lines changed

app.js

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,42 @@ App = (function(){
2020
class App {
2121
constructor(){
2222
this.settings = require('./app-settings')(
23-
`${App.paths.home}/preferences.json`,
24-
{
25-
CloseToTray: true,
26-
CloseToController: false,
27-
ShowApplicationMenu: true,
28-
ShowTray: true,
29-
TrayIcon: 'lime',
30-
Notifications: {
31-
ShowTrackChange: true,
32-
ShowPlaybackPlaying: true,
33-
ShowPlaybackPaused: true,
34-
ShowPlaybackStopped: true,
35-
OnlyWhenFocused: true
36-
},
37-
NavBar: {
38-
Follow: true,
39-
User: true,
40-
Radio: true,
41-
YourMusic: true,
42-
Browse: true,
43-
Settings: true,
44-
Search: true,
45-
Sing: true
46-
},
47-
AlbumCacheDisabled: false,
48-
Theme: 'dark',
49-
StartOnLogin: false,
50-
StartHidden: false,
51-
lastURL: null
52-
}
53-
);
54-
this.settings.open((err, data) => {
55-
if(err){
23+
`${App.paths.home}/preferences.json`,
24+
{
25+
CloseToTray: true,
26+
CloseToController: false,
27+
ShowApplicationMenu: true,
28+
ShowTray: true,
29+
TrayIcon: 'lime',
30+
Notifications: {
31+
ShowTrackChange: true,
32+
ShowPlaybackPlaying: true,
33+
ShowPlaybackPaused: true,
34+
ShowPlaybackStopped: true,
35+
OnlyWhenFocused: true
36+
},
37+
NavBar: {
38+
Follow: true,
39+
User: true,
40+
Radio: true,
41+
YourMusic: true,
42+
Browse: true,
43+
Settings: true,
44+
Search: true,
45+
Sing: true
46+
},
47+
AlbumCacheDisabled: false,
48+
Theme: 'dark',
49+
StartOnLogin: false,
50+
StartHidden: false,
51+
lastURL: null
52+
}
53+
);
54+
this.settings.open((err, data) => {
55+
if(err){
5656
console.log("The settings are corrupt, cannot continue.");
5757
process.exit(-1);
58-
}
58+
}
5959
});
6060
this.dbus = require('./dbus')(App.names.process);
6161
require('./plugins')(app);
@@ -75,27 +75,27 @@ App = (function(){
7575
_spotify = new Spotify();
7676
});
7777
app.on('quit', () => {
78-
console.log('Exiting...');
78+
console.log('Exiting...');
7979
});
8080
//Make sure we only run one instance of the application
8181
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
82-
// Someone tried to run a second instance, we should focus our window.
83-
if (_spotify) {
84-
if (_spotify.isMinimized()) _spotify.restore();
85-
_spotify.show();
86-
_spotify.focus();
87-
}
82+
// Someone tried to run a second instance, we should focus our window.
83+
if (_spotify) {
84+
if (_spotify.isMinimized()) _spotify.restore();
85+
_spotify.show();
86+
_spotify.focus();
87+
}
8888
});
8989
//Quit if we're trying to run another instance
9090
if (shouldQuit) {
91-
console.log('An instance is already running, exiting...');
92-
app.quit();
93-
return;
91+
console.log('An instance is already running, exiting...');
92+
app.quit();
93+
return;
9494
}
9595
//Let's support OS X anyways.
9696
app.on('activate', function () {
97-
_spotify.show();
98-
_spotify.unmaximize();
97+
_spotify.show();
98+
_spotify.unmaximize();
9999
});
100100
}
101101
get VERSION(){
@@ -205,12 +205,12 @@ App = (function(){
205205
}
206206
clearCache(){
207207
_spotify.loadURL("about:blank");
208-
_spotify.webContents.session.clearCache(() => {
209-
_spotify.webContents.session.clearStorageData(() => {
210-
console.log("Cleared session and cache.");
211-
_spotify.loadURL(this.HOST);
212-
});
213-
});
208+
_spotify.webContents.session.clearCache(() => {
209+
_spotify.webContents.session.clearStorageData(() => {
210+
console.log("Cleared session and cache.");
211+
_spotify.loadURL(this.HOST);
212+
});
213+
});
214214
}
215215
}
216216
return App;

dbus.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ module.exports = function(appName){
1717
class DBusMediaKeys extends EventEmitter{
1818
constructor(bus){
1919
super();
20-
2120
bus.getInterface('org.gnome.SettingsDaemon', '/org/gnome/SettingsDaemon/MediaKeys', 'org.gnome.SettingsDaemon.MediaKeys', (err, iface) => {
2221
if(err) return console.log(err);
23-
iface.on('MediaPlayerKeyPressed', (n, value) => {
24-
this.emit(value);
25-
});
22+
iface.on('MediaPlayerKeyPressed', (n, value) => this.emit(value));
2623
iface.GrabMediaPlayerKeys(0, 'org.gnome.SettingsDaemon.MediaKeys');
2724
});
2825
}
@@ -31,11 +28,11 @@ module.exports = function(appName){
3128
constructor(appName) {
3229
super();
3330
this._player = Player({
34-
name: appName,
35-
identity: appName,
36-
supportedUriSchemes: ['http'],
37-
supportedMimeTypes: ['application/www-url'],
38-
desktopEntry: appName
31+
name: appName,
32+
identity: appName,
33+
supportedUriSchemes: ['http'],
34+
supportedMimeTypes: ['application/www-url'],
35+
desktopEntry: appName
3936
});
4037
}
4138
on(name, func){

main.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ if (typeof electron == 'string'){
77
console.log(`Starting up app with Electron found at "${electron}"`);
88

99
ls.stdout.on('data', function(data) {
10-
console.log(data.toString());
11-
});
10+
console.log(data.toString());
11+
});
1212

13-
ls.stderr.on('data', function(data) {
14-
console.log(data.toString());
13+
ls.stderr.on('data', function(data) {
14+
console.log(data.toString());
1515
});
1616

17-
ls.on('close', function(code) {
18-
console.log(`child process exited with code ${code}`);
19-
});
17+
ls.on('close', function(code) {
18+
console.log(`child process exited with code ${code}`);
19+
});
2020
//process.exit(0);
2121
} else if (typeof electron == 'object' && electron.app){
2222
require('./app');
2323
} else {
24-
console.log('Cannot start up. Exiting...');
24+
console.log('Cannot start up. Exiting...');
2525
process.exit(-1);
26-
}
26+
}

windows/about/about.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<html>
33
<head>
44
<style>
5-
body{font-family: 'Open Sans', sans-serif, arial; overflow-x: hidden; -webkit-user-select: none;}
6-
a{text-decoration: none;}
7-
img {width: 350px;display: block; margin: 0 auto;padding: 20px 0;}
8-
p{margin: 0px;}
9-
div{padding: 0 20px;text-align: justify}
10-
div > p{margin: 10px;}
5+
body{font-family: 'Open Sans', sans-serif, arial; overflow-x: hidden; -webkit-user-select: none;}
6+
a{text-decoration: none;}
7+
img {width: 350px;display: block; margin: 0 auto;padding: 20px 0;}
8+
p{margin: 0px;}
9+
div{padding: 0 20px;text-align: justify}
10+
div > p{margin: 10px;}
1111
</style>
1212
</head>
1313
<body class='about'>
14-
<img id='logo'/>
15-
<p align='center' id='app_title_and_version'>Spotify Web Player for Linux</p>
16-
<div id='libraries'></div>
14+
<img id='logo'/>
15+
<p align='center' id='app_title_and_version'>Spotify Web Player for Linux</p>
16+
<div id='libraries'></div>
1717
</body>
1818
</html>

windows/about/preload.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ document.onreadystatechange = function(){
3232
$('#libraries').html(html);
3333
//For all clicks, open externally
3434
$('a').click(click);
35-
};
36-
35+
};

windows/facebook/preload.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,34 @@ var popup = remote.getCurrentWindow();
55
//Thanks to http://stackoverflow.com/questions/12049620/how-to-get-get-variables-value-in-javascript
66
var uriQuery = {};
77
if(document.location.toString().indexOf('?') !== -1) {
8-
var query = document.location
9-
.toString()
10-
// get the query string
11-
.replace(/^.*?\?/, '')
12-
// and remove any existing hash string (thanks, @vrijdenker)
13-
.replace(/#.*$/, '')
14-
.split('&');
8+
var query = document.location
9+
.toString()
10+
// get the query string
11+
.replace(/^.*?\?/, '')
12+
// and remove any existing hash string (thanks, @vrijdenker)
13+
.replace(/#.*$/, '')
14+
.split('&');
1515

16-
for(var i=0, l=query.length; i<l; i++) {
17-
var aux = decodeURIComponent(query[i]).split('=');
18-
uriQuery[aux[0]] = aux[1];
19-
}
16+
for(var i=0, l=query.length; i<l; i++) {
17+
var aux = decodeURIComponent(query[i]).split('=');
18+
uriQuery[aux[0]] = aux[1];
19+
}
2020
}
2121
//Check if we're trying to authenticate with FB.
2222
if(window.location.href.indexOf("oauth?") >= 0){
23-
if(!!uriQuery.app_id){
24-
//Click the button again to make FB check the authentication with our newly created cookie
25-
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
26-
//Close the FB window, we don't need it anymore
27-
popup.close();
28-
} else if (!!uriQuery.redirect_uri){
29-
popup.hide();
30-
props.spotify.loadURL(props.HOST + '/?');
31-
props.spotify.webContents.once('dom-ready', function(){
32-
//Click the button again to make FB check the authentication with our newly created cookie
33-
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
34-
//Close the FB window, we don't need it anymore
35-
popup.close();
36-
});
37-
}
23+
if(!!uriQuery.app_id){
24+
//Click the button again to make FB check the authentication with our newly created cookie
25+
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
26+
//Close the FB window, we don't need it anymore
27+
popup.close();
28+
} else if (!!uriQuery.redirect_uri){
29+
popup.hide();
30+
props.spotify.loadURL(props.HOST + '/?');
31+
props.spotify.webContents.once('dom-ready', function(){
32+
//Click the button again to make FB check the authentication with our newly created cookie
33+
props.spotify.webContents.executeJavaScript("document.getElementById('fb-signup-btn').click();");
34+
//Close the FB window, we don't need it anymore
35+
popup.close();
36+
});
37+
}
3838
}

0 commit comments

Comments
 (0)