How does google spreadsheet copy to clipboard? - html

I've been reading several articles saying it was not possible to copy from html5 to clipboard. Yet, I can see that it works perfectly fine from a google spreadsheet. How do they do it? Is there really a flash object under the hood?

The google uses a very simple but cool method. By using firebug you will get to know that the html code which is loaded has a text area in begining of size 1. What google doc does is that when user selects text and presses ctrl+c, it captures the event and by some technique gets the text which is selected in the doc container and sets the value of text area to that content. Than it focuses and selects the text area. Now it releases the ctrl+c event. But now the text is selected in text area so when the event is realeased the browser copies the text in text area and thus we get the copied text

Related

How can I get the markup's core extension to automatically close the text area it creates?

The MarkupsCore extension automatically creates a text area when you click that you enter text into. Now, I automatically insert text into this text area, but cannot find out how to close it programatically. After going through the source a little bit, it seemed like the text area was a little bit custom as I saw there were some custom implementations of the backspace button, etc. So, I assumed there was a different event.
It seems to happen when you focus out of the element, but that event didn't seem to do it either. In version 3 (or maybe it was earlier, I can't remember), you used to press the enter key. Now you just focus out.
So, what event needs to be fired in order to tell the extension to close the text area and create the markup?
Try the following...
Using the 'markupscore' object, send a 'mouse down' event with 'target:null' like this...
markupscoreExt = viewer.getExtension("Autodesk.Viewing.MarkupsCore")
markupscoreExt.onMouseDown({target:null})
As you are in the middle of typing some text, you can trigger the mouse down event to complete the text.
Let me know if that helps.
Cheers
Michael

ADF RichTextEditor autosubmit doesn't work in Google Chrome

I'm facing a problem when using the RichTextEditor with autosubmit="true" in JDev 12c. The component is added programmatically on a form.
In Firefox the autosubmit fires correctly for any  kind of action (e.g.: typing, changing text style, etc)
On the other side in Chrome, not every action fires the autosubmit. For example, typing some text would fire the autosubmit, but then selecting the text and changing the color or the font size for example, doesn't fire a value change event / autosubmit.
Has anyone else encountered this type of behavior before?
Thanks in advance!
I had the same problem as well, RichTextEditor's text is very difficult to erase the content or reset programatically too,
I advise to use other text tools like the very known RichTextArea:
// Create a rich text area
final RichTextArea rtArea = new RichTextArea();
rtArea .setCaption("My Rich Text Area");
// Set initial content as HTML
rtArea .setValue("<h1>Hello</h1>\n" +
"<p>This rich text area contains some text.</p>");
Then you could resize it to the size of the RichTextEditor and give it the same visual color by some tricks through js and css as usual.

Python 2.7 Webdriver - Automating mouse copy of an anchor text element

I am trying to automatically paste an anchor text link into a Facebook Note. Please try the following scenario:
Go to any site and locate anchor text with a hyperlink. Manually, with the mouse, left click and swipe across the text. Then, right click and select copy (not Copy link address). You have now copied the text and link to the clipboard as a single entity. Now open Facebook notes, create a note and paste and the link will be inserted. Pasting into MS Word also works. Please refer to the attached image from Facebook. I pasted Link-1 which is clickable and goes to a new site. Inserted html (Link-2) is rejected. So, what I need is to automate the mouse left click, swipe the located text element (I know how to find the element), right click it and select Copy.
Facebook Edit Note Page
Finding the element and using driver.send_keys(Keys.CONTROL, 'c') copied the anchor text to the clipboard successfully. I was able to paste it manually and click on it to go to the URL.
QED

Doubts about google sites and HTML

I have some troubles with google sites and HTML...I'd like to remind you that
I've spent a lot of time looking for the solution of the issue but I didn't get anything. I'm working on a Google website and I'd like to have a box with some text inside and then in a corner of the box a button where you can click and automatically get the text copied into the clipboard. Is it possible to do it in a Google site?.

IE9 Input Form type=file, manually edit text field

I'm looking to improve one of my company's web applications to support IE9.
One of the issues I'm having is with the input field. In IE8, a user could use the input form field to select a file, then manually edit the textual contents of the text box to, for instance, select a host folder of a file, or what have you.
In IE9, it seems that the text box is not editable. You click browse to select a file in the dialog window, and then the textbox from that point is locked.
Is there any attribute I can set to alter this behaviour?
Actually, IE8 introduced the read-only text box for File Upload, and it was not changed in IE9. There's no mechanism to turn off that behavior.
To change the contents of the box, simply click the Browse button and select or paste in the new filename.