diff --git a/LICENSE.txt b/LICENSE.txt
index 22e2ef6..0df40b3 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,5 +1,5 @@
The MIT License (MIT)
-Copyright (c) 2018 Ilian Sapundshiev
+Copyright (c) 2013-present Ilian Sapundshiev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/index.html b/index.html
index 649fcc3..6243e98 100644
--- a/index.html
+++ b/index.html
@@ -4,6 +4,7 @@
+
@@ -30,7 +31,7 @@
-
+
diff --git a/libs/jszip-utils/jszip-utils.min.js b/libs/jszip-utils/jszip-utils.min.js
new file mode 100644
index 0000000..8123378
--- /dev/null
+++ b/libs/jszip-utils/jszip-utils.min.js
@@ -0,0 +1,10 @@
+/*!
+
+ JSZipUtils - A collection of cross-browser utilities to go along with JSZip.
+
+
+ (c) 2014 Stuart Knightley, David Duponchel
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown.
+
+ */
+!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g ').css({
+ 'overflow': 'auto' ,
+ 'padding': '5px' ,
+ 'background-color': 'white' ,
+ 'fontSize': 12 ,
+ 'width': '100%' ,
+ 'height': '100%'
+ });
+ $zipContent.append('
Contents of file ' + filePath + ' ');
+ var ulFiles = $zipContent.append('');
+
+ function showPreviewDialog(event) {
+ event.preventDefault();
+ var containFile = zipFile.files[$(this).text()];
+ showContentFilePreviewDialog(containFile);
+ }
+
+ if (!!Object.keys(zipFile.files) &&
+ (typeof zipFile !== 'function' ||
+ zipFile === null)) {
+ for (var fileName in zipFile.files) {
+ if (zipFile.files[fileName].dir === true) {
+ continue;
+ }
+ var linkToFile = $('').attr('href' , '#').text(fileName);
+ linkToFile.click(showPreviewDialog);
+ var liFile = $(' ').css('list-style-type' , 'none').append(linkToFile);
+ ulFiles.append(liFile);
+ }
+ } else {
+ throw new TypeError('Object.keys called on non-object');
+ }
+ });
});
function showContentFilePreviewDialog(containFile) {
var unitArr = containFile.asUint8Array();
- var previewText = "";
+ var previewText = '';
var byteLength = (unitArr.byteLength > maxPreviewSize) ? maxPreviewSize : unitArr.byteLength;
for (var i = 0; i < byteLength; i++) {
previewText += String.fromCharCode(unitArr[i]);
}
- var fileContent = $(" ").text(previewText);
- var $htmlContent = $('#htmlContent');
+ var fileContent = $(' ').text(previewText);
- $.post("previewDialog.html" , function(uiTPL) {
- //console.log("Load modal " + uiTPL);
+ $.post('previewDialog.html' , function(uiTPL) {
+ //console.log('Load modal ' + uiTPL);
if ($('#previewDialog').length < 1) {
var uiTemplate = Handlebars.compile(uiTPL);
$('body').append(uiTemplate());
@@ -92,46 +147,3 @@ function showContentFilePreviewDialog(containFile) {
} , 1000);
});
}
-
-function setContent(content , fileDirectory) {
- var $htmlContent = $('#htmlContent');
- $htmlContent.append(content);
-
- if (fileDirectory.indexOf("file://") === 0) {
- fileDirectory = fileDirectory.substring(("file://").length , fileDirectory.length);
- }
-
- $htmlContent.append('
').css({
- 'overflow': 'auto' ,
- 'padding': '5px' ,
- 'background-color': 'white' ,
- 'fontSize': 12 ,
- 'width': '100%' ,
- 'height': '100%'
- });
- $htmlContent.append("
Contents of file " + fileDirectory + " ");
- var ulFiles = $htmlContent.append("");
- var zipFile = content;
-
- function showPreviewDialog(event) {
- event.preventDefault();
- var containFile = zipFile.files[$(this).text()];
- showContentFilePreviewDialog(containFile);
- }
-
- if (!!Object.keys(zipFile.files) &&
- (typeof zipFile !== 'function' ||
- zipFile === null)) {
- for (var fileName in zipFile.files) {
- if (zipFile.files[fileName].dir === true) {
- continue;
- }
- var linkToFile = $(' ').attr('href' , '#').text(fileName);
- linkToFile.click(showPreviewDialog);
- var liFile = $(' ').css('list-style-type' , 'none').append(linkToFile);
- ulFiles.append(liFile);
- }
- } else {
- throw new TypeError("Object.keys called on non-object");
- }
-}