[Pkg-javascript-commits] [pdf.js] 253/414: Add support for bold/italic styled outline items in the viewer

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 9b126711cd29ec7ef0a54a5b58e5316fb2eb68cc
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sun Jan 31 16:39:29 2016 +0100

    Add support for bold/italic styled outline items in the viewer
---
 web/pdf_outline_viewer.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/web/pdf_outline_viewer.js b/web/pdf_outline_viewer.js
index 42331c3..142107d 100644
--- a/web/pdf_outline_viewer.js
+++ b/web/pdf_outline_viewer.js
@@ -83,6 +83,23 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
     },
 
     /**
+     * @private
+     */
+    _setStyles: function PDFOutlineView_setStyles(element, item) {
+      var styleStr = '';
+      if (item.bold) {
+        styleStr += 'font-weight: bold;';
+      }
+      if (item.italic) {
+        styleStr += 'font-style: italic;';
+      }
+
+      if (styleStr) {
+        element.setAttribute('style', styleStr);
+      }
+    },
+
+    /**
      * Prepend a button before an outline item which allows the user to toggle
      * the visibility of all outline items at that level.
      *
@@ -161,6 +178,7 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
 
           var element = document.createElement('a');
           this._bindLink(element, item);
+          this._setStyles(element, item);
           element.textContent =
             PDFJS.removeNullCharacters(item.title) || DEFAULT_TITLE;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list