Skip to content

Commit 38b4544

Browse files
committed
replaces libwebsockets with mongoose, changed licese to gpl
add search support add playlist support various fixups C Cleanup
1 parent 160386b commit 38b4544

File tree

14 files changed

+628
-2293
lines changed

14 files changed

+628
-2293
lines changed

CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,27 @@ option(WITH_MPD_HOST_CHANGE "Let users of the web frontend change the MPD Host"
1111
find_package(LibMPDClient REQUIRED)
1212
find_package(Threads REQUIRED)
1313

14-
configure_file(${PROJECT_SOURCE_DIR}/src/config.h.in
15-
${PROJECT_BINARY_DIR}/config.h)
14+
configure_file(src/config.h.in ${PROJECT_BINARY_DIR}/config.h)
1615
include_directories(${PROJECT_BINARY_DIR})
1716

1817
include(CheckCSourceCompiles)
19-
include(CPack)
2018

2119
set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
2220
set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
2321

22+
file(GLOB RESOURCES
23+
RELATIVE ${PROJECT_SOURCE_DIR}
24+
htdocs/js/*
25+
htdocs/assets/*
26+
htdocs/css/*.min.css
27+
htdocs/fonts/*
28+
htdocs/index.html
29+
)
30+
2431
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/http_files.h
25-
COMMAND perl mkdata.pl index.html js/* assets/* css/* fonts/* > ${PROJECT_BINARY_DIR}/http_files.h
26-
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/htdocs
32+
COMMAND perl htdocs/mkdata.pl ${RESOURCES} > ${PROJECT_BINARY_DIR}/http_files.h
33+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
34+
DEPENDS ${RESOURCES}
2735
)
2836

2937
set(SOURCES

LICENSE

Lines changed: 340 additions & 22 deletions
Large diffs are not rendered by default.

htdocs/css/mpd.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ body {
2828
min-width: 50px;
2929
}
3030

31+
#search {
32+
margin-right: -10px;
33+
}
34+
3135
.btn-group-hover {
3236
opacity: 20%;
3337
}

htdocs/css/mpd.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

htdocs/index.html

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
<title>ympd</title>
1111

1212
<!-- Bootstrap core CSS -->
13-
<link href="css/bootstrap.css" rel="stylesheet">
13+
<link href="css/bootstrap.min.css" rel="stylesheet">
14+
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
1415

1516
<!-- Custom styles for this template -->
16-
<link href="css/mpd.css" rel="stylesheet">
17+
<link href="css/mpd.min.css" rel="stylesheet">
1718
<link href="assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
1819

1920
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
@@ -37,9 +38,8 @@
3738
<div class="collapse navbar-collapse">
3839

3940
<ul id="nav_links" class="nav navbar-nav">
40-
<li id="playlist"><a href="#/">Playlist</a></li>
41+
<li id="queue"><a href="#/">Queue</a></li>
4142
<li id="browse"><a href="#/browse/">Browse database</a></li>
42-
<li><a href="#" data-toggle="modal" data-target="#about">About</a></li>
4343
<li><a href="#" data-toggle="modal" data-target="#settings" onclick="getHost();">Settings</a></li>
4444
</ul>
4545

@@ -65,6 +65,11 @@
6565
</div>
6666
</div>
6767
</div>
68+
<form id="search" class="navbar-form navbar-right" role="search">
69+
<div class="form-group">
70+
<input type="text" class="form-control" placeholder="Search">
71+
</div>
72+
</form>
6873
</div><!--/.nav-collapse -->
6974
</div>
7075
</div>
@@ -77,7 +82,7 @@
7782

7883
<div class="panel panel-primary">
7984
<!-- Default panel contents -->
80-
<div id="panel-heading" class="panel-heading">Playlist</div>
85+
<div id="panel-heading" class="panel-heading">Queue</div>
8186
<div class="panel-body">
8287
<h1>
8388
<span id="track-icon" class="glyphicon glyphicon-play"></span>
@@ -150,42 +155,21 @@ <h4>
150155
</div><!-- /.container -->
151156

152157
<!-- Modal -->
153-
<div class="modal fade" id="about" tabindex="-1" role="dialog" aria-labelledby="aboutLabel" aria-hidden="true">
158+
<div class="modal fade" id="settings" tabindex="-1" role="dialog" aria-labelledby="settingsLabel" aria-hidden="true">
154159
<div class="modal-dialog">
155160
<div class="modal-content">
156161
<div class="modal-header">
157162
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
158-
<h2 class="modal-title" id="aboutLabel">About</h2>
163+
<h2 class="modal-title" id="settingsLabel"><span class="glyphicon glyphicon-wrench"></span> Settings</h2>
159164
</div>
160165
<div class="modal-body">
161166
<h4><a href="http://www.ympd.org"><span class="glyphicon glyphicon-play-circle"></span> ympd</a>&nbsp;&nbsp;&nbsp;<small>MPD Web GUI - written in C, utilizing Websockets and Bootstrap/JS</small></h4>
162167
<p>
163168
ympd is a lightweight MPD (Music Player Daemon) web client that runs without a dedicated werbserver or interpreters like PHP, NodeJS or Ruby. It's tuned for minimal resource usage and requires only very litte dependencies.</p>
164-
<p class="text-muted">
165-
ympd <span id="ympd_version"></span><br/>
166-
libmpdclient <span id="mpd_version"></span><br/>
167-
</p>
168169
<h5>ympd uses following excellent software:</h5>
169-
<h6><a href="http://libwebsockets.org">libWebSockets</a> <small>LGPL2.1 + static link exception</small></h6>
170+
<h6><a href="http://cesanta.com/docs.html">Mongoose</a> <small>GPLv2</small></h6>
170171
<h6><a href="http://www.musicpd.org/libs/libmpdclient/">libMPDClient</a> <small>BSD License</small></h6>
171-
<br/>
172-
</div>
173-
<div class="modal-footer">
174-
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
175-
</div>
176-
</div><!-- /.modal-content -->
177-
</div><!-- /.modal-dialog -->
178-
</div><!-- /.modal -->
179-
180-
<!-- Modal -->
181-
<div class="modal fade" id="settings" tabindex="-1" role="dialog" aria-labelledby="settingsLabel" aria-hidden="true">
182-
<div class="modal-dialog">
183-
<div class="modal-content">
184-
<div class="modal-header">
185-
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
186-
<h2 class="modal-title" id="settingsLabel"><span class="glyphicon glyphicon-wrench"></span> Settings</h2>
187-
</div>
188-
<div class="modal-body">
172+
<hr />
189173
<form role="form">
190174
<div class="row">
191175
<div class="form-group col-md-9">

0 commit comments

Comments
 (0)