whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Allow all PDFs to be parsed
Date Thu, 28 Nov 2019 16:23:11 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 484bdc2  Allow all PDFs to be parsed
484bdc2 is described below

commit 484bdc25f8942559cf9b554075843db300a579e2
Author: Sebb <sebb@apache.org>
AuthorDate: Thu Nov 28 16:22:49 2019 +0000

    Allow all PDFs to be parsed
---
 www/secretary/workbench/views/parts.js.rb | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/www/secretary/workbench/views/parts.js.rb b/www/secretary/workbench/views/parts.js.rb
index 6f05196..c40521c 100644
--- a/www/secretary/workbench/views/parts.js.rb
+++ b/www/secretary/workbench/views/parts.js.rb
@@ -82,6 +82,8 @@ class Parts < Vue
       _li.divider
       _li "\u2716 delete", onMousedown: self.delete_attachment
       _li "\u2709 pdf-ize", onMousedown: self.pdfize
+      _li.divider
+      _li "parse pdf", onMousedown: self.pdfparse
     end
 
     if @selected and not @menu and @selected !~ /\.(asc|sig)$/
@@ -203,10 +205,12 @@ class Parts < Vue
           _li.divider
           _li "\u21B7 right", onMousedown: self.rotate_attachment
           _li "\u21c5 flip", onMousedown: self.rotate_attachment
-              _li "\u21B6 left", onMousedown: self.rotate_attachment
+          _li "\u21B6 left", onMousedown: self.rotate_attachment
           _li.divider
           _li "\u2716 delete", onMousedown: self.delete_attachment
           _li "\u2709 pdf-ize", onMousedown: self.pdfize
+          _li.divider
+          _li "parse pdf", onMousedown: self.pdfparse
         end
 
       elsif @form == :mail
@@ -440,6 +444,14 @@ class Parts < Vue
     }
   end
 
+  # parse pdf and display extracted data
+  def pdfparse(event)
+    message = window.parent.location.pathname
+    attachment = @menu || decodeURI(@selected)
+    url = message.sub('/workbench/','/icla-parse/') + attachment
+    window.parent.frames.content.location.href = url
+  end
+  
   ########################################################################
   #                             Update email                             #
   ########################################################################


Mime
View raw message