Skip to content

Commit

Permalink
Merge branch 'feature-extract-files'
Browse files Browse the repository at this point in the history
  • Loading branch information
n1474335 committed Mar 9, 2019
2 parents 58d41f4 + 84d31c1 commit dcb59ed
Show file tree
Hide file tree
Showing 26 changed files with 2,580 additions and 638 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"$": false,
"jQuery": false,
"log": false,
"app": false,

"COMPILE_TIME": false,
"COMPILE_MSG": false,
Expand Down
8 changes: 6 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 28 additions & 3 deletions src/core/Utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,9 @@ class Utils {
const buff = await Utils.readFile(file);
const blob = new Blob(
[buff],
{type: "octet/stream"}
{type: file.type || "octet/stream"}
);
const blobURL = URL.createObjectURL(blob);

const html = `<div class='card' style='white-space: normal;'>
<div class='card-header' id='heading${i}'>
Expand All @@ -848,10 +849,19 @@ class Utils {
<span class='float-right' style="margin-top: -3px">
${file.size.toLocaleString()} bytes
<a title="Download ${Utils.escapeHtml(file.name)}"
href='${URL.createObjectURL(blob)}'
download='${Utils.escapeHtml(file.name)}'>
href="${blobURL}"
download="${Utils.escapeHtml(file.name)}"
data-toggle="tooltip">
<i class="material-icons" style="vertical-align: bottom">save</i>
</a>
<a title="Move to input"
href="#"
blob-url="${blobURL}"
file-name="${Utils.escapeHtml(file.name)}"
class="extract-file"
data-toggle="tooltip">
<i class="material-icons" style="vertical-align: bottom">open_in_browser</i>
</a>
</span>
</h6>
</div>
Expand Down Expand Up @@ -1163,6 +1173,21 @@ String.prototype.count = function(chr) {
};


/**
* Wrapper for self.sendStatusMessage to handle different environments.
*
* @param {string} msg
*/
export function sendStatusMessage(msg) {
if (ENVIRONMENT_IS_WORKER())
self.sendStatusMessage(msg);
else if (ENVIRONMENT_IS_WEB())
app.alert(msg, 10000);
else if (ENVIRONMENT_IS_NODE())
log.debug(msg);
}


/*
* Polyfills
*/
Expand Down
4 changes: 3 additions & 1 deletion src/core/config/Categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@
"XPath expression",
"JPath expression",
"CSS selector",
"Extract EXIF"
"Extract EXIF",
"Extract Files"
]
},
{
Expand Down Expand Up @@ -348,6 +349,7 @@
"ops": [
"Detect File Type",
"Scan for Embedded Files",
"Extract Files",
"Remove EXIF",
"Extract EXIF"
]
Expand Down
Empty file modified src/core/lib/BCD.mjs
100755 → 100644
Empty file.
Empty file modified src/core/lib/Base58.mjs
100755 → 100644
Empty file.
Empty file modified src/core/lib/Base64.mjs
100755 → 100644
Empty file.
Empty file modified src/core/lib/CanvasComponents.mjs
100755 → 100644
Empty file.
Loading

0 comments on commit dcb59ed

Please sign in to comment.