copy-paste

Clipboard management with websites

一世执手 提交于 2019-12-31 03:30:29
问题 I would like to know how to put text into the clipboard like some popular websites are able to do. I have seen sites like www.photobucket.com and www.hulu.com somehow make copying to the clipboard automatic and cross browser. How can I do the same? I saw a cross browser way to do it using flash, but it won't work with the current version? 回答1: Take a look at this: http://ajaxian.com/archives/seeding-the-clipboard-in-flash10-with-zero-clipboard 回答2: One option is Clippy, "a very simple Flash

How to Display ObservableCollection<string> in a UserControl

末鹿安然 提交于 2019-12-30 11:12:43
问题 I'm new to WPF and I've found some similar questions but can't quite figure out the last part. I have a ViewModel with an ObservableCollection that contains error messages. I want to display these on the form AND allow the user to select and copy all or part of the messages. (In the past in WinForm apps I used a RichTextBox for this, but I can't figure out how to bind to one to the collection in WPF.) I got the look I was after with the following xaml, but there is no built-in way to select

What is the required DataFlavor to copy files in Mac OSX

霸气de小男生 提交于 2019-12-30 06:49:28
问题 I'm currently working on Java code that can copy files into the system clipboard. For Windows and Linux I already got it working. For OSX I tried several flavors but the "Paste" action in Finder never cames active. Any idea which DataFlavor settings are required for Finder? Used flavors: DataFlavor.javaFileListFlavor URILIST_FLAVOR = new DataFlavor( "text/uri-list" ); XFILELIST_FLAVOR = new DataFlavor( "application/x-java-file-list" ); GNOMEFILELIST_FLAVOR = new DataFlavor( "x-special/gnome

Capture text pasted into a textarea with JQuery

左心房为你撑大大i 提交于 2019-12-30 04:02:27
问题 I have to take the paste event of a text area using JQuery. I have tried the following code but it is not working... $(document).ready(function() { $('#txtcomplaint').keyup(function() { TextCounter('txtcomplaint','counterComplaint', 1000 ); }) $('#txtcomplaint').onpaste(function() { alert() //TextCounter('txtcomplaint','counterComplaint', 1000 ); }) }); 回答1: You can do something like this $("#txtcomplaint").bind('paste', function(e) { var elem = $(this); setTimeout(function() { // gets the

Copy text from <span> to clipboard

梦想的初衷 提交于 2019-12-30 03:19:05
问题 I've been trying to copy the innerContent of a <span> to my clipboard without success: HTML <span id="pwd_spn" class="password-span"></span> JavaScript Function Call document.addEventListener('DOMContentLoaded', function () { document.getElementById('copy').addEventListener('click', copy_password); }); Function function copy_password() { var copyText = document.getElementById("pwd_spn").select(); document.execCommand("Copy"); } I've also tried: function copy_password() { var copyText =

Google Chrome Extensions: How to detect Copy action (Ctrl-C and Edit-Copy)?

半腔热情 提交于 2019-12-30 01:25:27
问题 How might I detect that a user has selected and copied some content in the currently active tab in a Google Chrome Extension? It appears that there are no suitable Events that deal with the Clipboard in chrome.tabs or chrome.windows. Is there a way to detect such actions through Content Scripts? 回答1: I found the following solution: Set up a manifest file to define a content script that is added to every page, and a separate background page. In the Content Script .js file, add an event

Implementing iphone's copy/paste controls on a custom view / uiview subclass

荒凉一梦 提交于 2019-12-30 01:20:11
问题 I will admit that there is already a question exactly along these lines here on S.O., but it lacks implementation details, a working answer, and I would like to be more specific, so I think a new question is in order. Obviously, let me know if I'm wrong and we can try to restart the thread over there. Basically, I want to copy the text in a UILabel to the pasteboard when a user holds down on the label. Not hard to do, honestly. However, I think the best way to provide visual feedback is to

VBA copy rows that meet criteria to another sheet

天涯浪子 提交于 2019-12-28 05:54:47
问题 I am new to VBA...I want to copy a row from Sheet2 to Sheet1 if the first cell in this row says X and then do so for all the rows that meet this criteria. I have an error in the If condition...I don't know how to fix it. Sub LastRowInOneColumn() 'Find the last used row in a Column: column A in this example Worksheets("Sheet2").Activate Dim LastRow As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row End With MsgBox (LastRow) For i = 1 To LastRow If Worksheet.Cells(i, 1)

Strange vanishing of CR in strings coming from a copy of a file's content passed to raw_input()

旧时模样 提交于 2019-12-25 19:40:37
问题 Trying to clear up the reasons of what seemed to be a bug, I finally bumped into a weird behaviour of the raw_input() function in Python 2.7: it removes the CR characters of pairs CR LF from only the strings that result from a manual copy (via the clipboard) of a file's content. The strings passed to raw_input() that are copies of a display of identical strings than the former ones don't loose their CR characters. The alone CR chars remain untouched in all the cases. A CR (carriage return) is

Excel VBA button (copy cells to a new row in another sheet)

蹲街弑〆低调 提交于 2019-12-25 10:25:14
问题 I need to copy a few cells from a form on sheet Form, then paste them into a new row on sheet Activities. Breaking it down: When the button is clicked: - The cells "B2,B3,B4,B5,B6,A10,A16,A21,A24,E10,E17,E20,E23,E26,I10,I12,I14,I16,M10,M12,M14,M16,M19,M22" will be selected on the active sheet (Form) and copied. - The copied cells are pasted on another sheet (Activities) and pasted on a new row (something like A + 1) This is what I have so far: Private Sub CommandButton1_Click() Sheets("Form")