Index: wp-admin/js/utils.dev.js
===================================================================
--- wp-admin/js/utils.dev.js	(revision 21217)
+++ wp-admin/js/utils.dev.js	(working copy)
@@ -1,4 +1,6 @@
 // utility functions
+var wp = wp || {};
+wp._private = wp._private || {};
 
 var wpCookies = {
 // The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL.
@@ -169,3 +171,205 @@
 
 	return wpCookies.getHash('wp-settings-' + userSettings.uid) || {};
 }
+
+/**
+ * Based on:
+ * Amplify Core 1.1.0
+ * 
+ * Copyright 2011 appendTo LLC. (http://appendto.com/team)
+ * Dual licensed under the MIT or GPL licenses.
+ * http://appendto.com/open-source-licenses
+ * 
+ * http://amplifyjs.com
+ */
+wp._private.WP_Actions = function() {
+	var slice = [].slice, subscriptions = {};
+	
+	/**
+	 * Triggers an action (custom event) previously added with addAction()
+	 *  
+	 * Usage: doAction( action, ... )
+	 * Any additional parameters will be passed to the callback(s).
+	 * 
+	 * @action string Name of the action.
+	 */  
+	this.doAction = function( action ) {
+		var args = slice.call( arguments, 1 ), eventSubscriptions, subscription, length, i = 0;
+
+		if ( !subscriptions[ action ] )
+			return false;
+
+		eventSubscriptions = subscriptions[ action ].slice();
+		
+		for ( length = eventSubscriptions.length; i < length; i++ ) {
+			subscription = eventSubscriptions[ i ];
+			subscription.callback.apply( subscription.context, args );
+		}
+		
+		subscriptions[ action ].done++;
+
+		return true;
+	}
+
+	/**
+	 * Adds an action (custom event) that is triggered later
+	 *
+	 * Usage:
+	 * addAction( 'action.namespace', callback );
+	 * addAction( 'action.namespace', callback, priority );
+	 * addAction( 'action.namespace', callback, priority, unique );
+	 * addAction( 'action.namespace', callback, priority, unique, scope );
+	 * addAction( 'action.namespace otheraction.namespace', callback );
+	 *
+	 * @action_names string Action name + namespace. The namespace is required. It is similar to jQuery('selector').bind('click.myname', ...) 
+	 *                      and has to be unique for this action and for the script adding the action
+	 *                      similarly to how PHP functions are unique (prefixed) in each WordPress plugin.
+	 *                      Supports adding the same callback to multiple actions (separated by spaces).
+	 * @callback function Callback function for the action. Can be anonymous: addAction( action.namespace, function(){...} );
+	 * @priority int optional Action priority. Lower values have higher priority. Default is 10 (same as add_action() in PHP).
+	 * @unique bool optional Whether to reject attempts to add the same action.namespace multiple times. Defaults to true. 
+	 * @scope object optional The JS scope when the callback is invoked.
+	 */
+	this.addAction = function( action_names, callback, priority, unique, context ) {
+		var eventIndex, events = action_names.split(' '), eventLength = events.length,
+			added, newaction, registered, i, subscriptionInfo, namespace;
+		
+		priority = priority || 10;
+
+		if ( typeof(unique) == 'undefined' )
+			unique = true;
+
+		for ( eventIndex = 0; eventIndex < eventLength; eventIndex++ ) {
+			newaction = events[ eventIndex ];
+			namespace = newaction.split('.');
+			added = false;
+
+			if ( !namespace[1] )
+				return false;
+
+			newaction = namespace[0];
+			namespace = namespace[1];
+
+			if ( !subscriptions[ newaction ] ) {
+				subscriptions[ newaction ] = [];
+				subscriptions[ newaction ]['done'] = 0;
+			} else if ( unique ) {
+				for ( registered in subscriptions[ newaction ] ) {
+					if ( subscriptions[ newaction ][ registered ].namespace === namespace )
+						return false;
+				}
+			}
+
+			i = subscriptions[ newaction ].length - 1;
+			subscriptionInfo = {
+				namespace: namespace,
+				callback: callback,
+				priority: priority,
+				context: context
+			};
+
+			for ( ; i >= 0; i-- ) {
+				if ( subscriptions[ newaction ][ i ].priority <= priority ) {
+					subscriptions[ newaction ].splice( i + 1, 0, subscriptionInfo );
+					added = true;
+					break;
+				}
+			}
+
+			if ( !added ) {
+				subscriptions[ newaction ].unshift( subscriptionInfo );
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * Removes an action
+	 *
+	 * Usage: removeAction( action.namespace )
+	 * 
+	 * Different actions on the same hook are identified by their namespace.
+	 *
+	 * @action string Name of the action and the namespace that was used on registering it.
+	 */  
+	this.removeAction = function( action_name ) {
+		var act = action_name.split('.'), namespace, action, i, ret = false, actions, reindexed = [];
+
+		if ( !act[1] )
+			return false;
+
+		action = act[0];
+		namespace = act[1];
+
+		if ( !subscriptions[ action ] )
+			return false;
+
+		actions = subscriptions[ action ];
+
+		for ( i in actions ) {
+			if ( !actions[ i ] ) {
+				continue;
+			} else if ( actions[ i ].namespace === namespace ) {
+				ret = true;
+				continue;
+			} else {
+				reindexed.push( actions[i] );
+			}
+		}
+
+		if ( reindexed.length )
+			subscriptions[ action ] = reindexed;
+		else
+			delete( subscriptions[ action ] );
+
+		return ret;
+	}
+
+	/**
+	 * Removes all actions from a hook.
+	 *
+	 * @action_name string Name of the action.
+	 */ 
+	this.removeAllActions = function( action_name ) {
+		var act = action_name.split('.'), action = act[0];
+		
+		if ( !subscriptions[ action ] )
+			return false;
+
+		delete( subscriptions[ action ] );
+		return true;
+	}
+
+	// Returns the number of times an action was ran or false if the action is not registered.
+	this.didAction = function( action_name ) {
+		var act = action_name.split('.'), action = act[0];
+
+		if ( subscriptions[ action ] )
+			return subscriptions[ action ].done;
+
+		return false;
+	}
+
+	// Returns an array of all currently registered actions.
+	// TODO needed?
+	this.registeredActions = function() {
+		var ret = [], i;
+
+		for ( i in subscriptions ) {
+			ret.push(i)
+		}
+
+		return ret;
+	}
+
+};
+
+// instantiate
+wp._private.actions = new wp._private.WP_Actions;
+wp.doAction = wp._private.actions.doAction;
+wp.addAction = wp._private.actions.addAction;
+wp.removeAction = wp._private.actions.removeAction;
+wp.removeAllActions = wp._private.actions.removeAllActions;
+wp.didAction = wp._private.actions.didAction;
+
