<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>jquery.matrixMap.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,8 @@
 /**
 * MySource Matrix Simple Edit Tools (jquery.matrix.js)
 * version: 0.3 (APR-22-2009)
+=======
+* version: 0.3 (May-05-2009)
 * Copyright (C) 2009 Nicholas Hubbard
 * @requires jQuery v1.3 or later
 * @requires Trigger or Asset configuration in MySource Matrix
@@ -28,179 +30,6 @@ function page_on_load() {
 	  
 
 /**
-* Plugin that allows you to browse the MySource Matrix asset tree structure.  
-* This is beneficial sometimes as you can bypass the java asset map.
-* It sends XML to Matrix, then receives an XML response.
-*
-* @version $Revision: 0.3
-*/
-$.fn.matrixMap = function (options) {
-	var defaults = {
-		root: '1',
-		showChildren: false
-	};
-	
-	var options = $.extend(defaults, options);
-	var obj = $(this);
-	
-	// Find out what site we are at
-	var proto = location.protocol;
-	var site = location.host;
-	var host_url = proto + '//' + site + '?SQ_ACTION=asset_map_request';
-	
-	// Construct our XML to send
-	//var xml_move = '&lt;command action=&quot;move asset&quot; to_parent_assetid=&quot;2858&quot; to_parent_pos=&quot;1&quot;&gt;&lt;asset assetid=&quot;47315&quot;  linkid=&quot;81951&quot;  parentid=&quot;2858&quot; /&gt;&lt;/command&gt;';
-	var xml_get = '&lt;command action=&quot;get assets&quot;&gt;&lt;asset assetid=&quot;' + defaults.root + '&quot; start=&quot;0&quot; limit=&quot;150&quot; linkid=&quot;10&quot; /&gt;&lt;/command&gt;';
-	
-	// Create our element
-	obj.append('&lt;ul id=&quot;map_root&quot;&gt;&lt;/ul&gt;');
-	
-	// Set somes image vars
-	var type_2_path = '/__lib/web/images/icons/asset_map/not_visible.png';
-	var type_2_image = '&lt;img class=&quot;type_2&quot; src=&quot;' + type_2_path + '&quot; /&gt;';
-	var branch_closed = '&lt;img src=&quot;/__lib/web/images/tree/branch_closed.gif&quot; /&gt;';
-	var branch_open = '&lt;img src=&quot;/__lib/web/images/tree/branch_open.gif&quot; /&gt;';
-	var branch_stalk = '&lt;img src=&quot;/__lib/web/images/tree/stalk&quot; /&gt;';
-	
-	// Create our ajax to send the XML
-	$.ajax({
-		url: host_url,
-		type: 'POST',
-		processData: false,
-		data: xml_get,
-		contentType: &quot;text/xml&quot;,
-		dataType: 'xml',
-		success: function(xml) {
-			// Check each asset that we find
-			$(xml).find('asset').each(function() {
-				// Only include asset tags with attributesp
-				if ($(this).attr('assetid') &gt; 0) {
-					// Set some of our vars that will populate our asset map
-					var asset_id = unescape($(this).attr('assetid'));
-					var asset_status = $(this).attr('status');
-					var asset_link_type = parseInt($(this).attr('link_type'));
-					var asset_type_code = $(this).attr('type_code');
-					var asset_num_kids = parseInt($(this).attr('num_kids'));
-					var asset_name = unescape($(this).attr('name')).replace(/\+/g, ' ');
-					// See what kind of link type we have
-					if (asset_link_type === 2) {
-						// Type 2 link
-						var asset_image = '&lt;img class=&quot;asset_image&quot; src=&quot;/__data/asset_types/' + asset_type_code + '/icon.png&quot; /&gt;';
-						asset_image = type_2_image + asset_image;
-					} else {
-						// Type 1 link
-						var asset_image = '&lt;img src=&quot;/__data/asset_types/' + asset_type_code + '/icon.png&quot; /&gt;';
-					}
-					
-					// See if we have kids
-					if (asset_num_kids === 0) {
-						var indicate_kids = branch_stalk;
-					} else {
-						var indicate_kids = branch_closed;
-					}
-					$('&lt;li&gt;&lt;/li&gt;').html(indicate_kids + '&lt;a href=&quot;#&quot; class=&quot;icon_hold&quot;&gt;' + asset_image + '&lt;/a&gt; &lt;a id=&quot;a' + asset_id + '&quot; href=&quot;#&quot; rel=&quot;' + asset_num_kids + '&quot;&gt;' + asset_name + '&lt;/a&gt;').appendTo('#map_root');
-				}// End if
-			
-			});// End each
-			
-		}// End success
-		
-	});// End ajax
-	
-	// Lets click our parents to show their children
-	$('#map_root li a').live('dblclick', function(){
-		
-		// Get our current asset
-		var current_asset = $(this);
-		var sub_root = $(this).attr('id').replace('a', '');
-		var num_kids = $(this).attr('rel');
-		
-		// If there are no kids don't continue
-		if (num_kids === '0') {
-			return;	
-		}
-		
-		// Check to see if we already have a class
-		if (current_asset.hasClass('children')) {
-			current_asset.removeClass('children');
-			// Hide our tree
-			current_asset.parent().next('ul').hide();
-			return;
-		} else {
-			// This must meen that we can expant, so add a class
-			current_asset.addClass('children');
-			// Let it know that we have expanded so we don't have to load again
-			current_asset.addClass('cache');
-		}
-		
-		// Construct our XML to send
-		var xml_get = '&lt;command action=&quot;get assets&quot;&gt;&lt;asset assetid=&quot;' + sub_root + '&quot; start=&quot;0&quot; limit=&quot;150&quot; linkid=&quot;10&quot; /&gt;&lt;/command&gt;';
-		
-		// Create a new list
-		current_asset.parent().after('&lt;ul&gt;&lt;/ul&gt;');
-		
-		// Grab our child assets
-		$.ajax({
-			url: host_url,
-			type: 'POST',
-			processData: false,
-			data: xml_get,
-			contentType: &quot;text/xml&quot;,
-			dataType: 'xml',
-			error: function (XMLHttpRequest, textStatus, errorThrown) {
-				console.log(XMLHttpRequest + textStatus + errorThrown);
-			},
-			beforeSend: function () {
-				current_asset.parent().after('&lt;ul class=&quot;loading&quot;&gt;&lt;li&gt;&lt;img src=&quot;/__lib/web/images/icons/asset_map/loading_node.png&quot; /&gt; Loading...&lt;/li&gt;&lt;/ul&gt;');
-			},
-			success: function (xml) {
-				// Remove loading
-				$('.loading').remove();
-				// Check each asset that we find
-				$(xml).find('asset').each(function() {
-					// Only include asset tags with attributesp
-					if ($(this).attr('assetid') &gt; 0) {
-						// Set some of our vars that will populate our asset map
-						var asset_id = unescape($(this).attr('assetid'));
-						var asset_type_code = $(this).attr('type_code');
-						var asset_link_type = parseInt($(this).attr('link_type'));
-						var asset_num_kids = parseInt($(this).attr('num_kids'));
-						var asset_name = unescape($(this).attr('name')).replace(/\+/g, ' ');
-						var asset_image = ' &lt;img src=&quot;/__data/asset_types/' + asset_type_code + '/icon.png&quot; /&gt;';
-						// See what kind of link type we have
-						if (asset_link_type === 2) {
-							// Type 2 link
-							var asset_image = '&lt;img class=&quot;asset_image&quot; src=&quot;/__data/asset_types/' + asset_type_code + '/icon.png&quot; /&gt;';
-							var asset_image = type_2_image + asset_image;
-						} else {
-							// Type 1 link
-							var asset_image = '&lt;img src=&quot;/__data/asset_types/' + asset_type_code + '/icon.png&quot; /&gt;';
-						}
-						
-						// See if we have kids
-						if (asset_num_kids === 0) {
-							var indicate_kids = branch_stalk;
-						} else {
-							var indicate_kids = branch_closed;
-						}
-						
-						$('&lt;li&gt;&lt;/li&gt;').html(indicate_kids + '&lt;a href=&quot;#&quot; class=&quot;icon_hold&quot;&gt;' + asset_image + '&lt;/a&gt; &lt;a id=&quot;a' + asset_id + '&quot; href=&quot;#&quot; rel=&quot;' + asset_num_kids + '&quot;&gt;' + asset_name + '&lt;/a&gt;').appendTo(current_asset.parent().next());
-					}// End if
-				
-				});// End each
-				
-			}// End success
-			
-		});// End ajax
-		
-		return false;
-		
-	});// End live click
-	
-};// End matrixMap
-
-
-/**
 * Plugin that allows Asset Builders to be submitted using Ajax.  
 * This is nessessary to allow Matrix to open a from as a stand alone.
 *
@@ -235,7 +64,8 @@ $.fn.matrixForm = function (options) {
 		var form_submit_class = form_submit.attr('class');
 		
 		// Check to see if we are uploading a file
-		if ($(obj + ' input:file').length === 0) {
+		if (!obj.find('input:file')) {
+			
 			$('#sq_commit_button').removeAttr('onclick');
 			
 			// Choose if we should set click for asset builder or custom form
@@ -333,6 +163,7 @@ $.fn.matrixForm = function (options) {
 			});// End Click
 			
 		} else {
+			// We are using an asset builder for file uploads
 			
 			// Use iframe if form is uploading a file
 			$('body').append('&lt;iframe id=&quot;assetBuilderFrame&quot; name=&quot;assetBuilderFrame&quot; style=&quot;position:absolute; top:-1000px; left:-1000px;&quot;&gt;&lt;/iframe&gt;');</diff>
      <filename>jquery.matrix.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,46 @@
 /* Styles for jquery.matrix.js matrixMap plugin */
 
