Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor sample app custom renderer tweaks.

  • Loading branch information...
commit ff3cfef08dcee3669d91ac062d39763676adfe09 1 parent 776367a
@cowboy authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 sample_app/app.rb
View
12 sample_app/app.rb
@@ -4,6 +4,7 @@
require 'haml'
require 'mime/types'
require 'diffy'
+require 'uri'
require '../lib/gaucho'
@@ -39,10 +40,19 @@ def self.soundcloud(o)
<param name="movie" value="http://player.soundcloud.com/player.swf?url=#{url}&amp;show_comments=true&amp;auto_play=false&amp;color=ff7700"></param>
<param name="allowscriptaccess" value="always"></param>
<param name="wmode" value="window"></param>
- <embed wmode="window" allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=#{url}&amp;show_comments=true&amp;auto_play=false&amp;color=ff7700" type="application/x-shockwave-flash" width="100%"></embed>
+ <embed wmode="window" src="http://player.soundcloud.com/player.swf?url=#{url}&amp;show_comments=true&amp;auto_play=false&amp;color=ff7700"
+ allowscriptaccess="always" height="81" type="application/x-shockwave-flash" width="100%"></embed>
</object>
EOF
end
+
+ # Open AppleScript in Script Editor.
+ self.filter_map[:applescript] = [:applescript]
+ def self.applescript(o)
+ script = URI.escape(o.data)
+ %Q{<a href="applescript://com.apple.scripteditor?action=new&script=#{script}">} +
+ %Q{Click here</a> to open this AppleScript in Script Editor. #{code(o)}}
+ end
end
class PageNotFound < Sinatra::NotFound
Please sign in to comment.
Something went wrong with that request. Please try again.