docxtemplater
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -101,2 +101,4 @@ var gulp = require('gulp'); | ||
regex=/([0-9]+) tests, ([0-9]+) assertions, ([0-9]+) failures, ([0-9]+) skipped/; | ||
var now=new Date(); | ||
var nowTime="---"+now.getHours()+":"+now.getMinutes() | ||
if(regex.test(totalData)) | ||
@@ -113,7 +115,7 @@ { | ||
{ | ||
gutil.log(gutil.colors.green(fullText)); | ||
gutil.log(gutil.colors.green(fullText+nowTime)); | ||
} | ||
else | ||
{ | ||
gutil.log(gutil.colors.red(fullText)); | ||
gutil.log(gutil.colors.red(fullText+nowTime)); | ||
gutil.beep() | ||
@@ -124,3 +126,3 @@ } | ||
{ | ||
gutil.log(gutil.colors.red(totalData)) | ||
gutil.log(gutil.colors.red(totalData+nowTime)) | ||
gutil.beep() | ||
@@ -127,0 +129,0 @@ } |
@@ -992,3 +992,3 @@ (function() { | ||
ImgReplacer.prototype.replaceImage = function(match, u) { | ||
var imageTag, imgName, newId, oldFile, rId, replacement, tag, tagrId, xmlImg; | ||
var imageTag, imgName, mockedQrCode, newId, oldFile, rId, replacement, tag, tagrId, xmlImg; | ||
xmlImg = DocUtils.Str2xml('<?xml version="1.0" ?><w:document mc:Ignorable="w14 wp14" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">' + match[0] + '</w:document>'); | ||
@@ -1007,3 +1007,3 @@ if (env === 'browser') { | ||
if (oldFile === null) { | ||
throw 'oldFile is not defined'; | ||
throw 'oldFile undefined'; | ||
} | ||
@@ -1062,3 +1062,8 @@ if (env === 'browser') { | ||
} else { | ||
return this.xmlTemplater.DocxGen.qrCodeCallBack(this.xmlTemplater.DocxGen.qrCodeNumCallBack, false); | ||
mockedQrCode = { | ||
xmlTemplater: this.xmlTemplater, | ||
imgName: imgName, | ||
data: oldFile.asBinary() | ||
}; | ||
return this.imageSetter(mockedQrCode); | ||
} | ||
@@ -1065,0 +1070,0 @@ } |
{ | ||
"name": "docxtemplater", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"author": "Edgar Hipp <hipp.edg@gmail.com>", | ||
@@ -38,3 +38,4 @@ "description": "A docX templater", | ||
"gulp-livereload": "~1.1.1", | ||
"gulp-notify": "^1.2.5" | ||
"gulp-notify": "^1.2.5", | ||
"gulp-jasmine": "^0.2.0" | ||
}, | ||
@@ -41,0 +42,0 @@ "license": "MIT", |
# DocxTemplater (also called docxgen.js) # | ||
[![Build Status](https://travis-ci.org/edi9999/docxtemplater.svg?branch=master)](https://travis-ci.org/edi9999/docxtemplater) | ||
[![Download count](http://img.shields.io/npm/dm/docxtemplater.svg)](https://www.npmjs.org/package/docxtemplater) | ||
[![Current tag](http://img.shields.io/npm/v/docxtemplater.svg)](https://www.npmjs.org/package/docxtemplater) | ||
@@ -5,0 +7,0 @@ **docxtemplater** is a small library to generate docx documents given a docx template. It can replace tags by their values and replace images with other images. It is very user oriented as users can without a lot of programming knowledge create their first template and automatically change variables in it. |
@@ -1354,3 +1354,3 @@ (function() { | ||
}); | ||
return it('should replace the inner text', function() { | ||
it('should replace the inner text', function() { | ||
sub.replace('<w:table>Sample Table</w:table>'); | ||
@@ -1360,4 +1360,23 @@ expect(sub.fullText).toBe('start<w:table>Sample Table</w:table>end'); | ||
}); | ||
return it("shouldn't bug if some images don't contain a qrcode", function() { | ||
var endcallback; | ||
docX['imageExample.docx'] = new DocxGen(docX['imageExample.docx'].loadedContent, {}, { | ||
intelligentTagging: false, | ||
qrCode: true | ||
}); | ||
expect(docX['imageExample.docx'].zip.files['word/media/image1.jpeg'].asBinary().length).toBe(713625); | ||
endcallback = function() { | ||
return 1; | ||
}; | ||
docX['imageExample.docx'].applyTags({}, endcallback); | ||
waitsFor(function() { | ||
return docX['imageExample.docx'].ready != null; | ||
}); | ||
return runs(function() { | ||
expect(docX['imageExample.docx'].zip.files['word/media/Copie_0.png'].asBinary().length).toBe(713625); | ||
return docX['imageExample.docx'].output(); | ||
}); | ||
}); | ||
}); | ||
}).call(this); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12233286
210
18964
439
9