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/bootstrap.css">
<link rel="stylesheet" href="css/style.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 rel="shortcut icon" href="/img/favicon.png">
<link href="/img/apple-touch-icon-120x120.png" rel="apple-touch-icon" sizes="120x120"> <link href="/img/apple-touch-icon-120x120.png" rel="apple-touch-icon" sizes="120x120">
@ -91,17 +91,17 @@
<label>Name</label> <label>Name</label>
</div> </div>
<div class="col-sm-9"> <div class="col-sm-9">
<input class="input" name="name" value="Freenode"> <input class="input" name="name" value="<%= defaults.name %>">
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<label>Server</label> <label>Server</label>
</div> </div>
<div class="col-sm-6 col-xs-8"> <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>
<div class="col-sm-3 col-xs-4"> <div class="col-sm-3 col-xs-4">
<div class="port"> <div class="port">
<input class="input" name="port" value="6697"> <input class="input" name="port" value="<%= defaults.port %>">
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@ -109,12 +109,12 @@
<label>Password</label> <label>Password</label>
</div> </div>
<div class="col-sm-9"> <div class="col-sm-9">
<input class="input" type="password" name="password"> <input class="input" type="password" name="password" value="<%= defaults.password %>">
</div> </div>
<div class="col-sm-3"></div> <div class="col-sm-3"></div>
<div class="col-sm-9"> <div class="col-sm-9">
<label class="tls"> <label class="tls">
<input type="checkbox" name="tls" checked="checked"> <input type="checkbox" name="tls" <%= defaults.tls ? 'checked="checked"' : '' %>>
Enable TLS/SSL Enable TLS/SSL
</label> </label>
</div> </div>
@ -126,20 +126,20 @@
<label>Nick</label> <label>Nick</label>
</div> </div>
<div class="col-sm-5"> <div class="col-sm-5">
<input class="input" name="nick" value="shout-user"> <input class="input" name="nick" value="<%= defaults.nick %>">
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-sm-3"> <div class="col-sm-3">
<label>Real Name</label> <label>Real Name</label>
</div> </div>
<div class="col-sm-9"> <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>
<div class="col-sm-3"> <div class="col-sm-3">
<label>Channels</label> <label>Channels</label>
</div> </div>
<div class="col-sm-9"> <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>
<div class="col-sm-3 clearfix"></div> <div class="col-sm-3 clearfix"></div>
<div class="col-sm-9"> <div class="col-sm-9">
@ -223,7 +223,7 @@
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<p class="about"> <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> <a href="http://github.com/erming/shout" target="_blank">Check for updates</a>
</p> </p>
</div> </div>

View File

@ -50,5 +50,77 @@ module.exports = {
// @type string // @type string
// @default false // @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"
}
}; };