Added 'defaults' to config.js

This commit is contained in:
Mattias Erming 2014-09-15 14:54:01 -07:00
parent c3552319cd
commit b6f6cc160e
2 changed files with 86 additions and 14 deletions

View File

@ -12,7 +12,7 @@
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
<link id="theme" rel="stylesheet" href="<%=theme%>">
<link id="theme" rel="stylesheet" href="<%= theme %>">
<link rel="shortcut icon" href="/img/favicon.png">
<link href="/img/apple-touch-icon-120x120.png" rel="apple-touch-icon" sizes="120x120">
@ -91,17 +91,17 @@
<label>Name</label>
</div>
<div class="col-sm-9">
<input class="input" name="name" value="Freenode">
<input class="input" name="name" value="<%= defaults.name %>">
</div>
<div class="col-sm-3">
<label>Server</label>
</div>
<div class="col-sm-6 col-xs-8">
<input class="input" name="host" value="irc.freenode.org">
<input class="input" name="host" value="<%= defaults.host %>">
</div>
<div class="col-sm-3 col-xs-4">
<div class="port">
<input class="input" name="port" value="6697">
<input class="input" name="port" value="<%= defaults.port %>">
</div>
</div>
<div class="clearfix"></div>
@ -109,12 +109,12 @@
<label>Password</label>
</div>
<div class="col-sm-9">
<input class="input" type="password" name="password">
<input class="input" type="password" name="password" value="<%= defaults.password %>">
</div>
<div class="col-sm-3"></div>
<div class="col-sm-9">
<label class="tls">
<input type="checkbox" name="tls" checked="checked">
<input type="checkbox" name="tls" <%= defaults.tls ? 'checked="checked"' : '' %>>
Enable TLS/SSL
</label>
</div>
@ -126,20 +126,20 @@
<label>Nick</label>
</div>
<div class="col-sm-5">
<input class="input" name="nick" value="shout-user">
<input class="input" name="nick" value="<%= defaults.nick %>">
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<label>Real Name</label>
</div>
<div class="col-sm-9">
<input class="input" name="realname" class="input" value="Shout User">
<input class="input" name="realname" class="input" value="<%= defaults.realname %>">
</div>
<div class="col-sm-3">
<label>Channels</label>
</div>
<div class="col-sm-9">
<input class="input" name="join" class="input" value="#foo, #shout-irc">
<input class="input" name="join" class="input" value="<%= defaults.join %>">
</div>
<div class="col-sm-3 clearfix"></div>
<div class="col-sm-9">
@ -223,7 +223,7 @@
</div>
<div class="col-sm-12">
<p class="about">
You're currently running version <small><%=version%></small><br>
You're currently running version <small><%= version %></small><br>
<a href="http://github.com/erming/shout" target="_blank">Check for updates</a>
</p>
</div>

View File

@ -7,9 +7,9 @@ module.exports = {
//
// @type boolean
// @default false
//
//
public: true,
//
// Allow connections from this host.
//
@ -17,7 +17,7 @@ module.exports = {
// @default "0.0.0.0"
//
host: "0.0.0.0",
//
// Set the port to listen on.
//
@ -50,5 +50,77 @@ module.exports = {
// @type string
// @default false
//
debug: false
debug: false,
//
// Default values for the 'Connect' form.
//
// @type object
// @default {}
//
defaults: {
//
// Name
//
// @type string
// @default "Freenode"
//
name: "Freenode",
//
// Host
//
// @type string
// @default "irc.freenode.org"
//
host: "irc.freenode.org",
//
// Port
//
// @type int
// @default 6697
//
port: 6697,
//
// Password
//
// @type string
// @default ""
//
password: "",
//
// Enable TLS/SSL
//
// @type boolean
// @default true
//
tls: true,
//
// Nick
//
// @type string
// @default "shout-user"
//
nick: "shout-user",
//
// Real Name
//
// @type string
// @default "Shout User"
//
realname: "Shout User",
//
// Channels
//
// @type string
// @default "#foo, #shout-irc"
//
join: "#foo, #shout-irc"
}
};