senny / pdfjs_viewer-rails

PDF.js viewer packaged as a Rails engine.
MIT License
114 stars 175 forks source link

make the verbosity configurable #19

Closed siegy22 closed 7 years ago

siegy22 commented 8 years ago

closes #10

Why did I use a meta tag to provide the verbosity?

Because.. When a javascript file is compiled (ENV variable written to code), the js file never get's updated unless you change it. So if you set the ENV["PDFJS_VIEWER_VERBOSITY"] = "warnings", then start your server, the verbosity will be "warnings". If you then stop your server and change the ENV variable: ENV["PDFJS_VIEWER_VERBOSITY"] = "errors" and start your server back up, this won't take any affect, because the javascript file stays the same.

But in the view, this is always updated when the view is loaded. (As views are not precompiled).
So I placed the verbosity as a meta tag inside the viewer's view and then write the javscript to set it.

/cc @shanear

siegy22 commented 8 years ago

@senny can you have a look at that if possible? :grin: