Quantcast
Channel: CKEditor™ Provider for DNN®
Viewing all articles
Browse latest Browse all 1992

New Post: compatibility with 2sexy content

$
0
0
rsiera wrote:
Thanks. That helps alot.
Is guess you didn't find a solution? I build a solution it looks like it works...

Replace the code in the ItemForm.js ...
var editor = $find(objWrapper.find(".RadEditor").get(0).id);

                    alert(Telerik.Web.UI.RadEditor);
                    Controller.SetReadOnly = function (readOnlyState) {
                        // Bug DNN 7: Radeditor won't get disabled if this runs without timeout
                        window.setTimeout(function () {
                            // Bug in Radeditor: Must not set editable to the same value twice!
                            if (!readOnlyState != editor.get_editable()) {
                                editor.enableEditing(!readOnlyState);
                                editor.set_editable(!readOnlyState);
                                if (readOnlyState == true) editor.get_document().body.style.backgroundColor = "#EEE";
                                else editor.get_document().body.style.backgroundColor = "";
                            }
                        }, 1);

                        //if (!editor.get_isInitialized()) {

                        //}
                    };
                    Controller.SetValue = function (value) {
                        editor.set_html(value);
                    };
                    Controller.GetValue = function () {
                        return editor.get_html();
                    };
with this one...
// Check if CKEditor is used
                if (CKEDITOR)
                {
                    Controller.SetReadOnly = function (readOnlyState) {
                        CKEDITOR.on('instanceReady', function (ev) {
                           var editor = ev.editor;

                           editor.setReadOnly(readOnlyState);

                           if (readOnlyState) {
                               editor.document.getBody().setStyle('background-color', '#EEE');
                           }
                           else {
                               editor.document.getBody().setStyle('background-color', '');
                           }
                           

                        });
                      
                    };
                    Controller.SetValue = function (value) {
                        CKEDITOR.on('instanceReady', function (ev) {
                            var editor = ev.editor;
                            editor.setData(value);

                        });
                    };
                    Controller.GetValue = function () {
                        CKEDITOR.on('instanceReady', function (ev) {
                            var editor = ev.editor;
                            return editor.getData();

                        });
                    };
                }
                else
                {
                    // Use Default RadEditor
                    var editor = $find(objWrapper.find(".RadEditor").get(0).id);

                    alert(Telerik.Web.UI.RadEditor);
                    Controller.SetReadOnly = function (readOnlyState) {
                        // Bug DNN 7: Radeditor won't get disabled if this runs without timeout
                        window.setTimeout(function () {
                            // Bug in Radeditor: Must not set editable to the same value twice!
                            if (!readOnlyState != editor.get_editable()) {
                                editor.enableEditing(!readOnlyState);
                                editor.set_editable(!readOnlyState);
                                if (readOnlyState == true) editor.get_document().body.style.backgroundColor = "#EEE";
                                else editor.get_document().body.style.backgroundColor = "";
                            }
                        }, 1);

                        //if (!editor.get_isInitialized()) {

                        //}
                    };
                    Controller.SetValue = function (value) {
                        editor.set_html(value);
                    };
                    Controller.GetValue = function () {
                        return editor.get_html();
                    };
                }

Viewing all articles
Browse latest Browse all 1992

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>