aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2011-08-18 13:51:48 +0200
committerAlex Legler <alex@a3li.li>2011-08-18 13:51:48 +0200
commit6b36b9210357f8528aa1fa2661a2d5b8bcfbe2b2 (patch)
treee948799ce7b30a5bf820e7bdc06897d18ca09453
parentVisual fixes for box titles (diff)
downloadglsamaker-6b36b9210357f8528aa1fa2661a2d5b8bcfbe2b2.tar.gz
glsamaker-6b36b9210357f8528aa1fa2661a2d5b8bcfbe2b2.tar.bz2
glsamaker-6b36b9210357f8528aa1fa2661a2d5b8bcfbe2b2.zip
Complete migration of the new-request view to rails3 and back to prototype
-rw-r--r--app/views/glsa/new-request.html.erb16
-rw-r--r--app/views/tools/ajaxdescr.html.erb4
2 files changed, 12 insertions, 8 deletions
diff --git a/app/views/glsa/new-request.html.erb b/app/views/glsa/new-request.html.erb
index 20cec1a..67fcf62 100644
--- a/app/views/glsa/new-request.html.erb
+++ b/app/views/glsa/new-request.html.erb
@@ -8,13 +8,17 @@
<p><input type="text" name="bugs" id="bugs" class="hugetext nice" value="<%= params[:bugs] %>"/></p>
<script language="javascript">
- $("#bugs").change(function() {
- $.post("<%= url_for :controller => 'tools', :action => 'file_req_ajax_info' %>", { bugs: $("#bugs").val() }, function (data) {
- $('#ajaxbugs').html(data.buginfo);
- $('#suggesteddescr').html(data.title);
- }, 'json');
+ $("bugs").observe('change', function(event) {
+ new Ajax.Request("<%= url_for :controller => 'tools', :action => 'file_req_ajax_info' %>", {
+ method: 'get',
+ parameters: { bugs: $('bugs').getValue() },
+ onSuccess : function(transport) {
+ $('ajaxbugs').update(transport.responseJSON.buginfo);
+ $('suggesteddescr').update(transport.responseJSON.title);
+ }
+ });
});
- </script>
+ </script>
<div id="ajaxbugs"></div>
</div>
<br />
diff --git a/app/views/tools/ajaxdescr.html.erb b/app/views/tools/ajaxdescr.html.erb
index 8aa5a85..9d3201c 100644
--- a/app/views/tools/ajaxdescr.html.erb
+++ b/app/views/tools/ajaxdescr.html.erb
@@ -1,3 +1,3 @@
-<a href="javascript:///" onclick="$('title').value = $('suggesd').firstChild.data; $('suggesteddescr').innerHTML = '';" title="Use suggested description"/>
-<img src="/images/icons/paste.png" style="float: right; margin: .5em;" />
+<a href="javascript:///" onclick="$('title').value = $('suggesd').firstChild.data; $('suggesteddescr').innerHTML = '';" title="Use suggested description">
+<img src="/assets/icons/paste.png" style="float: right; margin: .5em;" />
<span id="suggesd"><%= h @text %></span> </a> \ No newline at end of file