From fe3917c0f11cff6655c31edc6dbe1b9fbe88d114 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 12 Feb 2016 16:20:55 +0100 Subject: [PATCH] fix jshint complaints in codemirror directory --- www/code/realtime-wysiwyg.js | 24 +++++++++---------- www/code/rtwiki.js | 46 ++++++++++++++++++++---------------- www/code/sharejs_textarea.js | 11 +++++---- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/www/code/realtime-wysiwyg.js b/www/code/realtime-wysiwyg.js index c1b88d7a3..8a1178ebf 100644 --- a/www/code/realtime-wysiwyg.js +++ b/www/code/realtime-wysiwyg.js @@ -281,20 +281,20 @@ console.log(new Error().stack); var newCursor; var newSelection; if(oldCursorCMStart !== oldCursorCMEnd) { // Selection - if (op.toRemove > 0) { - var newSelection = [transformCursorCMRemove(oldValue, oldCursorCMStart, op.offset, op.toRemove), transformCursorCMRemove(oldValue, oldCursorCMEnd, op.offset, op.toRemove)]; - } - if (op.toInsert.length > 0) { - var newSelection = [transformCursorCMInsert(oldValue, oldCursorCMStart, op.offset, op.toInsert), transformCursorCMInsert(oldValue, oldCursorCMEnd, op.offset, op.toInsert)]; - } + if (op.toRemove > 0) { + newSelection = [transformCursorCMRemove(oldValue, oldCursorCMStart, op.offset, op.toRemove), transformCursorCMRemove(oldValue, oldCursorCMEnd, op.offset, op.toRemove)]; + } + if (op.toInsert.length > 0) { + newSelection = [transformCursorCMInsert(oldValue, oldCursorCMStart, op.offset, op.toInsert), transformCursorCMInsert(oldValue, oldCursorCMEnd, op.offset, op.toInsert)]; + } } else { // Cursor - if (op.toRemove > 0) { - var newCursor = transformCursorCMRemove(oldValue, oldCursor, op.offset, op.toRemove); - } - if (op.toInsert.length > 0) { - var newCursor = transformCursorCMInsert(oldValue, oldCursor, op.offset, op.toInsert); - } + if (op.toRemove > 0) { + newCursor = transformCursorCMRemove(oldValue, oldCursor, op.offset, op.toRemove); + } + if (op.toInsert.length > 0) { + newCursor = transformCursorCMInsert(oldValue, oldCursor, op.offset, op.toInsert); + } } $(doc).val(newValue); cmEditor.setValue(newValue); diff --git a/www/code/rtwiki.js b/www/code/rtwiki.js index a6a209d69..4f668ced3 100644 --- a/www/code/rtwiki.js +++ b/www/code/rtwiki.js @@ -33,7 +33,7 @@ define([ var warn = function (x) { }; var debug = function (x) { }; //debug = function (x) { console.log(x) }; - warn = function (x) { console.log(x) }; + warn = function (x) { console.log(x); }; var setStyle = function () { $('head').append([ '