-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add ogg extension to Video drop action.
- Loading branch information
1 parent
a7b8756
commit 7822e77
Showing
4 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>command</key> | ||
<string>#!/usr/bin/env ruby20 | ||
|
||
if ENV['TM_DROPPED_FILE'] =~ /(?i)\.mp4$/ | ||
mimetype = 'mp4' | ||
elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.mp3$/ | ||
mimetype = 'mp3' | ||
elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.og[ga]$/ | ||
mimetype = 'ogg' | ||
elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.webm$/ | ||
mimetype = 'webm' | ||
elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.flac$/ | ||
mimetype = 'flac' | ||
elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.wave?$/ | ||
mimetype = 'wav' | ||
end | ||
|
||
puts <<~TAG | ||
<audio controls> | ||
<source src="#{ENV['TM_DROPPED_FILE']}" type="audio/#{mimetype}"${TM_XHTML}> | ||
|
||
<p>Your browser doesn't support HTML5 audio. Here is | ||
a <a href="#{ENV['TM_DROPPED_FILE']}">link to the audio</a> instead.</p> | ||
</audio> | ||
TAG | ||
</string> | ||
<key>draggedFileExtensions</key> | ||
<array> | ||
<string>mp4</string> | ||
<string>mp3</string> | ||
<string>ogg</string> | ||
<string>oga</string> | ||
<string>webm</string> | ||
<string>flac</string> | ||
<string>wav</string> | ||
<string>wave</string> | ||
</array> | ||
<key>name</key> | ||
<string>Insert Audio</string> | ||
<key>output</key> | ||
<string>insertAsSnippet</string> | ||
<key>scope</key> | ||
<string>text.html</string> | ||
<key>uuid</key> | ||
<string>01D7DB7F-0A1E-4086-9277-562FD85A58CC</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>content</key> | ||
<string><audio controls> | ||
<source src="${1:example.mp3}" type="audio/${1/(?i).*?(?:\.((mp4)|(mp3)|(webm)|(og[ga])|(flac)|(wave?)))?$/(?2:mp4)(?3:mp3)(?4:webm)(?5:ogg)(?6:flac)(?7:wav)(?1::unknown)/}"${TM_XHTML}> | ||
<p>Your browser doesn't support HTML5 audio. Here is | ||
a <a href="${1:example.mp3}">link to the audio</a> instead.</p> | ||
</audio></string> | ||
<key>name</key> | ||
<string>Audio</string> | ||
<key>scope</key> | ||
<string>text.html - B:meta.tag - B:text.html meta.embedded</string> | ||
<key>tabTrigger</key> | ||
<string>audio</string> | ||
<key>uuid</key> | ||
<string>8C826982-F460-43FA-BA31-476EE410F101</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters