/*
* @title htmlpainter
* @description my bookmarklet
* @include http://*
* @license MIT License
* @require
*/
var __nona_paint = {
dragging: null,
divlistcache: null,
dropDst: null,
backgroundColorBackup: null,
onMouseDown : function(e) {
if (this.getAttribute('data-paint-color') == '')
{
var elms= document.getElementsByTagName("*");
for (var i = 0; i < elms.length; i++) {
if (elms[i].getAttribute('data-nona_paint-original-bgcolor')) {
if (elms[i].getAttribute('data-nona_paint-original-bgcolor') == 'x')
{
elms[i].style.backgroundColor = '';
}
else
{
elms[i].style.backgroundColor = elms[i].getAttribute('data-nona_paint-original-bgcolor');
}
}
if (elms[i].getAttribute('data-nona_paint-original-display'))
{
if (elms[i].getAttribute('data-nona_paint-original-display') == 'x')
{
elms[i].style.display = '';
}
else
{
elms[i].style.display = elms[i].getAttribute('data-nona_paint-original-display');
}
}
}
var palette = document.getElementById('__nona_paint_parent');
palette.parentNode.removeChild(palette);
return false;
}
var pos = __nona_paint.getElementPosition(this);
offsetX = e.pageX - pos.left;
offsetY = e.pageY - pos.top;
__nona_paint.dragging = this.cloneNode(true);
__nona_paint.dragging.id="__nona_paint_dragging";
document.body.appendChild(__nona_paint.dragging);
__nona_paint.dragging.style.position = 'absolute';
return false;
},
onMouseMove: function(e) {
if (!__nona_paint.dragging) {
return true;
}
if (!__nona_paint.divlistcache)
{
__nona_paint.divlistcache = document.all;
}
__nona_paint.dragging.style.left = (e.pageX - offsetX)+'px';
__nona_paint.dragging.style.top = (e.pageY - offsetY)+'px';
var size = 0;
var currentDropDst = null;
var objlist = __nona_paint.divlistcache;
for (i = 0; i < objlist.length; i++) {
if (objlist[i] == __nona_paint.dragging) continue;
if (objlist[i].className == '__nona_paint') continue;
var dstPos = __nona_paint.getElementPosition(objlist[i]);
if (!(e.pageY > dstPos.top
&& e.pageY < dstPos.top + parseInt(objlist[i].clientHeight) + 8))
{
continue;
}
if (!(e.pageX > dstPos.left
&& e.pageX < dstPos.left + parseInt(objlist[i].clientWidth)))
{
continue;
}
if (size == 0 || size > objlist[i].clientHeight * objlist[i].clientWidth)
{
size = objlist[i].clientHeight * objlist[i].clientWidth;
currentDropDst = objlist[i];
}
}
if (__nona_paint.dropDst != currentDropDst)
{
if (__nona_paint.dropDst)
{
__nona_paint.dropDst.style.backgroundColor = __nona_paint.backgroundColorBackup;
}
__nona_paint.backgroundColorBackup = currentDropDst.style.backgroundColor;
if (currentDropDst)
{
if (!currentDropDst.getAttribute('data-nona_paint-original-bgcolor'))
{
if (!currentDropDst.style.backgroundColor) {
currentDropDst.setAttribute('data-nona_paint-original-bgcolor', 'x');
}
else
{
currentDropDst.setAttribute('data-nona_paint-original-bgcolor', currentDropDst.style.backgroundColor);
}
}
currentDropDst.style.backgroundColor = __nona_paint.dragging.getAttribute('data-paint-color');
}
__nona_paint.dropDst = currentDropDst;
}
},
onMouseUp: function(e) {
if (!__nona_paint.dragging) {
return true;
}
__nona_paint.dragging.parentNode.removeChild(__nona_paint.dragging);
if (__nona_paint.dropDst)
{
if (__nona_paint.dragging.getAttribute('data-paint-color') == '#444')
{
if (!__nona_paint.dropDst.getAttribute('data-nona_paint-original-display'))
{
if (!__nona_paint.dropDst.style.display) {
__nona_paint.dropDst.setAttribute('data-nona_paint-original-display', 'x');
}
else
{
__nona_paint.dropDst.setAttribute('data-nona_paint-original-display', __nona_paint.dropDst.style.display);
}
}
__nona_paint.dropDst.style.display = 'none';
}
else
{
__nona_paint.dropDst.style.backgroundColor = __nona_paint.dragging.getAttribute('data-paint-color');
}
}
__nona_paint.dropDst = null;
__nona_paint.dragging = null;
__nona_paint.divlistcache = null;
},
srcList: ['data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAkhJREFUWEfFlyEwREEYx18QBOGCIAiCIAiiIAiCIArCBUEQBEEQBDOCIFw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TM71zPTg3feDMPhcB5towN0HjpFe2gTzYZrv5B4DV2gFzSOJ3SCFiN0Oki0gL6itjwjd2kmUrWH4HX0E1X5hj4jd2Q+/BaR23+IblGV76j9bhC0gX6ZIXDitRgeC37WyL1BgYuafBE4L6NHIwO/rNVW4m+xXhkc/ECT5cDxuggp2Q9za4idQdVFHMRQMzj5XyYXYe4MOeZQ/h2ekKJuGsEhv94q7uUokceaSJp3gcGl0qfgLMy9QL67Mu3wLkyjMPip9CnYCnNnyDGLLGh1hhKPd9oXwr0IOEbJXJg7Qw6L0NuziQe0Gu5FgPe6PIRpasjVtIi/JxcMuYD7MPUC+V4vYnRywfilGC7pfofXYD7kIuonFwa845P1MPcGOV3EcvwchcEPzhwchbkXyLeLvNJ3w1QPDvmauVW9NBfk8eVMTsNcDw7Vu+AwzFNBHl9SsZlZCXM9OPg/5a1lwMcY6gTxbntyHubx4OiDlK2XPUGnRRC3X2Qo8S/9c+v9C5wtmsTFHKGJagI/O6RLlPgR7U8VQS6i2oT6FW7pSGeEzXvfnbND9iVNbGw2wq09BqOsiSq+7TfIAvPkVCdNfNqXIlV3SGJhejpeN5xNOPFmhPcLiX1KLS5bdb9eOaHP7Q4af8ze+T8ZDH4Di5gTrTAuNtcAAAAASUVORK5CYII='],
colorList: ['#FDD','#FDF','#EDF','#DEF','#DFF','#CFC','#EFC','#FED','#FFF','#444',''],
getElementPosition: function (elem){
var position=elem.getBoundingClientRect();
return {
left:Math.round(window.document.body.scrollLeft + document.documentElement.scrollLeft + position.left),
top:Math.round(window.document.body.scrollTop + document.documentElement.scrollTop + position.top)
}
}
};
setTimeout(function () {
objlist = document.getElementsByTagName('IMG');
document.onmousemove = __nona_paint.onMouseMove;
document.onmouseup = __nona_paint.onMouseUp;
var palette = document.createElement("div");
palette.style.backgroundColor = 'gray';
palette.style.position = 'fixed';
palette.style.opacity = '0.8';
palette.style.zIndex = 999;
palette.style.height= '40px';
palette.style.padding = '4px';
palette.style.width = '372px';
palette.style.backgroundColor = 'gray';
palette.className = '__nona_paint';
palette.id = '__nona_paint_parent';
for (var i = 0; i < 11; i++)
{
var image = document.createElement("img");
image.src=__nona_paint.srcList[i];
image.setAttribute('data-paint-color', __nona_paint.colorList[i]);
image.className = '__nona_paint';
image.onmousedown = __nona_paint.onMouseDown;
palette.appendChild(image);
}
document.body.insertBefore(palette, document.body.childNodes[0]);
}, 0);