> Has anyone been able to get "copy to clipboard" working - with
> Firefox.  I tried and firefox just closes the tiddler.

Take a look at this code:
   http://www.TiddlyTools.com/#SaveToClipboard
which contructs a text string containing the *entire* TW document
source, and then copies that text to the clipboard.

Specifically, you want to look at the "copy()" function that I wrote.
It works in FireFox, IE6+, and Safari/Chrome.

function copy(out) {
        if(window.Components) { // FIREFOX
        
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
                var id='@mozilla.org/widget/clipboardhelper;1';
                var
clip=Components.classes[id].getService(Components.interfaces.nsIClipboardHelper);
                clip.copyString(out);
        } else if(window.clipboardData) { // IE
                window.clipboardData.setData('text',out);
        } else if(document.execCommand) { // CHROME, SAFARI, IE6
                var ta=document.createElement('textarea');
                ta.style.position='absolute';
                ta.style.left='-100%';
                document.body.appendChild(ta);
                ta.value=out; ta.select();
                document.execCommand('Copy',false,null);
                document.body.removeChild(ta);
        } else throw('cannot access clipboard');
}


enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

----
TiddlyTools needs YOUR financial support...
Help ME to continue to help YOU...
make a generous donation today:
   http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to