-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd50776
commit c76fb93
Showing
17 changed files
with
162 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"music":"true","desktopDanmu":"false"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,7 @@ | |
.num { | ||
margin: 5px; | ||
} | ||
|
||
#set { | ||
margin-top: 25px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
播放列表 | ||
1. 玫瑰 |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { shell } = require('electron'); | ||
|
||
$(document).ready(function() { | ||
const githubLink = document.getElementById('github'); | ||
githubLink.addEventListener('click', function(event) { | ||
shell.openExternal('http://github.com/zephyrzoom'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>系统设置</title> | ||
<link rel="stylesheet" href="../css/index.css"> | ||
<!-- Stylesheets --> | ||
<link rel="stylesheet" href="../css/photon.min.css"> | ||
<!-- Jquery --> | ||
<script> | ||
window.$ = window.jQuery = require('../js/jquery.js'); | ||
require('./github'); | ||
require('./settings'); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div class="window"> | ||
<div class="window-content"> | ||
<div class="pane-group"> | ||
<div class="pane" id="pane"> | ||
<div id="set"> | ||
<button class="btn" id="music"></button> | ||
<button class="btn" id="desktopDanmu"></button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<footer class="toolbar toolbar-footer"> | ||
<h1 class="title"><a id="github"><span class="icon icon-github"></span></a></h1> | ||
</footer> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const config = require('../util/config'); | ||
|
||
const { ipcRenderer } = require('electron'); | ||
|
||
let cfg; | ||
$(document).ready(() => { | ||
config.getConfig((data) => { | ||
cfg = data; | ||
if (data.music == 'true') { | ||
$('#music').addClass('btn-negative').text('关闭点歌'); | ||
} else { | ||
$('#music').addClass('btn-positive').text('开启点歌'); | ||
} | ||
if (data.desktopDanmu == 'true') { | ||
$('#desktopDanmu').addClass('btn-negative').text('关闭弹幕'); | ||
} else { | ||
$('#desktopDanmu').addClass('btn-positive').text('开启弹幕'); | ||
} | ||
}); | ||
|
||
$('#music').click(() => { | ||
if ($('#music').hasClass('btn-negative')) { | ||
cfg.music = 'false'; | ||
$('#music').removeClass('btn-negative').addClass('btn-positive').text('开启点歌'); | ||
} else { | ||
cfg.music = 'true'; | ||
$('#music').removeClass('btn-positive').addClass('btn-negative').text('关闭点歌'); | ||
} | ||
ipcRenderer.send('update-config', cfg); | ||
config.setConfig(cfg); | ||
}); | ||
|
||
$('#desktopDanmu').click(() => { | ||
if ($('#desktopDanmu').hasClass('btn-negative')) { | ||
cfg.desktopDanmu = 'false'; | ||
$('#desktopDanmu').removeClass('btn-negative').addClass('btn-positive').text('开启弹幕'); | ||
} else { | ||
cfg.desktopDanmu = 'true'; | ||
$('#desktopDanmu').removeClass('btn-positive').addClass('btn-negative').text('关闭弹幕'); | ||
} | ||
ipcRenderer.send('update-config', cfg); | ||
config.setConfig(cfg); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const fs = require('fs'); | ||
|
||
const CONFIG_PATH = __dirname + '/../config.json'; | ||
let config; | ||
|
||
|
||
exports.getConfig = function getConfig(callback) { | ||
fs.readFile(CONFIG_PATH, (err, data) => { | ||
if (err) throw err; | ||
config = JSON.parse(data); | ||
if (callback) { | ||
callback(config); | ||
} | ||
}); | ||
}; | ||
|
||
exports.setConfig = function setConfig(newConfig) { | ||
config = newConfig; | ||
fs.writeFile(CONFIG_PATH, JSON.stringify(config), (err) => { | ||
if (err) throw err; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
8/2/2016, 3:13:25 AM 点歌成功 | ||
8/2/2016, 3:15:25 AM 点歌成功 | ||
8/3/2016, 3:15:36 AM 点歌成功 | ||
8/3/2016, 3:16:21 AM 切歌成功 | ||
8/3/2016, 3:16:27 AM 点歌成功 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ | |
点歌升级 | ||
设置播放列表文件路径 | ||
弹幕显示的透明页面 | ||
增加系统配置文件 | ||
设置点歌开关 |