<div id="main">
while ($('.sub-menu > .sub-rubriс').length > 0) {
$('.sub-menu > .sub-rubriс:first')
.nextUntil('.sub-rubriс')
.add($('.sub-menu > .sub-rubriс:first'))
.wrapAll('<div class="sub-rubrik-wrap"></div>');
}
'use strict';
const fs = require('mz/fs');
fs.readdir(__dirname)
.then(filesNames => Promise.all(
filesNames.map(fileName => {
return fs.stat(fileName).then(stat => {
return {name: fileName, stat: stat};
});
})
)
)
.then(stats => stats.filter(
statsObj => statsObj.stat.isFile()
))
.then(stats => stats.reduce(
(sum, statsObj) => {
console.log(`${statsObj.name}: ${statsObj.stat.size}`);
return sum + statsObj.stat.size;
}, 0
))
.then(console.log)
.catch(error => console.log(error));
var s = '';
$('.tile').each(function() {
s += $(this).find('.tile__name').text() + ': "';
var s1 = '';
$(this).find('.tile__list span').each(function() {
s1 += $(this).text() + ',';
})
s += s1.slice(0, s1.length-1) + '", ';
});
s = s.slice(0, s.length-2);
alert(s);