Skip to content
Permalink
Browse files

RTE: support rtl direction on paragraph level (t#11954)

  • Loading branch information...
semion1956 committed Aug 26, 2013
1 parent 65b95e2 commit 5bf0c5ad1bc2ef0617e3f61b4ff5037bc2bad0e3
@@ -31,8 +31,13 @@ var NormalizeIndentOutdent = dojo.declare("dojox.editor.plugins.NormalizeIndentO
this.editor = editor;

// Register out indent handler via the builtin over-ride mechanism.
editor._indentImpl = dojo.hitch(this, this._indentImpl);
editor._outdentImpl = dojo.hitch(this, this._outdentImpl);
if(!editor._indentImpl){
editor._indentImpl = dojo.hitch(this, this._indentImpl);
}
if(!editor._outdentImpl){
editor._outdentImpl = dojo.hitch(this, this._outdentImpl);
}
editor._normalizeIndentOutdent = true;

This comment has been minimized.

Copy link
@wkeese

wkeese Nov 1, 2013

I understand what your goal is, but you can't just make the BidiSupport plugin silently disable the NormalizeIndentOutdent plugin.

Instead, perhaps BidiSupport can set up some sort of advice in the editor to get notified before and/or after the indent operation executes, to do bidi related cleanup.


// Take over the query command enabled function, we want to prevent
// indent of first items in a list, etc.
@@ -57,6 +62,12 @@ var NormalizeIndentOutdent = dojo.declare("dojox.editor.plugins.NormalizeIndentO
// The command passed in to check enablement.
// tags:
// private
if(this.editor.advancedBidi){
if(editor._indentoutdent_queryCommandEnabled){
return this.editor._indentoutdent_queryCommandEnabled(command);
}
return true;
}
var c = command.toLowerCase();
var ed, sel, range, node, tag, prevNode;
var style = "marginLeft";
@@ -881,7 +881,7 @@ var InsertTable = declare("dojox.editor.plugins.InsertTable", TablePlugins, {
dojo.disconnect(c);

this.editor.focus();
var res = this.editor.execCommand('inserthtml', obj.htmlText);
var res = this.editor.execCommand('inserthtml', obj.htmlText.replace(/>(\s)*</g,"><"));

This comment has been minimized.

Copy link
@wkeese

wkeese Nov 1, 2013

why the change?

This comment has been minimized.

Copy link
@wkeese

wkeese Jan 1, 2014

Still waiting for an answer to this.


// commenting this line, due to msg below
//var td = this.editor.query("td", this.editor.byId(obj.id));
@@ -968,6 +968,7 @@ var EditorModifyTableDialog = declare([Dialog, _TemplatedMixin, _WidgetsInTempla
this.selectPad.set("value", domAttr.get(this.table, "cellPadding"));
this.selectSpace.set("value", domAttr.get(this.table, "cellSpacing"));
this.selectAlign.set("value", domAttr.get(this.table, "align"));
this.selectDirection.set("value", domStyle.get(this.table,"direction"));
},
startup: function() {
array.forEach(this.pickers, function(picker){ picker.startup(); });
@@ -995,6 +996,7 @@ var EditorModifyTableDialog = declare([Dialog, _TemplatedMixin, _WidgetsInTempla
domAttr.set(this.table, "cellPadding", this.selectPad.get("value"));
domAttr.set(this.table, "cellSpacing", this.selectSpace.get("value"));
domAttr.set(this.table, "align", this.selectAlign.get("value"));
domStyle.set(this.table, "direction", this.selectDirection.get("value"));
var c = dojo.connect(this, "onHide", function(){
dojo.disconnect(c);
var self = this;
@@ -18,6 +18,9 @@ define({ root:
left: "left",
center: "center",
right: "right",
direction: "Direction:",
leftToRight: "left-to-right",
rightToLeft: "right-to-left",
buttonSet: "Set", // translated elsewhere?
buttonInsert: "Insert",
buttonCancel: "Cancel",
@@ -17,13 +17,20 @@
<span class="colorSwatchBtn" dojoAttachPoint="borderCol"></span>
</td></tr><tr><td>
<label>${align}</label>
</td><td colspan="2">
</td><td colspan="3">
<select dojoAttachPoint="selectAlign" dojoType="dijit.form.FilteringSelect">
<option value="default">${default}</option>
<option value="left">${left}</option>
<option value="center">${center}</option>
<option value="right">${right}</option>
</select>
</td></tr><tr><td>
<label>${direction}</label>
</td><td colspan="3">
<select dojoAttachPoint="selectDirection" dojoType="dijit.form.FilteringSelect">
<option value="ltr">${leftToRight}</option>
<option value="rtl">${rightToLeft}</option>
</select>

This comment has been minimized.

Copy link
@wkeese

wkeese Nov 1, 2013

Looks like the change to the table plugin can be independent of the other changes?

</td></tr>
<tr><td>
<label>${tableWidth}</label>

0 comments on commit 5bf0c5a

Please sign in to comment.
You can’t perform that action at this time.