mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-19 00:30:12 +01:00
parent
6149900e0c
commit
307e85287c
4 changed files with 28 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
class IntegrationsController < ApplicationController
|
class IntegrationsController < ApplicationController
|
||||||
|
|
||||||
|
skip_before_filter :login_required, :only => :search_plugin
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@page_title = 'TRACKS::Integrations'
|
@page_title = 'TRACKS::Integrations'
|
||||||
end
|
end
|
||||||
|
|
@ -22,4 +24,12 @@ class IntegrationsController < ApplicationController
|
||||||
context = current_user.contexts.find params[:context_id]
|
context = current_user.contexts.find params[:context_id]
|
||||||
render :partial => 'applescript2', :locals => { :context => context }
|
render :partial => 'applescript2', :locals => { :context => context }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search_plugin
|
||||||
|
@icon_data = [File.open(RAILS_ROOT + '/public/images/done.png').read].
|
||||||
|
pack('m').gsub(/\n/, '')
|
||||||
|
|
||||||
|
render :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
14
app/views/integrations/search_plugin.rxml
Normal file
14
app/views/integrations/search_plugin.rxml
Normal 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
|
||||||
|
|
||||||
|
|
@ -19,6 +19,9 @@
|
||||||
|
|
||||||
<link rel="shortcut icon" href="<%= url_for(:controller => 'favicon.ico') %>" />
|
<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"}) %>
|
<%= 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">
|
<script type="text/javascript">
|
||||||
window.onload=function(){
|
window.onload=function(){
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ ActionController::Routing::Routes.draw do |map|
|
||||||
|
|
||||||
map.preferences 'preferences', :controller => 'preferences', :action => 'index'
|
map.preferences 'preferences', :controller => 'preferences', :action => 'index'
|
||||||
map.integrations 'integrations', :controller => 'integrations', :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,
|
map.resources :recurring_todos,
|
||||||
:member => {:toggle_check => :put, :toggle_star => :put}
|
:member => {:toggle_check => :put, :toggle_star => :put}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue