Impact factor for posts is a measurement of importance.

Impact factor for users reflect their authority, reputation and contribution on a particular topic.

Rating reflects the quality of posts.

Rating on Voofie is not a simple average of all ratings, but a weighted average of rating, weighted by the impact factor of users who rated.

Explore exciting communities of

How to keep the html source in CKEditor untouched?

Bookmark and Share
02 Aug 10

I have a few problems with CKEditor.

It is very important for my users that a html source that is entered stays as entered and should not be "reformatted" by CKEditor. Means when a user enters (or pastes) a html source which consists of one single line (because of not producing to much spaces) it should also remain in one line. But when a user decides to write his html source with line breaks and indents and so on it also should stay the same.


Of course I have tried stuff like protectedSource and dataProcessor.writer.setRules but this is not the solution for my problem.

Help is very appreciated!

 

Thanks,

MS

Add comments >
10
09 Aug 10

I have just noticed you probably can use createfakeelement to achieve these.  I haven't use this function before.  Let me digest it a little bit and I will write something on it.

Add comments >
1
02 Aug 10

I don't think that can be easily done. 

CKEditor (or bascially web WYSIWYG editors) use HTML contentEditable feature provided by web broswers to implement the WYSIWYG page editing functionalities, which understands the HTML input and converts it into DOM element trees before allowing user to edit on the page. During editing, it is the DOM element tree being edited instead of the HTML source and the DOM tree is converted into HTML source code again during submission. As line breaks and tabs in HTML source are ingored during DOM tree parsing, that cannot easily be preserved.

If you insist to achieve what you want, one possible way that I can think of is converting all line breaks and tabs into HTML comments, which is preserved by DOM element tree. And during source editing/submission, convert back the HTML comments into tab/line breaks. But in order to achieve this, some customization into the core of CKEditor is needed. A rough guess is you may want to edit htmlparser and htmlwriter.

Add comments >
0
02 Aug 10

Thank you for your quick answer!

In addition I won't use the source view of CKEditor instead I'm using Codemirror for viewing the html source. Thus I have an own switching mechanism which also converts the PHP tags because CKEditor makes html entities out of them but they need to be shown as they are in Codemirror.

Maybe it is possible to build in your suggestion into my switching mechanism without changing something in the core? I'll have a try...

I have also noticed those two plugins you mentioned, thank you very much for your help!

1 comment >
0
05 Aug 10

Okay, I can live with reformatting of the source.

Because I'm not very experienced with the CKEditor, could you tell me how to write an plugin which displays an placeholder (fake element as far as I know) for entered JSP tags?

Thank you!

Cheers, MS

2 comments >
0
18 Aug 10

Thanks for your help!

Concerning to fake elements an example can easily be found in the folder of CKEditor in _source > plugins > link. This is the placeholder displayed for anchors.

Concerning the reformatting I can settle for it so it doesn't matter.

 

Cheers, MS

Add comments >

Please login to post answer.

Page Info
99Impacts
4/1 rate
2647
Your Rating: