Skip to content

Instantly share code, notes, and snippets.

@jsocol
Created December 10, 2012 05:59
Show Gist options
  • Select an option

  • Save jsocol/4248706 to your computer and use it in GitHub Desktop.

Select an option

Save jsocol/4248706 to your computer and use it in GitHub Desktop.
.js script: make trello card IDs visible
window.addEventListener("load", function() {
var ids = document.querySelectorAll("span.card-short-id");
Array.prototype.forEach.call(ids, function(el) {
el.classList.remove("hide");
});
}, false);
/* For Firefox's dotjs port: */
(function() {
var ids = document.querySelectorAll("span.card-short-id");
Array.prototype.forEach.call(ids, function(el) {
el.classList.remove("hide");
});
})();
@jsocol

jsocol commented Dec 10, 2012

Copy link
Copy Markdown
Author

Firefox's [dotjs] extension runs after the page load event, so you can just access the DOM. In the Chrome version, it runs way before the load event, so we need to wait.

Also, gotta love Array.prototype.forEach and element.classList.

@jsocol

jsocol commented Dec 10, 2012

Copy link
Copy Markdown
Author

That was supposed to be a link: dotjs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment