From d6723bef50acf5061d70491ae088cba948b6c773 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 7 Nov 2013 16:11:58 +0800 Subject: [PATCH] .. --- ChangeLog | 4 ++++ TODO | 3 --- share/manifest | 8 +++++--- share/pdf2htmlEX.js.in | 16 ++++++---------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9cd564..42704f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ Developing v0.11 * Compress JS with closure-compiler +* Compress CSS with YUI Compressor +* Remove jQuery +* Lots of JS code cleaning +* Enable global key handler by default v0.10 2013.10.17 diff --git a/TODO b/TODO index 0958f02..5088cb4 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,3 @@ -bind -undefined vs null -enable global key handler link handling + scale more information on demo page: diff --git a/share/manifest b/share/manifest index eeb4043..70af9d3 100644 --- a/share/manifest +++ b/share/manifest @@ -44,13 +44,15 @@ $css # entry point of pdf2htmlEX.Viewer # You can override default configuration by passing an object to the constructor of Viewer # Refer to DEFAULT_CONFIG in viewer.js for possible keys +# E.g. +# pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({ +# 'register_key_handler' : false +# }); @pdf2htmlEX.min.js """ """ diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index 06a789f..5f95553 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -276,7 +276,6 @@ this.find_pages(); - // disable dragging of background images disable_dragstart(document.getElementsByClassName(CSS_CLASS_NAMES.background_image)); @@ -291,12 +290,9 @@ }, false); // handle links - this.container.addEventListener('click', function(e) { - _.link_handler(e); - }, false); - this.outline.addEventListener('click', function(e) { - _.link_handler(e); - }, false); + [this.container, this.outline].forEach(funciton(ele) { + ele.addEventListener('click', _.link_handler.bind(_), false); + }); this.render(); }, @@ -547,8 +543,8 @@ }, // TODO - get_next_page : function() { return undefined; }, - get_prev_page : function() { return undefined; }, + get_next_page : function() { return null; }, + get_prev_page : function() { return null; }, /** * @param{number} ratio @@ -628,7 +624,7 @@ if (pl[i].is_visible()) return pl[i]; } - return; + return null; }, /** * @param{Node} ele