Friday 23 March 2018

PASTE AS PLAIN TEXT WITH JAVA COMMAND

PASTE AS PLAIN TEXT WITH JAVA COMMAND

-----------------------------------------------------------------------------------------------------------------
Read More:
https://stackoverflow.com/questions/12027137/javascript-trick-for-paste-as-plain-text-in-execcommand
http://jsfiddle.net/HBEzc/
copy plain text chrome
https://www.google.co.uk/search?q=copy+plain+text


Copy as plain text - amaz.in/g - Chrome Web Store

https://chrome.google.com/.../copy-as-plain-text.../mkkcgjeddgdnikkeoinjgbocghokol...

 Rating: 4.6 - ‎78 votes - ‎Free - ‎Chrome
16 Feb 2014 - Quick and easy, the selected text without formatting, so as plain textcopy to the clipboard.

Copy as Plain Text - Chrome Web Store

https://chrome.google.com/.../copy-as-plain-text/hmjdnojobglgfjhfdeamomnjdlfcmogl

 Rating: 3.5 - ‎8 votes - ‎Free - ‎Chrome
Extension to copy selected text as plain text. Also option to Append as plain text. Keeps carriage returns and line feeds.

EZ Copy Plaintext - Chrome Web Store

https://chrome.google.com/...copy-plaintext/khgahhiehdlgmaoghjoegkgbfcdodnhb?hl...

 Rating: 2.6 - ‎19 votes - ‎Free - ‎Chrome
2 Mar 2013 - If you need to keep the formatting, you can toggle it on and off by right clicking something you've selected/highlighted and pressing 'Get format next copy'. On the next copy you do, it will keep the formatting. Then it will reset back to the default plaintext setting for future copying. simple and robust. NOTE: The ...

Copy and Paste as plain Text in Chrome, Firefox browsers

www.thewindowsclub.com/copy-and-paste-as-plain-text-chrome-firefox

3 Oct 2014 - This post shows you how to copy and paste text as plain unformatted text natively, when using Chrome or Firefox browsers in Windows 8 / 7.

Copy Without Formatting Strips Text Formatting in Google Chrome

https://lifehacker.com/.../copy-without-formatting-strips-text-formatting-in-google-chr...

5 Apr 2010 - Chrome: If you frequently find yourself copying text from Chrome into Notepad just to strip the formatting away, Copy Without Formatting allows you to grab your selection as plain text.

Copy text from web pages in plain text format? - Google Product Forums

productforums.google.com/d/topic/chrome/6G_kybjwRuc

26 Oct 2009 - 21 posts - ‎17 authors
Hello Forum! I use very often the clipboard function of Win: mark a text in a web page, and then copy(ctrl C) and then paste in an another application (Word etc). But, if I drop the text to clipboard, Chromekeep the formatting of the text (character size, color, type etc.). But, I need only the pure text (plain text) ...

Google Chrome Blog: Tip: Just the text, please!

https://chrome.googleblog.com/2010/09/tip-just-text-please.html

