Your IP : 216.73.216.48
<html>
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<script type="text/javascript">
function getCurrentStyle(node, prop)
{
return document.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
}
function getUserSelection()
{
var userSelection;
if (window.getSelection)
{
userSelection = window.getSelection();
}
else
{
return null;
}
return userSelection;
}
function setDeleteSelectedText()
{
var selObj = getUserSelection();
if( selObj != null ) {
if(selObj.rangeCount > 1) {
for(var i = 1; i < selObj.rangeCount; i++) {
selObj.removeRange(selObj.getRangeAt(i));
}
} else if( selObj.rangeCount == 1) {
selObj.deleteFromDocument();
}
}
}
function getTextForegroundColor()
{
var node = getUserSelection().anchorNode.parentNode;
return getCurrentStyle(node, "color");
}
function getTextBackgroundColor()
{
var node = getUserSelection().anchorNode.parentNode;
return getCurrentStyle(node, "background-color");
}
function getTextDirection()
{
var node = getUserSelection().anchorNode.parentNode;
return getCurrentStyle(node, "direction");
}
function getAlignment()
{
var node = getUserSelection().anchorNode.parentNode;
return getCurrentStyle(node, "text-align");
}
function getFontFamily()
{
var node = getUserSelection().anchorNode.parentNode;
return getCurrentStyle(node, "font-family");
}
function getHtml()
{
var node = document.getElementById("editableArea");
return node.innerHTML;
}
function replaceImageSrc(src, dest)
{
var html = getHtml();
var res = html.replace(src, dest);
replaceHtml(res);
}
</script>
</head>
<body id="editableArea" contenteditable="true" onMouseDown="javaScript:mouseEventHandler(event);"></body>
</html>