+/* Text Styles */
+#map_root {font: .8em/.6em Helvetica, Arial, Geneva, sans-serif; color: #000;}
+
+/* Remove any offending styles */
+#map_root a, 
+#map_root :link,
+#map_root :visited {text-decoration:none;}
+#map_root ul,
+#map_root ol,
+#map_root li {list-style:none;}
+#map_root a img,
+#map_root :link img,
+#map_root :visited img {border:none;}
+#map_root a:focus, 
+#map_root a:visited {outline-style: none;}
+
 /* Tree */
-#map_root {width: 350px; height: 400px; overflow: auto; background-color: #fff; padding: 12px;	border: 1px solid #b8b8b8; margin-left: 0;}
-#map_root li {list-style: none; margin: 0;}
-#map_root li a {color: #000; font-size: .9em;}
+#map_root {width: 400px; height: 400px; overflow: auto; background-color: #fff; padding: 12px;	border: 1px solid #b8b8b8; margin-left: 0; white-space: nowrap;}
+#map_root li a {color: #000; font-size: .9em; line-height: 16px; height: 16px;}
 #map_root li a:hover {color: #000;}
-#map_root li img {margin-bottom: -6px;}
+#map_root li img {margin-bottom: 0;}
+#map_root a.asset_name {display: block; float: left; margin-left: 20px;}
+
+/* Stalks */
+#map_root ul {background: url(/__lib/web/images/tree/stalk.gif) repeat-y -5px 0; padding: 0 0 0 16px;}
+#map_root li {display: block; line-height: 18px; padding: 0 0 0 14px; background: url(/__lib/web/images/tree/stalk.gif) no-repeat -5px 0; clear: both; height: 16px;}
+#map_root li.closed {background: url(/__lib/web/images/tree/branch_closed.gif) no-repeat -5px 0;}
+#map_root li.kids_closed {background: url(/__lib/web/images/tree/branch_closed.gif) no-repeat -5px -2;}
+#map_root li.last {background: url(/__lib/web/images/tree/branch.gif) no-repeat -5px -3;}
+#map_root ul.loading li {background: url(/__lib/web/images/icons/asset_map/loading_node.png) no-repeat 0 0;}
+#map_root li.cache {background: url(/__lib/web/images/tree/branch_open.gif) no-repeat -5px -2px;}
 
 /* Icons */
