1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 23:57:59 +01:00

move the global copyToClipboard() to a slot in vimperator

This commit is contained in:
Doug Kearns
2007-08-05 06:43:40 +00:00
parent 022e455d48
commit b9bbc07ad2
4 changed files with 11 additions and 11 deletions

View File

@@ -1324,13 +1324,6 @@ function scrollBufferAbsolute(horizontal, vertical)
// misc helper functions /////////////////////////////////////////////// // misc helper functions ///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////{{{
function copyToClipboard(str)
{
var clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);
clipboardHelper.copyString(str);
}
// returns an XPathResult object // returns an XPathResult object
function evaluateXPath(expression, doc, ordered) function evaluateXPath(expression, doc, ordered)
{ {

View File

@@ -517,7 +517,7 @@ function Hints() //{{{
// disable the hints before we can echo() an information // disable the hints before we can echo() an information
this.disableHahMode(null, true); this.disableHahMode(null, true);
copyToClipboard(loc); vimperator.copyToClipboard(loc);
vimperator.echo("Yanked " + loc); vimperator.echo("Yanked " + loc);
}; };
@@ -540,7 +540,7 @@ function Hints() //{{{
// disable the hints before we can echo() an information // disable the hints before we can echo() an information
this.disableHahMode(null, true); this.disableHahMode(null, true);
copyToClipboard(loc); vimperator.copyToClipboard(loc);
vimperator.echo("Yanked " + loc); vimperator.echo("Yanked " + loc);
}; };

View File

@@ -539,7 +539,7 @@ function Mappings() //{{{
function() function()
{ {
var loc = getCurrentLocation(); var loc = getCurrentLocation();
copyToClipboard(loc); vimperator.copyToClipboard(loc);
vimperator.echo("Yanked " + loc); vimperator.echo("Yanked " + loc);
}, },
{ {
@@ -551,7 +551,7 @@ function Mappings() //{{{
function() function()
{ {
var sel = window.content.document.getSelection(); var sel = window.content.document.getSelection();
copyToClipboard(sel); vimperator.copyToClipboard(sel);
vimperator.echo("Yanked " + sel); vimperator.echo("Yanked " + sel);
}, },
{ {

View File

@@ -207,6 +207,13 @@ const vimperator = (function() //{{{
sound_service.beep(); sound_service.beep();
}, },
copyToClipboard: function(str)
{
var clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);
clipboardHelper.copyString(str);
},
execute: function(string, modifiers) execute: function(string, modifiers)
{ {
// skip comments and blank lines // skip comments and blank lines