For quite a while I have been looking for a way to “mirror” my CSS media queries in JavaScript, but without duplicating the actual queries. Of course, you can use matchMedia to evaluate a media query in JavaScript, but then you have to maintain your breakpoints in two places – not ideal.
Remove style attributes with a REGEX when you paste HTML in CKEditor
$('#htmleditor').ckeditor(options).bind('instanceReady.ckeditor', function() {
CKEDITOR.instances['htmleditor'].on('paste', function(e) {
e.data.html = e.data.html.replace(/\s*style="[^"]*"/g, '');
});
});
For example, rather than doing the following:
var universe = { answer: 42 }; // do something else universe.panic = false;it’s recommended to implement it this way:
var universe = { answer: 42, panic: true }; // do something else universe.panic = false;
All CSS cursors together on one page.