Skip to content

Commit 1a26e95

Browse files
committed
add js standard and auto-fix issues
1 parent c35f33f commit 1a26e95

File tree

151 files changed

+13365
-12822
lines changed

Some content is hidden

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

151 files changed

+13365
-12822
lines changed

client/lib/footable/footable.js

+4,160-4,231
Large diffs are not rendered by default.

client/lib/iconpicker/bootstrap-iconpicker.js

+502-524
Large diffs are not rendered by default.

client/lib/iconpicker/iconsets/iconset-fontawesome-all.js

+4,964-4,966
Large diffs are not rendered by default.

client/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import '/imports/startup/client/index';
1+
import '/imports/startup/client/index'

client/views/pages/login/login.js

+44-44
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
import { Template } from 'meteor/templating';
2-
import { Meteor } from 'meteor/meteor';
3-
import { Session } from 'meteor/session';
4-
import { TAPi18n } from 'meteor/tap:i18n';
5-
import { FlowRouter } from 'meteor/kadira:flow-router';
1+
import { Template } from 'meteor/templating'
2+
import { Meteor } from 'meteor/meteor'
3+
import { Session } from 'meteor/session'
4+
import { TAPi18n } from 'meteor/tap:i18n'
5+
import { FlowRouter } from 'meteor/kadira:flow-router'
66

77
Template.login.helpers({
8-
error() {
9-
return Session.get('error');
8+
error () {
9+
return Session.get('error')
1010
}
11-
});
11+
})
1212

1313
Template.login.onCreated(() => {
1414
if (FlowRouter.getRouteName() === 'dashboard.details') {
1515
if (!Meteor.userId() && !Meteor.loggingIn()) {
1616
return FlowRouter.go('welcome', {
1717
language: 'en'
18-
});
18+
})
1919
}
2020
}
21-
});
21+
})
2222

2323
Template.login.onRendered(() => {
24-
return Session.set('error', '');
25-
});
24+
return Session.set('error', '')
25+
})
2626

2727
Template.login.events({
28-
'submit form': function(event) {
29-
event.preventDefault();
30-
Session.set('error', '');
28+
'submit form': function (event) {
29+
event.preventDefault()
30+
Session.set('error', '')
3131

32-
const submit = $('#submit').ladda();
33-
submit.ladda('start');
32+
const submit = $('#submit').ladda()
33+
submit.ladda('start')
3434

35-
const usernameOrEmail = $('#usernameOrEmail').val();
36-
const password = $('#password').val();
35+
const usernameOrEmail = $('#usernameOrEmail').val()
36+
const password = $('#password').val()
3737

38-
function loginWithPasswordAsync(username, pw) {
38+
function loginWithPasswordAsync (username, pw) {
3939
return new Promise((resolve, reject) => {
4040
Meteor.loginWithPassword(username, pw, (error) => {
4141
if (error) {
42-
reject(error);
42+
reject(error)
4343
} else {
44-
resolve();
44+
resolve()
4545
}
46-
});
47-
});
46+
})
47+
})
4848
}
4949

5050
loginWithPasswordAsync(usernameOrEmail, password)
51-
.catch((error) => {
52-
if (error.reason == 'User not found') {
53-
return Meteor.callPromise('getUsernameForEmailAddress', usernameOrEmail)
54-
.then(username => loginWithPasswordAsync(username, password));
55-
}
56-
throw error;
57-
})
58-
.catch((error) => {
59-
let message = 'generic';
51+
.catch((error) => {
52+
if (error.reason == 'User not found') {
53+
return Meteor.callPromise('getUsernameForEmailAddress', usernameOrEmail)
54+
.then(username => loginWithPasswordAsync(username, password))
55+
}
56+
throw error
57+
})
58+
.catch((error) => {
59+
let message = 'generic'
6060

61-
if (error.error == 400) {
62-
message = 'missingField';
63-
} else if (error.error == 403) {
64-
message = 'incorrectPassword';
65-
} else if (['noAccountFound', 'multipleAccountsFound'].includes(error.error)) {
66-
message = error.error;
67-
}
61+
if (error.error == 400) {
62+
message = 'missingField'
63+
} else if (error.error == 403) {
64+
message = 'incorrectPassword'
65+
} else if (['noAccountFound', 'multipleAccountsFound'].includes(error.error)) {
66+
message = error.error
67+
}
6868

69-
submit.ladda('stop');
70-
Session.set('error', TAPi18n.__(`error.${message}`));
71-
});
69+
submit.ladda('stop')
70+
Session.set('error', TAPi18n.__(`error.${message}`))
71+
})
7272
}
73-
});
73+
})

client/views/pages/wiki/faq_item.js

