Moved to a dedicated repository: https://github.com/softwarespot/PubSub
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
<?php | |
// Prevent content sniffing attacks such as http://mths.be/bst. | |
header('X-Content-Type-Options: nosniff'); | |
// Note: The user-provided callback name must be filtered to prevent attack | |
// vectors. This script simply removes any symbols other than `[a-zA-Z0-9$_]` | |
// from the input. Sadly, this blocks the use of some valid JavaScript | |
// identifiers, and also accepts a few invalid ones. See | |
// http://mathiasbynens.be/notes/javascript-identifiers for details. |
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
var EventsUtility = { | |
addEvent: function (element, type, callback) { | |
if (typeof addEventListener !== 'undefined') { | |
element.addEventListener(type, callback, false); | |
} else if (typeof attachEvent !== 'undefined') { | |
element.attachEvent('on' + type, callback); // IE, legacy browser | |
} else { | |
element['on' + type] = callback; | |
} | |
}, |
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
/* | |
* jQuery Tiny Pub/Sub - v0.1 - 2015/08/07 | |
* http://benalman.com/ | |
* | |
* Original Copyright (c) 2010 'Cowboy' Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
* | |
* Made awesome by Rick Waldron, with additional ideas by Jeffrey Way and softwarespot | |
* URL: https://gist.github.com/rwaldron/705311 |