Skip to content

Instantly share code, notes, and snippets.

View balupton's full-sized avatar
🏥
Recovering from medical complications

Benjamin Lupton balupton

🏥
Recovering from medical complications
View GitHub Profile
@balupton
balupton / ajaxy-beginner-interface.js
Created September 21, 2010 19:25
Ajaxy Beginner Interface
// Option 1 - Good solution, can create a controller from this
$('.ajaxy-page').ajaxify({
controller: 'page',
request: function(){
$('#content').fadeOut();
},
response: function(){
$('#content').html(this.Response.data.content).fadeIn();
}
});
@balupton
balupton / registerplugin-impl.js
Created October 16, 2010 16:13
Proposal for the usage of a new Aloha.registerPlugin function.
/*
Demo of proposed registerPlugin function
*/
(function(window,undefined){
// Extract
var GENETICS = window.GENTICS,
jQuery = window.jQuery;
// Prototypes
@balupton
balupton / README.md
Last active September 23, 2015 23:27
Aloha Editor Plugin Migrator

Aloha Editor Plugin Migrator

Used to port over plugins to their new repos

@balupton
balupton / bind.trigger.prototype.js
Created January 26, 2011 15:42
Bind and Trigger Custom and Native Events in Prototype
/**
* Bind and Trigger custom and native events in Prototype
* @author Juriy Zaytsev (kangax)
* @author Benjamin Lupton (balupton)
* @copyright MIT license
**/
(function(){
var eventMatchers = {
'HTMLEvents': /^(?:load|unload|abort|error|select|hashchange|popstate|change|submit|reset|focus|blur|resize|scroll)$/,
@balupton
balupton / README.md
Last active September 24, 2015 19:28
jQuery Ajaxy Support Request
@balupton
balupton / $.fn.cmAjaxify.js
Created February 1, 2011 03:07
Ajaxify a Campaign Monitor Subscribe Form without the need for a server-side proxy
/**
* Ajaxify a Campaign Monitor Subscribe Form
* without the need for a server-side proxy
* @author Benjamin Arthur Lupton
* @license Public Domain
*/
$.fn.cmAjaxify = $.fn.cmAjaxify||function(options){
// Prepare Options
options = options||{};
options.html5ize = options.html5ize||false;
@balupton
balupton / $.fn.placeholder.js
Created February 1, 2011 03:10
Set or Fetch a HTML5 Placeholder without backwards compatibility for older browsers
/**
* Set or Fetch a HTML5 Placeholder
* without backwards compatibility for older browsers
* @author Benjamin Arthur Lupton
* @license Public Domain
*/
$.fn.placeholder = $.fn.placeholder||function(placeholder) {
// Prepare
var $input = $(this);
@balupton
balupton / $.fn.flash.js
Created February 1, 2011 09:42
Flash a Element Three Times - Great for validation and drawing attention
/**
* Flash a Element Three Times
* Great for validation and drawing attention
* @author Benjamin Arthur Lupton
* @license Public Domain
*/
$.fn.flash = $.fn.flash||function(){
var $el = $(this);
@balupton
balupton / $.fn.outerHtml
Created February 1, 2011 09:43
Fetch the outerHTML of an Element
/**
* Fetch the outerHTML of an Element
* @author Benjamin Arthur Lupton
* @license Public Domain
*/
$.fn.outerHtml = $.fn.outerHtml||function(){
var
$el = $(this),
el = $el.get(0),
html = el.outerHTML || new XMLSerializer().serializeToString(el);
@balupton
balupton / cli.rb
Last active September 25, 2015 00:08
Aloha Editor's Command Line Interface. Attempt #1
#!/usr/bin/env ruby
# == Name
# cli - Aloha Editor's Command Line Interface
#
# == Synopsis
# TODO: finish this section
#
# == Examples
# TODO: finish this section