Saturday, December 17, 2016

Code prevent copying text and images on your site or blog

 

   All of us suffer from copying themes and images of his blog and find other sites top search results Bmoadiek.Unfortunately this is the case with the Arab blogging a few tries and innovate in the writing of texts
     Usefulness of the code to prevent copying texts and disable copy images with the ability to work Ayman Click when you want to watch the most open threads, for example,
I have searched more than 10 consecutive days to resolve this problem and found a lot of tags but unfortunately almost everyone has flaws on the blog so I did a search for true and good code to prevent copying texts at the same time and found the code last to prevent Click Ayman on the image and you integration between them and went out a good result.


 I hope to take a backup copy of the template
Get into the subject without lengthening Tvdilo a code


Add the code after: </head>

This is code:


<script type="text/javascript">
//Prevent Copying Content From Blogger/Blogspot
//For full source code, visit http://wiki-ibda3.blogspot.com

var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>


<script type="text/javascript">
//<![CDATA[
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Disable context menu on images by GreenLava (BloggerSentral.com)
Version 1.0
You are free to copy and share this code but please do not remove this credit notice.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
    function nocontext(e) {
        var clickedTag = (e==null) ? event.srcElement.tagName : e.target.tagName;
        if (clickedTag == "IMG") {
            alert(alertMsg);
            return false;
        }
    }
    var alertMsg = "Forbidden to copy images";
    document.oncontextmenu = nocontext;
//]]>
</script>