How to work around visualeditor not working on iphone - tinymce

Visual editors such as kupu and tinymce don't allow you to type when used on an iphone. In Plone HTML view still works but the user will have to know html syntax. Is there any better work around?

Problem here is that most modern mobile phones (with a few exceptions) do support web browsing with a limited functionality only. Functionality that is necessary in order to use kupu and tinymce. Plone HTML is a good approach. You might have a very simplified html element description on that page or linked with the very few elements a user needs.

Plone supports plain text and restructured text (same as Sphinx docs) in rich text input also.
This is enabled for the default Page content type, though the option has been hidden in the latest Plone versions I think.
What you would need to do is to write a plug-in which monkey-patches rich text field to force the input to to be plain text/restructured text on mobile browsers.
Web and Mobile provides some facilities for this, to see whether a HTTP request is from a mobile user agent (mobile.sniffer package)
http://webandmobile.mfabrik.com/

I'm attempting to do the same thing on my DroidX with Plone 4.0.5. I've tried the default Browser, Dolphin, Opera Mini, Opera Mobile, Firefox 4, and Firefox 5. So far Rich Text fields do not work in the default Browser, Dolphin, Opera Mini, Opera Mobile. I got close in Firefox 4 and 5 as I could enter text but just not "see" it properly. However, Firefox 4 and 5 are buggy and locked up when I attempted to use them.
The way I got around this problem was to turn off javascript in your mobile browser and then when you edit your content use either Plain Text, Markdown, or type in the raw HTML into the place where the Rich Text field is supposed to be. I could successfully enter text this way in the default Android Browser and Dolphin.

Related

TinyMCE doesn't work on all similar pages

I have the TinyMCE sample with API key installed on a test page at https://myezwb.com/tinymce.htm - there is no other code on the page and the TinyMCE works great.
Now I have installed that same at the top of 3 production pages at https://myezwb.com, just like I did on the test page.
It works on one page that has a single textarea but on similar pages with one or multiple textareas it won't work, with or without an API key.
I don't find any differences between the code or structure on the three pages and/or the test page.
What am I missing?
Thanks in advance.
The error:
tinymce.min.js:2 Failed to initialize the editor as the document is not in standards mode.
TinyMCE requires standards mode
explains the issue. TinyMCE 5 requires the page in which it is loaded to be in Standards mode and not Quirks mode.
For more on this topic you can find lots of details online such as:
https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode
https://www.quirksmode.org/css/quirksmode.html
What is quirks mode?

Embedding YouTube Videos in Silverstripe - Strips Fullscreen and Rel=0

I'm trying to embed YouTube videos onto my Silverstripe site, using the page editor. We're having problems with two different ways of embedding.
Editor's Insert Media:
When I click the editor's "Insert Media" button I choose "From the web" and paste in the YouTube URL. However I need to hide related videos, so to do this we need to add "&rel=0" to the end of the URL. When I do this the "Insert Media" option doesn't work.
iFrame:
So instead I tried to use the embed code provided by Google. I went to he text editor and inserted it. The iframe works, however the editor strips off the "allowfullscreen" tag from the iframe - which means users cannot watch the video in full screen.
So I either have to show related videos, which I don't want to do. Or I need to block users from being able to watch it in full screen mode - which again I don't want to do.
We're running on Silverstripe 3.3.
Is there any way to stop Silverstripe from stripping the allowfullscreen tag? Or to have Silverstripe still process the YouTube URL if we put rel=0 on the end?
Alternatively, does anyone know if this has this been solved in 3.4, 3.5 or 3.6?
Before posting this I have done over 45 mins of thorough searching for an answer, including through Silverstripe forums (which are now discontinued), here on Stackoverflow and the Google group. Plus I worked my way through a number of the change logs of 3.4, 3.5 and 3.6 for anything related to iframes and YouTube, but was not able to find things specific to this problem.
The TinyMCE editor in a different CMS I use does not strip out the allowfullscreen tag from iframes. So it seems specific to Silverstripe's implementation of the editor.
Direct answer to your question would be to amend the tinymce config to include more attributes for the frame by setting the "extended_valid_elements"
https://docs.silverstripe.org/en/3/developer_guides/forms/field_types/htmleditorfield/#setting-options
Alternative way would be to introduce new shortcode : https://docs.silverstripe.org/en/3/developer_guides/extending/shortcodes/
Latter would be more user safe to some extend.

