Make job page poll for updates

This is a first go at having the job page update without refreshing.

The approach I’ve taken is to do all the rendering of HTML on the server side,
rather than use a Javascipt templating engine like mustache. This ensures that
we don’t have to maintain two sets of templates.

So the approach is to split the job page into partials. These partials can then:
- be included in the job page to render the whole page
- be rendered indivudually and then returned as a blob of HTML inside a JSON
  response

Then I’ve added a Javascript module which looks for areas of the page that should
be reloaded. For each area of the page it will poll a URL and re-render that
section of the page when it gets new HTML. It implements some throttling so that
API calls will never happen more frequently than 0.67 times/second.
This commit is contained in:
Chris Hill-Scott
2016-03-02 17:36:20 +00:00
parent 0e663e044f
commit b31c9fbc0d
10 changed files with 259 additions and 115 deletions

View File

@@ -54,6 +54,7 @@ gulp.task('javascripts', () => gulp
paths.src + 'javascripts/autofocus.js',
paths.src + 'javascripts/highlightTags.js',
paths.src + 'javascripts/fileUpload.js',
paths.src + 'javascripts/updateContent.js',
paths.src + 'javascripts/main.js'
])
.pipe(plugins.babel({