Permalink
Browse files

Updated TUAW preview for new design

Fixed Make Tag Link command to provide better search results
Added recognition of end tag to Copy for posting and Prepare post in place
Added recognition of appid and excerpt headers to more template commands
  • Loading branch information...
1 parent 671c2ee commit 639fc1556f8058b4edeac39c01d27fef0b18b028 @ttscoff committed Dec 6, 2011
@@ -77,7 +77,7 @@ output.each_with_index { |x,i|
o.push("[#{x['title']}]: #{x['link']}")
bottom = bottom.gsub(/\((#{e_sh x['orig']}|#{e_sh x['link']})\)/,"[#{x['title']}]").gsub(/\[#{e_sh x['orig']}\]/,"[#{x['title']}]")
}
-puts top + "\n#{o.join("\n")}\n" + bottom</string>
+puts top + "\n#{o.join("\n")}\n" + bottom + "\n#{o.join("\n")}\n" + bottom</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
@@ -7,7 +7,7 @@
<key>command</key>
<string>if (`echo $TM_SCOPE|grep -iq "markdown"`) then
bodytext=`cat $STDIN|perl -pe '
- s/^(doctype|title|link|categories|tags)\: ?([^\n]+)?\n+//ig;
+ s/^(doctype|title|link|categories|tags|appid|excerpt)\: ?([^\n]+)?\n+//ig;
s/&lt;!--\s?more\s?--&gt;//ig;
s/^&lt;\d+&gt; .*$//g;
s/&lt;\d+&gt;//g;
@@ -30,7 +30,7 @@ offset = 0
linktext = TextMate::UI.request_string(:title =&gt; "Search Query",:prompt =&gt; "Enter terms to create a tag link",:default =&gt; input)
elegant_exit("Cancelled") unless linktext
-query = linktext + " site:#{blogsite}/tag"
+query = linktext + " site:#{blogsite} inanchor:tag"
escapedUrl = "http://api.search.live.net/xml.aspx?Appid=6B9E3A4B9F0D8F963A24815A0317BF1DCA3B0E9A&amp;query=#{e_url(query)}&amp;sources=web&amp;web.offset=#{offset}"
@@ -67,7 +67,8 @@ title = res['selectedMenuItem']['title']
TextMate.exit_replace_text url if ENV['TM_CURRENT_LINE'] =~ /^link: #{input}/
if (input.empty? &amp;&amp; !(ENV['TM_SCOPE'].scan(/markdown/).empty?) &amp;&amp; ENV['TM_CURRENT_LINE'] =~ /^(\s+)?$/) || ENV['TM_CURRENT_LINE'] =~ /^(#{input})?(\s+)?$/
- input = "tag" + title.chomp.gsub(/\s+/,"_")
+# input = "tag" + title.chomp.gsub(/\s+/,"_")
+ input = "tag" + linktext
print ERB.new(ENV['TM_REF_LINK_FORMAT']).result
else
print ERB.new(ENV['TM_BLINK_FORMAT']).result
@@ -7,7 +7,7 @@
<key>command</key>
<string>if (`echo $TM_SCOPE|grep -iq "markdown"`) then
bodytext=`cat $STDIN|perl -pe '
- s/^[^ \[]+\: ([^\n]+)?\n+//g;
+ s/^[^ \[]+\: ?([^\n]+)?\n+//g;
s/^&lt;\d+&gt; .*$//g;
s/&lt;\d+&gt;//g;
s/&lt;!--\s?more\s?--&gt;//g;
Oops, something went wrong.

0 comments on commit 639fc15

Please sign in to comment.