Skip to content

Commit

Permalink
Fixing single quote bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alseambusher committed Sep 26, 2016
1 parent 42c5d01 commit adcaab0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions public/js/script.js
@@ -1,3 +1,4 @@
/*jshint esversion: 6 */
/*********** MessageBox ****************/
// simply show info. Only close button
function infoMessageBox(message, title){
Expand Down Expand Up @@ -84,7 +85,6 @@ function editJob(_id){
}
schedule = job.schedule;
job_command = job.command;
console.log(job.logging)
if (job.logging && job.logging != "false")
$("#job-logging").prop("checked", true);
job_string();
Expand All @@ -95,13 +95,13 @@ function editJob(_id){
// TODO good old boring validations
$.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: _id, logging: $("#job-logging").prop("checked")}, function(){
location.reload();
})
});
});
}

function newJob(){
schedule = ""
job_command = ""
schedule = "";
job_command = "";
$("#job-minute").val("*");
$("#job-hour").val("*");
$("#job-day").val("*");
Expand All @@ -117,7 +117,7 @@ function newJob(){
// TODO good old boring validations
$.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: -1, logging: $("#job-logging").prop("checked")}, function(){
location.reload();
})
});
});
}

Expand Down
3 changes: 1 addition & 2 deletions views/index.ejs
Expand Up @@ -13,7 +13,7 @@
$(function () {
// initialize tooltips
$('[data-toggle="tooltip"]').tooltip();
crontabs = JSON.parse('<%- crontabs.replace(/\\\\/g, "\\\\\\\\").replace(/\\\"/g,"\\\\\"") %>');
crontabs = JSON.parse('<%- crontabs.replace(/\\\\/g, "\\\\\\\\").replace(/\\\"/g,"\\\\\"").replace(/\'/g,"\\\'") %>');
routes = JSON.parse('<%- routes %>');
$("#env_vars").val(`<%- env %>`);
})
Expand Down Expand Up @@ -89,7 +89,6 @@
<a class="btn btn-info" onclick="startJob('<%= crontab._id %>')"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> Start</a>
<% } %>
<a class="btn btn-danger" onclick="deleteJob('<%= crontab._id %>')"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
</td>
</tr>
<% }); %>
Expand Down
2 changes: 1 addition & 1 deletion views/restore.ejs
Expand Up @@ -11,7 +11,7 @@
$(function () {
// initialize tooltips
$('[data-toggle="tooltip"]').tooltip();
crontabs = JSON.parse('<%- crontabs.replace(/\\\"/g,"\\\\\"") %>');
crontabs = JSON.parse('<%- crontabs.replace(/\\\\/g, "\\\\\\\\").replace(/\\\"/g,"\\\\\"").replace(/\'/g,"\\\'") %>');
routes = JSON.parse('<%- routes %>');
})
</script>
Expand Down

0 comments on commit adcaab0

Please sign in to comment.