Skip to content

Commit 29beca0

Browse files
committed
• Greasemonkey bundle from Henrik Nyh — http://www.greasespot.net/
git-svn-id: http://svn.textmate.org/trunk/Bundles/Greasemonkey.tmbundle@6857 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
0 parents  commit 29beca0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1882
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.toggle_log_comments</string>
12+
<key>input</key>
13+
<string>selection</string>
14+
<key>name</key>
15+
<string>Comment/Uncomment GM_logs</string>
16+
<key>output</key>
17+
<string>replaceSelectedText</string>
18+
<key>scope</key>
19+
<string>source.js.greasemonkey</string>
20+
<key>uuid</key>
21+
<string>0674F266-C30F-4089-95A4-DDB68E89439E</string>
22+
</dict>
23+
</plist>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.continue_header_url</string>
12+
<key>input</key>
13+
<string>document</string>
14+
<key>keyEquivalent</key>
15+
<string></string>
16+
<key>name</key>
17+
<string>Continue Header URL</string>
18+
<key>output</key>
19+
<string>afterSelectedText</string>
20+
<key>scope</key>
21+
<string>source.js.greasemonkey meta.header meta.directive</string>
22+
<key>uuid</key>
23+
<string>A38AD71E-0665-4E1E-8FEF-B2D22291BE0D</string>
24+
</dict>
25+
</plist>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string># Slightly modified version of the command for the JavaScript bundle by Thomas Aylott(?)
9+
10+
# index created using: curl -s 'http://devguru.com/technologies/javascript/index.asp'|grep -o '&lt;a href="[0-9]*.asp"&gt;[a-z][a-zA-Z]*&lt;/a&gt;'|perl -pe 's/&lt;a href="([^"]*)"&gt;([^&lt;]*)&lt;\/a&gt;/$2\t$1/'|sort|uniq|gzip &gt;data/dev_guru_index.gz
11+
12+
# First try GM docs
13+
14+
ref=$(ruby -e '
15+
GM_ENTRIES = %w{GM_addStyle GM_getValue GM_setValue GM_log GM_openInTab GM_registerMenuCommand GM_xmlhttpRequest unsafeWindow}
16+
look_up = ENV["TM_SELECTED_TEXT"] || ENV["TM_CURRENT_WORD"]
17+
puts look_up if GM_ENTRIES.include?(look_up)
18+
')
19+
20+
[[ -n "$ref" ]] &amp;&amp; exit_show_html "&lt;meta http-equiv='Refresh' content='0;URL=http://wiki.greasespot.net/$ref'&gt;"
21+
22+
# Then try JS docs
23+
24+
ref=$(zgrep -w "^${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}" "$TM_BUNDLE_SUPPORT/data/dev_guru_index.gz"|cut -f2)
25+
26+
[[ -n "$ref" ]] &amp;&amp; exit_show_html "&lt;meta http-equiv='Refresh' content='0;URL=http://devguru.com/technologies/javascript/$ref'&gt;"
27+
28+
echo "No documentation found for \"${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}\"."</string>
29+
<key>fallbackInput</key>
30+
<string>word</string>
31+
<key>input</key>
32+
<string>selection</string>
33+
<key>keyEquivalent</key>
34+
<string>^h</string>
35+
<key>name</key>
36+
<string>Documentation for Word / Selection</string>
37+
<key>output</key>
38+
<string>showAsTooltip</string>
39+
<key>scope</key>
40+
<string>source.js.greasemonkey</string>
41+
<key>uuid</key>
42+
<string>276FCB93-FB0E-49A9-A5E8-3714D4A0D0C6</string>
43+
</dict>
44+
</plist>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>open "http://userscripts.org/forums/1"</string>
9+
<key>input</key>
10+
<string>none</string>
11+
<key>keyEquivalent</key>
12+
<string>^~@h</string>
13+
<key>name</key>
14+
<string>Forum: US.O Script Development</string>
15+
<key>output</key>
16+
<string>showAsTooltip</string>
17+
<key>scope</key>
18+
<string>source.js.greasemonkey</string>
19+
<key>uuid</key>
20+
<string>2DB71989-6521-4590-8B27-67750D947891</string>
21+
</dict>
22+
</plist>

Commands/Gecko DOM Element.tmCommand

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>exit_show_html "&lt;meta http-equiv='Refresh' content='0;URL=http://developer.mozilla.org/en/docs/DOM:element#Properties'&gt;"</string>
9+
<key>input</key>
10+
<string>none</string>
11+
<key>keyEquivalent</key>
12+
<string>^~@h</string>
13+
<key>name</key>
14+
<string>Gecko DOM Element</string>
15+
<key>output</key>
16+
<string>showAsTooltip</string>
17+
<key>scope</key>
18+
<string>source.js.greasemonkey</string>
19+
<key>uuid</key>
20+
<string>E5F0DC32-D1AB-4CF0-8028-CC1972BEAECA</string>
21+
</dict>
22+
</plist>

Commands/GreaseSpot Wiki.tmCommand

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>exit_show_html "&lt;meta http-equiv='Refresh' content='0;URL=http://wiki.greasespot.net/Main_Page'&gt;"</string>
9+
<key>input</key>
10+
<string>none</string>
11+
<key>keyEquivalent</key>
12+
<string>^~@h</string>
13+
<key>name</key>
14+
<string>GreaseSpot Wiki</string>
15+
<key>output</key>
16+
<string>showAsTooltip</string>
17+
<key>scope</key>
18+
<string>source.js.greasemonkey</string>
19+
<key>uuid</key>
20+
<string>FA3989DC-F289-4E76-A441-57EA6A9C7141</string>
21+
</dict>
22+
</plist>

Commands/Help.tmCommand

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>. "$TM_SUPPORT_PATH/lib/webpreview.sh"
9+
html_header "Greasemonkey bundle help" "Greasemonkey"
10+
"$TM_SUPPORT_PATH/lib/markdown_to_help.rb" "$TM_BUNDLE_SUPPORT/help.markdown"
11+
html_footer</string>
12+
<key>input</key>
13+
<string>none</string>
14+
<key>keyEquivalent</key>
15+
<string></string>
16+
<key>name</key>
17+
<string>Help</string>
18+
<key>output</key>
19+
<string>showAsHTML</string>
20+
<key>scope</key>
21+
<string>source.js.greasemonkey</string>
22+
<key>uuid</key>
23+
<string>70D8CA43-2F62-416C-90DF-D1F83EB358CE</string>
24+
</dict>
25+
</plist>

Commands/IRC: #[email protected]

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>open "irc://irc.freenode.net/javascript"</string>
9+
<key>input</key>
10+
<string>none</string>
11+
<key>keyEquivalent</key>
12+
<string>^~@h</string>
13+
<key>name</key>
14+
<string>IRC: #javascript@Freenode</string>
15+
<key>output</key>
16+
<string>showAsTooltip</string>
17+
<key>scope</key>
18+
<string>source.js.greasemonkey</string>
19+
<key>uuid</key>
20+
<string>320A9A37-5564-4AA3-AE09-99369B9D4CA1</string>
21+
</dict>
22+
</plist>

Commands/Install and Edit.tmCommand

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.install_and_edit</string>
12+
<key>input</key>
13+
<string>document</string>
14+
<key>keyEquivalent</key>
15+
<string>@b</string>
16+
<key>name</key>
17+
<string>Install and Edit</string>
18+
<key>output</key>
19+
<string>showAsTooltip</string>
20+
<key>scope</key>
21+
<string>source.js.greasemonkey</string>
22+
<key>uuid</key>
23+
<string>D5D90653-B908-45AF-9BD1-D2ACAC494256</string>
24+
</dict>
25+
</plist>

Commands/Manage GM_Values.tmCommand

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.manage_gm_values</string>
12+
<key>input</key>
13+
<string>document</string>
14+
<key>name</key>
15+
<string>Manage GM_Values</string>
16+
<key>output</key>
17+
<string>showAsTooltip</string>
18+
<key>scope</key>
19+
<string>source.js.greasemonkey</string>
20+
<key>uuid</key>
21+
<string>5A9C9F8A-99E8-451D-BC0C-B5C2A8A9A45E</string>
22+
</dict>
23+
</plist>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.open_installed_script</string>
12+
<key>input</key>
13+
<string>none</string>
14+
<key>keyEquivalent</key>
15+
<string>^~@g</string>
16+
<key>name</key>
17+
<string>Open Installed Script…</string>
18+
<key>output</key>
19+
<string>showAsTooltip</string>
20+
<key>scope</key>
21+
<string>source.js.greasemonkey</string>
22+
<key>uuid</key>
23+
<string>17B22F8D-8631-4E3A-A1A2-CECD17F95320</string>
24+
</dict>
25+
</plist>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>saveActiveFile</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.reload_firefox(5) # Return in 5 secs</string>
12+
<key>input</key>
13+
<string>none</string>
14+
<key>keyEquivalent</key>
15+
<string>@R</string>
16+
<key>name</key>
17+
<string>Reload Firefox and Return</string>
18+
<key>output</key>
19+
<string>showAsTooltip</string>
20+
<key>scope</key>
21+
<string>source.js.greasemonkey</string>
22+
<key>uuid</key>
23+
<string>39AD9681-039A-400F-BBBA-C5B4D57A0C3E</string>
24+
</dict>
25+
</plist>

Commands/Reload Firefox.tmCommand

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>saveActiveFile</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.reload_firefox</string>
12+
<key>input</key>
13+
<string>none</string>
14+
<key>keyEquivalent</key>
15+
<string>@r</string>
16+
<key>name</key>
17+
<string>Reload Firefox</string>
18+
<key>output</key>
19+
<string>showAsTooltip</string>
20+
<key>scope</key>
21+
<string>source.js.greasemonkey</string>
22+
<key>uuid</key>
23+
<string>B5AD55C2-887E-4649-BCD0-C50273612E86</string>
24+
</dict>
25+
</plist>

Commands/Remove GM_logs.tmCommand

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.remove_logs</string>
12+
<key>input</key>
13+
<string>selection</string>
14+
<key>name</key>
15+
<string>Remove GM_logs</string>
16+
<key>output</key>
17+
<string>replaceSelectedText</string>
18+
<key>scope</key>
19+
<string>source.js.greasemonkey</string>
20+
<key>uuid</key>
21+
<string>C5B821F3-DDB1-4911-8C89-32FD98033769</string>
22+
</dict>
23+
</plist>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require "#{ENV['TM_BUNDLE_SUPPORT']}/greasemonkey.rb"
11+
Greasemonkey.new.uninstall_script</string>
12+
<key>input</key>
13+
<string>document</string>
14+
<key>name</key>
15+
<string>Uninstall Script…</string>
16+
<key>output</key>
17+
<string>showAsTooltip</string>
18+
<key>scope</key>
19+
<string>source.js.greasemonkey</string>
20+
<key>uuid</key>
21+
<string>36925E11-3A1B-4040-9A6E-629ABD7200D9</string>
22+
</dict>
23+
</plist>

0 commit comments

Comments
 (0)