xiki 0.5.1a → 0.5.3a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/Gemfile +1 -11
  2. data/README.markdown +67 -43
  3. data/bin/xiki +2 -15
  4. data/etc/command/xiki_command.rb +115 -41
  5. data/etc/command/xiki_process.rb +3 -7
  6. data/etc/install/el4r_setup.sh +5 -0
  7. data/etc/themes/Black_BG.notes +8 -0
  8. data/etc/themes/Dark_Metal.notes +0 -6
  9. data/etc/themes/Default.notes +24 -0
  10. data/etc/themes/Fall_Fonts.notes +6 -0
  11. data/etc/themes/Light_Gray_BG_Theme.notes +6 -0
  12. data/etc/themes/Orange_Path.notes +1 -1
  13. data/etc/themes/Pastel_Fonts.notes +6 -0
  14. data/etc/themes/Path_Mode_Line.notes +36 -0
  15. data/etc/themes/Rainbow_Fonts.notes +20 -0
  16. data/etc/themes/Shiny_Blue.notes +14 -18
  17. data/etc/themes/Shiny_Green.notes +0 -6
  18. data/etc/themes/White_BG.notes +5 -0
  19. data/etc/vim/vim_status.notes +32 -0
  20. data/etc/vim/xiki.vim +16 -0
  21. data/etc/wrappers/wrapper.rb +2 -2
  22. data/etc/www/index.rb +1 -1
  23. data/etc/www/public/error.html +47 -0
  24. data/etc/www/sinatra_server.rb +353 -0
  25. data/etc/www/web_server.rb +0 -252
  26. data/lib/xiki.rb +94 -26
  27. data/lib/{block.rb → xiki/block.rb} +0 -0
  28. data/lib/{bookmarks.rb → xiki/bookmarks.rb} +11 -10
  29. data/lib/{buffers.rb → xiki/buffers.rb} +10 -10
  30. data/lib/{clipboard.rb → xiki/clipboard.rb} +2 -2
  31. data/lib/{code.rb → xiki/code.rb} +3 -7
  32. data/lib/{code_tree.rb → xiki/code_tree.rb} +3 -3
  33. data/lib/{color.rb → xiki/color.rb} +4 -14
  34. data/lib/{console.rb → xiki/console.rb} +6 -0
  35. data/lib/{control_lock.rb → xiki/control_lock.rb} +5 -1
  36. data/lib/{control_tab.rb → xiki/control_tab.rb} +3 -1
  37. data/lib/{core_ext.rb → xiki/core_ext.rb} +7 -3
  38. data/lib/{cursor.rb → xiki/cursor.rb} +4 -5
  39. data/lib/{deletes.rb → xiki/deletes.rb} +0 -0
  40. data/lib/{diff_log.rb → xiki/diff_log.rb} +4 -4
  41. data/lib/{effects.rb → xiki/effects.rb} +5 -2
  42. data/lib/{environment.rb → xiki/environment.rb} +0 -0
  43. data/lib/{file_tree.rb → xiki/file_tree.rb} +34 -24
  44. data/lib/{files.rb → xiki/files.rb} +15 -5
  45. data/lib/{hide.rb → xiki/hide.rb} +0 -0
  46. data/lib/{history.rb → xiki/history.rb} +1 -0
  47. data/lib/{image.rb → xiki/image.rb} +0 -0
  48. data/lib/{incrementer.rb → xiki/incrementer.rb} +0 -0
  49. data/lib/{insert.rb → xiki/insert.rb} +0 -0
  50. data/lib/{irc.rb → xiki/irc.rb} +0 -0
  51. data/lib/{key_bindings.rb → xiki/key_bindings.rb} +7 -4
  52. data/lib/{keys.rb → xiki/keys.rb} +32 -36
  53. data/lib/{launcher.rb → xiki/launcher.rb} +42 -23
  54. data/lib/{line.rb → xiki/line.rb} +1 -1
  55. data/lib/{links.rb → xiki/links.rb} +0 -0
  56. data/lib/{location.rb → xiki/location.rb} +0 -0
  57. data/lib/{macros.rb → xiki/macros.rb} +0 -0
  58. data/lib/{man.rb → xiki/man.rb} +0 -0
  59. data/lib/{menu.rb → xiki/menu.rb} +62 -11
  60. data/lib/{merb.rb → xiki/merb.rb} +1 -1
  61. data/lib/{message.rb → xiki/message.rb} +0 -0
  62. data/lib/{meths.rb → xiki/meths.rb} +0 -0
  63. data/lib/{mode.rb → xiki/mode.rb} +0 -0
  64. data/lib/{move.rb → xiki/move.rb} +1 -1
  65. data/lib/{notes.rb → xiki/notes.rb} +41 -37
  66. data/lib/{numbers.rb → xiki/numbers.rb} +0 -0
  67. data/lib/{ol.rb → xiki/ol.rb} +2 -3
  68. data/lib/{ol_helper.rb → xiki/ol_helper.rb} +0 -0
  69. data/lib/{overlay.rb → xiki/overlay.rb} +0 -0
  70. data/lib/{pause_means_space.rb → xiki/pause_means_space.rb} +2 -2
  71. data/lib/{php.rb → xiki/php.rb} +0 -0
  72. data/lib/{projects.rb → xiki/projects.rb} +8 -1
  73. data/lib/{relinquish_exception.rb → xiki/relinquish_exception.rb} +0 -0
  74. data/lib/{remote.rb → xiki/remote.rb} +2 -2
  75. data/lib/{requirer.rb → xiki/requirer.rb} +3 -3
  76. data/lib/{rest_tree.rb → xiki/rest_tree.rb} +0 -0
  77. data/lib/{ruby.rb → xiki/ruby.rb} +0 -0
  78. data/lib/{ruby_console.rb → xiki/ruby_console.rb} +0 -0
  79. data/lib/{search.rb → xiki/search.rb} +7 -8
  80. data/lib/{search_term.rb → xiki/search_term.rb} +0 -0
  81. data/lib/{snippet.rb → xiki/snippet.rb} +0 -0
  82. data/lib/{specs.rb → xiki/specs.rb} +0 -0
  83. data/lib/{styles.rb → xiki/styles.rb} +8 -72
  84. data/lib/{svn.rb → xiki/svn.rb} +0 -0
  85. data/lib/{text_util.rb → xiki/text_util.rb} +2 -2
  86. data/lib/{tree.rb → xiki/tree.rb} +40 -32
  87. data/lib/{tree_cursor.rb → xiki/tree_cursor.rb} +0 -0
  88. data/lib/{trouble_shooting.rb → xiki/trouble_shooting.rb} +0 -0
  89. data/lib/{url_tree.rb → xiki/url_tree.rb} +0 -0
  90. data/lib/{view.rb → xiki/view.rb} +39 -16
  91. data/lib/xiki/vim/line.rb +8 -0
  92. data/lib/xiki/vim/tree.rb +9 -0
  93. data/lib/{window.rb → xiki/window.rb} +0 -0
  94. data/menus/address_book.rb +6 -4
  95. data/menus/agenda.rb +3 -3
  96. data/menus/amazon.rb +2 -2
  97. data/menus/applescript.rb +21 -10
  98. data/menus/black.menu +1 -0
  99. data/menus/bootstrap.rb +2 -7
  100. data/menus/browser.rb +8 -5
  101. data/menus/cassandra_db.rb +2 -2
  102. data/menus/chmod.rb +1 -1
  103. data/menus/conf.rb +5 -0
  104. data/menus/cookies.rb +1 -1
  105. data/menus/css.rb +2 -2
  106. data/menus/deck.rb +1 -1
  107. data/menus/dimensions_config.menu +30 -0
  108. data/menus/dimensions_config.rb +5 -0
  109. data/menus/docs.rb +33 -34
  110. data/menus/dotsies.rb +1 -0
  111. data/menus/emacs.rb +7 -2
  112. data/menus/firefox.rb +25 -25
  113. data/menus/git.rb +1 -1
  114. data/menus/gito.rb +2 -2
  115. data/menus/headings.rb +3 -3
  116. data/menus/ip.rb +2 -4
  117. data/menus/itunes.rb +9 -2
  118. data/menus/javascript.rb +3 -1
  119. data/menus/local_storage.rb +4 -4
  120. data/menus/mac.rb +2 -1
  121. data/menus/maps.rb +2 -2
  122. data/menus/models.rb +31 -0
  123. data/menus/mongo.rb +2 -2
  124. data/menus/piano.rb +47 -23
  125. data/menus/r.rb +57 -0
  126. data/menus/rails.rb +89 -27
  127. data/menus/redmine.rb +1 -1
  128. data/menus/sass.rb +1 -1
  129. data/menus/settings.menu +2 -0
  130. data/menus/technologies.rb +4 -1
  131. data/menus/web_interface.rb +58 -0
  132. data/menus/welcome.menu +18 -0
  133. data/menus/white.menu +1 -0
  134. data/menus/youtube.rb +32 -0
  135. data/spec/code_tree_spec.rb +1 -1
  136. data/spec/diff_log_spec.rb +4 -4
  137. data/spec/file_tree_spec.rb +2 -2
  138. data/spec/line_spec.rb +2 -2
  139. data/spec/menu_spec.rb +5 -5
  140. data/spec/ol_spec.rb +3 -3
  141. data/spec/remote_spec.rb +2 -2
  142. data/spec/search_spec.rb +2 -2
  143. data/spec/text_util_spec.rb +1 -1
  144. data/spec/tree_cursor_spec.rb +3 -3
  145. data/spec/tree_spec.rb +3 -3
  146. data/xiki.gemspec +22 -6
  147. metadata +311 -76
  148. data/menus/dir.rb +0 -8
