1299
1300 const raw_json_id = "fireSeqSearchWordcloudRawJson";
1301 var raw_dom = document.getElementById(raw_json_id);
1302 var raw_json = raw_dom.textContent;1303
1304 raw_dom.setAttribute("style", "width: 1000px");
1305 // consoleLogForDebug(raw_json);
1298 consoleLogForDebug(WordCloud.isSupported);
1299
1300 const raw_json_id = "fireSeqSearchWordcloudRawJson";
1301 var raw_dom = document.getElementById(raw_json_id);1302 var raw_json = raw_dom.textContent;
1303
1304 raw_dom.setAttribute("style", "width: 1000px");
1227 WordCloud.minFontSize = minFontSize
1228 WordCloud.stop = function stop () {
1229 if (timer) {
1230 for (var timerId in timer) {1231 window.clearImmediate(timer[timerId])
1232 }
1233 }
1201 }
1202 escapeTime = (new Date()).getTime()
1203 var drawn = putWord(settings.list[i])
1204 var canceled = !sendEvent('wordclouddrawn', true, {1205 item: settings.list[i],1206 drawn: drawn1207 })1208 if (exceedTime() || canceled) {
1209 stoppingFunction(timer[timerId])
1210 settings.abort()
1200 return
1201 }
1202 escapeTime = (new Date()).getTime()
1203 var drawn = putWord(settings.list[i])1204 var canceled = !sendEvent('wordclouddrawn', true, {
1205 item: settings.list[i],
1206 drawn: drawn
Declare variables at the top of their scope as it improves code readability, performance and also helps in code navigation.
The vars-on-top
rule generates warnings when variable declarations are not used serially at the top of a function scope or the top of a program. By default variable declarations are always moved (“hoisted”) invisibly to the top of their containing scope by the JavaScript interpreter. This rule forces the programmer to represent that behavior by manually moving the variable declaration to the top of its containing scope.
// Variable declarations in a block:
function doSomething() {
var first;
if (true) {
first = true;
}
var second;
}
// Variable declaration in for initializer:
function doSomething() {
for (var i=0; i<10; i++) {}
}
function doSomething() {
var first;
var second; //multiple declarations are allowed at the top
if (true) {
first = true;
}
}
function doSomething() {
var i;
for (i=0; i<10; i++) {}
}