MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / renderPreview

Function renderPreview

static/scripts/markitup/jquery.markitup.js:456–480  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

454 }
455
456 function renderPreview() {
457 if (options.previewParserPath !== '') {
458 $.ajax( {
459 type: 'POST',
460 async: false,
461 url: options.previewParserPath,
462 data: options.previewParserVar+'='+encodeURIComponent($$.val()),
463 success: function(data) {
464 phtml = localize(data, 1);
465 }
466 } );
467 } else {
468 if (!template) {
469 $.ajax( {
470 async: false,
471 url: options.previewTemplatePath,
472 success: function(data) {
473 template = localize(data, 1);
474 }
475 } );
476 }
477 phtml = template.replace(/<!-- content -->/g, $$.val());
478 }
479 return phtml;
480 }
481
482 // set keys pressed
483 function keyPressed(e) {

Callers 1

refreshPreviewFunction · 0.85

Calls 1

localizeFunction · 0.85

Tested by

no test coverage detected