xiki 0.5.1a → 0.5.3a
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -11
- data/README.markdown +67 -43
- data/bin/xiki +2 -15
- data/etc/command/xiki_command.rb +115 -41
- data/etc/command/xiki_process.rb +3 -7
- data/etc/install/el4r_setup.sh +5 -0
- data/etc/themes/Black_BG.notes +8 -0
- data/etc/themes/Dark_Metal.notes +0 -6
- data/etc/themes/Default.notes +24 -0
- data/etc/themes/Fall_Fonts.notes +6 -0
- data/etc/themes/Light_Gray_BG_Theme.notes +6 -0
- data/etc/themes/Orange_Path.notes +1 -1
- data/etc/themes/Pastel_Fonts.notes +6 -0
- data/etc/themes/Path_Mode_Line.notes +36 -0
- data/etc/themes/Rainbow_Fonts.notes +20 -0
- data/etc/themes/Shiny_Blue.notes +14 -18
- data/etc/themes/Shiny_Green.notes +0 -6
- data/etc/themes/White_BG.notes +5 -0
- data/etc/vim/vim_status.notes +32 -0
- data/etc/vim/xiki.vim +16 -0
- data/etc/wrappers/wrapper.rb +2 -2
- data/etc/www/index.rb +1 -1
- data/etc/www/public/error.html +47 -0
- data/etc/www/sinatra_server.rb +353 -0
- data/etc/www/web_server.rb +0 -252
- data/lib/xiki.rb +94 -26
- data/lib/{block.rb → xiki/block.rb} +0 -0
- data/lib/{bookmarks.rb → xiki/bookmarks.rb} +11 -10
- data/lib/{buffers.rb → xiki/buffers.rb} +10 -10
- data/lib/{clipboard.rb → xiki/clipboard.rb} +2 -2
- data/lib/{code.rb → xiki/code.rb} +3 -7
- data/lib/{code_tree.rb → xiki/code_tree.rb} +3 -3
- data/lib/{color.rb → xiki/color.rb} +4 -14
- data/lib/{console.rb → xiki/console.rb} +6 -0
- data/lib/{control_lock.rb → xiki/control_lock.rb} +5 -1
- data/lib/{control_tab.rb → xiki/control_tab.rb} +3 -1
- data/lib/{core_ext.rb → xiki/core_ext.rb} +7 -3
- data/lib/{cursor.rb → xiki/cursor.rb} +4 -5
- data/lib/{deletes.rb → xiki/deletes.rb} +0 -0
- data/lib/{diff_log.rb → xiki/diff_log.rb} +4 -4
- data/lib/{effects.rb → xiki/effects.rb} +5 -2
- data/lib/{environment.rb → xiki/environment.rb} +0 -0
- data/lib/{file_tree.rb → xiki/file_tree.rb} +34 -24
- data/lib/{files.rb → xiki/files.rb} +15 -5
- data/lib/{hide.rb → xiki/hide.rb} +0 -0
- data/lib/{history.rb → xiki/history.rb} +1 -0
- data/lib/{image.rb → xiki/image.rb} +0 -0
- data/lib/{incrementer.rb → xiki/incrementer.rb} +0 -0
- data/lib/{insert.rb → xiki/insert.rb} +0 -0
- data/lib/{irc.rb → xiki/irc.rb} +0 -0
- data/lib/{key_bindings.rb → xiki/key_bindings.rb} +7 -4
- data/lib/{keys.rb → xiki/keys.rb} +32 -36
- data/lib/{launcher.rb → xiki/launcher.rb} +42 -23
- data/lib/{line.rb → xiki/line.rb} +1 -1
- data/lib/{links.rb → xiki/links.rb} +0 -0
- data/lib/{location.rb → xiki/location.rb} +0 -0
- data/lib/{macros.rb → xiki/macros.rb} +0 -0
- data/lib/{man.rb → xiki/man.rb} +0 -0
- data/lib/{menu.rb → xiki/menu.rb} +62 -11
- data/lib/{merb.rb → xiki/merb.rb} +1 -1
- data/lib/{message.rb → xiki/message.rb} +0 -0
- data/lib/{meths.rb → xiki/meths.rb} +0 -0
- data/lib/{mode.rb → xiki/mode.rb} +0 -0
- data/lib/{move.rb → xiki/move.rb} +1 -1
- data/lib/{notes.rb → xiki/notes.rb} +41 -37
- data/lib/{numbers.rb → xiki/numbers.rb} +0 -0
- data/lib/{ol.rb → xiki/ol.rb} +2 -3
- data/lib/{ol_helper.rb → xiki/ol_helper.rb} +0 -0
- data/lib/{overlay.rb → xiki/overlay.rb} +0 -0
- data/lib/{pause_means_space.rb → xiki/pause_means_space.rb} +2 -2
- data/lib/{php.rb → xiki/php.rb} +0 -0
- data/lib/{projects.rb → xiki/projects.rb} +8 -1
- data/lib/{relinquish_exception.rb → xiki/relinquish_exception.rb} +0 -0
- data/lib/{remote.rb → xiki/remote.rb} +2 -2
- data/lib/{requirer.rb → xiki/requirer.rb} +3 -3
- data/lib/{rest_tree.rb → xiki/rest_tree.rb} +0 -0
- data/lib/{ruby.rb → xiki/ruby.rb} +0 -0
- data/lib/{ruby_console.rb → xiki/ruby_console.rb} +0 -0
- data/lib/{search.rb → xiki/search.rb} +7 -8
- data/lib/{search_term.rb → xiki/search_term.rb} +0 -0
- data/lib/{snippet.rb → xiki/snippet.rb} +0 -0
- data/lib/{specs.rb → xiki/specs.rb} +0 -0
- data/lib/{styles.rb → xiki/styles.rb} +8 -72
- data/lib/{svn.rb → xiki/svn.rb} +0 -0
- data/lib/{text_util.rb → xiki/text_util.rb} +2 -2
- data/lib/{tree.rb → xiki/tree.rb} +40 -32
- data/lib/{tree_cursor.rb → xiki/tree_cursor.rb} +0 -0
- data/lib/{trouble_shooting.rb → xiki/trouble_shooting.rb} +0 -0
- data/lib/{url_tree.rb → xiki/url_tree.rb} +0 -0
- data/lib/{view.rb → xiki/view.rb} +39 -16
- data/lib/xiki/vim/line.rb +8 -0
- data/lib/xiki/vim/tree.rb +9 -0
- data/lib/{window.rb → xiki/window.rb} +0 -0
- data/menus/address_book.rb +6 -4
- data/menus/agenda.rb +3 -3
- data/menus/amazon.rb +2 -2
- data/menus/applescript.rb +21 -10
- data/menus/black.menu +1 -0
- data/menus/bootstrap.rb +2 -7
- data/menus/browser.rb +8 -5
- data/menus/cassandra_db.rb +2 -2
- data/menus/chmod.rb +1 -1
- data/menus/conf.rb +5 -0
- data/menus/cookies.rb +1 -1
- data/menus/css.rb +2 -2
- data/menus/deck.rb +1 -1
- data/menus/dimensions_config.menu +30 -0
- data/menus/dimensions_config.rb +5 -0
- data/menus/docs.rb +33 -34
- data/menus/dotsies.rb +1 -0
- data/menus/emacs.rb +7 -2
- data/menus/firefox.rb +25 -25
- data/menus/git.rb +1 -1
- data/menus/gito.rb +2 -2
- data/menus/headings.rb +3 -3
- data/menus/ip.rb +2 -4
- data/menus/itunes.rb +9 -2
- data/menus/javascript.rb +3 -1
- data/menus/local_storage.rb +4 -4
- data/menus/mac.rb +2 -1
- data/menus/maps.rb +2 -2
- data/menus/models.rb +31 -0
- data/menus/mongo.rb +2 -2
- data/menus/piano.rb +47 -23
- data/menus/r.rb +57 -0
- data/menus/rails.rb +89 -27
- data/menus/redmine.rb +1 -1
- data/menus/sass.rb +1 -1
- data/menus/settings.menu +2 -0
- data/menus/technologies.rb +4 -1
- data/menus/web_interface.rb +58 -0
- data/menus/welcome.menu +18 -0
- data/menus/white.menu +1 -0
- data/menus/youtube.rb +32 -0
- data/spec/code_tree_spec.rb +1 -1
- data/spec/diff_log_spec.rb +4 -4
- data/spec/file_tree_spec.rb +2 -2
- data/spec/line_spec.rb +2 -2
- data/spec/menu_spec.rb +5 -5
- data/spec/ol_spec.rb +3 -3
- data/spec/remote_spec.rb +2 -2
- data/spec/search_spec.rb +2 -2
- data/spec/text_util_spec.rb +1 -1
- data/spec/tree_cursor_spec.rb +3 -3
- data/spec/tree_spec.rb +3 -3
- data/xiki.gemspec +22 -6
- metadata +311 -76
- data/menus/dir.rb +0 -8
File without changes
|
data/menus/address_book.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
class AddressBook
|
2
2
|
def self.names
|
3
|
-
names = Applescript.run "
|
4
|
-
names.
|
5
|
-
JSON[names]
|
3
|
+
names = Applescript.run "get the name of every person as string", :app=>"address book", :delimiter=>"|"
|
4
|
+
names.split "|"
|
6
5
|
end
|
7
6
|
|
8
7
|
def self.menu key=nil
|
9
8
|
return self.names.map{|o| "#{o}/"} if key.nil?
|
10
9
|
|
11
10
|
# Clean up a bit
|
12
|
-
|
11
|
+
# Broken by crap implementation of (do-applescript in emacs 23 that returns fucking "true" instead of the data)
|
12
|
+
# Emacs 22 implementation returned data structure as text - is there a way to force that in applescript?
|
13
|
+
txt = Applescript.run "get vcard of people whose name is \"#{key}\"", :delimiter=>"|", :app=>"address book"
|
14
|
+
|
13
15
|
txt.gsub! /, /, "\n"
|
14
16
|
txt.gsub! /:/, ": "
|
15
17
|
txt = txt.split("\n").select{|o| o !~ /^"\}|missing value|END: VCARD|VERSION: 3.0|BEGIN: VCARD/}.join("\n")
|
data/menus/agenda.rb
CHANGED
data/menus/amazon.rb
CHANGED
data/menus/applescript.rb
CHANGED
@@ -7,13 +7,11 @@ class Applescript
|
|
7
7
|
| tell application "iTunes" to playpause
|
8
8
|
- .api/
|
9
9
|
| Run applescript
|
10
|
-
@
|
10
|
+
@Applescript.run 'tell application "iTunes" to playpause'
|
11
11
|
|
|
12
12
|
| Shortcut to wrap "tell" in block
|
13
|
-
@
|
14
|
-
|
15
|
-
> Examples
|
16
|
-
| Applescript.run "iTunes", "playpause"
|
13
|
+
@Applescript.run "playpause", :app=>"iTunes"
|
14
|
+
@Applescript.run "get the name of every track of library playlist 1 as string", :app=>"iTunes", :delimiter=>"|"
|
17
15
|
`
|
18
16
|
end
|
19
17
|
|
@@ -27,20 +25,33 @@ class Applescript
|
|
27
25
|
".flash - ran it!"
|
28
26
|
end
|
29
27
|
|
30
|
-
|
28
|
+
#
|
29
|
+
# Applescript.run 'tell application "iTunes" to playpause'
|
30
|
+
# Applescript.run "playpause", :app=>"iTunes"
|
31
|
+
# Applescript.run "get the name of every track of library playlist 1 as string", :app=>"iTunes", :delimiter=>"|"
|
32
|
+
#
|
33
|
+
def self.run command, options={}
|
34
|
+
|
35
|
+
# If 2nd arg is string, assume "app", "command"
|
36
|
+
if options.is_a?(String)
|
37
|
+
options, command = {:app=>command}, options
|
38
|
+
end
|
39
|
+
|
40
|
+
extra = "set Applescript's text item delimiters to \"#{options[:delimiter]}\"\n" if options[:delimiter]
|
31
41
|
|
32
42
|
# If 2nd arg passed, treat first as app
|
33
|
-
if
|
43
|
+
if options[:app]
|
34
44
|
|
35
45
|
txt = "
|
36
|
-
tell application \"#{
|
37
|
-
#{command}
|
46
|
+
tell application \"#{options[:app]}\"
|
47
|
+
#{extra}#{command}
|
38
48
|
end tell
|
39
49
|
".unindent
|
40
50
|
|
41
51
|
return $el.do_applescript txt
|
42
52
|
end
|
43
53
|
|
44
|
-
$el.do_applescript
|
54
|
+
$el.do_applescript "#{extra}#{command}"
|
45
55
|
end
|
46
56
|
end
|
57
|
+
|
data/menus/black.menu
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<< themes/list/Black BG/
|
data/menus/bootstrap.rb
CHANGED
@@ -488,14 +488,13 @@ class Bootstrap
|
|
488
488
|
<meta charset="utf-8">
|
489
489
|
<title>#{@project_name}</title>
|
490
490
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
491
|
-
<meta name="description" content="">
|
492
|
-
<meta name="author" content="">
|
493
491
|
|
494
492
|
<!-- Le styles -->
|
495
493
|
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
|
496
494
|
<style>
|
497
495
|
body {
|
498
496
|
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
|
497
|
+
padding-bottom: 40px;
|
499
498
|
}
|
500
499
|
</style>
|
501
500
|
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet">
|
@@ -507,15 +506,11 @@ class Bootstrap
|
|
507
506
|
|
508
507
|
<!-- Le fav and touch icons -->
|
509
508
|
<link rel="shortcut icon" href="http://twitter.github.com/bootstrap/assets/ico/favicon.ico">
|
510
|
-
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-144-precomposed.png">
|
511
|
-
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-114-precomposed.png">
|
512
|
-
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-72-precomposed.png">
|
513
|
-
<link rel="apple-touch-icon-precomposed" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-57-precomposed.png">
|
514
509
|
</head>
|
515
510
|
|
516
511
|
<body>
|
517
512
|
|
518
|
-
<div class="navbar navbar-fixed-top">
|
513
|
+
<div class="navbar navbar-inverse navbar-fixed-top">
|
519
514
|
<div class="navbar-inner">
|
520
515
|
<div class="container">
|
521
516
|
#{navbar}
|
data/menus/browser.rb
CHANGED
@@ -29,10 +29,9 @@ class Browser
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.js txt, options={}
|
32
|
-
Firefox.
|
32
|
+
Firefox.exec txt, options
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
35
|
def self.open_in_browser
|
37
36
|
|
38
37
|
if Keys.prefix_u # Open as http://xiki/...
|
@@ -40,9 +39,13 @@ class Browser
|
|
40
39
|
return self.url "http://xiki/#{Tree.path}"
|
41
40
|
end
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
if FileTree.handles?
|
43
|
+
file = Tree.construct_path
|
44
|
+
else
|
45
|
+
# Put this somewhere wher it works in file tree as well
|
46
|
+
return Browser.html(Markdown.render(View.txt)) if View.extension == "markdown" # If .markdown, render it
|
47
|
+
file = View.file
|
48
|
+
end
|
46
49
|
|
47
50
|
mappings = Menu.menu_to_hash "/Users/craig/menus/url_mappings.menu"
|
48
51
|
|
data/menus/cassandra_db.rb
CHANGED
data/menus/chmod.rb
CHANGED
data/menus/conf.rb
ADDED
data/menus/cookies.rb
CHANGED
data/menus/css.rb
CHANGED
@@ -16,7 +16,7 @@ class Css
|
|
16
16
|
result;
|
17
17
|
`.unindent
|
18
18
|
|
19
|
-
result = Firefox.
|
19
|
+
result = Firefox.exec js
|
20
20
|
return "> No class attributes found!" if result == '""'
|
21
21
|
return result
|
22
22
|
end
|
@@ -48,7 +48,7 @@ class Css
|
|
48
48
|
txt.gsub!("\n", '\n')
|
49
49
|
txt.gsub!('"', '\"')
|
50
50
|
code = "$('head').append(\"<style>#{txt}</style>\")"
|
51
|
-
Firefox.
|
51
|
+
Firefox.exec code
|
52
52
|
|
53
53
|
nil
|
54
54
|
end
|
data/menus/deck.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
- full/View.dimensions_full; Styles.font_size 110
|
2
|
+
- full presentation/View.dimensions_full; Styles.font_size 260
|
3
|
+
- medium/Styles.font_size 160
|
4
|
+
- right/View.dimensions_set 119, 50, 573, 22; Styles.font_size 110
|
5
|
+
- right presentation/View.dimensions_set 53, 28, 274, 22; Styles.font_size 150
|
6
|
+
- small/View.dimensions_set 50, 15, 100, 22; Styles.font_size 110
|
7
|
+
- half/width = 166; width += 3 if ! View.scroll_bars; View.dimensions_set width, 58, 0, 925; Styles.font_size 110; Window.visibility('full')
|
8
|
+
- small/55, 20, 20, 22
|
9
|
+
- tiny/20, 10, 40, 22
|
10
|
+
- small font/Styles.font_size 110
|
11
|
+
- medium font/Styles.font_size 170
|
12
|
+
- large font/Styles.font_size 265
|
13
|
+
- prompt/left = (View.screen_width / 2) - 117; View.dimensions_set 30, 2, left, 41
|
14
|
+
- center/left = (View.screen_width / 2) - 187; View.dimensions_set 46, 15, left, 41
|
15
|
+
- large/145, 58, 46, 22
|
16
|
+
- website/View.dimensions_set 28, 16, 407, 234; Styles.font_size 110
|
17
|
+
|
18
|
+
> Won't be used
|
19
|
+
- screencast/View.dimensions_set 77, 21, 281, 418; Styles.font_size 140
|
20
|
+
- screencast half/View.dimensions_set 36, 21, 607, 418; Styles.font_size 140
|
21
|
+
- screencast window/View.dimensions_set 73, 17, 288, 447; Styles.font_size 140
|
22
|
+
- screencast half small/View.dimensions_set 65, 29, 571, 45; Styles.font_size 90
|
23
|
+
- skinny bar:
|
24
|
+
- right/28, 35, 504, 22
|
25
|
+
|
26
|
+
- screencast old:
|
27
|
+
- screencast half/View.dimensions_set 46, 24, 574, 39; Styles.font_size 120
|
28
|
+
- screencast dev/View.dimensions_set 89, 25, 279, 22; Styles.font_size 110
|
29
|
+
- screencast old/View.dimensions_set 77, 21, 281, 22; Styles.font_size 140
|
30
|
+
- screencast half old/42, 23, 561, 39
|
data/menus/docs.rb
CHANGED
@@ -4,55 +4,54 @@ class Docs
|
|
4
4
|
- Introduction/
|
5
5
|
| Most of the Xiki documentation is spread out among other menus, under
|
6
6
|
| their respective 'docs' menus.
|
7
|
-
|
7
|
+
|
8
8
|
> Here are some to check out first
|
9
9
|
@keys/docs/
|
10
10
|
@menu/docs/
|
11
11
|
@files/docs/
|
12
12
|
@view/docs/
|
13
|
-
|
|
14
13
|
- Try typing stuff/
|
15
|
-
> Try just typing a
|
14
|
+
> Try just typing a word
|
16
15
|
| Think of a menu name that might exist and sounds likely to solve your
|
17
16
|
| problem. For example, if you want to do something with images, try the
|
18
17
|
| 'images' menu. Type it on a blank line and double-click, or use
|
19
18
|
| open+menu (type Ctrl-O, Ctrl-M).
|
20
|
-
|
19
|
+
|
21
20
|
| Help us improve the docs, and contribute back to the Xiki project. If
|
22
21
|
| the menu doesn't exist, create it! If it exists, but could be improved,
|
23
22
|
| edit it! Many menus exist just to direct you to other menus. It takes
|
24
23
|
| only seconds to create them.
|
25
|
-
|
24
|
+
|
25
|
+
> See
|
26
26
|
@menu/docs/how_to_create/
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
- @docs/Try typing stuff/
|
55
|
-
|
|
27
|
+
- faq/
|
28
|
+
- What is Xiki?/
|
29
|
+
Xiki is an environment that can be used in several ways:
|
30
|
+
|
31
|
+
- Shell terminal on steroids
|
32
|
+
- Development environment for coding rails or node.js apps, etc.
|
33
|
+
- Framework for making lightweight user interfaces
|
34
|
+
- What does Xiki stand for?/
|
35
|
+
XIKI is short for eXecutable wIKI.
|
36
|
+
- What are Xiki's main dependencies?/
|
37
|
+
- An editor
|
38
|
+
- Emacs is fully supported
|
39
|
+
- Xiki takes advantage of many powerful Emacs features
|
40
|
+
- but you don't need to know Emacs to use Xiki
|
41
|
+
- El4r is used as a bridge
|
42
|
+
- Vim and support for other editors is on the way
|
43
|
+
- Xiki is implemented mostly in ruby
|
44
|
+
- but can use other languages like python, javascript, and coffeescript
|
45
|
+
- What's the best way to figure out how to do something?/
|
46
|
+
- @docs/Try typing stuff/
|
47
|
+
- How can I keep up to date with the latest Xiki happenings?/
|
48
|
+
- Follow http://twitter.com/xiki
|
49
|
+
- Join http://groups.google.com/group/xiki/
|
50
|
+
- Watch https://github.com/trogdoro/xiki
|
51
|
+
|
52
|
+
> From the shell console, you can type stuff like this:
|
53
|
+
$ xiki docs/Introduction
|
56
54
|
`
|
55
|
+
|
57
56
|
end
|
58
57
|
end
|
data/menus/dotsies.rb
CHANGED
data/menus/emacs.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
class Emacs
|
2
2
|
def self.menu
|
3
3
|
"
|
4
|
-
- .
|
4
|
+
- .version/
|
5
|
+
- .info pages/
|
5
6
|
- Keys/
|
6
7
|
- Prefix Keymaps/
|
7
8
|
- Keymaps/
|
@@ -9,7 +10,11 @@ class Emacs
|
|
9
10
|
"
|
10
11
|
end
|
11
12
|
|
12
|
-
def self.
|
13
|
+
def self.version
|
14
|
+
Tree.quote $el.emacs_version
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.info_pages name
|
13
18
|
View.to_upper
|
14
19
|
$el.info "(emacs)#{name}"
|
15
20
|
nil
|
data/menus/firefox.rb
CHANGED
@@ -34,7 +34,7 @@ class Firefox
|
|
34
34
|
- api/
|
35
35
|
| p Firefox.value "window.title"
|
36
36
|
| "The Title"
|
37
|
-
| Firefox.
|
37
|
+
| Firefox.exec "alert('hey')"
|
38
38
|
- docs/
|
39
39
|
> Js examples
|
40
40
|
@js/p('hi')
|
@@ -81,7 +81,7 @@ class Firefox
|
|
81
81
|
def self.js txt=nil
|
82
82
|
return Tree.<<("| $('div').toggle(1300) // Type some javascript here (to run in the browser)") if ! txt
|
83
83
|
|
84
|
-
Firefox.
|
84
|
+
Firefox.exec txt
|
85
85
|
end
|
86
86
|
|
87
87
|
def self.coffee txt=nil
|
@@ -89,7 +89,7 @@ class Firefox
|
|
89
89
|
|
90
90
|
txt = CoffeeScript.run_internal txt
|
91
91
|
|
92
|
-
Firefox.
|
92
|
+
Firefox.exec txt
|
93
93
|
".flash - ran in browser!"
|
94
94
|
end
|
95
95
|
|
@@ -104,17 +104,17 @@ class Firefox
|
|
104
104
|
|
105
105
|
prefix = Keys.prefix_n :clear=>true
|
106
106
|
if ! prefix
|
107
|
-
Firefox.
|
107
|
+
Firefox.exec("gBrowser.reload()", :browser=>true)
|
108
108
|
elsif prefix == 0
|
109
109
|
# Similar to reload, but field values will reset
|
110
|
-
Firefox.
|
110
|
+
Firefox.exec("document.location = document.location;")
|
111
111
|
else
|
112
112
|
|
113
113
|
tab = prefix - 1
|
114
114
|
if tab == -1 # If 0, close tab
|
115
115
|
self.close_tab
|
116
116
|
else # If number, switch to tab
|
117
|
-
Firefox.
|
117
|
+
Firefox.exec("gBrowser.tabContainer.selectedIndex = #{tab}", :browser=>true)
|
118
118
|
end
|
119
119
|
|
120
120
|
end
|
@@ -124,14 +124,14 @@ class Firefox
|
|
124
124
|
def self.close_tab
|
125
125
|
times = Keys.prefix_n :clear=>true
|
126
126
|
(times||1).times do
|
127
|
-
self.
|
127
|
+
self.exec "gBrowser.removeCurrentTab();", :browser=>true
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
131
|
def self.click
|
132
132
|
link = Keys.input(:prompt=>'Substring of link to click on: ')
|
133
133
|
|
134
|
-
Firefox.
|
134
|
+
Firefox.exec("
|
135
135
|
var a = $('a:contains(#{link}):first');
|
136
136
|
var url = a.attr('href');
|
137
137
|
if(url == '#')
|
@@ -142,11 +142,11 @@ class Firefox
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def self.back
|
145
|
-
Firefox.
|
145
|
+
Firefox.exec "history.back()"
|
146
146
|
end
|
147
147
|
|
148
148
|
def self.forward
|
149
|
-
Firefox.
|
149
|
+
Firefox.exec "history.forward()"
|
150
150
|
end
|
151
151
|
|
152
152
|
# # Copied from here (and modified):
|
@@ -194,7 +194,7 @@ class Firefox
|
|
194
194
|
|
195
195
|
|
196
196
|
|
197
|
-
def self.
|
197
|
+
def self.exec_block
|
198
198
|
|
199
199
|
prefix = Keys.prefix
|
200
200
|
|
@@ -224,7 +224,7 @@ class Firefox
|
|
224
224
|
return
|
225
225
|
end
|
226
226
|
|
227
|
-
def self.
|
227
|
+
def self.exec txt, options={}
|
228
228
|
|
229
229
|
result = Firefox.mozrepl_command txt, options
|
230
230
|
|
@@ -249,7 +249,7 @@ class Firefox
|
|
249
249
|
end
|
250
250
|
|
251
251
|
def self.value txt
|
252
|
-
self.
|
252
|
+
self.exec(txt).sub(/\A"/, "").sub(/"\z/, "")
|
253
253
|
end
|
254
254
|
|
255
255
|
def self.url url=nil, options={}
|
@@ -281,7 +281,7 @@ class Firefox
|
|
281
281
|
|
282
282
|
`.unindent
|
283
283
|
|
284
|
-
result = self.
|
284
|
+
result = self.exec js, :browser=>true
|
285
285
|
|
286
286
|
nil
|
287
287
|
end
|
@@ -313,13 +313,13 @@ class Firefox
|
|
313
313
|
html.gsub! "\n", ' '
|
314
314
|
|
315
315
|
code = "$('body').append(\"#{html}\")"
|
316
|
-
result = Firefox.
|
316
|
+
result = Firefox.exec code
|
317
317
|
nil
|
318
318
|
end
|
319
319
|
|
320
320
|
def self.jso txt=nil
|
321
321
|
return View.prompt("Add some js to output its result") if txt.nil?
|
322
|
-
Firefox.
|
322
|
+
Firefox.exec txt
|
323
323
|
end
|
324
324
|
|
325
325
|
def self.enter_log_javascript_line
|
@@ -354,7 +354,7 @@ class Firefox
|
|
354
354
|
|
355
355
|
def self.include_jquery_and_utils
|
356
356
|
|
357
|
-
Firefox.
|
357
|
+
Firefox.exec "
|
358
358
|
var s=document.createElement('script');
|
359
359
|
s.setAttribute('src', 'http://code.jquery.com/jquery.min.js');
|
360
360
|
document.getElementsByTagName('head')[0].appendChild(s);
|
@@ -369,7 +369,7 @@ class Firefox
|
|
369
369
|
|
370
370
|
def self.enter_as_url
|
371
371
|
if Keys.prefix_u
|
372
|
-
self.
|
372
|
+
self.exec "gBrowser.tabContainer.selectedIndex += 1", :browser=>true
|
373
373
|
end
|
374
374
|
|
375
375
|
url = Firefox.value('document.location.toString()')
|
@@ -459,7 +459,7 @@ class Firefox
|
|
459
459
|
return nil # Text without error, so don't load
|
460
460
|
end
|
461
461
|
|
462
|
-
self.
|
462
|
+
self.exec "
|
463
463
|
if(! document.getElementById('jqid')){
|
464
464
|
var s=document.createElement('script');
|
465
465
|
s.setAttribute('src', 'http://code.jquery.com/jquery.min.js'); s.setAttribute('id', 'jqid');
|
@@ -510,7 +510,7 @@ class Firefox
|
|
510
510
|
jQuery(\"#{selector}\").blink();
|
511
511
|
"
|
512
512
|
|
513
|
-
txt = Firefox.
|
513
|
+
txt = Firefox.exec code
|
514
514
|
nil
|
515
515
|
end
|
516
516
|
|
@@ -531,7 +531,7 @@ Launcher.add(/^\.[\w-]+$/) do |line|
|
|
531
531
|
end
|
532
532
|
|
533
533
|
Menu.js do |path|
|
534
|
-
Applescript.
|
534
|
+
Applescript.exec("Firefox", "activate") if Keys.prefix_u
|
535
535
|
Firefox.js Tree.rest(path)
|
536
536
|
nil
|
537
537
|
end
|
@@ -545,7 +545,7 @@ Menu.jsp do |path|
|
|
545
545
|
txt = Tree.leaf path
|
546
546
|
txt = txt.strip.sub(/;\z/, '') # Remove any semicolon at end
|
547
547
|
code = "p(#{txt})"
|
548
|
-
result = Firefox.
|
548
|
+
result = Firefox.exec code
|
549
549
|
nil
|
550
550
|
end
|
551
551
|
|
@@ -559,7 +559,7 @@ Menu.length do |path|
|
|
559
559
|
|
560
560
|
next View.prompt("Type a jquery selector to show length of result") if txt.nil?
|
561
561
|
txt = "$(\"#{txt}\").length"
|
562
|
-
txt = Firefox.
|
562
|
+
txt = Firefox.exec txt
|
563
563
|
|
564
564
|
# txt = Firefox.jso txt
|
565
565
|
Tree.<< txt, :no_slash=>1
|
@@ -571,7 +571,7 @@ Menu.jsc do |path| # - (js): js to run in firefox
|
|
571
571
|
return View.prompt("Add some js to run and output to firebug console.") if txt.nil?
|
572
572
|
txt = txt.strip.sub(/;\z/, '') # Remove any semicolon at end
|
573
573
|
code = "console.log(#{txt})"
|
574
|
-
Firefox.
|
574
|
+
Firefox.exec code
|
575
575
|
nil
|
576
576
|
end
|
577
577
|
|
@@ -598,7 +598,7 @@ end
|
|
598
598
|
Menu.click do |path|
|
599
599
|
nth = 0
|
600
600
|
txt = Tree.leaf path
|
601
|
-
Firefox.
|
601
|
+
Firefox.exec("$('a, *[onclick]').filter(':contains(#{txt}):eq(#{nth})').click()")
|
602
602
|
nil
|
603
603
|
end
|
604
604
|
|