Skip to content

Instantly share code, notes, and snippets.

@primozcigler
Last active November 22, 2018 09:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save primozcigler/7e0aa9f6330b177c3a06 to your computer and use it in GitHub Desktop.
Save primozcigler/7e0aa9f6330b177c3a06 to your computer and use it in GitHub Desktop.
Trello changelog in console
(function() {
'use strict';
var changelog = [];
var date = new Date();
var padLeft = function ( str ) {
var pad = '00';
return pad.substring(0, pad.length - str.length) + str;
};
// opening <pre>
changelog.push( '<pre>' );
// ver + date
changelog.push( $$( '.js-title-helper' )[0].textContent + ' (' + date.getFullYear() + '-' + padLeft( "" + ( 1 + date.getMonth() ) ) + '-' + padLeft( "" + date.getDate() ) + ')' );
// changes from checklist
Array.prototype.map.call( $$('.checklist .checklist-item-state-complete .checklist-item-details-text'), function( $elm ) {
changelog.push( $elm.textContent );
} );
// closing </pre>
changelog.push( '</pre>' );
changelog.push( '' );
copy(
changelog
.map( function( line ) {
return line.trim();
} )
.join( '\n' )
);
return 'Changelog copied to clipboard!';
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment