diff --git a/Editor.js b/Editor.js
index 650a8fc..fde8fe9 100644
|
a
|
b
|
|
| 56 | 56 | |
| 57 | 57 | if(!this.toolbar){ |
| 58 | 58 | // if we haven't been assigned a toolbar, create one |
| 59 | | this.toolbar = new dijit.Toolbar({}); |
| | 59 | this.toolbar = new dijit.Toolbar({region:'top'}); // LALEE Added 'region:top' for BorderLayout |
| 60 | 60 | dojo.place(this.toolbar.domNode, this.editingArea, "before"); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | dojo.forEach(this.plugins, this.addPlugin, this); |
| 64 | 64 | this.onNormalizedDisplayChanged(); //update toolbar button status |
| | 65 | |
| | 66 | //LALEE: ADD THE TOOLBAR TO OUR BORDERLAYOUT OBJECT |
| | 67 | if (this.borderContainer) { |
| | 68 | this.borderContainer.addChild(this.toolbar, 0); |
| | 69 | this.borderContainer.resize(); // = new dijit.layout.BorderContainer({}, this.domNode); |
| | 70 | } else { |
| | 71 | console.debug('RichEdit Control has no usable borderContainer at this time.'); |
| | 72 | } |
| | 73 | |
| 65 | 74 | // }catch(e){ console.debug(e); } |
| 66 | 75 | |
| 67 | 76 | this.toolbar.startup(); |
diff --git a/_editor/RichText.js b/_editor/RichText.js
index 384e250..6de056f 100644
|
a
|
b
|
|
| 6 | 6 | dojo.require("dojo.i18n"); |
| 7 | 7 | dojo.requireLocalization("dijit.form", "Textarea"); |
| 8 | 8 | |
| | 9 | dojo.require("dijit.layout.BorderContainer"); //LALEE: Need BorderContainer for enhanced RichEditor |
| | 10 | |
| 9 | 11 | // used to restore content when user leaves this page then comes back |
| 10 | 12 | // but do not try doing dojo.doc.write if we are using xd loading. |
| 11 | 13 | // dojo.doc.write will only work if RichText.js is included in the dojo.js |
| … |
… |
|
| 442 | 444 | // By default, this is 300px. If you want to have the editor always |
| 443 | 445 | // resizes to accommodate the content, use AlwaysShowToolbar plugin |
| 444 | 446 | // and set height="" |
| 445 | | height: "300px", |
| | 447 | height: "100%", //LALEE: Make our BorderContainer Stretch to fit the Container by default; Override if necessary. |
| 446 | 448 | |
| 447 | 449 | // minHeight: String |
| 448 | 450 | // The minimum height that the editor should have |
| … |
… |
|
| 599 | 601 | this.name=this.textarea.name; |
| 600 | 602 | html = this._preFilterContent(this.textarea.value); |
| 601 | 603 | this.domNode = dojo.doc.createElement("div"); |
| | 604 | |
| | 605 | //LALEE: Make a BorderContainer out of a NEW DIV (assigned to this.domNode) if we're starting out from a TEXTAREA . . . |
| | 606 | // this.domNode.setAttribute('lalee', 'div_to_wrap_all_from_textarea'); |
| | 607 | this.borderContainer = new dijit.layout.BorderContainer({region:this.textarea.getAttribute('region')}, this.domNode); |
| | 608 | this.domNode.style.height = this.textarea.style.height; // || this.height; |
| | 609 | |
| 602 | 610 | this.domNode.setAttribute('widgetId',this.id); |
| 603 | 611 | this.textarea.removeAttribute('widgetId'); |
| 604 | 612 | this.domNode.cssText = this.textarea.cssText; |
| … |
… |
|
| 626 | 634 | |
| 627 | 635 | // this.domNode.innerHTML = html; |
| 628 | 636 | |
| 629 | | if(this.textarea.form){ |
| 630 | | dojo.connect(this.textarea.form, "onsubmit", this, function(){ |
| | 637 | //LALEE: For some reason, this "out-of-box" code won't FORM-POST . . . |
| | 638 | // if(this.textarea.form){ |
| | 639 | // dojo.connect(this.textarea.form, "onsubmit", this, function(){ |
| | 640 | // // FIXME: should we be calling close() here instead? |
| | 641 | // this.textarea.value = this.getValue(); |
| | 642 | // }); |
| | 643 | // } |
| | 644 | |
| | 645 | // ------------------------------------------------------------ |
| | 646 | //LALEE: I need this patch in order to get dijit.Editor to work for Form Submits!! |
| | 647 | // (From http://dojotoolkit.org/forum/support/dijit/dijit-editor-linked-textarea-submit-failes-textarea-content#comment-6023 ) |
| | 648 | // ------------------------------------------------------------ |
| | 649 | //this.domNode.innerHTML = html; |
| | 650 | if (this.textarea.form) { |
| | 651 | // FIXME: port: this used to be before advice!!! |
| | 652 | dojo.connect(this.textarea.form, "onsubmit", this, function(e){ |
| 631 | 653 | // FIXME: should we be calling close() here instead? |
| 632 | 654 | this.textarea.value = this.getValue(); |
| 633 | | }); |
| | 655 | if (this.textarea.form == null) { |
| | 656 | this.textarea_form.appendChild(this.textarea); |
| | 657 | } |
| | 658 | }, this); |
| | 659 | this.textarea_form = this.textarea.form; |
| 634 | 660 | } |
| | 661 | |
| 635 | 662 | }else{ |
| | 663 | //LALEE: Make a BorderContainer out of the EXISTING DIV (already assigned to this.domNode) |
| | 664 | // since we're starting out from a NON-TEXTAREA (i.e. we're starting from a DIV) |
| | 665 | // this.domNode.setAttribute('lalee', 'div_to_wrap_all_from_div'); |
| | 666 | this.domNode.id += "_bc"; // LALEE: Euwww DAMN!! But I can't figure out any other way to get this "working" at the moment. :-( |
| | 667 | this.borderContainer = new dijit.layout.BorderContainer({region:this.region}, this.domNode); |
| | 668 | // this.borderContainer.domNode.style.height = this.borderContainer.domNode.style.height || this.height; |
| | 669 | |
| 636 | 670 | html = this._preFilterContent(dijit._editor.getChildrenHtml(this.domNode)); |
| 637 | 671 | this.domNode.innerHTML = ''; |
| 638 | 672 | } |
| … |
… |
|
| 652 | 686 | this.domNode.innerHTML = " <br>"; |
| 653 | 687 | } |
| 654 | 688 | |
| 655 | | this.editingArea = this.domNode; // dojo.doc.createElement("div"); |
| 656 | | // this.domNode.appendChild(this.editingArea); |
| | 689 | this.editingArea = dojo.doc.createElement("div"); // this.domNode; |
| | 690 | |
| | 691 | //LALEE: If we did our BorderContainer correctly, we can now Convert this.editingArea into a ContentPane |
| | 692 | // and then add it to our wrapping BorderContainer |
| | 693 | if (this.borderContainer) { |
| | 694 | var editContentPane = new dijit.layout.ContentPane({region:'center'}, this.editingArea); |
| | 695 | this.borderContainer.addChild(editContentPane); |
| | 696 | } |
| 657 | 697 | |
| 658 | 698 | if(this.name != "" && (!dojo.config["useXDomain"] || dojo.config["allowXdRichTextSave"])){ |
| 659 | 699 | var saveTextarea = dojo.byId(dijit._scopeName + "._editor.RichText.savedContent"); |