Skip to content

Instantly share code, notes, and snippets.

@equinox79
Last active December 10, 2015 06:48
Show Gist options
  • Save equinox79/4396773 to your computer and use it in GitHub Desktop.
Save equinox79/4396773 to your computer and use it in GitHub Desktop.
office365_bookmarklet.js(つくりかけです/本当は作成ウィンドウに流し込みたいが無理っぽい)
// 選択した文字列をコピー&全員に返信
javascript:(function(){
var r = document.selection.createRange();
if(r.text.length > 0){
clipboardData.setData("Text", r.text.replace(/\n/g, "\n> ").replace(/^/g, "> "));
};
document.getElementById('imgReplyAllIcon').fireEvent("onclick");
})();
/*
javascript:(function(){ var r = document.selection.createRange(); if(r.text.length > 0){ clipboardData.setData("Text", r.text.replace(/\n/g, "\n> ").replace(/^/g, "> ")); }; document.getElementById('imgReplyAllIcon').fireEvent("onclick");})();
*/
// 全員に返信ボタン押下時に選択文字列をクリップボードにコピー
javascript:(function(){
var f = function(e, cf, r){
if(r.text.length > 0){
clipboardData.setData("Text", r.text.replace(/\n/g, "\n> ").replace(/^/g, "> "));
cf();
};
};
document.getElementById('divNavHostBody').attachEvent("onmouseover", function(){
document.getElementById('imgReplyAllIcon').attachEvent("onclick", function(event){
var cf = document.getElementById('imgReplyAllIcon').click;
f(event, cf, document.selection.createRange());
});
});
})();
/*
javascript:(function(){ var f = function(e, cf, r){ if(r.text.length > 0){ clipboardData.setData("Text", r.text.replace(/\n/g, "\n> ").replace(/^/g, "> ")); cf(); }; }; document.getElementById('divNavHostBody').attachEvent("onmouseover", function(){ document.getElementById('imgReplyAllIcon').attachEvent("onclick", function(event){ var cf = document.getElementById('imgReplyAllIcon').click; f(event, cf, document.selection.createRange()); }); });})();
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment