...
|
...
|
@@ -147,9 +147,6 @@ Second line.</code></pre>
|
147
|
147
|
<a href="#" class="button icon-fullscreen feature" data-feature="fullscreen" data-tofocus="markdown" title="Go fullscreen"></a>
|
148
|
148
|
</div>
|
149
|
149
|
</div>
|
150
|
|
- <a href="#" id="downloadMD"><img src="img/md.png" width="24px" height="24px"></img></a>
|
151
|
|
- <div style="display: inline;position: absolute;margin-top: 1px;margin-right: 2px;margin-left: 2px;">output prefix</div>
|
152
|
|
- <textarea id="filename" rows="1" columns="32" style="resize: none;display: inline;position: absolute;margin-left: 82px;">myfile</textarea>
|
153
|
150
|
<hr>
|
154
|
151
|
<textarea id="markdown" class="full-height" placeholder="Write Markdown"># Minimalist Online Markdown Editor
|
155
|
152
|
|
...
|
...
|
@@ -193,8 +190,11 @@ Just start typing in the left panel.
|
193
|
190
|
<div class="bottom-bar hidden-when-fullscreen clearfix">
|
194
|
191
|
<div class="word-count"></div>
|
195
|
192
|
</div>
|
|
193
|
+ <a href="#" id="downloadMD"><img src="img/md.png" width="24px" height="24px"></img></a>
|
196
|
194
|
<a href="#" id="downloadHTML"><img src="img/html5.png" width="24px" height="24px"></img></a>
|
197
|
195
|
<a href="#" id="downloadPDF" style="display: inline"><img src="img/pdf.png" width="24px" height="24px"></a>
|
|
196
|
+ <div style="display: inline;position: absolute;margin-top: 1px;margin-right: 2px;margin-left: 2px;">output prefix</div>
|
|
197
|
+ <textarea id="filename" rows="1" columns="32" style="resize: none;display: inline;position: absolute;margin-left: 82px;">myfile</textarea>
|
198
|
198
|
<hr>
|
199
|
199
|
<textarea id="html" class="full-height"></textarea>
|
200
|
200
|
<div id="preview" class="full-height"></div>
|
...
|
...
|
@@ -226,29 +226,23 @@ Just start typing in the left panel.
|
226
|
226
|
link.click();
|
227
|
227
|
}
|
228
|
228
|
|
229
|
|
- //var fileNameMD = 'myfile.md';
|
|
229
|
+ function printPDF() {
|
|
230
|
+ var printDoc = new jsPDF();
|
|
231
|
+ printDoc.fromHTML($('#preview').get(0), 10, 10, {'width': 180});
|
|
232
|
+ var filename = document.getElementById("filename").innerHTML+".pdf";
|
|
233
|
+ printDoc.save(filename);
|
|
234
|
+ }
|
|
235
|
+
|
230
|
236
|
$('#downloadMD').click(function(){
|
231
|
237
|
var filename = document.getElementById("filename").innerHTML+".md";
|
232
|
|
- downloadInnerHtml(filename, 'preview','text/html');
|
233
|
|
- //downloadInnerHtml(fileNameMD, 'markdown','text/html');
|
|
238
|
+ downloadInnerHtml(filename, 'markdown','text/html');
|
234
|
239
|
});
|
235
|
|
- //var fileNameHTML = 'myfile.html';
|
|
240
|
+
|
236
|
241
|
$('#downloadHTML').click(function(){
|
237
|
242
|
var filename = document.getElementById("filename").innerHTML+".html";
|
238
|
243
|
downloadInnerHtml(filename, 'preview','text/html');
|
239
|
|
- //downloadInnerHtml(fileNameHTML, 'preview','text/html');
|
240
|
244
|
});
|
241
|
245
|
|
242
|
|
- //jsPDF
|
243
|
|
- //var fileNamePDF = 'myfile.pdf';
|
244
|
|
- function printPDF() {
|
245
|
|
- var printDoc = new jsPDF();
|
246
|
|
- printDoc.fromHTML($('#preview').get(0), 10, 10, {'width': 180});
|
247
|
|
- //printDoc.output("dataurlnewwindow"); // this opens a new popup, after this the PDF opens the print window view but there are browser inconsistencies with how this is handled
|
248
|
|
- var filename = document.getElementById("filename").innerHTML+".pdf";
|
249
|
|
- printDoc.save(filename);
|
250
|
|
- //printDoc.save(fileNamePDF)
|
251
|
|
- }
|
252
|
246
|
$('#downloadPDF').click(function(){
|
253
|
247
|
printPDF();
|
254
|
248
|
});
|