Prettified Code!
This commit is contained in:
13
index.js
13
index.js
@@ -145,7 +145,7 @@ instance.prototype.actions = function (system) {
|
|||||||
id: 'project',
|
id: 'project',
|
||||||
default: 0,
|
default: 0,
|
||||||
choices: self.projects,
|
choices: self.projects,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
getCurrentTimer: {
|
getCurrentTimer: {
|
||||||
@@ -168,7 +168,12 @@ instance.prototype.action = function (action) {
|
|||||||
if (opt.project == '0') {
|
if (opt.project == '0') {
|
||||||
var body = '{"time_entry":{"description":"' + opt.description + '","created_with":"companion"}}'
|
var body = '{"time_entry":{"description":"' + opt.description + '","created_with":"companion"}}'
|
||||||
} else {
|
} else {
|
||||||
var body = '{"time_entry":{"description":"' + opt.description + '","created_with":"companion","pid":"' + opt.project + '"}}'
|
var body =
|
||||||
|
'{"time_entry":{"description":"' +
|
||||||
|
opt.description +
|
||||||
|
'","created_with":"companion","pid":"' +
|
||||||
|
opt.project +
|
||||||
|
'"}}'
|
||||||
}
|
}
|
||||||
console.log(body)
|
console.log(body)
|
||||||
break
|
break
|
||||||
@@ -294,10 +299,10 @@ instance.prototype.getProjects = function () {
|
|||||||
for (p = 0; p < result.data.length; p++) {
|
for (p = 0; p < result.data.length; p++) {
|
||||||
if ('id' in result.data[p]) {
|
if ('id' in result.data[p]) {
|
||||||
self.projects.push({
|
self.projects.push({
|
||||||
id: result.data[p].id.toString(),
|
id: result.data[p].id.toString(),
|
||||||
label: result.data[p].name,
|
label: result.data[p].name,
|
||||||
})
|
})
|
||||||
self.log('debug','Project ' + result.data[p].id + ':' + result.data[p].name)
|
self.log('debug', 'Project ' + result.data[p].id + ':' + result.data[p].name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('Projects:')
|
console.log('Projects:')
|
||||||
|
|||||||
Reference in New Issue
Block a user