Author: sebb
Date: Sun Jul 6 12:44:52 2025
New Revision: 1926997
URL: http://svn.apache.org/viewvc?rev=1926997&view=rev
Log:
JS linting: don't use var
Modified:
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-http-extensions.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-js-extensions.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/datepicker.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/scaffolding-html.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
comdev/reporter.apache.org/trunk/site/wizard/js/source/whimsy-flow.js
comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
Modified:
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-http-extensions.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/base-http-extensions.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
---
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-http-extensions.js
(original)
+++
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-http-extensions.js
Sun Jul 6 12:44:52 2025
@@ -17,17 +17,17 @@
// URL calls currently 'in escrow'. This controls the spinny wheel animation
-var async_escrow = {}
-var async_maxwait = 250; // ms to wait before displaying spinner
-var async_status = 'clear';
-var async_cache = {}
-var no_spinner = true;
+let async_escrow = {}
+let async_maxwait = 250; // ms to wait before displaying spinner
+let async_status = 'clear';
+let async_cache = {}
+let no_spinner = true;
// Escrow spinner check
async function escrow_check() {
let now = new Date();
let show_spinner = false;
- for (var k in async_escrow) {
+ for (let k in async_escrow) {
if ( (now - async_escrow[k]) > async_maxwait ) {
show_spinner = true;
break;
@@ -72,8 +72,8 @@ async function GET(url, callback, state,
method = method || 'get'
console.log("Fetching JSON resource at %s".format(url))
let pkey = "GET-%s-%s".format(callback, url);
- let res = undefined;
- let res_json = undefined;
+ let res;
+ let res_json;
state = state || {};
state.url = url;
if (state && state.cached === true && async_cache[url]) {
Modified:
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-js-extensions.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/base-js-extensions.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
---
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-js-extensions.js
(original)
+++
comdev/reporter.apache.org/trunk/site/wizard/js/source/base-js-extensions.js
Sun Jul 6 12:44:52 2025
@@ -71,7 +71,7 @@ Number.prototype.pretty = function(fix)
*/
Number.prototype.pad = function(n) {
- var str;
+ let str;
str = String(this);
/* Do we need to pad? if so, do it using String.repeat */
@@ -85,7 +85,7 @@ Number.prototype.pad = function(n) {
/* Func for converting a date to YYYY-MM-DD HH:MM */
Date.prototype.ISOBare = function() {
- var M, d, h, m, y;
+ let M, d, h, m, y;
y = this.getFullYear();
m = (this.getMonth() + 1).pad(2);
d = this.getDate().pad(2);
@@ -112,7 +112,7 @@ isHash = function(value) {
/* Remove an array element by value */
Array.prototype.remove = function(val) {
- var i, item, j, len;
+ let i, item, j, len;
for (i = j = 0, len = this.length; j < len; i = ++j) {
item = this[i];
if (item === val) {
@@ -126,7 +126,7 @@ Array.prototype.remove = function(val) {
/* Check if array has value */
Array.prototype.has = function(val) {
- var i, item, j, len;
+ let i, item, j, len;
for (i = j = 0, len = this.length; j < len; i = ++j) {
item = this[i];
if (item === val) {
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/datepicker.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/datepicker.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/datepicker.js
(original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/datepicker.js Sun
Jul 6 12:44:52 2025
@@ -15,10 +15,10 @@
limitations under the License.
*/
-var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December'];
-var datepicker_spawner = null
-var calendarpicker_spawner = null
-var units = {
+let months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December'];
+let datepicker_spawner = null
+let calendarpicker_spawner = null
+let units = {
w: 'week',
d: 'day',
M: 'month',
@@ -37,7 +37,7 @@ function fixupPicker(obj) {
}
// makeSelect: Creates a <select> object with options
function makeSelect(options, id, selval) {
- var sel = document.createElement('select')
+ let sel = document.createElement('select')
sel.addEventListener("focus", function(event){
$('html').on('hide.bs.dropdown', function (e) {
return false;
@@ -49,8 +49,8 @@ function makeSelect(options, id, selval)
sel.setAttribute("name", id)
sel.setAttribute("id", id)
// For each options element, create it in the DOM
- for (var key in options) {
- var opt = document.createElement('option')
+ for (let key in options) {
+ let opt = document.createElement('option')
// Hash or array?
if (typeof key == "string") {
opt.setAttribute("value", key)
@@ -74,15 +74,15 @@ function makeSelect(options, id, selval)
// and puts div2 into the right column,
// and 'name' as text in the left one.
function splitDiv(id, name, div2) {
- var div = document.createElement('div')
- var subdiv = document.createElement('div')
- var radio = document.createElement('input')
+ let div = document.createElement('div')
+ let subdiv = document.createElement('div')
+ let radio = document.createElement('input')
radio.setAttribute("type", "radio")
radio.setAttribute("name", "datepicker_radio")
radio.setAttribute("value", name)
radio.setAttribute("id", "datepicker_radio_" + id)
radio.setAttribute("onclick", "calcTimespan('"+ id + "')")
- var label = document.createElement('label')
+ let label = document.createElement('label')
label.innerHTML = " " + name + ": "
label.setAttribute("for", "datepicker_radio_" + id)
@@ -108,15 +108,15 @@ function splitDiv(id, name, div2) {
// for the datepicker choice and puts it in the datepicker's
// spawning input/select element.
function calcTimespan(what) {
- var wat = ""
- var tval = ""
+ let wat = ""
+ let tval = ""
// Less than N units ago?
if (what == 'lt') {
// Get unit and how many units
- var N = document.getElementById('datepicker_lti').value
- var unit = document.getElementById('datepicker_lts').value
- var unitt = units[unit]
+ let N = document.getElementById('datepicker_lti').value
+ let unit = document.getElementById('datepicker_lts').value
+ let unitt = units[unit]
if (parseInt(N) != 1) {
unitt += "s"
}
@@ -132,9 +132,9 @@ function calcTimespan(what) {
// More than N units ago?
if (what == 'mt') {
// As above, get unit and no of units.
- var N = document.getElementById('datepicker_mti').value
- var unit = document.getElementById('datepicker_mts').value
- var unitt = units[unit]
+ let N = document.getElementById('datepicker_mti').value
+ let unit = document.getElementById('datepicker_mts').value
+ let unitt = units[unit]
if (parseInt(N) != 1) {
unitt += "s"
}
@@ -149,8 +149,8 @@ function calcTimespan(what) {
// Date range?
if (what == 'cd') {
// Get From and To values
- var f = document.getElementById('datepicker_cfrom').value
- var t = document.getElementById('datepicker_cto').value
+ let f = document.getElementById('datepicker_cfrom').value
+ let t = document.getElementById('datepicker_cto').value
// construct timespan val + description if both from and to are valid
if (f.length > 0 && t.length > 0) {
wat = "From " + f + " to " + t
@@ -176,12 +176,12 @@ function calcTimespan(what) {
// timespan options right next to the parent caller.
function datePicker(parent, seedPeriod) {
datepicker_spawner = parent
- var div = document.getElementById('datepicker_popup')
+ let div = document.getElementById('datepicker_popup')
// If the datepicker object doesn't exist, spawn it
if (!div) {
div = document.createElement('div')
- var id = parseInt(Math.random() * 10000).toString(16)
+ let id = parseInt(Math.random() * 10000).toString(16)
div.setAttribute("id", "datepicker_popup")
div.setAttribute("class", "datepicker")
}
@@ -191,21 +191,21 @@ function datePicker(parent, seedPeriod)
div.style.display = "block"
// Position the datepicker next to whatever called it
- var bb = parent.getBoundingClientRect()
+ let bb = parent.getBoundingClientRect()
div.style.top = (bb.bottom + 8) + "px"
div.style.left = (bb.left + 32) + "px"
// -- Less than N $units ago
- var ltdiv = document.createElement('div')
- var lti = document.createElement('input')
+ let ltdiv = document.createElement('div')
+ let lti = document.createElement('input')
lti.setAttribute("id", "datepicker_lti")
lti.style.width = "48px"
lti.setAttribute("onkeyup", "calcTimespan('lt')")
lti.setAttribute("onblur", "calcTimespan('lt')")
ltdiv.appendChild(lti)
- var lts = makeSelect({
+ let lts = makeSelect({
'd': "Day(s)",
'w': 'Week(s)',
'M': "Month(s)",
@@ -219,9 +219,9 @@ function datePicker(parent, seedPeriod)
// -- More than N $units ago
- var mtdiv = document.createElement('div')
+ let mtdiv = document.createElement('div')
- var mti = document.createElement('input')
+ let mti = document.createElement('input')
mti.style.width = "48px"
mti.setAttribute("id", "datepicker_mti")
mti.setAttribute("onkeyup", "calcTimespan('mt')")
@@ -229,7 +229,7 @@ function datePicker(parent, seedPeriod)
mtdiv.appendChild(mti)
- var mts = makeSelect({
+ let mts = makeSelect({
'd': "Day(s)",
'w': 'Week(s)',
'M': "Month(s)",
@@ -244,9 +244,9 @@ function datePicker(parent, seedPeriod)
// -- Calendar timespan
// This is just two text fields, the calendarPicker sub-plugin populates
them
- var cdiv = document.createElement('div')
+ let cdiv = document.createElement('div')
- var cfrom = document.createElement('input')
+ let cfrom = document.createElement('input')
cfrom.style.width = "90px"
cfrom.setAttribute("id", "datepicker_cfrom")
cfrom.setAttribute("onfocus", "showCalendarPicker(this)")
@@ -254,7 +254,7 @@ function datePicker(parent, seedPeriod)
cdiv.appendChild(document.createTextNode('From: '))
cdiv.appendChild(cfrom)
- var cto = document.createElement('input')
+ let cto = document.createElement('input')
cto.style.width = "90px"
cto.setAttribute("id", "datepicker_cto")
cto.setAttribute("onfocus", "showCalendarPicker(this)")
@@ -267,7 +267,7 @@ function datePicker(parent, seedPeriod)
// -- Magic button that sends the timespan back to the caller
- var okay = document.createElement('input')
+ let okay = document.createElement('input')
okay.setAttribute("type", "button")
okay.setAttribute("value", "Okay")
okay.setAttribute("onclick", "setDatepickerDate()")
@@ -280,18 +280,18 @@ function datePicker(parent, seedPeriod)
// This is for recalcing the set options if spawned from a
// select/input box with an existing value derived from an
// earlier call to datePicker
- var ptype = ""
- var pvalue = parent.hasAttribute("data") ? parent.getAttribute("data") :
parent.value
+ let ptype = ""
+ let pvalue = parent.hasAttribute("data") ? parent.getAttribute("data") :
parent.value
if (pvalue.search(/=|-/) != -1) {
// Less than N units ago?
if (pvalue.match(/lte/)) {
- var m = pvalue.match(/lte=(\d+)([dMyw])/)
+ let m = pvalue.match(/lte=(\d+)([dMyw])/)
ptype = 'lt'
if (m) {
document.getElementById('datepicker_lti').value = m[1]
- var sel = document.getElementById('datepicker_lts')
- for (var i in sel.options) {
+ let sel = document.getElementById('datepicker_lts')
+ for (let i in sel.options) {
if (parseInt(i) >= 0) {
if (sel.options[i].value == m[2]) {
sel.options[i].selected = "selected"
@@ -307,12 +307,12 @@ function datePicker(parent, seedPeriod)
// More than N units ago?
if (pvalue.match(/gte/)) {
ptype = 'mt'
- var m = pvalue.match(/gte=(\d+)([dMyw])/)
+ let m = pvalue.match(/gte=(\d+)([dMyw])/)
if (m) {
document.getElementById('datepicker_mti').value = m[1]
- var sel = document.getElementById('datepicker_mts')
+ let sel = document.getElementById('datepicker_mts')
// Go through the unit values, select the one we use
- for (var i in sel.options) {
+ for (let i in sel.options) {
if (parseInt(i) >= 0) {
if (sel.options[i].value == m[2]) {
sel.options[i].selected = "selected"
@@ -328,8 +328,8 @@ function datePicker(parent, seedPeriod)
if (pvalue.match(/dfr/)) {
ptype = 'cd'
// Make sure we have both a dfr and a dto here, catch them
- var mf = pvalue.match(/dfr=(\d+-\d+-\d+)/)
- var mt = pvalue.match(/dto=(\d+-\d+-\d+)/)
+ let mf = pvalue.match(/dfr=(\d+-\d+-\d+)/)
+ let mt = pvalue.match(/dto=(\d+-\d+-\d+)/)
if (mf && mt) {
// easy peasy, just set two text fields!
document.getElementById('datepicker_cfrom').value = mf[1]
@@ -340,11 +340,11 @@ function datePicker(parent, seedPeriod)
if (pvalue.match(/(\d{4})-(\d+)/)) {
ptype = 'cd'
// Make sure we have both a dfr and a dto here, catch them
- var m = pvalue.match(/(\d{4})-(\d+)/)
+ let m = pvalue.match(/(\d{4})-(\d+)/)
if (m.length == 3) {
// easy peasy, just set two text fields!
- var dfrom = new Date(parseInt(m[1]),parseInt(m[2])-1,1, 0, 0,
0)
- var dto = new Date(parseInt(m[1]),parseInt(m[2]),0, 23, 59, 59)
+ let dfrom = new Date(parseInt(m[1]),parseInt(m[2])-1,1, 0, 0,
0)
+ let dto = new Date(parseInt(m[1]),parseInt(m[2]),0, 23, 59, 59)
document.getElementById('datepicker_cfrom').value = m[0] + "-"
+ dfrom.getDate()
document.getElementById('datepicker_cto').value = m[0] + "-" +
dto.getDate()
}
@@ -358,15 +358,15 @@ function datePickerValue(seedPeriod) {
// This is for recalcing the set options if spawned from a
// select/input box with an existing value derived from an
// earlier call to datePicker
- var ptype = ""
- var rv = seedPeriod
+ let ptype = ""
+ let rv = seedPeriod
if (seedPeriod && seedPeriod.search && seedPeriod.search(/=|-/) != -1) {
// Less than N units ago?
if (seedPeriod.match(/lte/)) {
- var m = seedPeriod.match(/lte=(\d+)([dMyw])/)
+ let m = seedPeriod.match(/lte=(\d+)([dMyw])/)
ptype = 'lt'
- var unitt = units[m[2]]
+ let unitt = units[m[2]]
if (parseInt(m[1]) != 1) {
unitt += "s"
}
@@ -376,8 +376,8 @@ function datePickerValue(seedPeriod) {
// More than N units ago?
if (seedPeriod.match(/gte/)) {
ptype = 'mt'
- var m = seedPeriod.match(/gte=(\d+)([dMyw])/)
- var unitt = units[m[2]]
+ let m = seedPeriod.match(/gte=(\d+)([dMyw])/)
+ let unitt = units[m[2]]
if (parseInt(m[1]) != 1) {
unitt += "s"
}
@@ -387,8 +387,8 @@ function datePickerValue(seedPeriod) {
// Date range?
if (seedPeriod.match(/dfr/)) {
ptype = 'cd'
- var mf = seedPeriod.match(/dfr=(\d+-\d+-\d+)/)
- var mt = seedPeriod.match(/dto=(\d+-\d+-\d+)/)
+ let mf = seedPeriod.match(/dfr=(\d+-\d+-\d+)/)
+ let mt = seedPeriod.match(/dto=(\d+-\d+-\d+)/)
if (mf && mt) {
rv = "From " + mf[1] + " to " + mt[1]
}
@@ -397,7 +397,7 @@ function datePickerValue(seedPeriod) {
// Month??
if (seedPeriod.match(/^(\d+)-(\d+)$/)) {
ptype = 'mr' // just a made up thing...(month range)
- var mr = seedPeriod.match(/(\d+)-(\d+)/)
+ let mr = seedPeriod.match(/(\d+)-(\d+)/)
if (mr) {
dfrom = new Date(parseInt(mr[1]),parseInt(mr[2])-1,1, 0, 0, 0)
rv = months[dfrom.getMonth()] + ', ' + mr[1]
@@ -412,19 +412,19 @@ function datePickerDouble(seedPeriod) {
// This basically takes a date-arg and doubles it backwards
// so >=3M becomes =>6M etc. Also returns the cutoff for
// the original date and the span in days of the original
- var ptype = ""
- var rv = seedPeriod
- var dbl = seedPeriod
- var tspan = 1
- var dfrom = new Date()
- var dto = new Date()
+ let ptype = ""
+ let rv = seedPeriod
+ let dbl = seedPeriod
+ let tspan = 1
+ let dfrom = new Date()
+ let dto = new Date()
// datepicker range?
if (seedPeriod && seedPeriod.search && seedPeriod.search(/=/) != -1) {
// Less than N units ago?
if (seedPeriod.match(/lte/)) {
- var m = seedPeriod.match(/lte=(\d+)([dMyw])/)
+ let m = seedPeriod.match(/lte=(\d+)([dMyw])/)
ptype = 'lt'
rv = "<" + m[1] + m[2] + " ago"
dbl = "lte=" + (parseInt(m[1])*2) + m[2]
@@ -456,7 +456,7 @@ function datePickerDouble(seedPeriod) {
// More than N units ago?
if (seedPeriod.match(/gte/)) {
ptype = 'mt'
- var m = seedPeriod.match(/gte=(\d+)([dMyw])/)
+ let m = seedPeriod.match(/gte=(\d+)([dMyw])/)
rv = ">" + m[1] + m[2] + " ago"
dbl = "gte=" + (parseInt(m[1])*2) + m[2]
tspan = parseInt(parseInt(m[1]) * 30.4)
@@ -491,8 +491,8 @@ function datePickerDouble(seedPeriod) {
if (seedPeriod.match(/dfr/)) {
ptype = 'cd'
// Find from and to
- var mf = seedPeriod.match(/dfr=(\d+)-(\d+)-(\d+)/)
- var mt = seedPeriod.match(/dto=(\d+)-(\d+)-(\d+)/)
+ let mf = seedPeriod.match(/dfr=(\d+)-(\d+)-(\d+)/)
+ let mt = seedPeriod.match(/dto=(\d+)-(\d+)-(\d+)/)
if (mf && mt) {
rv = "from " + mf[1] + " to " + mt[1]
// Starts at 00:00:00 on from date
@@ -505,7 +505,7 @@ function datePickerDouble(seedPeriod) {
tspan = parseInt((dto.getTime() - dfrom.getTime() + 5000) /
(1000*86400))
// double the distance
- var dpast = new Date(dfrom)
+ let dpast = new Date(dfrom)
dpast.setDate(dpast.getDate() - tspan)
dbl = seedPeriod.replace(/dfr=[^|]+/, "dfr=" +
(dpast.getFullYear()) + '-' + (dpast.getMonth()+1) + '-' + dpast.getDate())
} else {
@@ -525,7 +525,7 @@ function datePickerDouble(seedPeriod) {
else if (seedPeriod.match(/^(\d+)-(\d+)$/)) {
// just a made up thing...(month range)
ptype = 'mr'
- var mr = seedPeriod.match(/(\d+)-(\d+)/)
+ let mr = seedPeriod.match(/(\d+)-(\d+)/)
if (mr) {
rv = seedPeriod
// Same as before, start at 00:00:00
@@ -537,7 +537,7 @@ function datePickerDouble(seedPeriod) {
tspan = parseInt((dto.getTime() - dfrom.getTime() + 5000) /
(1000*86400))
// Double timespan
- var dpast = new Date(dfrom)
+ let dpast = new Date(dfrom)
dpast.setDate(dpast.getDate() - tspan)
dbl = "dfr=" + (dpast.getFullYear()) + '-' + (dpast.getMonth()+1)
+ '-' + dpast.getDate() + "|dto=" + (dto.getFullYear()) + '-' +
(dto.getMonth()+1) + '-' + dto.getDate()
} else {
@@ -574,7 +574,7 @@ function findParent(el, name) {
// function for hiding the date picker
function blurDatePicker(evt) {
- var es = evt ? (evt.target || evt.srcElement) : null;
+ let es = evt ? (evt.target || evt.srcElement) : null;
if ((!es || !es.parentNode || (!findParent(es, "datepicker_popup") &&
!findParent(es, "calendarpicker_popup"))) && !(es ? es :
"null").toString().match(/javascript:void/)) {
document.getElementById('datepicker_popup').style.display = "none"
$('html').trigger('hide.bs.dropdown')
@@ -588,28 +588,28 @@ function drawCalendarPicker(obj, date) {
obj.focus()
// Default to NOW for calendar.
- var now = new Date()
+ let now = new Date()
// if called with an existing date (YYYY-MM-DD),
// convert it to a JS date object and use that for
// rendering the calendar
if (date) {
- var ar = date.split(/-/)
+ let ar = date.split(/-/)
now = new Date(ar[0],parseInt(ar[1])-1,ar[2])
}
- var days = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']
- var mat = now
+ let days = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']
+ let mat = now
// Go to first day of the month
mat.setDate(1)
obj.innerHTML = "<h3>" + months[mat.getMonth()] + ", " + mat.getFullYear()
+ ":</h3>"
- var tm = mat.getMonth()
+ let tm = mat.getMonth()
// -- Nav buttons --
// back-a-year button
- var a = document.createElement('a')
+ let a = document.createElement('a')
fixupPicker(a)
a.setAttribute("onclick", "drawCalendarPicker(this.parentNode, '" +
(mat.getFullYear()-1) + '-' + (mat.getMonth()+1) + '-' + mat.getDate() + "');")
a.setAttribute("href", "javascript:void(0);")
@@ -643,15 +643,15 @@ function drawCalendarPicker(obj, date) {
// Table containing the dates of the selected month
- var table = document.createElement('table')
+ let table = document.createElement('table')
table.setAttribute("border", "1")
table.style.margin = "0 auto"
// Add header day names
- var tr = document.createElement('tr');
- for (var m = 0; m < 7; m++) {
- var td = document.createElement('th')
+ let tr = document.createElement('tr');
+ for (let m = 0; m < 7; m++) {
+ let td = document.createElement('th')
td.innerHTML = days[m]
tr.appendChild(td)
}
@@ -659,13 +659,13 @@ function drawCalendarPicker(obj, date) {
// Until we hit the first day in a month, add blank days
tr = document.createElement('tr');
- var weekday = mat.getDay()
+ let weekday = mat.getDay()
if (weekday == 0) {
weekday = 7
}
weekday--;
- for (var i = 0; i < weekday; i++) {
- var td = document.createElement('td')
+ for (let i = 0; i < weekday; i++) {
+ let td = document.createElement('td')
tr.appendChild(td)
}
@@ -701,7 +701,7 @@ function setCalendarDate(what) {
calendarpicker_spawner.value = what
- var div = document.getElementById('calendarpicker_popup')
+ let div = document.getElementById('calendarpicker_popup')
div.parentNode.focus()
div.style.display = "none"
calcTimespan('cd')
@@ -713,14 +713,14 @@ function showCalendarPicker(parent, seed
// If supplied with a YYYY-MM-DD date, use this to seed the calendar
if (!seedDate) {
- var m = parent.value.match(/(\d+-\d+(-\d+)?)/)
+ let m = parent.value.match(/(\d+-\d+(-\d+)?)/)
if (m) {
seedDate = m[1]
}
}
// Show or create the calendar object
- var div = document.getElementById('calendarpicker_popup')
+ let div = document.getElementById('calendarpicker_popup')
if (!div) {
div = document.createElement('div')
div.setAttribute("id", "calendarpicker_popup")
@@ -729,7 +729,7 @@ function showCalendarPicker(parent, seed
div.innerHTML = "Calendar goes here..."
}
div.style.display = "block"
- var bb = parent.getBoundingClientRect()
+ let bb = parent.getBoundingClientRect()
// Align with the calling object, slightly below
div.style.top = (bb.bottom + 8) + "px"
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js Sun Jul 6
12:44:52 2025
@@ -83,7 +83,7 @@ function show_draft_list(state, json) {
txt += "<h6>Found the following saved drafts for %s:</h6>".format(project);
txt += "<small style='font-size: 0.75rem;'><ul style='margin: 0px;
padding: 10px;'>"
filenames.sort();
- for (var i = filenames.length -1; i >= 0; i--) {
+ for (let i = filenames.length -1; i >= 0; i--) {
let ts = filenames[i];
let del = ''
if (saved_drafts[ts].yours) {
@@ -115,7 +115,7 @@ function deleted_draft(state, json) {
if (json.message) {
modal("Draft was successfully removed.");
let filenames = Object.keys(saved_drafts);
- for (var i = 0; i < filenames.length; i++) {
+ for (let i = 0; i < filenames.length; i++) {
let ts = filenames[i];
let fn = saved_drafts[ts].filename;
if (fn == state.filename) {
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
(original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Sun
Jul 6 12:44:52 2025
@@ -62,7 +62,7 @@ function generate_pmc_roster(pdata) {
let no_added = 0;
let last_added = null;
txt += "Community changes, past quarter:\n";
- for (var availid in changes) {
+ for (let availid in changes) {
let change = changes[availid];
let name = change[0];
let added = moment(change[1]*1000.0);
@@ -92,7 +92,7 @@ function generate_pmc_roster(pdata) {
three_months_ago = now.subtract(3, 'months');
no_added = 0;
last_added = null;
- for (var availid in changes) {
+ for (let availid in changes) {
let change = changes[availid];
let name = change[0];
let added = moment(change[1]*1000.0);
@@ -145,7 +145,7 @@ function generate_meta(data) {
let ntxt = "";
let a = comment.match(/(?:^|\n)([a-z0-9]+:
[\s\S\r\n]+?)(?=(\n[a-z0-9]+:|$))/gi);
if (a) {
- for (var i = 0; i < a.length; i++) {
+ for (let i = 0; i < a.length; i++) {
let cmt = a[i];
cmt = cmt.replace(/[\r\n]+/g, ' ').replace(/([a-z0-9]+:)/, (a) =>
"<kbd>"+a+"</kbd><br/>");
ntxt += cmt + "<br/>";
@@ -181,7 +181,7 @@ function splash(state, json, all) {
let keys = json.pdata;
if (all) keys = cycles;
let found = 0;
- for (var key in keys) {
+ for (let key in keys) {
found++;
if (pdata.pmcsummary[key]) {
let tlpname = pdata.pmcsummary[key].name;
@@ -215,7 +215,7 @@ function health_tips(data) {
let haskibble = data.kibble && Object.keys(data.kibble) > 0;
let txt = "";
// Mailing list changes
- for (var ml in data.delivery[project]) {
+ for (let ml in data.delivery[project]) {
let mldata = data.delivery[project][ml];
let a = ml.match(/([^-]+)-(.+)/);
ml = "%s@%s.apache.org".format(a[2], a[1]);
@@ -403,7 +403,7 @@ function health_tips(data) {
showit = true;
let ul = new HTML('ul');
let arr = data.kibble.busiest.email;
- for (var i = 0; i < arr.length; i++) {
+ for (let i = 0; i < arr.length; i++) {
let ml = arr[i].source.split('?')[1];
let li = new HTML('li', {}, [
new HTML("kbd", {}, ml),
@@ -422,7 +422,7 @@ function health_tips(data) {
showit = true;
let ul = new HTML('ul');
let arr = data.kibble.busiest.github;
- for (var i = 0; i < arr.length; i++) {
+ for (let i = 0; i < arr.length; i++) {
let li = new HTML('li', {}, [
new HTML("a", {href: arr[i].url},
arr[i].url.replace('https://github.com/apache/', '')),
new HTML('i', {style: {display:
'inline-block', textIndent: '10px'}}, arr[i].subject),
@@ -439,7 +439,7 @@ function health_tips(data) {
showit = true;
let ul = new HTML('ul');
let arr = data.kibble.busiest.jira;
- for (var i = 0; i < arr.length; i++) {
+ for (let i = 0; i < arr.length; i++) {
let li = new HTML('li', {}, [
new HTML("a", {href: arr[i].url},
arr[i].key),
new HTML('i', {style: {display:
'inline-block', textIndent: '10px'}}, arr[i].subject),
@@ -482,7 +482,7 @@ function activity_tips(data) {
let rtxt = "";
let new_releases = 0;
let ages = [];
- for (var rel in data.releases[project]) {
+ for (let rel in data.releases[project]) {
let reldate = moment(data.releases[project][rel] * 1000.0);
if (reldate > three_months_ago) {
new_releases++;
@@ -496,7 +496,7 @@ function activity_tips(data) {
let releases_picked = {};
while (ages.length) {
let ts = ages.shift();
- for (var rel in data.releases[project]) {
+ for (let rel in data.releases[project]) {
if (releases_shown >= to_show) break;
let reldate = moment(data.releases[project][rel] * 1000.0);
if (releases_picked[rel]) continue;
@@ -526,7 +526,7 @@ function should_reflow(txt, chars) {
if (typeof txt != 'string') return false;
chars = chars || 80;
let lines = txt.split(/[\r\n]+/g);
- for (var i = 0; i < lines.length; i++) {
+ for (let i = 0; i < lines.length; i++) {
if (lines[i].length > chars && lines[i].match(/\s/)) return true;
}
return false;
@@ -539,7 +539,7 @@ function reflow(txt, chars) {
if (!words) return txt;
let x = 0;
let output = "";
- for (var i = 0; i < words.length; i++) {
+ for (let i = 0; i < words.length; i++) {
let word = words[i];
x += word.length;
if (x > chars) {
@@ -568,7 +568,7 @@ function compile_check(pdata, editor) {
function show_examples(examples, title) {
let out = "<p>Here are some good examples of what to write in your
<kbd>%s</kbd> section:</p>".format(title);
- for (var i = 0; i < examples.length; i++) {
+ for (let i = 0; i < examples.length; i++) {
out += "<pre style='background: #FFE; border: 0.75px solid #3339; padding:
3px; border-radius: 3px;'>" + examples[i] + "</pre><hr/>";
}
title = "Examples for %s:".format(title);
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js Sun Jul 6
12:44:52 2025
@@ -32,7 +32,7 @@ function init_wizard(so) {
} else {
document.title = so ? "ASF Project Statistics: %s".format(project) :
"ASF Board Report Wizard: %s".format(project);
let titles = document.getElementsByClassName("title");
- for (var i in titles) {
+ for (let i in titles) {
titles[i].innerText = document.title;
}
if (so) {
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js Sun Jul 6
12:44:52 2025
@@ -18,7 +18,7 @@ function prime_wizard(state, json) {
pdata = json;
document.title = (statsonly ? "ASF Project Statistics: %s" : "ASF Board
Report Wizard: %s").format(json.pdata[project].name);
let titles = document.getElementsByClassName("title");
- for (var i in titles) {
+ for (let i in titles) {
titles[i].innerText = document.title;
}
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js
(original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js Sun
Jul 6 12:44:52 2025
@@ -6,9 +6,9 @@ const reporting_date_shifts = { // Dates
}
function getWednesdays(mo, y) {
- var d = new Date();
+ let d = new Date();
d.setFullYear(y, mo, 1)
- var month = d.getMonth(),
+ let month = d.getMonth(),
wednesdays = [];
// Get the first Wednesday (day 3 of week) in the month
@@ -38,12 +38,12 @@ function everyMonth(s) {
return s == 'Every month'
}
-var m = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December']
+let m = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December']
// Format the report month array. Assumes that non-month values appear first
function formatRm(array) {
- var first = array[0]
+ let first = array[0]
if (array.length == 1) { // e.g. every month
return first
}
@@ -54,16 +54,16 @@ function formatRm(array) {
}
function getReportDate(json, pmc, dateOnly, agenda) {
- var today = new Date()
+ let today = new Date()
- var dates = [] // the entries must be in date order
+ let dates = [] // the entries must be in date order
- var rm = json[pmc] // reporting months for the pmc
+ let rm = json[pmc] // reporting months for the pmc
// First check if the list contains an every month indicator
// This is necessary to ensure that the dates are added to the list in
order
- for (var i = 0; i < rm.length; i++) {
- var sm = rm[i];
+ for (let i = 0; i < rm.length; i++) {
+ let sm = rm[i];
if (everyMonth(sm)) {
rm = m // reset to every month
break
@@ -71,10 +71,10 @@ function getReportDate(json, pmc, dateOn
}
// Find the 3rd Wed in each month for this year
- var this_year = today.getFullYear();
+ let this_year = today.getFullYear();
// Check the months in order, so it does not matter if the data is
unordered
- for (var x = 0; x < m.length; x++) {
- for (var i = 0; i < rm.length; i++) {
+ for (let x = 0; x < m.length; x++) {
+ for (let i = 0; i < rm.length; i++) {
if (m[x] == rm[i]) {
dates.push(getWednesdays(x, this_year)[2])
}
@@ -82,8 +82,8 @@ function getReportDate(json, pmc, dateOn
}
// Also for next year to allow for year-end wrap-round
// cannot combine with the code above because that would destroy the
order
- for (var x = 0; x < m.length; x++) {
- for (var i = 0; i < rm.length; i++) {
+ for (let x = 0; x < m.length; x++) {
+ for (let i = 0; i < rm.length; i++) {
if (m[x] == rm[i]) {
dates.push(getWednesdays(x, this_year+1)[2])
}
Modified:
comdev/reporter.apache.org/trunk/site/wizard/js/source/scaffolding-html.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/scaffolding-html.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/scaffolding-html.js
(original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/scaffolding-html.js
Sun Jul 6 12:44:52 2025
@@ -31,13 +31,13 @@
#}, "Some text inside a div")
*/
-var txt = (msg) => document.createTextNode(msg);
+let txt = (msg) => document.createTextNode(msg);
-var HTML = (function() {
+let HTML = (function() {
function HTML(type, params, children) {
/* create the raw element, or clone if passed an existing element */
- var child, j, len, val;
+ let child, j, len, val;
if (typeof type === 'object') {
this.element = type.cloneNode();
} else {
@@ -46,7 +46,7 @@ var HTML = (function() {
/* If params have been passed, set them */
if (isHash(params)) {
- for (var key in params) {
+ for (let key in params) {
val = params[key];
/* Standard string value? */
@@ -59,7 +59,7 @@ var HTML = (function() {
} else if (isHash(val)) {
/* Are we trying to set multiple sub elements, like a style? */
- for (var subkey in val) {
+ for (let subkey in val) {
let subval = val[subkey];
if (!this.element[key]) {
throw "No such attribute, " + key + "!";
@@ -112,7 +112,7 @@ var HTML = (function() {
*/
HTMLElement.prototype.inject = function(child) {
- var item, j, len;
+ let item, j, len;
if (isArray(child)) {
for (j = 0, len = child.length; j < len; j++) {
item = child[j];
@@ -137,7 +137,7 @@ HTMLElement.prototype.inject = function(
*/
HTMLElement.prototype.empty = function() {
- var ndiv;
+ let ndiv;
ndiv = this.cloneNode();
this.parentNode.replaceChild(ndiv, this);
return ndiv;
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics.js
(original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics.js Sun
Jul 6 12:44:52 2025
@@ -4,12 +4,12 @@ function StatisticsPage(layout, pdata) {
wrapper.style.padding = '8px';
wrapper.style.height = 'auto';
wrapper.innerHTML = "";
- for (var i = 0; i < layout.length; i++) {
+ for (let i = 0; i < layout.length; i++) {
let step = layout[i];
if (step.statsgenerator||step.tipgenerator) {
let thtml = new HTML('p');
let f = Function('a', 'b', "return
%s(a,b);".format(step.statsgenerator||step.tipgenerator));
- data = f(pdata, {});
+ let data = f(pdata, {});
if (typeof data == 'string') thtml.innerHTML += data;
else if (typeof data == 'object') thtml.inject(data);
thtml.inject(new HTML('hr'));
@@ -19,7 +19,7 @@ function StatisticsPage(layout, pdata) {
headers = $(wrapper).find("h4");
let toc = "<ul style='background: #3333;'>";
- for (var i = 0; i < headers.length; i++) {
+ for (let i = 0; i < headers.length; i++) {
let t = headers[i].innerText.replace(/:.*$/, '');
let id = t.replace(/\s+/g, '').toLowerCase();
headers[i].setAttribute('id', id);
Modified:
comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
---
comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js
(original)
+++
comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js
Sun Jul 6 12:44:52 2025
@@ -50,7 +50,7 @@ function statistics_roster(pdata) {
let no_added = 0;
let last_added = null;
txt += "<h5>Community changes, past quarter:</h5><ul>";
- for (var availid in changes) {
+ for (let availid in changes) {
let change = changes[availid];
let name = change[0];
let added = moment(change[1] * 1000.0);
@@ -80,7 +80,7 @@ function statistics_roster(pdata) {
three_months_ago = now.subtract(3, 'months');
no_added = 0;
last_added = null;
- for (var availid in changes) {
+ for (let availid in changes) {
let change = changes[availid];
let name = change[0];
let added = moment(change[1] * 1000.0);
@@ -129,12 +129,12 @@ function kibble_mailstats(xhtml, timeser
['threads'],
['authors']
];
- for (var i = 0; i < 27; i++) {
+ for (let i = 0; i < 27; i++) {
let date = moment.utc().subtract(i,
'weeks').startOf('week').weekday(1);
let c = 0;
let o = 0;
let a = 0;
- for (var n = 0; n < timeseries.length; n++) {
+ for (let n = 0; n < timeseries.length; n++) {
let el = timeseries[n];
if (el.date == date.unix()) {
c = el['emails'];
@@ -216,7 +216,7 @@ function statistics_health(data) {
html.inject(new HTML('div', {}, `(as at ${data.email_date})`));
let txt = "";
// Mailing list changes
- for (var ml in data.delivery[project]) {
+ for (let ml in data.delivery[project]) {
let xhtml = new HTML('div', {
style: {
@@ -256,7 +256,7 @@ function statistics_health(data) {
['x'],
[ml]
];
- for (var i = 0; i < 27; i++) {
+ for (let i = 0; i < 27; i++) {
let date = moment.utc().subtract(i,
'weeks').startOf('week').weekday(4);
cols[0].push(date);
cols[1].push(mldata.weekly[date.unix()] || 0);
@@ -385,11 +385,11 @@ function statistics_health(data) {
['Tickets opened'],
['Tickets closed']
];
- for (var i = 0; i < 27; i++) {
+ for (let i = 0; i < 27; i++) {
let date = moment.utc().subtract(i,
'weeks').startOf('week').weekday(1);
let c = 0;
let o = 0;
- for (var n = 0; n < data.kibble.timeseries.jira.length; n++) {
+ for (let n = 0; n < data.kibble.timeseries.jira.length; n++) {
let el = data.kibble.timeseries.jira[n];
if (el.date == date.unix()) {
c = el['issues closed']
@@ -514,10 +514,10 @@ function statistics_health(data) {
['x'],
['Commits']
];
- for (var i = 0; i < 27; i++) {
+ for (let i = 0; i < 27; i++) {
let date = moment.utc().subtract(i,
'weeks').startOf('week').weekday(1);
let c = 0;
- for (var n = 0; n < data.kibble.timeseries.commits.length;
n++) {
+ for (let n = 0; n < data.kibble.timeseries.commits.length;
n++) {
let el = data.kibble.timeseries.commits[n];
if (el.date == date.unix()) {
c = el['commits']
@@ -635,11 +635,11 @@ function statistics_health(data) {
['PRs opened'],
['PRs closed']
];
- for (var i = 0; i < 27; i++) {
+ for (let i = 0; i < 27; i++) {
let date = moment.utc().subtract(i,
'weeks').startOf('week').weekday(1);
let c = 0;
let o = 0;
- for (var n = 0; n < data.kibble.timeseries.github.length; n++)
{
+ for (let n = 0; n < data.kibble.timeseries.github.length; n++)
{
let el = data.kibble.timeseries.github[n];
if (el.date == date.unix()) {
c = el['pull requests closed']
@@ -763,11 +763,11 @@ function statistics_health(data) {
['issues opened'],
['issues closed']
];
- for (var i = 0; i < 27; i++) {
+ for (let i = 0; i < 27; i++) {
let date = moment.utc().subtract(i,
'weeks').startOf('week').weekday(1);
let c = 0;
let o = 0;
- for (var n = 0; n < data.kibble.timeseries.github.length; n++)
{
+ for (let n = 0; n < data.kibble.timeseries.github.length; n++)
{
let el = data.kibble.timeseries.github[n];
if (el.date == date.unix()) {
c = el['issues closed']
@@ -842,7 +842,7 @@ function statistics_health(data) {
showit = true;
let ul = new HTML('ul');
let arr = data.kibble.busiest.email;
- for (var i = 0; i < arr.length; i++) {
+ for (let i = 0; i < arr.length; i++) {
let ml = arr[i].source.split('?')[1];
let li = new HTML('li', {}, [
new HTML("kbd", {}, ml),
@@ -871,7 +871,7 @@ function statistics_health(data) {
txt += "<h5>Busiest GitHub issues/PRs:</h5>";
let ul = new HTML('ul');
let arr = data.kibble.busiest.github;
- for (var i = 0; i < arr.length; i++) {
+ for (let i = 0; i < arr.length; i++) {
let li = new HTML('li', {}, [
new HTML("a", {
href: arr[i].url
@@ -900,7 +900,7 @@ function statistics_health(data) {
txt += "<h5>Busiest JIRA tickets:</h5>";
let ul = new HTML('ul');
let arr = data.kibble.busiest.jira;
- for (var i = 0; i < arr.length; i++) {
+ for (let i = 0; i < arr.length; i++) {
let li = new HTML('li', {}, [
new HTML("a", {
href: arr[i].url
@@ -933,7 +933,7 @@ function statistics_health(data) {
headers = $(html).find("h5");
let toc = "<ul>";
- for (var i = 0; i < headers.length; i++) {
+ for (let i = 0; i < headers.length; i++) {
let t = headers[i].innerText.replace(/:.*$/, '');
let id = t.replace(/\s+/g, '').toLowerCase();
headers[i].setAttribute('id', id);
@@ -957,7 +957,7 @@ function statistics_releases(data) {
let rtxt = "";
let new_releases = 0;
let ages = [];
- for (var rel in data.releases[project]) {
+ for (let rel in data.releases[project]) {
let reldate = moment(data.releases[project][rel] * 1000.0);
if (reldate > three_months_ago) {
new_releases++;
@@ -971,7 +971,7 @@ function statistics_releases(data) {
let releases_picked = {};
while (ages.length) {
let ts = ages.shift();
- for (var rel in data.releases[project]) {
+ for (let rel in data.releases[project]) {
if (releases_shown >= to_show) break;
let reldate = moment(data.releases[project][rel] * 1000.0);
if (releases_picked[rel]) continue;
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js Sun Jul
6 12:44:52 2025
@@ -40,7 +40,7 @@ function ReportStepper(div, editor, layo
// build the step div
this.object.innerHTML = '';
- for (var i = 0; i < this.layout.length; i++) {
+ for (let i = 0; i < this.layout.length; i++) {
let element = this.layout[i];
let wrapper = new HTML('div', {class: 'wizard-step-wrapper'});
let x = i;
@@ -83,7 +83,7 @@ function ReportStepper(div, editor, layo
if (step.minchars) {
this.editor.parse(true);
let chars_remain = step.minchars;
- for (var n = 0; n < this.editor.sections.length; n++ ) {
+ for (let n = 0; n < this.editor.sections.length; n++ ) {
let sct = this.editor.sections[n];
if (sct.title == (step.rawname||step.description) &&
sct.text.indexOf(PLACEHOLDER) == -1) {
chars_remain = step.minchars - sct.text.length;
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js Sun Jul
6 12:44:52 2025
@@ -89,14 +89,14 @@ function UnifiedEditor_find_section(e) {
if (nextheader) {
let title = nextheader[nextheader.length-1].replace(/:[\s\S]*?$/,
'').replace(/^##\s+/, '');
custom_step.description = title;
- for (var i = 0; i < this.layout.length; i++) {
+ for (let i = 0; i < this.layout.length; i++) {
let step = this.layout[i];
if (title == (step.rawname || step.description)) {
at_step = i;
}
}
} else {
- for (var i = 0; i < this.layout.length; i++) {
+ for (let i = 0; i < this.layout.length; i++) {
let step = this.layout[i];
let tline = "## %s".format(step.rawname || step.description);
if (tprec.indexOf(tline) != -1) {
@@ -170,7 +170,7 @@ function UnifiedEditor_parse_report(quie
function UnifiedEditor_mark_section(title) {
this.parse(true);
let foundit = false;
- for (var i = 0; i < this.sections.length; i++) {
+ for (let i = 0; i < this.sections.length; i++) {
let section = this.sections[i];
if (section.title == title && section.text.indexOf(PLACEHOLDER) == -1
&& section.text.length > 4) {
//console.log("Marking entire %s section from %u to
%u".format(title, this.sections[i].start, this.sections[i].end))
@@ -196,7 +196,7 @@ function UnifiedEditor_reset() {
}
this.report = "";
this.changed = true;
- for (var i = 0; i < this.layout.length; i++) {
+ for (let i = 0; i < this.layout.length; i++) {
let step = this.layout[i];
if (!step.noinput || step.rawname) {
this.report += "## %s:\n".format(step.rawname || step.description);
@@ -220,12 +220,12 @@ function UnifiedEditor_compile() {
let text = "";
let required_sections = [];
this.parse();
- for (var i = 0; i < this.layout.length; i++) {
+ for (let i = 0; i < this.layout.length; i++) {
let step = this.layout[i];
if (!step.noinput) {
let found = false;
required_sections.push(step.rawname||step.description);
- for (var n = 0; n < this.sections.length; n++) {
+ for (let n = 0; n < this.sections.length; n++) {
if (this.sections[n].title == (step.rawname||step.description)) {
found = true;
if (this.sections[n].text.indexOf(PLACEHOLDER) != -1) {
@@ -257,7 +257,7 @@ function UnifiedEditor_compile() {
}
// Remark on additional sections not required
- for (var n = 0; n < this.sections.length; n++) {
+ for (let n = 0; n < this.sections.length; n++) {
if (!required_sections.has(this.sections[n].title)) {
text += "<li><span style='display: inline-block; width: 20px;
font-size: 18px; color: pink;'>‽</span> Found custom section
<kbd>%s</kbd></li>".format(this.sections[n].title);
}
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/whimsy-flow.js
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/whimsy-flow.js?rev=1926997&r1=1926996&r2=1926997&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/whimsy-flow.js
(original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/whimsy-flow.js Sun
Jul 6 12:44:52 2025
@@ -11,10 +11,10 @@ class Flow {
new RegExp(`(.{1,${len}})( +|$\\n?)|(.{1,${len}})`, "g"),
`$1$3\n${indent}`
).trim()
- };
+ }
return lines.join("\n")
- };
+ }
// reflow text. Indent is a string containing the amount of spaces that are
// to be added to each line. The Incubator has special punctuation rules
that
@@ -36,7 +36,7 @@ class Flow {
if (/^\s*\w/m.test(lines[i]) && !/^\s*\d+\./m.test(lines[i])) {
lines.splice(i - 1, 2, lines[i - 1] + lines[i].replace(/^\s*/m, " "))
}
- };
+ }
// reflow each line
let len = 78 - indent.length;
@@ -67,8 +67,8 @@ class Flow {
).replace(indent, "").replace(/[\n\r]+$/m, "")
}
}
- };
+ }
return lines.join("\n")
}
-};
+}