Permalink
Browse files

Parsear correctamente archivos PDF y SWF

Fixes #1
  • Loading branch information...
1 parent 8427e0d commit 4fef939aa54b7e4e0d31f611ca1f477828e934f5 @HispachanFiles committed Aug 5, 2016
Showing with 2,306 additions and 1,760 deletions.
  1. +3 −1 client/components/thread.js
  2. +2 −2 components/parsers/parsePost.js
  3. +1 −1 components/parsers/parseThread.js
  4. +2,289 −1,745 public/dist/app.js
  5. +10 −10 public/dist/app.min.js
  6. +1 −1 public/semantic
@@ -17,7 +17,9 @@ export default class Thread
{
let expandUrl = $(imgEl).parent().parent().prop('href');
if(expandUrl.substr(-4) == 'webm') return;
-
+ if(expandUrl.substr(-3) == 'pdf') return;
+ if(expandUrl.substr(-3) == 'swf') return;
+
if($(imgEl).is('[expand]'))
{
// Fix para imágenes muy altas
@@ -74,8 +74,8 @@ function postMeta(post, $) {
let fileMeta = fileInfo.children('span[style^="font-size"]').first();
let fileMetaR = fileMeta.text().replace(/(\r\n|\n|\r|[()])/gm, "").split(',');
let fileSize = fileMetaR[0].trim();
- let fileRes = (fileMetaR.length > 2) ? fileMetaR[1].trim() : '';
- let fileON = (fileMetaR.length > 2) ? fileMetaR[2].trim() : fileMetaR[1].trim();
+ let fileRes = (fileMetaR.length > 1) ? fileMetaR[1].trim() : '';
+ let fileON = (fileMetaR.length > 1) ? fileMetaR[2].trim() : fileInfo.find('a').first().attr('href').split('/').reverse()[0];
data.file = {
url: fileInfo.find('a').first().attr('href'),
size: fileSize,
@@ -14,7 +14,7 @@ function threadMeta(thread, $) {
// Metadatos básicos
data = postMeta(thread);
data.board = $('input[name="board"]').val();
- data.subject = $('span.filetitle').first().text().replace(/(\r\n|\n|\r)/gm, "");
+ data.subject = thread.find('span.filetitle').first().text().replace(/(\r\n|\n|\r)/gm, "");
var replies = thread.find(".reply");
data.replyCount = replies.length;
var omitted = thread.find(".omittedposts");
Oops, something went wrong.

0 comments on commit 4fef939

Please sign in to comment.