.spacer .progress .progress-bar(role='progressbar', aria-valuenow= (step * 10), aria-valuemin='0', aria-valuemax='100', style="width: #{step * 10}%;") span.sr-only= step * 10 | % Complete h3.gray-text.text-center Step #{step} of 10 script. $('#story-url').on('keypress', function (e) { if (e.which === 13 || e === 13) { $('#preliminary-story-submit').click(); } }); var preliminaryStorySubmit = function preliminaryStorySubmit() { var storyURL = $('#story-url').val(); $('#preliminary-story-submit').attr('disabled', 'disabled'); $.post('/stories/preliminary', { data: { url: storyURL } }) .fail(function (xhr, textStatus, errorThrown) { $('#preliminary-story-submit').attr('disabled', false); }) .done(function (data, textStatus, xhr) { if (data.alreadyPosted) { window.location = data.storyURL; } else { window.location = '/stories/submit/new-story?url=' + encodeURIComponent(data.storyURL) + '&title=' + encodeURIComponent(data.storyTitle) + '&image=' + encodeURIComponent(data.storyImage) + '&description=' + encodeURIComponent(data.storyMetaDescription); } }); } $('#preliminary-story-submit').on('click', preliminaryStorySubmit);