File without changes
@@ -1,15 +1,17 @@
1
1
  class AddressBook
2
2
  def self.names
3
- names = Applescript.run "address book", "get the name of every person"
4
- names.sub! /^\{(.+)\}/, "[\\1]"
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
- txt = Applescript.run "address book", "get vcard of people whose name is \"#{key}\""
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
@@ -1,6 +1,6 @@
1
- require 'view'
2
- require 'line'
3
- require 'effects'
1
+ require 'xiki/view'
2
+ require 'xiki/line'
3
+ require 'xiki/effects'
4
4
 
5
5
 
6
6
  class Agenda
data/menus/amazon.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'view'
2
- require 'effects'
1
+ require 'xiki/view'
2
+ require 'xiki/effects'
3
3
 
4
4
  class Amazon
5
5
 
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
- @ Applescript.run 'tell application "iTunes" to playpause'
10
+ @Applescript.run 'tell application "iTunes" to playpause'
11
11
  |
12
12
  | Shortcut to wrap "tell" in block
13
- @ Applescript.run "iTunes", "playpause"
14
- - .docs/
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
- def self.run txt, command=nil
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 command.present?
43
+ if options[:app]
34
44
 
35
45
  txt = "
36
- tell application \"#{txt}\"
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 txt
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.run txt, options
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
- file = FileTree.tree_path_or_this_file
44
-
45
- return Browser.html Markdown.render(View.txt) if View.extension == "markdown" # If .markdown, render it
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
 