-#map_root a {padding-left: 16px;}
-#map_root a.icon_hold {position: relative; padding-left: 0;}
+#map_root a.icon_hold {position: relative; display: block; float: left;}
 #map_root a.icon_hold img.type_2 {position: absolute; z-index: 2; top: 0; left: 0;}
 #map_root a.icon_hold img.asset_image,
 #map_root a.icon_hold img {position: absolute; z-index: 1; top: 0; left: 0;}
 
 /* Loading */
-#map_root ul.loading {font-size: .9em;}
\ No newline at end of file
+#map_root ul.loading {font-size: .9em;}
+
+/* Status */
+#map_root a.live {background-color: #dbf18a;}
+#map_root a.construction {background-color: #aaccdd;}
\ No newline at end of file</diff>
      <filename>matrixMap.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fc2e37bb89b328acbb92ae9f0a291868b516790a</id>
    </parent>
    <parent>
      <id>854138fd5b4da394660cc03b6dc17705688617ac</id>
    </parent>
  </parents>
  <author>
    <name>Nic Hubbard</name>
    <email>nic@zedsaid.com</email>
  </author>
  <url>http://github.com/nnhubbard/matrix-jquery-tools/commit/b07520d074ab90cddc151f02c1d8edf8dccfd4c6</url>
  <id>b07520d074ab90cddc151f02c1d8edf8dccfd4c6</id>
  <committed-date>2009-05-08T09:23:22-07:00</committed-date>
  <authored-date>2009-05-08T09:23:22-07:00</authored-date>
  <message>Merging dev into master</message>
  <tree>ef3c14f0026958c15e72b313c5586fd9a08264de</tree>
  <committer>
    <name>Nic Hubbard</name>
    <email>nic@zedsaid.com</email>
  </committer>
</commit>
