mcyrrer / sessionweb

Automatically exported from code.google.com/p/sessionweb
5 stars 0 forks source link

CKEditor - allow CLASS attributes in TR elements #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is an Enhancement/HowTo request.

sessionweb24: Edit Session -> Notes -> InputMethod-Source: it is possible to 
enter HTML source code which include for example <script> elements and CLASS 
attributes in TR elements.
sessionweb25: Edit Session -> Notes -> InputMethod-Source: CLASS attributes in 
TR elements are filtered/removed after exiting Source view.

After searching the Internet I found some explanations on how to change the 
allowed content in CKEditor but I failed to figure out how I can apply this to 
my sessionweb installation.
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent

It would be great if you could provide a description on how to configure the 
CKEditor in the context of sessionweb in order to allow additional elements and 
attributes.
Are there some known drawbacks for some HTML elements if the allowed content is 
changed?
http://xkcd.com/1172/

The reason why I would like the class attribute in the TR element is following:

I use RapidReporter to write my session notes
http://testing.gershon.info/reporter/ 
RapidReporter creates a csv file which I convert to HTML and just paste into 
SessionWeb. In order to filter and distinguish the different notetypes by 
different styles the class attribute in TR elements is used. 

this is a snippet of HTML code I use:

<script src="RapidReporter/RapidReporter.js"></script></p>
<link href="RapidReporter/RapidReporter.css" rel="stylesheet" type="text/css" />
<div class="RapidReporter" id="aroundtable">
    <table border="1">
......
            <tr class="Question">
                <td>
                    06/12/2013 11:31:22</td>
                <td class="notetype">
                    Question</td>
                <td>
                    tried to change \etc\logrotate.d\loadtest but it seems the it is not run at all?</td>
            </tr>
......
            <tr class="Session End. Duration">
                <td>
                    04/12/2013 11:04:37</td>
                <td class="notetype">
                    Session End. Duration</td>
                <td>
                    01:03:50</td>
                <td>
                    &nbsp;</td>
            </tr>
    </table>
</div>
<script src="RapidReporter/RapidReporterAfterTable.js"></script>

Original issue reported on code.google.com by dietmar....@gmail.com on 12 Dec 2013 at 11:37

GoogleCodeExporter commented 9 years ago
Sorry, I have totaly forgot this issue.. will look into this and I will try to 
find a workaround with the config for you

Original comment by mcyr...@gmail.com on 9 Jan 2014 at 9:48

GoogleCodeExporter commented 9 years ago

Original comment by mcyr...@gmail.com on 9 Jan 2014 at 9:49

GoogleCodeExporter commented 9 years ago
Could you try to edit js/sessionweb-edit-v26.js
edit function SetContentsCharter
and change 

var config = {extraPlugins: 'onchange'};

to

var config = {
        extraPlugins: 'onchange',
        allowedContent: true
    };

This works for me at least

Original comment by mcyr...@gmail.com on 9 Jan 2014 at 9:59

GoogleCodeExporter commented 9 years ago
finally I found the time to try your workaround for my scenario: It works! 
Thanks a lot!!

I use "Sessionweb ver 25" so I changed the file js/sessionweb-edit-v25.js the 
described way:

function SetContentsNotes(text) {

    // var config = { extraPlugins: 'onchange'};
    // CKEDITOR.replace('noteseditor');//, config);

    var config = {
        extraPlugins: 'onchange',
        allowedContent: true
    };
    CKEDITOR.replace('noteseditor', config);

Original comment by dietmar....@gmail.com on 22 Jan 2014 at 5:05