TheDesk Miho (ver.13)
This commit is contained in:
@@ -65,3 +65,22 @@
|
||||
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
|
||||
});
|
||||
};
|
||||
//コピー
|
||||
function execCopy(string){
|
||||
var temp = document.createElement('div');
|
||||
|
||||
temp.appendChild(document.createElement('pre')).textContent = string;
|
||||
|
||||
var s = temp.style;
|
||||
s.position = 'fixed';
|
||||
s.left = '-100%';
|
||||
|
||||
document.body.appendChild(temp);
|
||||
document.getSelection().selectAllChildren(temp);
|
||||
|
||||
var result = document.execCommand('copy');
|
||||
|
||||
document.body.removeChild(temp);
|
||||
// true なら実行できている falseなら失敗か対応していないか
|
||||
return result;
|
||||
}
|
Reference in New Issue
Block a user