Merge git://github.com/graaff/tracks into opensearch

This commit is contained in:
Reinier Balt 2008-12-11 08:30:18 +01:00
commit c1d0e8d7cc
4 changed files with 28 additions and 0 deletions

View file

@ -1,5 +1,7 @@
class IntegrationsController < ApplicationController
skip_before_filter :login_required, :only => :search_plugin
def index
@page_title = 'TRACKS::Integrations'
end
@ -22,4 +24,12 @@ class IntegrationsController < ApplicationController
context = current_user.contexts.find params[:context_id]
render :partial => 'applescript2', :locals => { :context => context }
end
def search_plugin
@icon_data = [File.open(RAILS_ROOT + '/public/images/done.png').read].
pack('m').gsub(/\n/, '')
render :layout => false
end
end

View file

@ -0,0 +1,14 @@
xml.instruct!
xml.OpenSearchDescription 'xmlns' => "http://a9.com/-/spec/opensearch/1.1/" do
xml.ShortName Tracks
xml.Description 'Search in Tracks'
xml.InputEncoding 'UTF-8'
xml.Image("data:image/x-icon;base64," + @icon_data,
'width' => '16', 'height' => '16')
xml.Url 'type' => 'text/html', 'method' => 'GET',
'template' => url_for(:controller => 'search', :action => 'results',
:only_path => false) + '?search={searchTerms}'
end

View file

@ -19,6 +19,9 @@
<link rel="shortcut icon" href="<%= url_for(:controller => 'favicon.ico') %>" />
<%= auto_discovery_link_tag(:rss, {:controller => "todos", :action => "index", :format => 'rss', :token => "#{current_user.token}"}, {:title => "RSS feed of next actions"}) %>
<link rel="search" type="application/opensearchdescription+xml"
title="Tracks"
href="<%= search_plugin_path %>" />
<script type="text/javascript">
window.onload=function(){

View file

@ -65,6 +65,7 @@ ActionController::Routing::Routes.draw do |map|
map.preferences 'preferences', :controller => 'preferences', :action => 'index'
map.integrations 'integrations', :controller => 'integrations', :action => 'index'
map.search_plugin '/integrations/search_plugin.xml', :controller => 'integrations', :action => 'search_plugin', :format => 'xml'
map.resources :recurring_todos,
:member => {:toggle_check => :put, :toggle_star => :put}