Fixed the warnings/errors reported by eslint for all the static

javascripts.
This commit is contained in:
Ashesh Vashi
2018-01-12 12:59:51 +05:30
parent b78b97d89b
commit c32eb6bd37
102 changed files with 25830 additions and 24548 deletions

View File

@@ -1,37 +1,47 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["codemirror"], mod);
if (typeof exports == 'object' && typeof module == 'object') // CommonJS
mod(require('codemirror'));
else if (typeof define == 'function' && define.amd) // AMD
define(['codemirror'], mod);
else // Plain browser env
mod(CodeMirror);
mod(window.CodeMirror);
})(function(CodeMirror) {
"use strict";
'use strict';
CodeMirror.pgadminKeywordRangeFinder = function(cm, start, startTkn, endTkn) {
var line = start.line, lineText = cm.getLine(line);
var at = lineText.length, startChar, tokenType;
var line = start.line,
lineText = cm.getLine(line);
var at = lineText.length,
startChar, tokenType;
for (; at > 0;) {
var found = lineText.lastIndexOf(startTkn, at);
var startToken = startTkn;
var endToken = endTkn;
if (found < start.ch) {
var found = lineText.lastIndexOf("[", at);
found = lineText.lastIndexOf('[', at);
if (found < start.ch) break;
var startToken = '[';
var endToken = ']';
startToken = '[';
endToken = ']';
}
tokenType = cm.getTokenAt(CodeMirror.Pos(line, found + 1)).type;
if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; }
if (!/^(comment|string)/.test(tokenType)) {
startChar = found;
break;
}
at = found - 1;
}
if (startChar == null || lineText.lastIndexOf(startToken) > startChar) return;
var count = 1, lastLine = cm.lineCount(), end, endCh;
var count = 1,
lastLine = cm.lineCount(),
end, endCh;
outer: for (var i = line + 1; i < lastLine; ++i) {
var text = cm.getLine(i), pos = 0;
var text = cm.getLine(i),
pos = 0;
for (;;) {
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
var nextOpen = text.indexOf(startToken, pos),
nextClose = text.indexOf(endToken, pos);
if (nextOpen < 0) nextOpen = text.length;
if (nextClose < 0) nextClose = text.length;
pos = Math.min(nextOpen, nextClose);
@@ -48,8 +58,10 @@
}
}
if (end == null || end == line + 1) return;
return {from: CodeMirror.Pos(line, startChar + startTkn.length),
to: CodeMirror.Pos(end, endCh)};
return {
from: CodeMirror.Pos(line, startChar + startTkn.length),
to: CodeMirror.Pos(end, endCh),
};
};
CodeMirror.pgadminBeginRangeFinder = function(cm, start) {