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

Can not input "+" #118

Closed
chinnkou opened this issue Jul 20, 2017 · 4 comments
Closed

Can not input "+" #118

chinnkou opened this issue Jul 20, 2017 · 4 comments

Comments

@chinnkou
Copy link

I can't input "+", and found the below code in rich_editor.js

RE.setHtml = function(contents) {
RE.editor.innerHTML = decodeURIComponent(contents.replace(/+/g, '%20'));
}

why replace "+"?

@DushyantMainwal
Copy link

@chinnkou Did you found any solution for that?

@chinnkou
Copy link
Author

chinnkou commented Aug 8, 2017

@DushyantMainwal
Yes, now I use the RE.editor.innerHTML. It can support the '+'.

rich_editor.js

RE.callback = function() {
window.location.href = "re-callback:https://" + encodeURI(RE.getHtml());
RichEditor.setInnerHTML(RE.getHtml());
}

RE.setHtml = function(contents) {
RE.editor.innerHTML = decodeURIComponent(contents.replace(/+/g, '%20'));
RichEditor.setInnerHTML(RE.getHtml());
}

RE.getHtml = function() {
return RE.editor.innerHTML;
}

RichEditor.java

addJavascriptInterface(this, "RichEditor");

@JavascriptInterface
public void setInnerHTML(String innerHTML) {
this.innerHTML = innerHTML;

 if (mInnerHTMLChangeListener != null) {
   mInnerHTMLChangeListener.onInnerHTMLChange(innerHTML);
 }

}

@chinnkou chinnkou closed this as completed Aug 8, 2017
@methodForLife
Copy link

@chinnkou Hi, could you please make your explain more specific? I am a new bee and unfamiliar with javascript. Am I supposed to extend the RichEditor.java? And add a rich_editor.js in my project? Thank you in advance:)

@shah-xad
Copy link

kindly can you explain it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants