removing unwanted commit

This commit is contained in:
Alexander Leibzon
2015-02-01 12:00:23 +02:00
parent 091e3d41e1
commit bee9cde347
3 changed files with 23 additions and 1 deletions

View File

@@ -125,6 +125,9 @@
<script src="/scripts/ui-bootstrap-tpls-0.5.0.min.js"></script>
<script src="/bower_components/bucky/bucky.js"></script>
<script src="/bower_components/pace/pace.js"></script>
<script src="/bower_components/canvg/rgbcolor.js"></script>
<script src="/bower_components/canvg/StackBlur.js"></script>
<script src="/bower_components/canvg/canvg.js"></script>
<!-- endbuild -->
<!-- build:js({.tmp,app}) /scripts/scripts.js -->

View File

@@ -153,6 +153,24 @@
this.redraw();
}
},
{
text: 'Save Image',
onclick: function () {
var canvas = document.createElement('canvas');
window.canvg(canvas, this.getSVG())
var href = canvas.toDataURL('image/png');
var a = document.createElement('a');
a.href = href;
var filenameSuffix = '';
if (this.title) {
filenameSuffix = this.title.text;
}
a.download = 'redash_'+filenameSuffix+'.png';
document.body.appendChild(a);
a.click();
a.remove();
}
}
]
}

View File

@@ -26,7 +26,8 @@
"marked": "~0.3.2",
"bucky": "~0.2.6",
"pace": "~0.5.1",
"angular-ui-select": "0.8.2"
"angular-ui-select": "0.8.2",
"canvg": "gabelerner/canvg"
},
"devDependencies": {
"angular-mocks": "1.2.18",