|
|
@ -144,6 +144,11 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var onModeChanged = function (mode) {
|
|
|
|
var onModeChanged = function (mode) {
|
|
|
|
var $codeMirror = $iframe.find('.CodeMirror');
|
|
|
|
var $codeMirror = $iframe.find('.CodeMirror');
|
|
|
|
|
|
|
|
window.clearTimeout(APP.previewTo);
|
|
|
|
|
|
|
|
$codeMirror.addClass('transition');
|
|
|
|
|
|
|
|
APP.previewTo = window.setTimeout(function () {
|
|
|
|
|
|
|
|
$codeMirror.removeClass('transition');
|
|
|
|
|
|
|
|
}, 500);
|
|
|
|
if (mode === "markdown") {
|
|
|
|
if (mode === "markdown") {
|
|
|
|
APP.$previewButton.show();
|
|
|
|
APP.$previewButton.show();
|
|
|
|
Cryptpad.getPadAttribute('previewMode', function (e, data) {
|
|
|
|
Cryptpad.getPadAttribute('previewMode', function (e, data) {
|
|
|
@ -244,6 +249,11 @@ define([
|
|
|
|
$previewButton.attr('title', Messages.previewButtonTitle);
|
|
|
|
$previewButton.attr('title', Messages.previewButtonTitle);
|
|
|
|
$previewButton.click(function () {
|
|
|
|
$previewButton.click(function () {
|
|
|
|
var $codeMirror = $iframe.find('.CodeMirror');
|
|
|
|
var $codeMirror = $iframe.find('.CodeMirror');
|
|
|
|
|
|
|
|
window.clearTimeout(APP.previewTo);
|
|
|
|
|
|
|
|
$codeMirror.addClass('transition');
|
|
|
|
|
|
|
|
APP.previewTo = window.setTimeout(function () {
|
|
|
|
|
|
|
|
$codeMirror.removeClass('transition');
|
|
|
|
|
|
|
|
}, 500);
|
|
|
|
if (CodeMirror.highlightMode !== 'markdown') {
|
|
|
|
if (CodeMirror.highlightMode !== 'markdown') {
|
|
|
|
$previewContainer.show();
|
|
|
|
$previewContainer.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|