Remove applescript integration. Closes #1723

This commit is contained in:
Matteo Giaccone 2015-01-01 23:50:50 +00:00
parent 13f8023ca0
commit 177971a70e
19 changed files with 3 additions and 450 deletions

View file

@ -725,23 +725,6 @@ var ContextListPage = {
}
};
var IntegrationsPage = {
setup_behavior: function() {
$(document).on("change",'#applescript1-contexts', function(){
IntegrationsPage.get_script_for_context("#applescript1", "get_applescript1", this.value);
});
$(document).on("change",'#applescript2-contexts', function(){
IntegrationsPage.get_script_for_context("#applescript2", "get_applescript2", this.value);
});
$(document).on("change",'#quicksilver-contexts', function(){
IntegrationsPage.get_script_for_context("#quicksilver", "get_quicksilver_applescript", this.value);
});
},
get_script_for_context: function(element, getter, context){
generic_get_script_for_list(element, "integrations/"+getter, "context_id="+context);
}
};
var FeedsPage = {
setup_behavior: function() {
/* TODO: blocking of dropdown */
@ -1166,7 +1149,7 @@ $(document).ready(function() {
TodoItemsContainer.setup_container_toggles();
/* enable page specific behavior */
$([ 'PreferencesPage', 'IntegrationsPage', 'NotesPage', 'ProjectListPage', 'ContextListPage',
$([ 'PreferencesPage', 'NotesPage', 'ProjectListPage', 'ContextListPage',
'FeedsPage', 'RecurringTodosPage', 'TodoItems', 'TracksPages',
'TracksForm', 'SearchPage', 'UsersPage' ]).each(function() {
eval(this+'.setup_behavior();');
@ -1175,3 +1158,4 @@ $(document).ready(function() {
/* Gets called from all AJAX callbacks, too */
enable_rich_interaction();
});

View file

@ -12,18 +12,6 @@ class IntegrationsController < ApplicationController
@page_title = 'TRACKS::REST API Documentation'
end
def get_quicksilver_applescript
get_applescript('quicksilver_applescript')
end
def get_applescript1
get_applescript('applescript1')
end
def get_applescript2
get_applescript('applescript2')
end
def search_plugin
@icon_data = [File.open(File.join(Rails.root, 'app', 'assets', 'images', 'done.png')).read].
pack('m').gsub(/\n/, '')
@ -72,9 +60,5 @@ class IntegrationsController < ApplicationController
return result
end
def get_applescript(partial_name)
context = current_user.contexts.find params[:context_id]
render :partial => partial_name, :locals => { :context => context }
end
end

View file

@ -1,20 +0,0 @@
(* Pops up a dialog box in which you enter a description for a next action.
It then creates that next action in Tracks in the context specified below.
*)
set myUsername to "<%= current_user.login %>"
set myToken to "<%= current_user.token %>"
set myContextID to <%= context.id %> (* <%= context.name %> *)
-- Display dialog to enter your description
display dialog "<%= t('integrations.applescript_next_action_prompt') %>" default answer ""
set myDesc to text returned of the result
-- Now send all that info to Tracks
-- Edit the URL of your Tracks installation if necessary"
tell application "<%= root_url %>backend/api"
set returnValue to call xmlrpc {method name:"NewTodo", parameters:{myUsername, myToken, myContextID, myDesc}}
end tell
-- Show the ID of the newly created next action
display dialog "<%= t('integrations.applescript_success_before_id') %> " & returnValue & " <%= t('integrations.applescript_success_after_id') %>"

View file

@ -1,82 +0,0 @@
(*
Script to grab the sender and subject of the selected
Mail message(s), and create new next action(s) with description
"Email [sender] about [subject]"
If you have Growl, it pops a notification up with the id of
the newly created action.
*)
(* Edit appropriately for your setup *)
property myUsername : "<%= current_user.login %>"
property myToken : "<%= current_user.token %>"
property myContextID : <%= context.id %> (* <%= context.name %> *)
-- this string is used when the message subject is empty
property emptySubject : "No Subject Specified"
-- Get the selected email in Mail
tell application "Mail"
set theSelection to the selection
if the length of theSelection is less than 1 then
display dialog "One or more messages must be selected." buttons {"OK"} default button 1 with icon caution
else
repeat with theMessage in theSelection
my importMessage(theMessage)
end repeat
end if
end tell
on importMessage(theMessage)
-- Get the info from the email message
tell application "Mail"
try
set theSender to the sender of theMessage
set theSubject to subject of theMessage
if theSubject is equal to "" then set theSubject to emptySubject
set theMessageId to message id of theMessage
-- Construct the description string from the email info
set myDesc to "Email " & theSender & " about " & theSubject
-- Trim the string to 100 characters otherwise it won't validate
if length of myDesc > 100 then
set myDesc to characters 1 thru 100 of myDesc
end if
set myNote to "message://<" & theMessageId & ">"
end try
end tell
-- Now send all that info to Tracks
-- Edit the URL of your Tracks installation if necessary"
tell application "<%= root_url %>backend/api"
set returnValue to call xmlrpc {method name:"NewTodo", parameters:{myUsername, myToken, myContextID, myDesc, myNote}}
end tell
(* Growl support - comment out or delete this section if
you don't have Growl *)
tell application "GrowlHelperApp"
set the allNotificationsList to ¬
{"Tracks Notification"}
-- Make a list of the notifications
-- that will be enabled by default.
-- Those not enabled by default can be enabled later
-- in the 'Applications' tab of the growl prefpane.
set the enabledNotificationsList to ¬
{"Tracks Notification"}
-- Register our script with growl.
-- You can optionally (as here) set a default icon
-- for this script's notifications.
register as application ¬
"Tracks Applescript" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Script Editor"
set growlDescription to "Action with ID " & returnValue & " was created."
notify with name "Tracks Notification" title "New action sent to Tracks" description growlDescription application name "Tracks Applescript" icon of application "Script Editor.app"
end tell
(* End of Growl section *)
end importMessage

View file

@ -1,15 +0,0 @@
using terms from application "Quicksilver"
on process text ThisClipping
set myUsername to "<%= current_user.login %>"
set myToken to "<%= current_user.token %>"
set myContextID to <%= context.id %> (* <%= context.name %> *)
tell application "<%= root_url %>backend/api"
set returnValue to call xmlrpc {method name:"NewTodo", parameters:{myUsername, myToken, myContextID, ThisClipping}}
end tell
tell application "Quicksilver"
show notification "Tracks: action added."
end tell
end process text
end using terms from

View file

@ -8,9 +8,6 @@
Weitere Informationen finden Sie in der <%= link_to "Entwickler Documentation der Tracks' REST API", url_for(:action => 'rest_api') %> (englisch).</p>
<br/><p>Inhalt:</p>
<ul>
<li><a href="#applescript1-section">Eine Aktion mit Applescript hinzuf&uuml;gen</a></li>
<li><a href="#applescript2-section">Eine Aktion anhand der aktuell in Mail.app selektierten Nachricht erstellen</a></li>
<li><a href="#quicksilver-applescript-section">Aktionen mit Quicksilver und Applescript erstellen</a></li>
<li><a href="#email-cron-section">Anstehende Aufgaben automatisch sich via E-Mail zusenden lassen</a></li>
<li><a href="#message_gateway">Tracks mit einem Mail-Server integrieren, um Aufgaben via E-Mail zu erstellen</a></li>
<li><a href="#google_gadget">Tracks zu Ihrer Google Gmail Seite hinzuf&uuml;gen</a></li>
@ -20,71 +17,6 @@
in unserem Tipps&amp;Tricks Forum</a>, damit wir es f&uuml;r die n&auml;chsten Versionen ber&uuml;cksichtigen k&ouml;nnen.
</p>
<a name="applescript1-section"> </a>
<h2>Eine Aktion mit Applescript hinzuf&uuml;gen</h2>
<p>Dieses Beispiel-Script zeigt einen Dialog, welcher nach einer Beschreibung fragt und die Aufgabe in einem festen Kontext anlegt.</p>
<% if has_contexts -%>
<ol>
<li>W&auml;hlen Sie den Kontext, f&uuml;r welchen die Aktion erstellt werden soll: <select name="applescript1-contexts" id="applescript1-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Kopieren Sie das AppleScript in die Zwischenablage.<br />
<textarea id="applescript1" name="applescript1" rows="15"><%= render :partial => 'applescript1', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>&Ouml;ffnen Sie den Script Editor und f&uuml;gen die Daten in ein neues Script ein.</li>
<li>Kompilieren und speichern Sie das Script, um es bei Bedarf einzusetzen.</li>
</ol>
<% else %>
<br/><p id="no_context_msg"><i>Sie haben noch keinen Kontext angelegt. Dieses Script ist automatisch verf&uuml;gbar, sobald Sie Ihren ersten Kontext angelegt haben.</i></p>
<% end %>
<a name="applescript2-section"> </a>
<h2>Add an Action with Applescript based on the currently selected Email in Mail.app</h2>
<p>This script takes the sender and subject of the selected email(s) in Mail and creates a new action for each one, with the description, "Email [sender] about [subject]". The description gets truncated to 100 characters (the validation limit for the field) if it is longer than that. It also has Growl notifications if you have Growl installed.</p>
<% if has_contexts -%>
<ol>
<li>Choose the context you want to add actions to: <select name="applescript2-contexts" id="applescript2-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Copy the Applescript below to the clipboard.<br />
<textarea id="applescript2" name="applescript2" rows="15"><%= render :partial => 'applescript2', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open Script Editor and paste the script into a new document.</li>
<li>Compile and save the script to the ~/Library/Scriipts/Mail Scripts directory.</li>
<li>For more information on using AppleScript with Mail.app, see <a href="http://www.apple.com/applescript/mail/" title="Scriptable Applications: Mail">this overview</a>.</li>
</ol>
<% else %>
<br/><p><i>You do not have any context yet. The script will be available after you add your first context</i></p>
<% end %>
<a name="quicksilver-applescript-section"></a>
<h2>Add Actions with Quicksilver and Applescript</h2>
<p>This integration will allow you to add actions to Tracks via <a href="http://quicksilver.blacktree.com/">Quicksilver</a>.</p>
<% if has_contexts -%>
<ol>
<li>Choose the context you want to add actions to: <select name="quicksilver-contexts" id="quicksilver-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Copy the Applescript below to the clipboard.<br />
<textarea id="quicksilver" name="quicksilver" rows="15"><%= render :partial => 'quicksilver_applescript', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open Script Editor and paste the script into a new document.</li>
<li>Compile and save the script as "Add to Tracks.scpt" in ~/Library/Application Support/Quicksilver/Actions/ (you may need to create the Actions directory)</li>
<li>Restart Quicksilver</li>
<li>Activate Quicksilver (Ctrl+Space by default)</li>
<li>Press "." to put quicksilver into text mode</li>
<li>Type the description of the next action you want to add</li>
<li>Press tab to switch to the action pane.</li>
<li>By typing or scrolling, choose the "Add to Tracks" action.</li>
</ol>
<% else %>
<br/><p><i>You do not have any context yet. The script will be available after you add your first context</i></p>
<% end %>
<a name="email-cron-section"> </a>
<h2>Automatically Email Yourself Upcoming Actions</h2>

View file

@ -8,9 +8,6 @@
See also <%= link_to "developer documentation for Tracks' REST API", url_for(:action => 'rest_api') %>.</p>
<br/><p>Contents:</p>
<ul>
<li><a href="#applescript1-section">Add an Action with Applescript</a></li>
<li><a href="#applescript2-section">Add an Action with Applescript based on the currently selected Email in Mail.app</a></li>
<li><a href="#quicksilver-applescript-section">Add Actions with Quicksilver and Applescript</a></li>
<li><a href="#email-cron-section">Automatically Email Yourself Upcoming Actions</a></li>
<li><a href="#message_gateway">Integrate Tracks with an email server to be able to send an action through email to Tracks</a></li>
<li><a href="#mailgun">Send emails to Tracks with Mailgun</a>
@ -22,71 +19,6 @@
it in our Tips and Tricks forum</a> and we may include it on this page in a future versions of Tracks.
</p>
<a name="applescript1-section"> </a>
<h2>Add an Action with Applescript</h2>
<p>This is a simple script that pops up a dialog box asking for a description, and then sends that to Tracks with a hard-coded context.</p>
<% if has_contexts -%>
<ol>
<li>Choose the context you want to add actions to: <select name="applescript1-contexts" id="applescript1-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Copy the Applescript below to the clipboard.<br />
<textarea id="applescript1" name="applescript1" rows="15"><%= render :partial => 'applescript1', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open Script Editor and paste the script into a new document.</li>
<li>Compile and save the script. Run it as necessary.</li>
</ol>
<% else %>
<br/><p id="no_context_msg"><i>You do not have any context yet. The script will be available after you add your first context</i></p>
<% end %>
<a name="applescript2-section"> </a>
<h2>Add an Action with Applescript based on the currently selected Email in Mail.app</h2>
<p>This script takes the sender and subject of the selected email(s) in Mail and creates a new action for each one, with the description, "Email [sender] about [subject]". The description gets truncated to 100 characters (the validation limit for the field) if it is longer than that. It also has Growl notifications if you have Growl installed.</p>
<% if has_contexts -%>
<ol>
<li>Choose the context you want to add actions to: <select name="applescript2-contexts" id="applescript2-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Copy the Applescript below to the clipboard.<br />
<textarea id="applescript2" name="applescript2" rows="15"><%= render :partial => 'applescript2', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open Script Editor and paste the script into a new document.</li>
<li>Compile and save the script to the ~/Library/Scriipts/Mail Scripts directory.</li>
<li>For more information on using AppleScript with Mail.app, see <a href="http://www.apple.com/applescript/mail/" title="Scriptable Applications: Mail">this overview</a>.</li>
</ol>
<% else %>
<br/><p><i>You do not have any context yet. The script will be available after you add your first context</i></p>
<% end %>
<a name="quicksilver-applescript-section"></a>
<h2>Add Actions with Quicksilver and Applescript</h2>
<p>This integration will allow you to add actions to Tracks via <a href="http://quicksilver.blacktree.com/">Quicksilver</a>.</p>
<% if has_contexts -%>
<ol>
<li>Choose the context you want to add actions to: <select name="quicksilver-contexts" id="quicksilver-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Copy the Applescript below to the clipboard.<br />
<textarea id="quicksilver" name="quicksilver" rows="15"><%= render :partial => 'quicksilver_applescript', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open Script Editor and paste the script into a new document.</li>
<li>Compile and save the script as "Add to Tracks.scpt" in ~/Library/Application Support/Quicksilver/Actions/ (you may need to create the Actions directory)</li>
<li>Restart Quicksilver</li>
<li>Activate Quicksilver (Ctrl+Space by default)</li>
<li>Press "." to put quicksilver into text mode</li>
<li>Type the description of the next action you want to add</li>
<li>Press tab to switch to the action pane.</li>
<li>By typing or scrolling, choose the "Add to Tracks" action.</li>
</ol>
<% else %>
<br/><p><i>You do not have any context yet. The script will be available after you add your first context</i></p>
<% end %>
<a name="email-cron-section"> </a>
<h2>Automatically Email Yourself Upcoming Actions</h2>

View file

@ -8,9 +8,6 @@
Zie ook <%= link_to "de documentatie voor ontwikkelaars met Tracks' REST API", url_for(:action => 'rest_api') %>.</p>
<br/><p>Inhoud:</p>
<ul>
<li><a href="#applescript1-section">Voeg een actie toe met Applescript</a></li>
<li><a href="#applescript2-section">Voeg een acties toe met Applescript op basis van de huidig geselecteerde e-mail in Mail.app</a></li>
<li><a href="#quicksilver-applescript-section">Voeg acties toe met Quicksilver en Applescript</a></li>
<li><a href="#email-cron-section">Email jezelf automatisch de acties met een aflopende deadline</a></li>
<li><a href="#message_gateway">Integreer Tracks met een email server om een actie via email naar Tracks te sturen</a></li>
<li><a href="#google_gadget">Voeg tracks toe als een Google Gmail gadget</a></li>
@ -20,74 +17,6 @@
Tips and Tricks forum</a> en misschien voegen we jouw tip toe op deze pagina in een toekomstige versie van Tracks.
</p>
<a name="applescript1-section"> </a>
<h2>Voeg een actie toe met Applescript</h2>
<p>Dit is een eenvoudig script die een dialog box toont om jou om een beschrijving te vragen en vervolgens die op te sturen naar Tracks
met een hard-coded context.</p>
<% if has_contexts -%>
<ol>
<li>Kies de context waar de je acties aan toe wilt laten voegen: <select name="applescript1-contexts" id="applescript1-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Kopieer de volgende Applescript naar het klembord.<br />
<textarea id="applescript1" name="applescript1" rows="15"><%= render :partial => 'applescript1', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open de Script Editor en plak het script in een nieuw document.</li>
<li>Compileer en bewaar het script. Voert het uit wanneer nodig.</li>
</ol>
<% else %>
<br/><p id="no_context_msg"><i>Je hebt nog geen context(en). Het script komt beschikbaar als je het eerste context hebt toegevoegd.</i></p>
<% end %>
<a name="applescript2-section"> </a>
<h2>Voeg een acties toe met Applescript op basis van de huidig geselecteerde e-mail in Mail.app</h2>
<p>Dit script neemt de verstuurder en het onderwerp van de geselecteerde email(s)
van Mail over en maakt een nieuwe acties voor elke email met de beschrijving
"Email [sender] about [subject]". De beschrijving wordt, als nodig, na 100 karakters afgebroken
(dit is de limiet voor een beschrijving). Het heeft ook Growl notificaties mocht je Growl geïnstalleerd hebben.</p>
<% if has_contexts -%>
<ol>
<li>Kies de context waar de je acties aan toe wilt laten voegen: <select name="applescript2-contexts" id="applescript2-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Kopieer de volgende Applescript naar het klembord.<br />
<textarea id="applescript2" name="applescript2" rows="15"><%= render :partial => 'applescript2', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open de Script Editor en plak het script in een nieuw document.</li>
<li>Compileer en bewaar het script in de directory ~/Library/Scripts/Mail Scripts.</li>
<li>Voor meer informatie over het gebruiken van AppleScript met Mail.app, zie
<a href="http://www.apple.com/applescript/mail/" title="Scriptable Applications: Mail">dit overzicht</a>.</li>
</ol>
<% else %>
<br/><p><i>Je hebt nog geen context(en). Het script komt beschikbaar als je het eerste context hebt toegevoegd.</i></p>
<% end %>
<a name="quicksilver-applescript-section"></a>
<h2>Voeg acties toe met Quicksilver en Applescript</h2>
<p>Dit integratievoorbeeld laat je acties toevoegen aan Tracks via <a href="http://quicksilver.blacktree.com/">Quicksilver</a>.</p>
<% if has_contexts -%>
<ol>
<li>Kies de context waar de je acties aan toe wilt laten voegen: <select name="quicksilver-contexts" id="quicksilver-contexts"><%= options_from_collection_for_select(current_user.contexts, "id", "name", current_user.contexts.first.id) %></select>
</li>
<li>Kopieer de volgende Applescript naar het klembord.<br/>
<textarea id="quicksilver" name="quicksilver" rows="15"><%= render :partial => 'quicksilver_applescript', :locals => { :context => current_user.contexts.first } %></textarea>
</li>
<li>Open de Script Editor en plak het script in een nieuw document.</li>
<li>Compileer en bewaar het script als "Add to Tracks.scpt" in ~/Library/Application Support/Quicksilver/Actions/
(mogelijk moet je eerst de Actions directory aanmaken)</li>
<li>Herstart Quicksilver</li>
<li>Activeer Quicksilver (Standaard via Ctrl+Space)</li>
<li>Toets "." om quicksilver in text mode te brengen</li>
<li>Voer de gewenste beschrijving van de actie in.</li>
<li>Toets tab om naar de action pane te gaan.</li>
<li>Via typen of bladeren, kies de "Add to Tracks" actie.</li>
</ol>
<% else %>
<br/><p><i>Je hebt nog geen context(en). Het script komt beschikbaar als je het eerste context hebt toegevoegd.</i></p>
<% end %>
<a name="email-cron-section"> </a>
<h2>Email jezelf automatisch de acties met een aflopende deadline</h2>

View file

@ -308,9 +308,6 @@ cs:
footer:
send_feedback: Poslat zpětnou vazbu na %{version}
integrations:
applescript_next_action_prompt: 'Popis úkolu:'
applescript_success_after_id: vytvořen
applescript_success_before_id: Nový úkol s ID
gmail_description: Gadget pro Tracks do Gmailu
opensearch_description: Prohledat Tracks
layouts:

View file

@ -313,9 +313,6 @@ de:
footer:
send_feedback: Senden Sie Feedback zu %{version}
integrations:
applescript_next_action_prompt: 'Beschreibung der nächsten Aufgabe:'
applescript_success_after_id: erstellt
applescript_success_before_id: Nächste neue Aufgabe mit ID
gmail_description: Gadget, um Tracks als Gadget zu Googlemail hinzuzufügen
opensearch_description: In Tracks suchen
layouts:

View file

@ -796,10 +796,7 @@ en:
save_status_message: "Note %{id} was saved"
integrations:
opensearch_description: Search in Tracks
applescript_next_action_prompt: "Description of next action:"
gmail_description: Gadget to add Tracks to Gmail as a gadget
applescript_success_after_id: created
applescript_success_before_id: New next action with ID
preferences:
open_id_url: Your OpenID URL is
staleness_starts_after: Staleness starts after %{days} days

View file

@ -310,9 +310,6 @@ es:
footer:
send_feedback: Envía comentarios sobre el %{version}
integrations:
applescript_next_action_prompt: 'Descripción de la próxima tarea:'
applescript_success_after_id: creado
applescript_success_before_id: Nueva acción junto con la identificación
gmail_description: Gadget para añadir pistas a Gmail como un gadget
opensearch_description: Buscar en las Tracks
layouts:

View file

@ -340,9 +340,6 @@ fr:
submit: Sauvegarder %{model}
update: Mettre à jour %{model}
integrations:
applescript_next_action_prompt: 'Description de l''action suivante :'
applescript_success_after_id: Créé
applescript_success_before_id: Nouvelle action suivante avec ID
gmail_description: Gadget pour ajouter Tracks à Gmail
opensearch_description: Rechercher dans Tracks
layouts:

View file

@ -257,9 +257,6 @@ he:
footer:
send_feedback: "שליחת משוב על גירסא %{version}"
integrations:
applescript_next_action_prompt: "תיאור הפעולות הבאות:"
applescript_success_after_id: "נוצר"
applescript_success_before_id: "פעולת המשך עם זיהוי"
gmail_description: "חֲפִיץ להוספת מסלולים ל-Gmail"
opensearch_description: "חיפוש במסלולים"
layouts:

View file

@ -358,9 +358,6 @@ nl:
submit: Bewaar %{model}
update: Bijwerken %{model}
integrations:
applescript_next_action_prompt: 'Omschrijving van de actie:'
applescript_success_after_id: gemaakt
applescript_success_before_id: Nieuwe actie met ID
gmail_description: Gadget om Tracks toe te voegen aan Gmail als een gadget
opensearch_description: Zoek in Tracks
layouts:

View file

@ -376,9 +376,6 @@ ru:
submit: "Сохранить %{model}"
update: "Обновить %{model}"
integrations:
applescript_next_action_prompt: "Описание следующего действия:"
applescript_success_after_id: "создано"
applescript_success_before_id: "Новое действие с ID"
gmail_description: "Гаджет для добавления Tracks в Gmail как гаджета боковой панели"
opensearch_description: "Искать в Tracks"
layouts:

View file

@ -29,9 +29,6 @@ Rails.application.routes.draw do
post 'integrations/cloudmailin' => 'integrations#cloudmailin'
get 'integrations/search_plugin' => "integrations#search_plugin", :as => 'search_plugin'
get 'integrations/google_gadget.xml' => 'integrations#google_gadget', :as => 'google_gadget'
get 'integrations/get_applescript1.js' => 'integrations#get_applescript1'
get 'integrations/get_applescript2.js' => 'integrations#get_applescript2'
get 'integrations/get_quicksilver_applescript.js' => 'integrations#get_quicksilver_applescript'
get 'preferences' => "preferences#index"
get 'preferences/render_date_format' => "preferences#render_date_format"

View file

@ -1,44 +0,0 @@
Feature: Integrate Tracks in various ways
In order to use tracks with other software
As a Tracks user
I want to be informed about the various ways to integrate tracks
Background:
Given the following user record
| login | password | is_admin |
| testuser | secret | false |
And I have logged in as "testuser" with password "secret"
And I have the following contexts:
| context |
| @pc |
| @home |
| @shops |
| @boss |
Scenario: I cannot see scripts when I do not have a context
Given I have no contexts
When I go to the integrations page
Then I should see a message that you need a context to see scripts
Scenario: I can see scripts when I have one or more contexts
When I go to the integrations page
Then I should see scripts
@javascript
Scenario: The scripts on the page should be prefilled with the first context
When I go to the integrations page
Then I should see a script "applescript1" for "@pc"
@javascript
Scenario Outline: When I select a different context the example scripts should change accordingly
When I go to the integrations page
When I select "<context1>" from "<context-list>"
Then I should see a script "<script>" for "<context1>"
When I select "<context2>" from "<context-list>"
Then I should see a script "<script>" for "<context2>"
Examples:
| context1 | context2 | context-list | script |
| @home | @boss | applescript1-contexts | applescript1 |
| @shops | @home | applescript2-contexts | applescript2 |
| @boss | @shops | quicksilver-contexts | quicksilver |

View file

@ -1,20 +0,0 @@
Then /^I should see a message that you need a context to see scripts$/ do
step 'I should see "You do not have any context yet. The script will be available after you add your first context"'
end
Then /^I should see scripts$/ do
# check on a small snippet of the first applescript
step 'I should see "set returnValue to call xmlrpc"'
end
Then /^I should see a script "([^\"]*)" for "([^\"]*)"$/ do |script, context_name|
expect(page).to have_css("##{script}", :visible => true)
context = Context.where(:name => context_name).first
expect(page).to have_content("#{context.id} (* #{context_name} *)")
# make sure the text is found within the textarea
script_source = page.find(:xpath, "//textarea[@id='#{script}']").text
expect(script_source).to match(/#{context.id} \(\* #{context_name} \*\)/)
end