$('.chatButton').on('click', function(){
window.isClicked = 1;
});
client.on("Room.timeline", function(event, room, toStartOfTimeline) {
if(!window.isClicked) return;
console.log("(%s) %s :: %s", room.name, event.getSender(), event.getContent().body);
});
An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.
_mainPageEffects.globals.initBlogScrollTitle = function () {
var article = document.querySelector('.b-content'),
headers = article.querySelectorAll('h2,h3'),
contents = document.createDocumentFragment(),
ul = document.createElement('ul'),
anchor, header, link, li;
ul.className = "b-scroll";
for (var i = 0; i < headers.length; i++) {
header = headers[i];
link = 'anchor' + (i + 1);
anchor = document.createElement('a');
anchor.href = '#' + link;
anchor.innerHTML = header.innerHTML;
li = document.createElement('li');
li.appendChild(anchor);
ul.appendChild(li);
anchor = document.createElement('a');
anchor.id = link;
// article.insertBefore(anchor, header)
header.id = link;
}
contents.appendChild(ul);
article.insertBefore(contents, article.firstElementChild.nextElementSibling)
};
}
var ch = document.querySelector('.b-scroll'),
p = document.querySelector('.b-content > .container-fluid');
p.appendChild(ch);
document.querySelector('.container-fluid').classList.add('container-position');
Как из двух массивов сделать объект с новыми свойствами?
Вдруг, есть накатаное решение. А без либ я смогу сделать, но неохота велосипедить, если есть решение.
В любом случае, спасибо, поковыряю.