diff --git a/app/assets/javascripts/tracks.js.erb b/app/assets/javascripts/tracks.js.erb index c5737d92..1974af86 100644 --- a/app/assets/javascripts/tracks.js.erb +++ b/app/assets/javascripts/tracks.js.erb @@ -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(); }); + diff --git a/app/controllers/integrations_controller.rb b/app/controllers/integrations_controller.rb index 88f2b839..72ca7eda 100644 --- a/app/controllers/integrations_controller.rb +++ b/app/controllers/integrations_controller.rb @@ -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 + diff --git a/app/views/integrations/_applescript1.html.erb b/app/views/integrations/_applescript1.html.erb deleted file mode 100644 index 1e6497d5..00000000 --- a/app/views/integrations/_applescript1.html.erb +++ /dev/null @@ -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') %>" \ No newline at end of file diff --git a/app/views/integrations/_applescript2.html.erb b/app/views/integrations/_applescript2.html.erb deleted file mode 100644 index 59de5201..00000000 --- a/app/views/integrations/_applescript2.html.erb +++ /dev/null @@ -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 diff --git a/app/views/integrations/_quicksilver_applescript.html.erb b/app/views/integrations/_quicksilver_applescript.html.erb deleted file mode 100644 index 0ef5d614..00000000 --- a/app/views/integrations/_quicksilver_applescript.html.erb +++ /dev/null @@ -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 diff --git a/app/views/integrations/index.de.html.erb b/app/views/integrations/index.de.html.erb index 70bc29d2..cd71480c 100644 --- a/app/views/integrations/index.de.html.erb +++ b/app/views/integrations/index.de.html.erb @@ -8,9 +8,6 @@ Weitere Informationen finden Sie in der <%= link_to "Entwickler Documentation der Tracks' REST API", url_for(:action => 'rest_api') %> (englisch).


Inhalt: