diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index 118c8d6..2b22d45 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -267,17 +267,15 @@ Viewer.prototype = { var r = elements[i]; r.addEventListener('click', function() { - if(this.className.search("checked") == -1) - this.className += " checked"; + if(!this.classList.contains("checked")) + this.classList.add("checked"); else - this.className = "ir"; + this.classList.remove("checked"); }); } }, init_after_loading_content : function() { - this.initialize_radio_button(); - this.sidebar = document.getElementById(this.config['sidebar_id']); this.outline = document.getElementById(this.config['outline_id']); this.container = document.getElementById(this.config['container_id']); @@ -329,6 +327,7 @@ Viewer.prototype = { ele.addEventListener('click', self.link_handler.bind(self), false); }); + this.initialize_radio_button(); this.render(); }, diff --git a/src/HTMLRenderer/form.cc b/src/HTMLRenderer/form.cc index b8b0521..9acff2c 100644 --- a/src/HTMLRenderer/form.cc +++ b/src/HTMLRenderer/form.cc @@ -44,30 +44,34 @@ void HTMLRenderer::process_form(ofstream & out) { font_size = height / 2; - out - << "" << endl; - } - - if(w->getType() == formButton) + out << "" << endl; + } + else if(w->getType() == formButton) { + //Ideally would check w->getButtonType() + //for more specific rendering width += 3; height += 3; - out - << "
" << endl; - + out << "
" << endl; + } + else if(w->getType() == formChoice || + w->getType() == formSignature || + w->getType() == formUndef) + { + cerr << "Unsupported form field detected" << endl; } } }