Skip to content

Commit e21d3b4

Browse files
committed
Merge pull request #228 from 10gen/INT-793-help-windows-squash
INT-793 Added help window
2 parents 035dce7 + ba0e293 commit e21d3b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1143
-62
lines changed

gulpfile.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ gulp.task('watch', function() {
9595
gulp.watch(['src/*.jade'], ['build:pages']);
9696
gulp.watch('images/{*,**/*}', ['copy:images']);
9797
gulp.watch('fonts/*', ['copy:fonts']);
98+
gulp.watch('src/help/entries/*.md', ['copy:text']);
9899
gulp.watch(['src/electron/{*,**/*}'], ['copy:js']);
99100
gulp.watch('package.json', function() {
100101
gutil.log('package.json changed!');
@@ -232,8 +233,12 @@ gulp.task('copy:package.json', function() {
232233
});
233234

234235
gulp.task('copy:text', function() {
235-
return gulp.src(['README.md'])
236-
.pipe(gulp.dest('build/'));
236+
return merge(
237+
gulp.src('README.md')
238+
.pipe(gulp.dest('build/')),
239+
gulp.src('src/help/entries/*.md')
240+
.pipe(gulp.dest('build/src/help/entries'))
241+
);
237242
});
238243

239244
// Copy non-UI js into the build.

images/help/dev/view_hierarchy.png

207 KB
Loading
11.8 KB
Loading
13.5 KB
Loading

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@
7777
"debug": "^2.2.0",
7878
"electron-squirrel-startup": "^0.1.4",
7979
"keytar": "mongodb-js/node-keytar",
80+
"highlight.js": "^8.9.1",
8081
"localforage": "^1.3.0",
82+
"marky-mark": "^1.2.1",
8183
"mongodb-collection-model": "^0.1.1",
8284
"mongodb-connection-model": "^3.0.7",
8385
"mongodb-instance-model": "^1.0.2",

src/app.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var MongoDBInstance = require('./models/mongodb-instance');
2828
var User = require('./models/user');
2929
var Router = require('./router');
3030
var Statusbar = require('./statusbar');
31+
var $ = require('jquery');
3132

3233
var debug = require('debug')('scout:app');
3334

@@ -119,7 +120,12 @@ var Application = View.extend({
119120
user: User
120121
},
121122
events: {
122-
'click a': 'onLinkClick'
123+
'click a': 'onLinkClick',
124+
'click i.help': 'onHelpClicked'
125+
},
126+
onHelpClicked: function(evt) {
127+
var id = $(evt.target).attr('data-hook');
128+
app.sendMessage('show help window', id);
123129
},
124130
onClientReady: function() {
125131
debug('Client ready! Took %dms to become readable',
@@ -284,12 +290,12 @@ app.extend({
284290
setFeature: function(id, bool) {
285291
FEATURES[id] = bool;
286292
},
287-
sendMessage: function(msg, arg1) {
288-
ipc.send('message', msg, arg1);
293+
sendMessage: function(msg, arg) {
294+
ipc.send('message', msg, arg);
289295
},
290-
onMessageReceived: function(msg) {
291-
debug('message received from main process:', msg);
292-
this.trigger(msg);
296+
onMessageReceived: function(msg, arg) {
297+
debug('message received from main process:', msg, arg);
298+
this.trigger(msg, arg);
293299
},
294300
metrics: metrics,
295301
init: function() {

src/connect/authentication.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ var MONGODB = {
3838
new InputView({
3939
template: inputTemplate,
4040
name: 'mongodb_database_name',
41-
label: 'Database Name',
41+
label: 'Authentication Database',
4242
placeholder: 'admin',
43+
helpEntry: 'connect-userpass-auth-db',
4344
required: false
4445
})
4546
]
@@ -57,6 +58,7 @@ var KERBEROS = {
5758
name: 'kerberos_principal',
5859
label: 'Principal',
5960
placeholder: '',
61+
helpEntry: 'connect-kerberos-principal',
6062
required: true,
6163
tests: [
6264
function(value) {

src/connect/connect-form-view.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ var ConnectFormView = FormView.extend({
187187
name: 'name',
188188
label: 'Favorite Name',
189189
placeholder: 'e.g. Shared Dev, QA Box, PRODUCTION',
190+
helpEntry: 'connect-favorite-name',
190191
required: false
191192
})
192193
];

src/connect/filereader-default.jade

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.form-item
2-
label(data-hook='label')= label
2+
label
3+
span(data-hook='label')= label
4+
if helpEntry
5+
i.help(data-hook='#{helpEntry}')
36
.message.message-below.message-error(data-hook='message-container')
47
p(data-hook='message-text')
58
.form-item-file

src/connect/filereader-view.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ module.exports = InputView.extend({
3030
type: 'boolean',
3131
required: true,
3232
default: false
33+
},
34+
helpEntry: {
35+
type: 'string',
36+
default: null
3337
}
3438
},
3539
derived: {
@@ -91,6 +95,9 @@ module.exports = InputView.extend({
9195
_.defaults(spec, {
9296
value: []
9397
});
98+
if (spec.helpEntry) {
99+
this.helpEntry = spec.helpEntry;
100+
}
94101
this.invalidClass = 'has-error';
95102
this.validityClassSelector = '.form-item-file';
96103
InputView.prototype.initialize.call(this, spec);

0 commit comments

Comments
 (0)