1 define(function(require) {
5 var _ = require('libs/underscore'),
6 plugin = {documentExtension: {textNode: {}}};
9 plugin.documentExtension.textNode.transformations = {
11 impl: function(args) {
14 newNodes = node.split({offset: args.offset});
15 [newNodes.first, newNodes.second].some(function(newNode) {
16 if(!(newNode.contents().length)) {
17 emptyText = newNode.append({text: ''});
21 return _.extend(newNodes, {emptyText: emptyText});
23 getChangeRoot: function() {
24 return this.context.parent().parent();
27 mergeContentUp: function() {
28 var myPrev = this.prev(),
32 ret = myPrev.append(this);
33 return {node: ret, offset: ret.sameNode(this) ? null : ret.getText().length - this.getText().length};
35 var range = this.parent().unwrapContent();
36 return {node: range.element1, offset: 0};