jHtmlArea "enter" key generated HTML not cross browser - javascript

I'm trying to use the jHtmlArea WYSIWYG editor based on jQuery.
My problem is that the behaviour of the editor towards the "enter key" is different from browser to browser, for instance, IE renders a p tag, Chrome renders a div tag and Firefox renders a br tag.
What's causing this? How can I make this consistent?
Thanks.

Related

TextArea Field Component of Redux Form Weird Behavior?

I've got some weird behavior going on my posts/new page. When I click inside Content text area input (which is a Field component of Redux Form), a white blank box appears at the top-left of the screen, then again to the top-middle, then inserts itself inside the content text area. I'm using CSS Modules (not sure if that's relevant). This behavior only occurs on the Google Chrome browser and not on Mozilla Firefox. Any help is appreciated.
https://blogaboutit.herokuapp.com/posts/new
https://github.com/KenAustria/BlogAboutIt

How can I copy text from some site which disable right click, and also select text?

How can I copy text from some site which disable right click, and also select text?
I mean I cant select any text from that site, and also I cant right click on that site.
Do I have to Inspect Element and Find that text?
or is there any easier way?
In Chrome or any of the popular modern browsers, open Developer Tools by pressing F12 and then click on the magnifying glass icon (or equivalent icon in other browsers) to turn on inspect mode. Move to the content within the web page and point to the specific portion of text that you want to copy. The HTML code corresponding to the pointed area will appear in the docked Dev Tools window. Double click on the HTML code to copy the content you need.
Alternatively, you can save the page as a text file in Internet Explorer and then you can get just the text within the web page in the text file. In IE, choose File > Save As and in the dialog box that opens up, specify the Save as type as Text file.
Also you could try the site after disabling JavaScript in your browser.
For doing so, you have several methods:
Disable JavaScript
Remove the event handler(s) (if you are a developer)
Use DOM
You could use latest Intenet Explorer.
Caret Browsing is a new feature introduced in Internet Explorer 8 and later. With this feature enabled, you can use the navigating keys on the keyboard, select text & move it around within a webpage .
You can select and copy snippets of text as short as a single character by using only the keyboard. Other content types such as tables or images can also be selected and copied.
Enable Caret Browsing in Internet Explorer
To turn on Caret Browsing in Internet Explorer, press F7.
It can be enabled on a per tab basis or for all tabs and windows. Moving the cursor within the text of a web page is like moving the cursor within the text of a Microsoft Word document. To select text, hold the Shift key & press the arrow keys.
Instead of using a mouse to select text and move around within a webpage, you can use standard navigation keys on your keyboard : Home, End, Page Up, Page Down & the arrow keys. This feature is named after the caret, or cursor, that appears when you edit a document.
Reference here.

Enable text selection on a website using JavaScript

I know that typing
javascript:void(document.oncontextmenu=null) allows users to enable right click on a webpage
and javascript:void(document.onselectstart=null) should enable text selection if i'm correct?
but I tried typing these on http://www.pcworld.co.uk/gbuk/laptops-netbooks/laptops/apple-laptops/apple-macbook-pro-15-with-retina-display-21576115-pdt.html and it won't work.
by the way I typed it in the console of Google Chrome browser.
#Pointy pointed out that text selection worked fine for him. I tried in a few browsers - in Google Chrome specifically, on mouse down, the cursor changes when one tries to select text on a particular part of the page, and it does not allow this. However, on Firefox, you are perfectly capable of selecting the text.
For your intents, use a different browser and select the text.
For all we know, that sight could have custom javascript and logic preventing text selection, though its pretty lame that it doesn't work cross browser. But this custom logic is probably why your above mentioned commands aren't working.

Can't set focus to tinyMCE textarea on iPad

I need use to be able to use multiple tinyMCE <textarea>s on an iPad compatible site.
However when I view the site example website on my iPad, I can't get it to focus on the 2nd <textarea>.
Programatically, you may use tinymce.get('your_editor_id').focus() to focus your editor.
What you see as editor is not a a textarea, but a contenteditable iframe.

ContentEditable element does not react on hotkeys [duplicate]

I'm developing a Chrome extension that injects JS code into all opened tabs. The task of this code includes displaying a textbox, implemented as a contentEditable <div> to allow formatting. However, the contentEditable element doesn't play well with some websites, e.g. Twitter.
Try it yourself:
Go to twitter.com
Paste javascript:document.body.setAttribute('contentEditable', true); in the address bar and hit enter.
Click anywhere in the document - you should now be able to edit the text.
Try typing a j or k. You will see: The character does not appear, instead, the selection is moved (a tweet in the list will be highlighted).
I have tried hard to find out how Twitter's keyboard navigation is implemented, but could not find any hints. Can you give me any tips on how to solve this problem (and avoid similar problems on other websites)?
Using an iFrame for the input triggers some other, very weird bugs, so I want to avoid that if it's possible.
Please make sure you don't have installed vim keyboard extension on google chrome.
J and K are then used for navigation shortcuts. (up/down).

Categories