editor-para.js revision d2a5a45ff58ab15a8ee0339edcd03f0243373d59
/**
* Plugin for Editor to paragraph auto wrapping and correction.
* @module editor
* @submodule editor-para
*/
/**
* Plugin for Editor to paragraph auto wrapping and correction.
* @class Plugin.EditorPara
* @extends Base
* @constructor
*/
var EditorPara = function() {
/**
* Utility method to create an empty paragraph when the document is empty.
* @private
* @method _fixFirstPara
*/
_fixFirstPara: function() {
sel.focusCursor(true, false);
},
/**
* nodeChange handler to handle fixing an empty document.
* @private
* @method _onNodeChange
*/
_onNodeChange: function(e) {
switch (e.changedType) {
case 'keydown':
this._fixFirstPara();
}
}
break;
case 'backspace-up':
case 'delete-up':
}
this._fixFirstPara();
e.changedEvent.halt();
}
}
break;
}
},
/**
* Performs a block element filter when the Editor is first ready
* @private
* @method _afterEditorReady
*/
_afterEditorReady: function() {
if (inst) {
}
},
/**
* Performs a block element filter when the Editor after an content change
* @private
* @method _afterContentChange
*/
_afterContentChange: function() {
}
},
/**
* @private
* @method _afterPaste
*/
_afterPaste: function() {
sel.focusCursor(true, true);
});
},
initializer: function() {
}
}, {
/**
* editorBidi
* @static
* @property NAME
*/
NAME: 'editorPara',
/**
* editorBidi
* @static
* @property NS
*/
NS: 'editorPara',
ATTRS: {
host: {
value: false
}
}
});
Y.namespace('Plugin');