This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/app/views/albums/_album_form.html.erb

35 lines
951 B
Plaintext
Raw Normal View History

2008-06-27 00:13:15 -04:00
<fieldset>
<legend>Album Details</legend>
<p>
2008-10-01 02:57:49 -04:00
<%= text_field :name, :label => 'Name: ' %>
2008-06-27 00:13:15 -04:00
</p>
<h3>Tags</h3>
<p>
2008-10-01 02:57:49 -04:00
<p><a href="#" onclick="$('album[tag_names]').value = ''; return false;"><img src="/images/edit-clear.png" style="vertical-align: top;" /></a> <%= text_field :tag_names, :size => 30 -%></p>
2008-06-27 00:13:15 -04:00
<div id="tag_auto_complete" class="auto_complete"></div>
</p>
</fieldset>
<script type="text/javascript">
//<![CDATA[
new Ajax.Autocompleter(
'album_tag_names',
'tag_auto_complete',
'/tags/auto_complete',
{
paramName: 'id',
updateElement: function(tag_name)
{
var new_tag = tag_name.innerHTML.gsub(/\<[^>]+\>/, '');
var existing_tags = $('album_tag_names').value.gsub(/( |^)[^ ]+$/, '');
var plus_space = (existing_tags.length == 0 ? '' : ' ');
$('album_tag_names').value = existing_tags + plus_space + new_tag;
$('album_tag_names').focus();
}
}
);
//]]>
</script>