+40-41
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { FlowRouter } from 'meteor/kadira:flow-router';
2-
import { Template } from 'meteor/templating';
3-
import { ReactiveVar } from 'meteor/reactive-var';
1+
import { FlowRouter } from 'meteor/kadira:flow-router'
2+
import { Template } from 'meteor/templating'
3+
import { ReactiveVar } from 'meteor/reactive-var'
44

5-
import SimpleSchema from 'simpl-schema';
5+
import SimpleSchema from 'simpl-schema'
66

77
Template.faq_item.onCreated(function () {
88
this.autorun(() => {
@@ -13,67 +13,66 @@ Template.faq_item.onCreated(function () {
1313
'faq._id': String,
1414
'faq.question': String,
1515
'faq.answer': { type: String, optional: true }
16-
}).validate(Template.currentData());
17-
});
16+
}).validate(Template.currentData())
17+
})
1818

19-
this.editing = new ReactiveVar(false);
19+
this.editing = new ReactiveVar(false)
2020

2121
this.toggleEditing = (editing) => {
2222
this.editing.set(editing)
2323
if (editing) {
24-
this.$('.note-editor').removeClass('hidden');
25-
}
26-
else {
27-
this.$('.note-editor').addClass('hidden');
24+
this.$('.note-editor').removeClass('hidden')
25+
} else {
26+
this.$('.note-editor').addClass('hidden')
2827
}
2928
}
30-
});
29+
})
3130

3231
Template.faq_item.helpers({
33-
hideWhenEditing() {
34-
return Template.instance().editing.get() && 'hidden';
32+
hideWhenEditing () {
33+
return Template.instance().editing.get() && 'hidden'
3534
},
36-
hideWhenNotEditing() {
37-
return !Template.instance().editing.get() && 'hidden';
35+
hideWhenNotEditing () {
36+
return !Template.instance().editing.get() && 'hidden'
3837
}
39-
});
38+
})
4039

4140
Template.faq_item.events({
42-
'click .editQuestion': function(e, instance) {
43-
const projectId = FlowRouter.getParam('projectId');
41+
'click .editQuestion': function (e, instance) {
42+
const projectId = FlowRouter.getParam('projectId')
4443
return swalInput({
4544
swal: 'update.question',
46-
doConfirm: function(inputValue) {
47-
Meteor.call('changeQuestion', projectId, instance.data.tabId, instance.data.faq._id, inputValue);
45+
doConfirm: function (inputValue) {
46+
Meteor.call('changeQuestion', projectId, instance.data.tabId, instance.data.faq._id, inputValue)
4847
}
49-
});
48+
})
5049
},
51-
'click .js-move-faq-down': function(e, instance) {
52-
instance.data.moveFaq('down', instance.data.tabId, instance.data.faq._id);
50+
'click .js-move-faq-down': function (e, instance) {
51+
instance.data.moveFaq('down', instance.data.tabId, instance.data.faq._id)
5352
},
54-
'click .js-move-faq-up': function(e, instance) {
55-
instance.data.moveFaq('up', instance.data.tabId, instance.data.faq._id);
53+
'click .js-move-faq-up': function (e, instance) {
54+
instance.data.moveFaq('up', instance.data.tabId, instance.data.faq._id)
5655
},
57-
'click .removeFaq': function(e, instance) {
58-
const projectId = FlowRouter.getParam('projectId');
56+
'click .removeFaq': function (e, instance) {
57+
const projectId = FlowRouter.getParam('projectId')
5958
return swalYesNo({
6059
swal: 'delete.question',
6160
type: 'warning',
62-
doConfirm: function() {
63-
Meteor.call('removeFaq', projectId, instance.data.tabId, instance.data.faq._id);
61+
doConfirm: function () {
62+
Meteor.call('removeFaq', projectId, instance.data.tabId, instance.data.faq._id)
6463
}
65-
});
64+
})
6665
},
67-
'click .editFaq': function(e, instance) {
68-
instance.toggleEditing(true);
66+
'click .editFaq': function (e, instance) {
67+
instance.toggleEditing(true)
6968
},
70-
'click .changeFaq': function(e, instance) {
71-
code = instance.$('.summernote').summernote('code');
72-
Meteor.call('changeFaq', FlowRouter.getParam('projectId'), instance.data.tabId, instance.data.faq._id, code, function() {
73-
instance.toggleEditing(false);
74-
});
69+
'click .changeFaq': function (e, instance) {
70+
code = instance.$('.summernote').summernote('code')
71+
Meteor.call('changeFaq', FlowRouter.getParam('projectId'), instance.data.tabId, instance.data.faq._id, code, function () {
72+
instance.toggleEditing(false)
73+
})
7574
},
76-
'click .cancelFaq': function(e, instance) {
77-
instance.toggleEditing(false);
75+
'click .cancelFaq': function (e, instance) {
76+
instance.toggleEditing(false)
7877
}
79-
});
78+
})

0 commit comments

Comments
 (0)