Fixes for Roan's crazy half-baked commit

Change-Id: Ic104debc3a941e4cf8e4dca19633dcad04a0fe0a
This commit is contained in:
Trevor Parscal 2012-05-04 16:13:54 -07:00
parent 0433717b29
commit 1d74945dfc
5 changed files with 6 additions and 5 deletions

View file

@ -34,7 +34,7 @@ ve.dm.DocumentSynchronizer.prototype.getDocument = function() {
* @param {ve.Range} range Range that was annotated * @param {ve.Range} range Range that was annotated
*/ */
ve.dm.DocumentSynchronizer.prototype.pushAnnotation = function( range ) { ve.dm.DocumentSynchronizer.prototype.pushAnnotation = function( range ) {
this.action.push( { this.actions.push( {
'type': 'annotation', 'type': 'annotation',
'range': range 'range': range
} ); } );
@ -49,7 +49,7 @@ ve.dm.DocumentSynchronizer.prototype.pushAnnotation = function( range ) {
* @param to New value of the attribute * @param to New value of the attribute
*/ */
ve.dm.DocumentSynchronizer.prototype.pushAttributeChange = function( node, key, from, to ) { ve.dm.DocumentSynchronizer.prototype.pushAttributeChange = function( node, key, from, to ) {
this.action.push( { this.actions.push( {
'type': 'attributeChange', 'type': 'attributeChange',
'node': node, 'node': node,
'key': key, 'key': key,

View file

@ -60,7 +60,7 @@ ve.dm.Surface.prototype.setSelection = function( selection ) {
* @param {ve.dm.Transaction} transactions Tranasction to apply to the document * @param {ve.dm.Transaction} transactions Tranasction to apply to the document
*/ */
ve.dm.Surface.prototype.transact = function( transaction ) { ve.dm.Surface.prototype.transact = function( transaction ) {
this.documentModel.commit( transaction ); ve.dm.TransactionProcessor.commit( this.documentModel, transaction );
this.emit( 'transact', transaction ); this.emit( 'transact', transaction );
}; };

View file

@ -14,7 +14,7 @@ ve.dm.TransactionProcessor = function( doc, transaction, reversed ) {
this.document = doc; this.document = doc;
this.operations = transaction.getOperations(); this.operations = transaction.getOperations();
// TODO add DocumentSynchronizer // TODO add DocumentSynchronizer
//this.synchronizer = new ve.dm.DocumentSynchronizer( this.model ); this.synchronizer = new ve.dm.DocumentSynchronizer( this.model );
this.reversed = reversed; this.reversed = reversed;
// Linear model offset that we're currently at // Linear model offset that we're currently at

View file

@ -32,7 +32,7 @@ test('setSelection', 1, function(){
test('transact', 1, function(){ test('transact', 1, function(){
var surface = new ve.dm.SurfaceStub(); var surface = new ve.dm.SurfaceStub();
var tx = 'transaction'; var tx = new ve.dm.Transaction();
surface.on('transact', function(){ surface.on('transact', function(){
ok( true, 'transact was emitted'); ok( true, 'transact was emitted');
}); });

View file

@ -37,6 +37,7 @@
<script src="../../modules/ve2/dm/ve.dm.LeafNode.js"></script> <script src="../../modules/ve2/dm/ve.dm.LeafNode.js"></script>
<script src="../../modules/ve2/dm/ve.dm.DocumentFragment.js"></script> <script src="../../modules/ve2/dm/ve.dm.DocumentFragment.js"></script>
<script src="../../modules/ve2/dm/ve.dm.Document.js"></script> <script src="../../modules/ve2/dm/ve.dm.Document.js"></script>
<script src="../../modules/ve2/dm/ve.dm.DocumentSynchronizer.js"></script>
<script src="../../modules/ve2/dm/ve.dm.Transaction.js"></script> <script src="../../modules/ve2/dm/ve.dm.Transaction.js"></script>
<script src="../../modules/ve2/dm/ve.dm.TransactionProcessor.js"></script> <script src="../../modules/ve2/dm/ve.dm.TransactionProcessor.js"></script>
<script src="../../modules/ve2/dm/ve.dm.Surface.js"></script> <script src="../../modules/ve2/dm/ve.dm.Surface.js"></script>