editor-bidi-debug.js revision fa2ede9f0bd25baec5d0e29166b52862cfd11412
157N/A * Plugin for Editor to support BiDirectional (bidi) text operations. 157N/A * @class Plugin.EditorBidi 157N/A * @submodule editor-bidi 2899N/A * Place holder for the last direction when checking for a switch 260N/A * @property lastDirection 157N/A * Tells us that an initial bidi check has already been performed 157N/A * Method checks to see if the direction of the text has changed based on a nodeChange event. * Checked for a change after a specific nodeChange event has been fired. * @method _afterNodeChange // If this is the first event ever, or an event that can result in a context change * Checks for a direction change after a mouseup occurs. * The events to check for a direction change on * More elements may be needed. BODY *must* be in the list to take care of the special case. * blockParent could be changed to use inst.Selection.BLOCKS * instead, but that would make Y.Plugin.EditorBidi.blockParent * unusable in non-RTE contexts (it being usable is a nice //BLOCKS: Y.Selection.BLOCKS+',LI,HR,' + BODY, * Template for creating a block element * Returns a block parent for a given element // This shouldn't happen if the RTE handles everything // according to spec: we should get to a P before BODY. But // we don't want to set the direction of BODY even if that // happens, so we wrap everything in a DIV. // The code is based on YUI3's Y.Selection._wrapBlock function. * The data key to store on the node. * @property _NODE_SELECTED * Generates a list of all the block parents of the current NodeList // This works automagically, since new parents added get processed // later themselves. So if there's a node early in the process that // we haven't discovered some of its siblings yet, thus resulting in // its parent not added, the parent will be added later, since those // siblings will be added to the array and then get processed. // Don't add the parent if the parent is the BODY element. // We don't want to change the direction of BODY. Also don't // do it if the parent is already in the list. return true;
// stop more processing * @property RE_TEXT_ALIGN * Method to test a node's style attribute for text-align and removing it. * @method removeTextAlign * bidi execCommand override for setting the text direction of a node. * @for Plugin.ExecCommand * @property COMMANDS.bidi //TODO -- This should not add this command unless the plugin is added to the instance.. Y.
error(
'bidi execCommand is not available without the EditorBiDi plugin.');
//Remove text-align attribute if it exists //If no direction is set, auto-detect the proper setting to make it "toggle" }
else {
// some text is selected //Remove text-align attribute if it exists