Skip to content

Instantly share code, notes, and snippets.

View redsquare's full-sized avatar
📞
OnCall

steve flitcroft redsquare

📞
OnCall
View GitHub Profile
@redsquare
redsquare / header.js
Created January 24, 2012 19:16 — forked from tvpmb/header.js
Moving Events from Module to separate file
(function() {
var Events = {
dropMenu: function(evt) {
alert("Handle the click");
},
events: {
"click .drop-menu": "dropMenu",
},
}
return Events;
@redsquare
redsquare / jquery.ba-tinypubsub.js
Created December 26, 2011 11:21 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@redsquare
redsquare / gist:1053873
Created June 29, 2011 13:52
js encapsulation template - better minification
//
// Module pattern:
// http://yuiblog.com/blog/2007/06/12/module-pattern
//
var APP = (function($, window, document, undefined) {
// For use only inside APP.
var PRIVATE_CONSTANT_1 = 'foo';
var PRIVATE_CONSTANT_2 = 'bar';
// Expose contents of APP.
$scope.updateview = function (iteration, $event) {
var _this = $("#" + $event.target.id);
$http.get('../issues?size=25&iteration=' + iteration).success(function (data) {
$scope.issueList = data;
_this.addClass("tab-selected");
});
};