export function queryLog(state = initialState, action): object {
if (action.type === constants.LOAD_QUERY_LOG_STOP) {
log = action.queryLog;
}
if (action.type === constants.LOAD_COMMENTS_STOP) {
comments = action.comments;
}
const list = log.concat(comments);
console.log("list:", list); // ----------- 1 ----------------
let summ = list.map(el => {
console.log("el:", el); // ----------- 2 ----------------
el.date = el.dt_changelog * 1000 || el.datetime * 1000;
el.type = el.dt_changelog ? 'changelog' : 'comment';
el.text = el.dt_changelog ? changed : el.text;
el.author = el.dt_changelog ? el.usr.source : el.author;
el.status = ("Статус") in el.changelog ? el.changelog["Статус"].after : 'не назначен';
return el;
});
console.log('!!!!!!!!!!!!!!!!!!!!!');
console.log(comments);
console.log(log);
console.log(summ);
summ.sort(function(a, b) {
if (a.date > b.date) {
return 1;
}
if (a.date < b.date) {
return -1;
}
return 0;
});
return summ;
}
// ...
let summ = log.concat(comments).map(items => {
items.forEach(el=>{
el.date = el.dt_changelog * 1000 || el.datetime * 1000;
el.type = el.dt_changelog ? 'changelog' : 'comment';
el.text = el.dt_changelog ? changed : el.text;
el.author = el.dt_changelog ? el.usr.source : el.author;
el.status = ("Статус") in el.changelog ? el.changelog["Статус"].after : 'не назначен';
});
return items;
});
// ...
el.forEach(item=>{
item.status = "Статус" in item.changelog ? item.changelog["Статус"].after : "не назначен";
});
// ...
let summ = log.concat(comments).map(items => {
items.forEach(el=>{
el.date = el.dt_changelog * 1000 || el.datetime * 1000;
el.type = el.dt_changelog ? 'changelog' : 'comment';
el.text = el.dt_changelog ? changed : el.text;
el.author = el.dt_changelog ? el.usr.source : el.author;
el.status = ("Статус") in el.changelog ? el.changelog["Статус"].after : 'не назначен';
});
return items;
});
// ...
test.js router.use { prefix: '/' } help 111
help.js router.on { prefix: '/', command: 'help', target: 'join' } join 222
help.js router.on { prefix: '/', command: 'help', target: 'join' } join 333
test.js router.use { prefix: '!' } help 111
help.js router.гыу { prefix: '/', command: 'help', target: 'join' } join 444
help.js router.on { prefix: '!', command: 'help', target: 'join' } join 222
help.js router.on { prefix: '/', command: 'help', target: 'join' } join 555
help.js router.on { prefix: '!', command: 'help', target: 'join' } join 333
test.js router.use { prefix: '/', command: 'help', target: 'join' } help 666
help.js router.гыу { prefix: '!', command: 'help', target: 'join' } join 444
help.js router.on { prefix: '!', command: 'help', target: 'join' } join 555
test.js router.use { prefix: '!', command: 'help', target: 'join' } help 666
const slideAmount = 5; // количество слайдов
for(let n=-10; n<10; n++ ){
const slideIndex = ((n%slideAmount)+slideAmount)%slideAmount;
console.log("n:", n, " ---> ", "slideIndex:", slideIndex);
}
n: -10 ---> slideIndex: 0
n: -9 ---> slideIndex: 1
n: -8 ---> slideIndex: 2
n: -7 ---> slideIndex: 3
n: -6 ---> slideIndex: 4
n: -5 ---> slideIndex: 0
n: -4 ---> slideIndex: 1
n: -3 ---> slideIndex: 2
n: -2 ---> slideIndex: 3
n: -1 ---> slideIndex: 4
n: 0 ---> slideIndex: 0
n: 1 ---> slideIndex: 1
n: 2 ---> slideIndex: 2
n: 3 ---> slideIndex: 3
n: 4 ---> slideIndex: 4
n: 5 ---> slideIndex: 0
n: 6 ---> slideIndex: 1
n: 7 ---> slideIndex: 2
n: 8 ---> slideIndex: 3
n: 9 ---> slideIndex: 4
playButton.addEventListener("click", () => {
playerArea.classList.toggle("play")
if (audioPlayer.paused) {
setTimeout(()=> {audioPlayer.play()}, 300)
timer = setInterval(updateDurationLabel, 100)
} else {
audioPlayer.pause()
clearInterval(timer)
}
}, false)
const playMusic = () => {
playerArea.classList.toggle("play")
if (audioPlayer.paused) {
setTimeout(()=> {audioPlayer.play()}, 300)
timer = setInterval(updateDurationLabel, 100)
} else {
audioPlayer.pause()
clearInterval(timer)
}
}
playButton.addEventListener("click", playMusic , false);
window.onload = ()=>{
setTimeout(playMusic,2000);
}