Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add actual protected content after icon #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions showprotected/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ CKEDITOR.plugins.add( 'showprotected', {

var template = '.%2 showprotected-img.cke_protected' +
'{' +
baseStyle +
'display:block;' +
'width:16px;' +
'min-height:15px;' +
'line-height:1.6em;' +
'height:1.15em;' +
'cursor:default;' +
// Opera works better with "middle" (even if not perfect)
'vertical-align:' + ( CKEDITOR.env.opera ? 'middle' : 'text-bottom' ) + ';' +
baseStyle +
'display:inline-block;' +
'min-height:15px;' +
'height:1.15em;' +
'cursor:pointer;' +
'padding:3px 3px 3px 16px;' +
'}';

// Styles with contents direction awareness.
Expand Down Expand Up @@ -75,8 +72,9 @@ CKEDITOR.plugins.add( 'showprotected', {
alt: cleanedCommentText,
title: cleanedCommentText
} );
fakeElement.setHtml(cleanedCommentText);
fakeElement.insertAfter(commentElement);

return commentText;
}

Expand Down Expand Up @@ -124,4 +122,4 @@ CKEDITOR.plugins.showprotected = {
encodeURIComponent( protectedSource ).replace( /--/g, '%2D%2D' );
}

};
};