madebymany/sir-trevor-js — pull request #25 by ninjabiscuit (2013-07-21 13:39:02+00:00)
Title: Features/truncation block

There's not actually much different here - just moved some stuff around.

Created a SimpleBlock class which now has all the base Block functionality on it. Block inherits from simple block and there are no breaking changes. Creating a SimpleBlock makes it easier to leave out all the usual block stuff. It also allows us to keep simple blocks out of the block controls.

I have had to special case the truncation block and have added an option for it on SirTrevor defaults. If `useTruncationBlock : true` then show the truncation block at the bottom of the editor. I guess we could create another array of SimpleBlocks - that way truncation would be less of a special case. Not sure though.

Right now it always creates a truncation block if that option is set and will always create data for it meaning that if a user creates no other blocks but saves the data then validation will pass because there will be truncation data in the textarea. I wasn't really sure whether to handle this in the editor or not. Anyway, have tested this with ITV dotcom and aside from the previous issue it works really well.

There are some rails methods that I've used on dotcom that I won't PR into STR until people are happy with this.