<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,9 +5,7 @@
 			                      &quot;type&quot; =&gt; &quot;text_block&quot;,
 			                      &quot;rows&quot; =&gt; 4,
 			                      &quot;label&quot; =&gt; __(&quot;Video&quot;, &quot;video&quot;),
-			                      &quot;bookmarklet&quot; =&gt; (isset($_GET['url']) and
-			                                        preg_match(&quot;/http:\/\/(www\.|[a-z]{2}\.)?youtube\.com\/watch\?v=([^&amp;]+)/&quot;,
-			                                                   $_GET['url'])) ?
+			                      &quot;bookmarklet&quot; =&gt; $this-&gt;isVideo() ?
 			                                        &quot;url&quot; :
 			                                        &quot;&quot;));
 			$this-&gt;setField(array(&quot;attr&quot; =&gt; &quot;caption&quot;,
@@ -18,9 +16,7 @@
 			                      &quot;preview&quot; =&gt; true,
 			                      &quot;bookmarklet&quot; =&gt; &quot;selection&quot;));
 
-			$this-&gt;bookmarkletSelected(isset($_GET['url']) and
-			                           preg_match(&quot;/http:\/\/(www\.|[a-z]{2}\.)?youtube\.com\/watch\?v=([^&amp;]+)/&quot;,
-			                                      $_GET['url']));
+			$this-&gt;bookmarkletSelected($this-&gt;isVideo());
 
 			$this-&gt;setFilter(&quot;caption&quot;, &quot;markup_post_text&quot;);
 		}
@@ -55,8 +51,39 @@
 		public function embed_tag($video) {
 			if (preg_match(&quot;/http:\/\/(www\.|[a-z]{2}\.)?youtube\.com\/watch\?v=([^&amp;]+)/&quot;, $video, $matches)) {
 				return '&lt;object type=&quot;application/x-shockwave-flash&quot; class=&quot;object-youtube&quot; data=&quot;http://'.$matches[1].'youtube.com/v/'.$matches[2].'&quot; width=&quot;468&quot; height=&quot;391&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://'.$matches[1].'youtube.com/v/'.$matches[2].'&quot; /&gt;&lt;param name=&quot;FlashVars&quot; value=&quot;playerMode=embedded&quot; /&gt;&lt;/object&gt;';
+			} else if (preg_match(&quot;/http:\/\/(www\.)?vimeo.com\/([0-9]+)/&quot;, $video, $matches)) {
+				$site = get_remote($video);
+				preg_match('/&lt;div id=&quot;vimeo_player_1397502&quot; class=&quot;player&quot; style=&quot;width:([0-9]+)px;height:([0-9]+)px;&quot;&gt;/',
+				           $site,
+				           $scale);
+				return '&lt;object type=&quot;application/x-shockwave-flash&quot; class=&quot;object-vimeo&quot; width=&quot;'.$scale[1].'&quot; height=&quot;'.$scale[2].'&quot; data=&quot;http://www.vimeo.com/moogaloop.swf?clip_id='.$matches[2].'&amp;amp;server=www.vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=00adef&amp;amp;fullscreen=1&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.vimeo.com/moogaloop.swf?clip_id='.$matches[2].'&amp;amp;server=www.vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=00adef&amp;amp;fullscreen=1&quot; /&gt;&lt;/object&gt;';
 			} else {
 				return $video;
 			}
 		}
+		public function embed_tag_for($post, $max_width = 500) {
+			preg_match('/width=(&quot;|\')([0-9]+)(&quot;|\') height=(&quot;|\')([0-9]+)(&quot;|\')/', $post-&gt;embed, $scale);
+			$match  = $scale[0];
+			$width  = $scale[2];
+			$height = $scale[5];
+
+			if ($width &lt; $max_width)
+				return $post-&gt;embed;
+
+			$height = ($max_width / $width) * $height;
+
+			return str_replace($match, 'width=&quot;'.$max_width.'&quot; height=&quot;'.$height.'&quot;', $post-&gt;embed);
+		}
+		public function isVideo() {
+			if (!isset($_GET['url']))
+				return false;
+
+			if (preg_match(&quot;/http:\/\/(www\.|[a-z]{2}\.)?youtube\.com\/watch\?v=([^&amp;]+)/&quot;, $_GET['url']))
+				return true;
+
+			if (preg_match(&quot;/http:\/\/(www\.)?vimeo.com\/([0-9]+)/&quot;, $_GET['url']))
+				return true;
+
+			return false;
+		}
 	}</diff>
      <filename>feathers/video/video.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 {% extends &quot;content/post.twig&quot; %}
 
 {% block content %}
-						${ feathers.photo.image_tag_for(post, 434) }
+						${ feathers['photo'].image_tag_for(post, 434) }
 						&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 						${ post.caption | read_more }
 {% endblock %}
\ No newline at end of file</diff>
      <filename>themes/stardust/feathers/photo.twig</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 {% extends &quot;content/post.twig&quot; %}
 
 {% block content %}
-						$post.embed
+						${ feathers['video'].embed_tag_for(post, 434) }
 						&lt;br /&gt;
 						${ post.caption | read_more }
 {% endblock %}
\ No newline at end of file</diff>
      <filename>themes/stardust/feathers/video.twig</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b27ffecdb8416c07b44e120ccd4ae5bf12f12ea2</id>
    </parent>
  </parents>
  <author>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </author>
  <url>http://github.com/vito/chyrp/commit/5d0346555f81f526a535c3c70f8ca4553502aa3c</url>
  <id>5d0346555f81f526a535c3c70f8ca4553502aa3c</id>
  <committed-date>2008-07-24T07:39:22-07:00</committed-date>
  <authored-date>2008-07-24T07:39:22-07:00</authored-date>
  <message>Added Vimeo support to the Video feather, and now it resizes videos similar to the Photo feather.</message>
  <tree>06dbe32f94dbfbcdb05e2566cb45be788cd1279e</tree>
  <committer>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </committer>
</commit>