15 Sep 2010 - This happened to us so many times while building Google Chrome that we added a special shortcut to do just that. Alongside the common Ctrl-V keyboard shortcut for "paste", GoogleChrome supports a similar shortcut, Ctrl-Shift-V, for "paste as plain text". (And it's Command-Shift-Option-V on a Mac.).

5 Ways to Strip the Formatting When You Copy & Paste Text

https://www.makeuseof.com › Windows

6 Feb 2015 - The Chrome shortcut from Windows is the same: Command + Shift + Option + V, and you can install the extensions if you want. Using TextEdit, the Mac equivalent to Notepad, you can copy and paste text as in the first method outlined above. You may need to choose Format > Make Plain Text(Command + ...

Chrome tip: How to paste plain text using keyboard shortcuts ...

www.pocketables.com/.../chrome-tip-how-to-paste-plain-text-using-keyboard-shortcut...

21 Aug 2013 - Almost everyone knows the keyboard shortcuts for copying (ctrl + c) and pasting (ctrl + v) text on practically every modern computer, but most of the time copying or cutting text will preserve formatting (like bold or underlined) when you don't really want it to. Luckily, if you're using the GoogleChrome browser ...

Plain Text Copy And Paste - Google Chrome...

blog.gvm-it.eu/post/14992846001/plain-text-copy-and-paste-google-chrome

30 Dec 2011 - I came to the realisation that I get mad whenever I accidently paste formatted text and that I am too lazy to use CTRL + SHIFT + V, so I wrote a tiny Google Chrome extension that removes formatting and markup information from text that you copy to your clipboard: Plain Text Copy And Paste. I recently have ...
------------------------------------------------------------------------------------------------------------------
Intercept the paste event, cancel the paste, and manually insert the text representation of the clipboard: http://jsfiddle.net/HBEzc/. This should be the most reliable:
  • It catches all kinds of pasting (Ctrl+V, context menu, etc.)
  • It allows you to get the clipboard data directly as text, so you don't have to do ugly hacks to replace HTML
I'm not sure of cross-browser support, though.
editor.addEventListener("paste", function(e) {
    // cancel paste
    e.preventDefault();

    // get text representation of clipboard
    var text = e.clipboardData.getData("text/plain");

    // insert text manually
    document.execCommand("insertHTML", false, text);
});
------------------------------------------------------------------------------------------------------------------
CODE:
------------------------------------------------------------------------------------------------------------------
<html>
<title>PASTE AS PLAIN TEXT IN JAVA SCRIPT</title>
<head>
<style type="text/css">
div[contenteditable] {
height: 100px;
background-color:yellow;
}
 </style>
<script type="text/javascript">
//<![CDATA[
window.onload=function(){
document.querySelector("div[contenteditable]").addEventListener("paste", function(e) {
e.preventDefault();
var text = e.clipboardData.getData("text/plain");
document.execCommand("insertHTML", false, text);
});
}
//]]>
</script>
</head>
<body>
<div contenteditable></div>
</body>
</html>
------------------------------------------------------------------------------------------------------------------
TINY MICE HTML CODE:
https://www.tinymce.com/docs/plugins/codesample
------------------------------------------------------------------------------------------------------------------

<html> <title>PASTE AS PLAIN TEXT IN JAVA SCRIPT</title> <!-- https://www.tinymce.com/docs/plugins/codesample/ --> <head> <style type="text/css"> textarea[contenteditable] { height: 100px; background-color:yellow; } </style> <script type="text/javascript"> tinymce.init({ selector: 'textarea', height: 500, plugins: 'codesample code', codesample_dialog_width: '400', codesample_dialog_height: '400', codesample_languages: [ {text: 'HTML/XML', value: 'markup'}, {text: 'JavaScript', value: 'javascript'}, {text: 'CSS', value: 'css'}, {text: 'PHP', value: 'php'}, {text: 'Ruby', value: 'ruby'}, {text: 'Python', value: 'python'}, {text: 'Java', value: 'java'}, {text: 'C', value: 'c'}, {text: 'C#', value: 'csharp'}, {text: 'C++', value: 'cpp'} ], toolbar: 'codesample code', content_css: [ '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', '//www.tinymce.com/css/codepen.min.css'] }); </script> </head> <textarea> <p style="text-align: center; font-size: 15px;"><img title="TinyMCE Logo" src="//www.tinymce.com/images/glyph-tinymce@2x.png" alt="TinyMCE Logo" width="110" height="97" /></p> <h1 style="text-align: center;">TinyMCE Code Sample Plugin</h1> <p style="text-align: center;">Code Sample automatically applies color highlighting to PRE and CODE elements. Highlight some text, click the Code Sample button to see `code` applied to the text.</p> <h3 style="text-align: center;">How to insert a snippet</h3> <p style="text-align: center;">To create a snippet, insert the cursor on a new/empty line and click the Code Sample button in the toolbar. Add a code snippet to the modal, select the language and click OK to add the snippet to the page.</p> <p style="text-align: center">Note: this demo includes the Code plugin, which enables a <strong>code view</strong>. You can use this to see how Code Sample changes the HTML in the editable area. </textarea> </html>


------------------------------------------------------------------------------------------------------------------
OTHER CODE FOR MAGENTO2
------------------------------------------------------------------------------------------------------------------
<html>
<title>PASTE AS PLAIN TEXT IN JAVA SCRIPT</title>
<head>
<style type="text/css">
div[contenteditable] {
height: 100px;
background-color:yellow;
}
 </style>
<script type="text/javascript">
//<![CDATA[
window.onload=function(){
document.querySelector("#tinymce").addEventListener("paste", function(e) {
e.preventDefault();
var text = e.clipboardData.getData("text/plain");
document.execCommand("insertHTML", false, text);
});
}

</script>
</head>
<body id="tinymce" class="mceContentBody " contenteditable="true" spellcheck="false" dir="ltr">
<div contenteditable></div>
</body>
</html>

 ------------------------------------------------------------------------------------------------------------------
OR USE THIS CODE
-------------------------------------------------------------------------------------------------------------------
<html>
<title>PASTE AS PLAIN TEXT IN JAVA SCRIPT</title>
<head>
<style type="text/css">
div[contenteditable] {
height: 100px;
background-color:yellow;
}
 </style>
<script type="text/javascript">
//<![CDATA[
window.onload=function(){
document.querySelector("#tinymce").addEventListener("paste", function(e) {
e.preventDefault();
var text = e.clipboardData.getData("text/plain");
document.execCommand("insertHTML", false, text);
});
}
//]]>
</script>
</head>
<div id="tinymce" class="mceContentBody " contenteditable="true" spellcheck="false" dir="ltr">
</div>
</html>
-------------------------------------------------------------------------------------------------------------------

0 comments:

Post a Comment

FB Gadgets | Template Designed by Fatakat PhotosCoolBThemes.com
Code by : paid web directory

https://www.google.co.uk/search?q=site%3Ablogspot.com+fbgadgets