make e2ee work on tinymce
This commit is contained in:
parent
d9013f4311
commit
54438be7c2
16
js/crypto.js
16
js/crypto.js
@ -31,6 +31,9 @@ function red_encrypt(alg, elem,text) {
|
|||||||
var enc_text = '';
|
var enc_text = '';
|
||||||
var newdiv = '';
|
var newdiv = '';
|
||||||
|
|
||||||
|
if(typeof tinyMCE !== "undefined")
|
||||||
|
tinyMCE.triggerSave(false,true);
|
||||||
|
|
||||||
var text = $(elem).val();
|
var text = $(elem).val();
|
||||||
|
|
||||||
// key and hint need to be localised
|
// key and hint need to be localised
|
||||||
@ -63,7 +66,18 @@ function red_encrypt(alg, elem,text) {
|
|||||||
|
|
||||||
// alert(newdiv);
|
// alert(newdiv);
|
||||||
|
|
||||||
$(elem).val(newdiv);
|
// This might be a comment box on a page with a tinymce editor
|
||||||
|
// so check if there is a tinymce editor but also check the display
|
||||||
|
// property of our source element - because a tinymce instance
|
||||||
|
// will have display "none". If a normal textarea such as in a comment
|
||||||
|
// box has display "none" you wouldn't be able to type in it.
|
||||||
|
|
||||||
|
if($(elem).css('display') == 'none' && typeof tinyMCE !== "undefined") {
|
||||||
|
tinyMCE.activeEditor.setContent(newdiv);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(elem).val(newdiv);
|
||||||
|
}
|
||||||
|
|
||||||
// textarea = document.getElementById(elem);
|
// textarea = document.getElementById(elem);
|
||||||
// if (document.selection) {
|
// if (document.selection) {
|
||||||
|
@ -299,12 +299,13 @@ function enableOnUser(){
|
|||||||
|
|
||||||
|
|
||||||
function addeditortext(data) {
|
function addeditortext(data) {
|
||||||
if(plaintext == 'none') {
|
if(typeof tinyMCE !== "undefined") {
|
||||||
|
tinyMCE.execCommand('mceInsertRawHTML',false,data);
|
||||||
|
}
|
||||||
|
else {
|
||||||
var currentText = $("#profile-jot-text").val();
|
var currentText = $("#profile-jot-text").val();
|
||||||
$("#profile-jot-text").val(currentText + data);
|
$("#profile-jot-text").val(currentText + data);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
tinyMCE.execCommand('mceInsertRawHTML',false,data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function h2b(s) {
|
function h2b(s) {
|
||||||
|
Reference in New Issue
Block a user