How to put the Amazon Kindle Web Browser into Article Mode

How do you put the Amazon Kindle web browser into Article Mode via HTML or Javascript?
Editor's note: Some pages are not automatically detected as "articles" by the Kindle 3 browser, and give an error message when trying to go into Article mode. What does the Article mode use to determine what portion of the page to display?
Is this related at all to Readability?
http://lifehacker.com/5163401/readability-bookmarklet-quick+formats-pages-for-smoother-text
Actual JavaScript code for Readability, which is heuristic based:
// Study all the paragraphs and find the chunk that has the most <p>'s and keep it:
This also appears to be related to Safari 5's Reader mode. Here is what is required for Safari Reader:
This definitely needs more investigating, but so far, these appear to be the most important factors for Safari’s Reader functionality to kick in:
Use the right markup, i.e. make sure the most important content is wrapped inside a container element. Whether you use <article>, <div> or even <span> doesn’t seem to matter — as long as it’s not <p>.
The content needs to be long enough. Use enough words, use enough paragraphs, use enough punctuation. Every paragraph should have at least 100 characters.
Reader doesn’t work for local documents.
http://www.wired.com/gadgetlab/2010/09/simple-tip-turns-kindle-into-ultimate-news-reader/ - The "f" key feature outlined above or some other feature? Not quite sure what article mode means.
It means that the browser will try to identify if the page you are looking at has a main body of text (is an article), parse it out and then display only that text without clutter and for easy scrolling.
I don't think you can force it via the web page's code
As far as I know, once the website has loaded (and if you are on an specific topic) you can turn on the "Article Mode" from the menu.
I've seen similar JS tools for Chrome too, so I assume it's part of webkit.

gwt typeahead missing

I have a GWT app with a bunch of textboxes. In firefox I would expect that when I type a word in a textbox that I have already typed in and submitted, that firefox would offer to autocomplete that text. But for this GWT app it is not happening.
The ids and the name of the html elements are the same everytime. I don't know if it makes a difference, but I am using UiBinders for presentation.
Also in IE it seems that none of my css stuff is loaded. And when I IE developer tools on my GWT page, it can focus in on any of the textboxes it just focuses on the encompassing DIV around all the textboxes.
The problem with autocompletion is caused by how the DOM tree is created in a dynamic web application, such as the one created using GWT. Basically, all the DOM elements (textboxes, etc) are dynamically created, after the page is loaded. However, AFAIK, the browser only supports autocompletion on "static" elements, ones that are part of the HTML host page. So, for that reason you won't get autocompletion support from your browser in a GWT app. Fot some cases, you can still emulate it via SuggestBox.
You could try including the elements you want autocompletion for in your HTML host page, and then wrapping your GWT Widgets around them - that might work :) But it's not the "prettiest" solution, since you probably want autocompletion for a number of unrelated fields/elements.

Use of HTML 5 doctype creates a gap at top of page on iphone safari browser

Update: Please disregard, my problem was caused by an advertisement bar being inserted by the vendor who provides my workplace wireless service.
I was building a mobile friendly website and wanted to use HTML 5. However when I specify the doctype as <!DOCTYPE HTML> , I get a gap at the top of the page on safari on the iphone.
I notice that other sites have the same problem such as nextstop.com and nike.com
I guess safari does not fully support HTML 5 yet. Anybody know of a workaround?
HTML 5 is still in a very unstable state. Don't use it in a production environment.
Edit Just so you guys know what it's about, HTML 5 is currently an Editor's Draft, and the document clearly states (in the Status of This Document section) that this specification is not stable, and that a consensus may not have been reached on any of the proposed sections. I think it should be clear enough that it means it's a bit early to start using it.
All browsers correctly interpret the HTML doctype. Putting it in sets your browser into Standards Compliant mode, that is the only difference with or without the doctype.
You can use a CSS reset tool like http://meyerweb.com/eric/tools/css/reset/ to get rid of default margins and padding on all elements.