diff --git a/app/views/integrations/index.html.erb b/app/views/integrations/index.html.erb index d99f0066..51398c24 100644 --- a/app/views/integrations/index.html.erb +++ b/app/views/integrations/index.html.erb @@ -27,12 +27,6 @@ <% if has_contexts -%>
  1. Choose the context you want to add actions to: - <%= observe_field "applescript1-contexts", :update => "applescript1", - :with => 'context_id', - :url => { :controller => "integrations", :action => "get_applescript1" }, - :before => "$('applescript1').startWaiting()", - :complete => "$('applescript1').stopWaiting()" - %>
  2. Copy the Applescript below to the clipboard.
    @@ -52,12 +46,6 @@ <% if has_contexts -%>
    1. Choose the context you want to add actions to: - <%= observe_field "applescript2-contexts", :update => "applescript2", - :with => 'context_id', - :url => { :controller => "integrations", :action => "get_applescript2" }, - :before => "$('applescript2').startWaiting()", - :complete => "$('applescript2').stopWaiting()" - %>
    2. Copy the Applescript below to the clipboard.
      @@ -79,12 +67,6 @@ <% if has_contexts -%>
      1. Choose the context you want to add actions to: - <%= observe_field "quicksilver-contexts", :update => "quicksilver", - :with => 'context_id', - :url => { :controller => "integrations", :action => "get_quicksilver_applescript" }, - :before => "$('quicksilver').startWaiting()", - :complete => "$('quicksilver').stopWaiting()" - %>
      2. Copy the Applescript below to the clipboard.
        diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 901e2b21..6fa769ef 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -489,6 +489,43 @@ $(document).ready(function() { $("#feeds-for-project").load('/feedlist/get_feeds_for_project?project_id='+this.value); }); + /* Integrations page */ + /* + <%= observe_field "applescript1-contexts", :update => "applescript1", + :with => 'context_id', + :url => { :controller => "integrations", :action => "get_applescript1" }, + :before => "$('applescript1').startWaiting()", + :complete => "$('applescript1').stopWaiting()" + %> + */ + $('#applescript1-contexts').live('change', function(){ + $("#applescript1").load(relative_to_root('integrations/get_applescript1?context_id='+this.value)); + }); + + /* + <%= observe_field "applescript2-contexts", :update => "applescript2", + :with => 'context_id', + :url => { :controller => "integrations", :action => "get_applescript2" }, + :before => "$('applescript2').startWaiting()", + :complete => "$('applescript2').stopWaiting()" + %> + */ + $('#applescript2-contexts').live('change', function(){ + $("#applescript2").load(relative_to_root('integrations/get_applescript2?context_id='+this.value)); + }); + + /* + <%= observe_field "quicksilver-contexts", :update => "quicksilver", + :with => 'context_id', + :url => { :controller => "integrations", :action => "get_quicksilver_applescript" }, + :before => "$('quicksilver').startWaiting()", + :complete => "$('quicksilver').stopWaiting()" + %> + */ + $('#quicksilver-contexts').live('change', function(){ + $("#quicksilver").load(relative_to_root('integrations/get_quicksilver_applescript?context_id='+this.value)); + }); + /* Gets called from some AJAX callbacks, too */ enable_rich_interaction(); });