From bc3d2ef389b0e6bd12b0060bbb682f8478ce6fc3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 10 Oct 2014 00:25:05 +0200 Subject: [PATCH] Normalize usage of quote char to double-quote char on wisiwyg module. --- app/coffee/modules/common/wisiwyg.coffee | 39 ++++++++++++------------ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/app/coffee/modules/common/wisiwyg.coffee b/app/coffee/modules/common/wisiwyg.coffee index de500089..3abb17b3 100644 --- a/app/coffee/modules/common/wisiwyg.coffee +++ b/app/coffee/modules/common/wisiwyg.coffee @@ -45,7 +45,7 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> previewDomNode = $("
", {class: "preview"}) #openHelp = -> - # window.open($rootscope.urls.wikiHelpUrl(), '_blank') + # window.open($rootscope.urls.wikiHelpUrl(), "_blank") closePreviewMode = -> element.parents(".markdown").find(".preview").remove() @@ -72,7 +72,7 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> setCaretPosition = (elm, caretPos) -> if elm.createTextRange range = elm.createTextRange() - range.move('character', caretPos) + range.move("character", caretPos) range.select() else if elm.selectionStart @@ -91,8 +91,8 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> return currentCaretPosition - removedLineLength + 1 markdownSettings = - nameSpace: 'markdown' - onShiftEnter: {keepDefault:false, openWith:'\n\n'} + nameSpace: "markdown" + onShiftEnter: {keepDefault:false, openWith:"\n\n"} onEnter: keepDefault: false replaceWith: (data) => @@ -168,28 +168,28 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> placeHolder: $tr.t("markdown-editor.placeholder") }, { - separator: '---------------' + separator: "---------------" }, { name: $tr.t("markdown-editor.bold") key: "B" - openWith: '**' - closeWith: '**' + openWith: "**" + closeWith: "**" }, { name: $tr.t("markdown-editor.italic") key: "I" - openWith: '_' - closeWith: '_' + openWith: "_" + closeWith: "_" }, { name: $tr.t("markdown-editor.strike") key: "S" - openWith: '~~' - closeWith: '~~' + openWith: "~~" + closeWith: "~~" }, { - separator: '---------------' + separator: "---------------" }, { name: $tr.t("markdown-editor.bulleted-list") @@ -200,7 +200,7 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> openWith: (markItUp) -> markItUp.line+". " }, { - separator: '---------------' + separator: "---------------" }, { name: $tr.t("markdown-editor.picture") @@ -210,12 +210,12 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> { name: $tr.t("markdown-editor.link") key: "L" - openWith: '[' + openWith: "[" closeWith: ']([![Url:!:http://]!] "[![Title]!]")' placeHolder: $tr.t("markdown-editor.link-placeholder") }, { - separator: '---------------' + separator: "---------------" }, { name: $tr.t("markdown-editor.quotes") @@ -227,7 +227,7 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> closeWith: "\n```" }, { - separator: '---------------' + separator: "---------------" }, { name: $tr.t("markdown-editor.preview") @@ -235,7 +235,7 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> className: "preview-icon" }, # { - # separator: '---------------' + # separator: "---------------" # }, # { # name: $tr.t("markdown-editor.help") @@ -248,16 +248,15 @@ tgMarkitupDirective = ($rootscope, $rs, $tr) -> $model.$setViewValue(target.val()) markdownTitle = (markItUp, char) -> - heading = '' + heading = "" n = $.trim(markItUp.selection or markItUp.placeHolder).length for i in [0..n-1] heading += char - return '\n'+heading+'\n' + return "\n"+heading+"\n" element.markItUp(markdownSettings) - element.on "keypress", (event) -> $scope.$apply()