diff --git a/convertMe.html b/convertMe.html
new file mode 100644
index 0000000..1a3c94f
--- /dev/null
+++ b/convertMe.html
@@ -0,0 +1,62 @@
+
+
+ `)
+ // cube.append(yMid);
+ //
+ // var zMid = $(`
`)
+ // cube.append(zMid);
+
+
+ $('body').append(cube);
+
+
}
$('head>#projection').remove()
@@ -200,8 +256,8 @@ SvgCube.prototype.init = function(){
}
- /* draw cube from urls in options and outline according to options */
-SvgCube.prototype.drawCube = function (){
+/* draw cube from urls in options and outline according to options */
+SvgCube.prototype.drawCube = function () {
// var imgS = this.options.size / Math.sqrt(2);
// this.cube = this.paper.g();
@@ -224,34 +280,36 @@ SvgCube.prototype.drawCube = function (){
}
- // svg2png
-SvgCube.prototype.toPNG = function(){
- try{
- var dataUrl = svg2png(this.paper.node);
- img = document.createElement("img");
- document.body.appendChild(img)
- img.src=dataUrl
- img.id="toPNG"
- } catch (e) {console.log(e)};
- }
-
- // svg2png
-SvgCube.prototype.toPNG2 = function(){
+// svg2png
+SvgCube.prototype.toPNG = function () {
+ try {
var dataUrl = svg2png(this.paper.node);
img = document.createElement("img");
document.body.appendChild(img)
- img.src=dataUrl
- img.id="toPNG"
- }
+ img.src = dataUrl
+ img.id = "toPNG"
+ } catch (e) {
+ console.log(e)
+ };
+}
- // svg2png
-SvgCube.prototype.update = function(){
- //this.paper.remove();
- this.init();
- this.drawCube();
- }
+// svg2png
+SvgCube.prototype.toPNG2 = function () {
+ var dataUrl = svg2png(this.paper.node);
+ img = document.createElement("img");
+ document.body.appendChild(img)
+ img.src = dataUrl
+ img.id = "toPNG"
+}
+
+// svg2png
+SvgCube.prototype.update = function () {
+ //this.paper.remove();
+ this.init();
+ this.drawCube();
+}
-try{
- module.exports=SvgCube
-} catch(e){};
+try {
+ module.exports = SvgCube
+} catch (e) {};
diff --git a/webdriver_rasterize.js b/webdriver_rasterize.js
index 3c6c832..5683411 100644
--- a/webdriver_rasterize.js
+++ b/webdriver_rasterize.js
@@ -1,3 +1,4 @@
+'use strict';
var webdriverio = require('webdriverio');
var path = require('path');
@@ -18,16 +19,24 @@ var config = {
var input = process.argv[2];
console.log('input:',input);
+var screenHandler = function(err, screenshot, response) {
+ if (config.debug){
+ console.log({err,screenshot,response});
+ } else if (err){
+ console.log('saveScreenshot',err);
+ }
+}
globby(input).then(inputs => {
console.log('glob(',input,') =>', inputs);
for (var i=0; i
',outfile);
webdriverio
.remote(options)
@@ -38,15 +47,8 @@ globby(input).then(inputs => {
})
.saveScreenshot(
[outfile],
- function(err, screenshot, response) {
- if (config.debug){
- console.log({file,err,screenshot,response});
- } else if (err){
- 'saveScreenshot',console.log(err);
- }
- }
+ screenHandler
)
.end();
}
}, this)
-