Created
February 7, 2015 15:04
-
-
Save MSakamaki/ae570e0d68d2451f613f to your computer and use it in GitHub Desktop.
FaceBookMessange MemoTool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var id = 'nikukyu'; | |
sessionStorage.setItem(id, JSON.stringify({msg:[]})); | |
var makebtn = function(){ | |
var btn = document.createElement("button"); | |
btn.innerText = "メモAdd"; | |
btn.onclick=function(e){ | |
var ary = JSON.parse(sessionStorage.getItem(id)).msg; | |
var msg =e.srcElement.parentElement.querySelector('.clearfix').innerText; | |
ary.push(msg); | |
sessionStorage.setItem(id, JSON.stringify({msg:ary})); | |
e.srcElement.textContent = 'Done'; | |
e.srcElement.disabled = false; | |
window.test = e.srcElement; | |
} | |
return btn; | |
}; | |
var dom = document.querySelectorAll('.webMessengerMessageGroup'); | |
Object.keys(dom).forEach(function(key){ | |
dom[key].appendChild(makebtn()); | |
}); | |
document.querySelector('#js_q').appendChild((function(){ | |
var btn = document.createElement("button"); | |
btn.innerText = "CALL MESSAGE"; | |
btn.onclick=function(e){ | |
var ary = JSON.parse(sessionStorage.getItem(id)).msg; | |
ary.forEach(function(data){ | |
console.log(data); | |
}) | |
} | |
return btn; | |
})()); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment