diff --git a/Support/css/default/style.css b/Support/css/default/style.css index 2f28d2e..1cb15fa 100644 --- a/Support/css/default/style.css +++ b/Support/css/default/style.css @@ -70,6 +70,15 @@ padding: 2px; } +#todo_list .todo_hidden { + display: none; +} + +/* TODO: alternate row bg colors don't work anymore with filtering */ +/*#todo_list table.todo_content tr[class=""]:nth-child(even) { + background-color: rgba(127,127,127,0.15); +}*/ + #toplink { position: fixed; bottom: 1em; diff --git a/Support/template_head.rhtml b/Support/template_head.rhtml index 843c4cd..0291193 100644 --- a/Support/template_head.rhtml +++ b/Support/template_head.rhtml @@ -2,10 +2,15 @@ function goTo(id) { document.body.scrollTop = document.getElementById(id).offsetTop + 8; } + window["_todo"] = {}; + window["_tags"] = []; + <% tags.each do |tag| %> + window["_tags"].push("<%= tag[:label] %>"); + window["_todo"]["<%= tag[:label] %>"] = []; + <% end %>
-
+ \ No newline at end of file diff --git a/Support/todo.rb b/Support/todo.rb index dd7f70a..2b58d15 100644 --- a/Support/todo.rb +++ b/Support/todo.rb @@ -13,6 +13,14 @@ require "#{ENV['TM_SUPPORT_PATH']}/lib/web_preview" +if ARGV.size > 0 + if ARGV[0] == 'file' + ENV.delete 'TM_PROJECT_DIRECTORY' + elsif ARGV[0] == 'dir' + ENV['TM_PROJECT_DIRECTORY'] = File.dirname ENV['TM_FILEPATH'] + end +end + if ENV['TM_PROJECT_DIRECTORY'] == '/' puts html_head(:window_title => "TODO", :page_title => "TODO List", :sub_title => "Error") puts <<-HTML @@ -57,6 +65,7 @@ def TextMate.file_link (file, line = 0) STDOUT.flush +project_dir = ENV['TM_PROJECT_DIRECTORY'] home_dir = /^#{Regexp.escape ENV['HOME']}/ total = 0 TextMate.each_text_file do |file| @@ -70,7 +79,9 @@ def TextMate.file_link (file, line = 0) :file => file, :line => io.lineno, :content => content, - :type => tag[:label] + :type => tag[:label], + :rendered => '', + :index => tag[:matches].length } if tag[:label] == "RADAR" then url, display = "http://openradar.appspot.com/" + $2, "rdar://" + $2 @@ -78,11 +89,14 @@ def TextMate.file_link (file, line = 0) else match[:match] = html_escape($1) end + match[:clean] = match[:content].gsub(/\s+/, " ").gsub(/[^\w@`~!@#\$%\^&*\(\)-=+\[\]|\\\'\"\{\}<>,.\/\? ]/i, "") + tag[:matches] << match count = tag[:matches].length total += 1 puts ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_update.rhtml"), 0, '<>').result(binding) - tag[:rendered] += ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_item.rhtml"), 0, '<>').result binding + match[:rendered] = ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_item.rhtml"), 0, '<>').result binding + tag[:rendered] += match[:rendered] STDOUT.flush end end if File.readable?(file)