1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-18 23:42:25 +02:00

Fix for images in Firefox

This commit is contained in:
Hillel Coren 2016-08-09 15:22:33 +03:00
parent 713394ea8a
commit fa88c74d23
8 changed files with 111 additions and 85 deletions

View File

@ -83,11 +83,12 @@ elixir(function(mix) {
*/
mix.scripts(['resources/assets/js/Chart.js'], 'public/js/Chart.min.js')
.scripts(['resources/assets/js/d3.js'], 'public/js/d3.min.js');
mix.scripts([
'public/js/pdf_viewer.js',
'public/js/compatibility.js',
'public/js/pdfmake.min.js',
//'public/js/pdfmake.min.js',
'public/js/pdfmake.js',
'public/js/vfs.js'
], 'public/pdf.built.js');

19
public/css/built.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3001,11 +3001,11 @@
if(!curGroup || deco !== curGroup.decoration ||
style !== curGroup.decorationStyle || color !== curGroup.decorationColor ||
deco === 'lineThrough') {
curGroup = {
line: line,
decoration: deco,
decorationColor: color,
decoration: deco,
decorationColor: color,
decorationStyle: style,
inlines: [ inline ]
};
@ -3015,7 +3015,7 @@
}
}
}
return groups;
}
@ -3042,9 +3042,9 @@
ascent = biggerInline.font.ascender / 1000 * biggerInline.fontSize,
height = biggerInline.height,
descent = height - ascent;
var lw = 0.5 + Math.floor(Math.max(biggerInline.fontSize - 8, 0) / 2) * 0.12;
switch (group.decoration) {
case 'underline':
y += lineAscent + descent * 0.45;
@ -3059,7 +3059,7 @@
throw 'Unkown decoration : ' + group.decoration;
}
pdfKitDoc.save();
if(group.decorationStyle === 'double') {
var gap = Math.max(0.5, lw*2);
pdfKitDoc .fillColor(group.decorationColor)
@ -3096,7 +3096,7 @@
rwx += sh*6;
}
pdfKitDoc.stroke(group.decorationColor);
} else {
pdfKitDoc .fillColor(group.decorationColor)
.rect(x + firstInline.x, y-lw/2, totalWidth, lw)
@ -14510,7 +14510,7 @@
margin = convertMargin(flattenedStyleArray.margin);
}
}
margin = processSingleMargins(node, margin);
if(node.margin){
@ -15218,9 +15218,9 @@
};
PageElementWriter.prototype.moveToNextPage = function(pageOrientation) {
var nextPage = this.writer.context.moveToNextPage(pageOrientation);
if (nextPage.newPageCreated) {
this.repeatables.forEach(function(rep) {
this.writer.addFragment(rep, true);
@ -16690,7 +16690,7 @@
/* 30 */
/***/ function(module, exports, __webpack_require__) {
/**
* isArray
*/
@ -17664,7 +17664,7 @@
// modules, so it is better not to alter this value unless you know what
// you're doing.
function buildCanvas(data, options) {
var canvas = [];
var background = data.background || '#fff';
var foreground = data.foreground || '#000';
@ -17673,12 +17673,12 @@
var n = matrix.length;
var modSize = Math.floor( options.fit ? options.fit/n : 5 );
var size = n * modSize;
canvas.push({
type: 'rect',
x: 0, y: 0, w: size, h: size, lineWidth: 0, color: background
});
for (var i = 0; i < n; ++i) {
for (var j = 0; j < n; ++j) {
if(matrix[i][j]) {
@ -17694,12 +17694,12 @@
}
}
}
return {
canvas: canvas,
size: size
};
}
function measure(node) {
@ -19734,7 +19734,7 @@
this._fontSize = 12;
this._font = null;
this._registeredFonts = {};
},
font: function(src, family, size) {
var cacheKey, font, id, _ref;
@ -21435,7 +21435,7 @@
function Zlib(mode) {
if (mode < exports.DEFLATE || mode > exports.UNZIP)
throw new TypeError("Bad argument");
this.mode = mode;
this.init_done = false;
this.write_in_progress = false;
@ -21453,18 +21453,18 @@
this.memLevel = memLevel;
this.strategy = strategy;
// dictionary not supported.
if (this.mode === exports.GZIP || this.mode === exports.GUNZIP)
this.windowBits += 16;
if (this.mode === exports.UNZIP)
this.windowBits += 32;
if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)
this.windowBits = -this.windowBits;
this.strm = new zstream();
switch (this.mode) {
case exports.DEFLATE:
case exports.GZIP:
@ -21490,12 +21490,12 @@
default:
throw new Error("Unknown mode " + this.mode);
}
if (status !== exports.Z_OK) {
this._error(status);
return;
}
this.write_in_progress = false;
this.init_done = true;
};
@ -21507,31 +21507,31 @@
Zlib.prototype._writeCheck = function() {
if (!this.init_done)
throw new Error("write before init");
if (this.mode === exports.NONE)
throw new Error("already finalized");
if (this.write_in_progress)
throw new Error("write already in progress");
if (this.pending_close)
throw new Error("close is pending");
};
Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {
Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {
this._writeCheck();
this.write_in_progress = true;
var self = this;
process.nextTick(function() {
self.write_in_progress = false;
var res = self._write(flush, input, in_off, in_len, out, out_off, out_len);
self.callback(res[0], res[1]);
if (self.pending_close)
self.close();
});
return this;
};
@ -21549,7 +21549,7 @@
Zlib.prototype._write = function(flush, input, in_off, in_len, out, out_off, out_len) {
this.write_in_progress = true;
if (flush !== exports.Z_NO_FLUSH &&
flush !== exports.Z_PARTIAL_FLUSH &&
flush !== exports.Z_SYNC_FLUSH &&
@ -21558,18 +21558,18 @@
flush !== exports.Z_BLOCK) {
throw new Error("Invalid flush value");
}
if (input == null) {
input = new Buffer(0);
in_len = 0;
in_off = 0;
}
if (out._set)
out.set = out._set;
else
out.set = bufferSet;
var strm = this.strm;
strm.avail_in = in_len;
strm.input = input;
@ -21577,7 +21577,7 @@
strm.avail_out = out_len;
strm.output = out;
strm.next_out = out_off;
switch (this.mode) {
case exports.DEFLATE:
case exports.GZIP:
@ -21593,11 +21593,11 @@
default:
throw new Error("Unknown mode " + this.mode);
}
if (status !== exports.Z_STREAM_END && status !== exports.Z_OK) {
this._error(status);
}
this.write_in_progress = false;
return [strm.avail_in, strm.avail_out];
};
@ -21607,15 +21607,15 @@
this.pending_close = true;
return;
}
this.pending_close = false;
if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) {
zlib_deflate.deflateEnd(this.strm);
} else {
zlib_inflate.inflateEnd(this.strm);
}
this.mode = exports.NONE;
};
@ -21630,7 +21630,7 @@
var status = zlib_inflate.inflateReset(this.strm);
break;
}
if (status !== exports.Z_OK) {
this._error(status);
}
@ -21638,7 +21638,7 @@
Zlib.prototype._error = function(status) {
this.onerror(msg[status] + ': ' + this.strm.msg, status);
this.write_in_progress = false;
if (this.pending_close)
this.close();
@ -21657,20 +21657,20 @@
/*
# MIT LICENSE
# Copyright (c) 2011 Devon Govett
#
# 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
#
# 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:
#
# The above copyright notice and this permission notice shall be included in all copies or
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@ -30781,12 +30781,12 @@
* An implementation of Ruby's string.succ method.
* By Devon Govett
*
* Returns the successor to str. The successor is calculated by incrementing characters starting
* Returns the successor to str. The successor is calculated by incrementing characters starting
* from the rightmost alphanumeric (or the rightmost character if there are no alphanumerics) in the
* string. Incrementing a digit always results in another digit, and incrementing a letter results in
* another letter of the same case.
*
* If the increment generates a carry, the character to the left of it is incremented. This
* If the increment generates a carry, the character to the left of it is incremented. This
* process repeats until there is no carry, adding an additional character if necessary.
*
* succ("abcd") == "abce"
@ -32501,10 +32501,11 @@
var fnTyped = {
arraySet: function (dest, src, src_offs, len, dest_offs) {
if (src.subarray && dest.subarray) {
dest.set(src.subarray(src_offs, src_offs+len), dest_offs);
return;
}
// https://github.com/bpampuch/pdfmake/issues/577#issuecomment-238223949
//if (src.subarray && dest.subarray) {
// dest.set(src.subarray(src_offs, src_offs+len), dest_offs);
// return;
//}
// Fallback to ordinary array
for(var i=0; i<len; i++) {
dest[dest_offs + i] = src[src_offs + i];
@ -66365,4 +66366,4 @@
/***/ }
/******/ ]);
/******/ ]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long