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

@ -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">

View File

@ -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"
}
};