0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Add commands for setting text/background colour.

This commit is contained in:
Neil Jenkins 2011-11-09 15:41:46 +11:00
parent b3d9de6e86
commit d01cc9875f

View file

@ -1491,6 +1491,37 @@ document.addEventListener( 'DOMContentLoaded', function () {
focus(); focus();
return this; return this;
}, },
setTextColour: function ( colour ) {
changeFormat({
tag: 'SPAN',
attributes: {
'class': 'colour',
style: 'color: ' + colour
}
}, {
tag: 'SPAN',
attributes: { 'class': 'colour' }
});
focus();
return this;
},
setHighlightColour: function ( colour ) {
changeFormat({
tag: 'SPAN',
attributes: {
'class': 'highlight',
style: 'background-color: ' + colour
}
}, {
tag: 'SPAN',
attributes: { 'class': 'highlight' }
});
focus();
return this;
},
setTextAlignment: function ( dir ) { setTextAlignment: function ( dir ) {
forEachBlock( function ( block ) { forEachBlock( function ( block ) {
block.className = 'align-' + dir; block.className = 'align-' + dir;