-
Star
(115)
You must be signed in to star a gist -
Fork
(33)
You must be signed in to fork a gist
-
-
Save Kilian/767982 to your computer and use it in GitHub Desktop.
| //make sure the browser window is 'maximised' | |
| window.resizeTo(1024,768); | |
| //no context menu | |
| document.oncontextmenu = function(){return false} | |
| //no loading in iframes | |
| if (parent.frames.length > 0) top.location.replace(document.location); | |
| //no dragging | |
| document.ondragstart = function(){return false} | |
| //no text selection, in IE | |
| document.onselectstart=function(){ | |
| if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password") { | |
| return false | |
| } else { | |
| return true; | |
| } | |
| }; | |
| //no text selection, in Firefox | |
| document.onmousedown=function(e){ | |
| var obj=e.target; | |
| if (obj.tagName.toUpperCase() == "INPUT" || obj.tagName.toUpperCase() == "TEXTAREA" || obj.tagName.toUpperCase() == "PASSWORD") { | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } | |
| //prompt when the user leaves your page | |
| window.onunload=function() { | |
| function dontLeave() { | |
| alert("Please come back!!1"); | |
| } | |
| dontLeave(); | |
| } | |
| //prevent user from copying or pasting text | |
| window.onkeydown = function(e) { | |
| if (e.ctrlKey == true) { | |
| return false; | |
| } | |
| } | |
I like :) Dont forget to show a hint that this site looks best in IE6 - and to be honest I miss the -tag and moving messages in the status bar..
Won't this throw an error with Annoying being undefined?
Or did I miss part of the joke...
How about:
a.refresh = function() {
setTimeout('location.reload(true);', 2000);
};
I updated this with a bunch of new functions! Thanks for the replies/suggestions. This is still on my todo list:
- bookmark alert
- stuff floating around mouse
- move messages in the status bar
I made some fixes and jshinted the code! https://gist.github.com/998465
Thanks, I merged the changes back in! :)
doesn't work on chrome, here
Do you think that the 'a.stayOnSite = function ()' is still evil in the age of tabbed windows? Even sites like blogger give users the option of having links to pictures and other sites opened in a new window/tab...
-Jun
doesn't work...how annoying :D
What is in s, and why do you throw away the text value in copyToClipboard() ?
https://gist.github.com/alexmcmillan/4419e9375aec9886a919beac02bc5e9a
Opening links in a popup - it would be easier to assign target="_blank" than to create a popup ;)
A "force video autoplay" and a "recurrent pop-in" feature are missing.
Dick move.