<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,6 @@
 /**
 * MySource Matrix Simple Edit Tools (jquery.matrix.js)
-* version: 0.3 (May-05-2009)
+* version: 0.3.1 (JUNE-11-2009)
 * Copyright (C) 2009 Nicholas Hubbard
 * @requires jQuery v1.3 or later
 * @requires Trigger or Asset configuration in MySource Matrix
@@ -633,7 +633,8 @@ function check_errors(item_id) {
 	// Everything depends on the ID, so we need to check that we have it
 	var item_id = clean_id(item_id);
 	if (isNaN(item_id) || item_id === '' || item_id === undefined) {
-		alert('The asset ID that was passed does not appear to be a number, please check the ID you are passing.');
+		alert('The asset ID that was passed does not appear to be a number, please check the ID you are passing.'+
+			  '\n\n See documentation for the correct usage: www.zedsaid.com/jquery-matrix');
 		return true;
 	}
 }// End check_errors
@@ -671,6 +672,9 @@ function ajax_error(xhr, ajaxOptions, errorThrown) {
 * @access public
 */
 function progress(item_id, percent_done, submitted_hippo_url, ajax_status, complete, obj) {
+	
+	debug('progress', 1);
+	
 	if (percent_done &gt;= 100 || isNaN(percent_done)) {
 		
 		// Remove ajax_status one we are finished with the hippo
@@ -706,6 +710,9 @@ function progress(item_id, percent_done, submitted_hippo_url, ajax_status, compl
 * @access public
 */
 function submit_hippo(item_id, submitted_hippo_url, ajax_status, complete, obj) {
+	
+	debug('submit_hippo function', 1);
+	
 	$.ajax({
 		url: submitted_hippo_url,
 		type: 'GET',
@@ -726,6 +733,8 @@ function submit_hippo(item_id, submitted_hippo_url, ajax_status, complete, obj)
 
 function process_hippo(item_id, screen_url, main_form, hippo_url, ajax_status, complete, obj, linking_data) {
 	
+	debug('process_hippo function', 1);
+	
 	var status_message = 'Building data';
 	status(item_id, status_message, ajax_status);
 	
@@ -739,7 +748,7 @@ function process_hippo(item_id, screen_url, main_form, hippo_url, ajax_status, c
 			var status_message = 'Submitting hippo job';
 			status(item_id, status_message, ajax_status);
 		},
-		success: function(hippo){
+		success: function(hippo) {
 			
 			// What screen are we using
 			var current_screen = screen_url.split('asset_ei_screen=');
@@ -759,8 +768,11 @@ function process_hippo(item_id, screen_url, main_form, hippo_url, ajax_status, c
 			var submitted_hippo = submitted_hippo.split('?SQ_ACTION=hipo');
 			// Check to see if we actually have a hippo
 			if (submitted_hippo[1] === undefined) {
+				var status = 'There has been a hippo error, please check the hippo herder.';
+				debug(status, 4);
 				var status_message = 'Hippo Error';
 				status(item_id, status_message, ajax_status);
+				alert(status);
 				return;	
 			}// End if
 			var submitted_hippo = submitted_hippo[1].split('&amp;SQ_BACKEND_PAGE');
@@ -796,6 +808,9 @@ function process_hippo(item_id, screen_url, main_form, hippo_url, ajax_status, c
 * @access public
 */
 function status(item_id, status_message, ajax_status) {
+	
+	debug('status function', 1);
+	
 	if (ajax_status) {
 		// We need to set where out status will be
 		$('#' + item_id).next('.ajax_status').remove();
@@ -822,6 +837,8 @@ function status(item_id, status_message, ajax_status) {
 */
 function details_screen(item_id, screen_url, main_form, hippo_url, ajax_status, complete, obj, asset_status) {
 	
+	debug('details_screen function', 1);
+	
 	// Lets see what status means in numerical values
 	if (asset_status === 'Live') {
 		var status_code = 16;
@@ -829,6 +846,10 @@ function details_screen(item_id, screen_url, main_form, hippo_url, ajax_status,
 		var status_code = 64;
 	} else if (asset_status === 'Under Construction') {
 		var status_code = 2;
+	} else {
+		var status = 'The status you are trying to set it not supported!';
+		debug(status, 4);
+		alert(status);
 	}
 	
 	$.ajax({
@@ -881,6 +902,9 @@ function details_screen(item_id, screen_url, main_form, hippo_url, ajax_status,
 * @access public
 */
 function linking_screen(item_id, screen_url, main_form, hippo_url, ajax_status, complete, obj) {
+	
+	debug('linking_screen function', 1);
+	
 	$.ajax({
 		url: screen_url,
 		type: 'GET',
@@ -929,8 +953,11 @@ function linking_screen(item_id, screen_url, main_form, hippo_url, ajax_status,
 */
 function get_locks(item_id, item_screen, ajax_status, asset_status, complete, obj) {
 	
+	debug('get_locks function', 1);
+	
 	// Everything depends on the ID, so we need to check that we have it
 	if (check_errors(item_id)) {
+		debug('Not a valid asset ID', 4);
 		return;
 	}// End if
 	
@@ -959,6 +986,7 @@ function get_locks(item_id, item_screen, ajax_status, asset_status, complete, ob
 			// What is our current asset status
 			var current_status = $(&quot;.sq-backend-data img&quot;, html).next('i:first').text();
 			if (current_status === asset_status) {
+				debug('You are tying to set the same status that the asset is', 4);
 				// Remove status from DOM and alert the user
 				$('#' + item_id).next('.ajax_status').remove();
 				alert('Asset ID:' + clean_id(item_id) + ' currently has the status of ' + current_status + '.  You are tring set this same status.');
@@ -1004,15 +1032,46 @@ function get_locks(item_id, item_screen, ajax_status, asset_status, complete, ob
 					
 				});// End ajax
 				
-			}// End if
-			
-			var status_message = 'Error getting locks';
-			status(item_id, status_message, ajax_status);
+			} else {
+				
+				debug('Error Getting Locks', 4);
 					
-			return;
+				var status_message = 'Error Getting Locks';
+				status(item_id, status_message, ajax_status);
+						
+				return;
+			
+			}// End else
 			
 		}// End success
 	
 	});// End ajax
 	
-}// End get_locks
\ No newline at end of file
+}// End get_locks
+
+
+/**
+* Function to debug issues with our hippo functions
+*
+* @param string		message		The message to display in the console
+* @param integer	error		The error type to display
+* @param boolean	trace		Whether or not to show a stack trace
+*
+* @access public
+*/
+function debug(message, error) {
+	
+	// Should we debug?
+	var status = false;
+	// Should we show a stack trace for each dubug call?
+	var trace = false;
+	
+	if (status) {
+		if (error === 1) console.debug(message);
+		if (error === 2) console.info(message);
+		if (error === 3) console.warn(message);
+		if (error === 4) console.error(message);
+		if (trace) console.trace();
+	}
+	
+}// End debug
\ No newline at end of file</diff>
      <filename>jquery.matrix.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7d88c73f6ae7f9eb771a9d6a0dc1b1254dcac64a</id>
    </parent>
    <parent>
      <id>fa8e457c88f4cb39fd2a835833e6d3b18304f903</id>
    </parent>
  </parents>
  <author>
    <name>Nic Hubbard</name>
    <email>nic@zedsaid.com</email>
  </author>
  <url>http://github.com/nnhubbard/matrix-jquery-tools/commit/a3b739a45f1035ddbe8a0db08c6305eb9bdb7f54</url>
  <id>a3b739a45f1035ddbe8a0db08c6305eb9bdb7f54</id>
  <committed-date>2009-06-11T11:50:20-07:00</committed-date>
  <authored-date>2009-06-11T11:50:20-07:00</authored-date>
  <message>Merge branch 'dev'</message>
  <tree>1bc98f3d0ea3b4ed904e2e986f5bebef26f51f90</tree>
  <committer>
    <name>Nic Hubbard</name>
    <email>nic@zedsaid.com</email>
  </committer>
</commit>
