For an application I need a document that is able to record and display among each other any type (text, audio, video, HTML, maybe PDF) that the user enters or inserts.
At first I wanted to use a listview with different types of widgets (textfields, video via plugin, webview via plugin etc.), but it seemed much too complicated to me. For example, how could I have selected parts of a text field, the following image and parts of the next text field at the same time?
Actually, the document format that I need already exists: HTML. If you set the attribute "contentEditable" accordingly, it is not a big problem to let the user change the document in any way with the help of JS. And this is exactly my problem: If I use the Webview (Developer Preview) of the Flutter team (webview_flutter), the attribute "contentEditable" is apparently ignored. I can't mark text and no keyboard appears.
Am I doing something wrong or does the plugin not (yet) support this attribute? Otherwise, is there an alternative? I have to say that I am an absolute beginner in Flutter.
Related
I know about html plugins which can be used to add pages of long paragraphs
I also know about flutter codes which can be used to add long paras of texts
But I am not satisfied with both methods..
I am creating a lesson app and want to insert tons of texts and images in a beautifully way...
Can you suggest me any way [better way] to add long texts with keeping eye on the size of the app
I have added screenshots for reference
I'd recommend checking out Zefyr. It's a WYSIWYG that can embed images, display lists and even has collaborative editing capabilities. If you only wanted it for presentation you could make it view only by changing the mode to ZefyrMode.view on the ZefyrEditor constructor.
Edit:
Another more lightweight solution is to use flutter_markdown. It also supports images, lists and so on and doesn't require the special delta format that Zefyr does when storing your strings of text.
I know I can get the whole body of a document with context.document.body.getOoxml() and the current selection with context.document.getSelection(), however I can't find a way to establish what is currently on screen and what is not...
Is there a method in the Word Office JS api to retrieve only the content currently displayed on the screen?
There isn't a solution for this. The way some of the JavaScript libraries in web pages are able figure out this problem is through the view port.
Example here: https://www.customd.com/articles/13/checking-if-an-element-is-visible-on-screen-using-jquery
See another helpful SO answer here: Get the browser viewport dimensions with JavaScript
Now - Word however uses HTML as a way of formatting - and not as a way of directly displaying things. So even if you could run the same library on the HTML - it wouldn't have the same context.
The best you could do is to get the height of the visible space (which should be the same height as your add-in frame) and attempt to do some mapping. You would have some weird edge cases though, like if the font-size is different, or you have a page-break in the view etc...
Although the author of Draft-js said that he "didn't want to release any conversion utilities" (https://github.com/facebook/draft-js/issues/62),
I still want to ask that after saving raw object into database, how can we conveniently retrieve and display the raw object in our react component?
And how can we customized the display effect, to be different with effect of displaying it using Draft-js Editor component with the readOnly prop? Because we often want to customize the display effect, for the display effect is always different with the effect when we were editing in the editor.
We will be facing this issue shortly. It's been our plan to simply provide a different blockRendererFn and possibly a different blockStyleFn to the Editor when rendering on front of the site (in readOnly=true mode). That way the bits of UI needed for authoring the custom content blocks will not exist.
I'm using DTCoreText DTAttributedTextView in my app to highlight the urls in my text. My other criteria is to be able to select by tapping and holding similar to UITextView. However, DTAttributedTextView doesn't seem to to use a UITextView as a placeholder. Anybody has an idea how I can achieve this?
Thanks
That's a feature that's only available via the paid version of DTCoreText.
from the github page
This is useful for drawing simple rich text like any HTML document without having to use a UIWebView. For text selection and highlighting (as you might need for an Editor or Reader) there is the commercial DTRichTextEditor component which can be purchased in the Cocoanetics Parts Store.
I am writing a app that has a UIWebView that displays a HTML5 page. I want to annotate some text on the web page and save it in SQLite database. The annotated text must be changed to a specific color as a visual effect.
Any suggestions that how can I select and get the text back in Objective-C?
You have two choices:
Parse the HTML5 document by hand
Inject Javascript into the page and walk the document. See Search and highlight text in UIWebView