dojo.provide("dijit._editor.RichText"); dojo.require("dijit._Widget"); dojo.require("dijit._editor.selection"); dojo.require("dijit._editor.range"); dojo.require("dijit._editor.html"); dojo.require("dojo.i18n"); dojo.requireLocalization("dijit.form", "Textarea"); // used to restore content when user leaves this page then comes back // but do not try doing dojo.doc.write if we are using xd loading. // dojo.doc.write will only work if RichText.js is included in the dojo.js // file. If it is included in dojo.js and you want to allow rich text saving // for back/forward actions, then set dojo.config.allowXdRichTextSave = true. if(!dojo.config["useXDomain"] || dojo.config["allowXdRichTextSave"]){ if(dojo._postLoad){ (function(){ var savetextarea = dojo.doc.createElement('textarea'); savetextarea.id = dijit._scopeName + "._editor.RichText.savedContent"; dojo.style(savetextarea, { display:'none', position:'absolute', top:"-100px", height:"3px", width:"3px" }); dojo.body().appendChild(savetextarea); })(); }else{ //dojo.body() is not available before onLoad is fired try { dojo.doc.write(''); }catch(e){ } } } dojo.declare("dijit._editor.RichText", dijit._Widget, { constructor: function(params){ // summary: // dijit._editor.RichText is the core of dijit.Editor, which provides basic // WYSIWYG editing features. // // description: // dijit._editor.RichText is the core of dijit.Editor, which provides basic // WYSIWYG editing features. It also encapsulates the differences // of different js engines for various browsers. Do not use this widget // with an HTML <TEXTAREA> tag, since the browser unescapes XML escape characters, // like <. This can have unexpected behavior and lead to security issues // such as scripting attacks. // // tags: // private // contentPreFilters: Function(String)[] // Pre content filter function register array. // these filters will be executed before the actual // editing area gets the html content. this.contentPreFilters = []; // contentPostFilters: Function(String)[] // post content filter function register array. // These will be used on the resulting html // from contentDomPostFilters. The resulting // content is the final html (returned by getValue()). this.contentPostFilters = []; // contentDomPreFilters: Function(DomNode)[] // Pre content dom filter function register array. // These filters are applied after the result from // contentPreFilters are set to the editing area. this.contentDomPreFilters = []; // contentDomPostFilters: Function(DomNode)[] // Post content dom filter function register array. // These filters are executed on the editing area dom. // The result from these will be passed to contentPostFilters. this.contentDomPostFilters = []; // editingAreaStyleSheets: dojo._URL[] // array to store all the stylesheets applied to the editing area this.editingAreaStyleSheets=[]; this._keyHandlers = {}; this.contentPreFilters.push(dojo.hitch(this, "_preFixUrlAttributes")); if(dojo.isMoz){ this.contentPreFilters.push(this._fixContentForMoz); this.contentPostFilters.push(this._removeMozBogus); } if(dojo.isSafari){ this.contentPostFilters.push(this._removeSafariBogus); } //this.contentDomPostFilters.push(this._postDomFixUrlAttributes); this.onLoadDeferred = new dojo.Deferred(); }, // inheritWidth: Boolean // whether to inherit the parent's width or simply use 100% inheritWidth: false, // focusOnLoad: [deprecated] Boolean // Focus into this widget when the page is loaded focusOnLoad: false, // name: String? // Specifies the name of a (hidden)