1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 20:27:58 +01:00

Fallback to useable clipboard on Windows. Closes issue #690.

This commit is contained in:
Kris Maglione
2011-10-13 15:39:18 -04:00
parent 5b8fa19a3a
commit 0029f7bd16
2 changed files with 11 additions and 8 deletions

View File

@@ -378,10 +378,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
* @optional
*/
clipboardWrite: function clipboardWrite(str, verbose, which) {
if (which == null)
if (which == null || which == "selection" && !services.clipboard.supportsSelectionClipboard())
services.clipboardHelper.copyString(str);
else if (which == "selection" && !services.clipboard.supportsSelectionClipboard())
return;
else
services.clipboardHelper.copyStringToClipboard(str,
services.clipboard["k" + util.capitalize(which) + "Clipboard"]);

View File

@@ -1518,6 +1518,7 @@ var Buffer = Module("Buffer", {
},
_exWidth: function _exWidth(elem) {
try {
let div = DOM(<elem style="width: 1ex !important; position: absolute !important; padding: 0 !important; display: block;"/>,
elem.ownerDocument).appendTo(elem.body || elem);
try {
@@ -1526,6 +1527,10 @@ var Buffer = Module("Buffer", {
finally {
div.remove();
}
}
catch (e) {
return parseFloat(DOM(elem).fontSize) / 1.618;
}
},
openUploadPrompt: function openUploadPrompt(elem) {