@@ -1,7 +1,7 @@
1
1
  gem 'cassandra'
2
- require 'cassandra'
2
+ require 'xiki/cassandra'
3
3
 
4
- require "launcher"
4
+ require 'xiki/launcher'
5
5
 
6
6
  # Cassandras structure:
7
7
  # keyspace ->* table family ->* key (->* super column) ->* column
data/menus/chmod.rb CHANGED
@@ -19,7 +19,7 @@ class Chmod
19
19
  # Arg passed, so do chmod
20
20
 
21
21
  command = "chmod #{mode} \"#{path}\""
22
- command = "sudo #{command}" if ! File.writable? path
22
+ command = "sudo #{command}" # if ! File.writable? path
23
23
 
24
24
  Console.run command, :dir=>path
25
25
 
data/menus/conf.rb ADDED
@@ -0,0 +1,5 @@
1
+ class Conf
2
+ def self.menu *args
3
+ Launcher.menu_keys.select{|o| o =~ /config/}.map{|o| "<< #{o}/"}.join("\n")
4
+ end
5
+ end
data/menus/cookies.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  class Cookies
2
2
  def self.menu key=nil, val=nil
3
3
 
4
- txt = Firefox.run "document.cookie"
4
+ txt = Firefox.exec "document.cookie"
5
5
  hash = txt.split('; ').inject({}) do |acc, e|
6
6
  k, v = e.match(/(.*?)=(.*)/)[1..2]
7
7
  acc[k] = v
data/menus/css.rb CHANGED
@@ -16,7 +16,7 @@ class Css
16
16
  result;
17
17
  `.unindent
18
18
 
19
- result = Firefox.run js
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.run code #, :jquery=>1
51
+ Firefox.exec code
52
52
 
53
53
  nil
54
54
  end
data/menus/deck.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "mode"
1
+ require 'xiki/mode'
2
2
 
3
3
  # Makes text in .deck files huge, and makes left and right arrow keys treat
4
4
  # headings as slides.
@@ -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
@@ -0,0 +1,5 @@
1
+ class DimensionsConfig
2
+ def self.menu name, txt
3
+ Window.dimensions_set txt
4
+ end
5
+ end
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 menu
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
- - Other places to look/
29
- - You may want to check out__
30
- __
31
- - for developers
32
- - code dirs/__
33
- > All Commands
34
- @all/
35
- |
36
- - FAQ/
37
- > What is Xiki?
38
- | Xiki is an environment that can be used in several ways:
39
- | - Shell terminal on steroids
40
- | - Development environment for coding rails or node.js apps, etc.
41
- | - Framework for making lightweight user interfaces
42
- |
43
- > What does Xiki stand for?
44
- | XIKI is short for eXecutable wIKI
45
- |
46
- > What are Xiki's main dependencies?
47
- | - Xiki runs inside of Emacs
48
- | - and takes advantage of many powerful Emacs features
49
- | - but you don't need to know Emacs to use Xiki
50
- | - Xiki is implemented mostly in ruby
51
- | - but can use other languages like python, javascript, and coffeescript
52
- |
53
- > What's the best way to figure out how to do something?
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
@@ -23,6 +23,7 @@ class Dotsies
23
23
 
24
24
  > See
25
25
  << dotsies tweets/
26
+ << youtube/use dotsies in transcript/
26
27
  `
27
28
  end
28
29
 
data/menus/emacs.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  class Emacs
2
2
  def self.menu
3
3
  "
4
- - .info/
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.info name
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.run "alert('hey')"
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.run txt #, :jquery=>1
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.run txt #, :jquery=>1
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.run("gBrowser.reload()", :browser=>true)
107
+ Firefox.exec("gBrowser.reload()", :browser=>true)
108
108
  elsif prefix == 0
109
109
  # Similar to reload, but field values will reset
110
- Firefox.run("document.location = document.location;")
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.run("gBrowser.tabContainer.selectedIndex = #{tab}", :browser=>true)
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.run "gBrowser.removeCurrentTab();", :browser=>true
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.run("
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.run "history.back()"
145
+ Firefox.exec "history.back()"
146
146
  end
147
147
 
148
148
  def self.forward
149
- Firefox.run "history.forward()"
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.run_block
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.run txt, options={}
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.run(txt).sub(/\A"/, "").sub(/"\z/, "")
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.run js, :browser=>true
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.run code #, :jquery=>1
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.run txt #, :jquery=>1
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.run "
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.run "gBrowser.tabContainer.selectedIndex += 1", :browser=>true
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.run "
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.run code #, :jquery=>1
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.run("Firefox", "activate") if Keys.prefix_u
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.run code #, :jquery=>1
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.run txt #, :jquery=>1
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.run code #, :jquery=>1
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.run("$('a, *[onclick]').filter(':contains(#{txt}):eq(#{nth})').click()") #, :jquery=>1)
601
+ Firefox.exec("$('a, *[onclick]').filter(':contains(#{txt}):eq(#{nth})').click()")
602
602
  nil
603
603
  end
604
604