split favor forms code
darcs-hash:20080918032048-5ed1f-90a55a52e5444d9ae85c0d52af204b44fb895f58.gz
This commit is contained in:
parent
560cab3427
commit
4af5b0441b
21
js/util.js
21
js/util.js
|
@ -52,14 +52,25 @@ $(document).ready(function(){
|
||||||
// set the focus
|
// set the focus
|
||||||
$("#status_textarea").focus();
|
$("#status_textarea").focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = {dataType: 'xml',
|
// XXX: refactor this code
|
||||||
|
|
||||||
|
var favoptions = {dataType: 'xml',
|
||||||
success: function(xml) {
|
success: function(xml) {
|
||||||
// replace the form with what's returned
|
var new_form = $('form.disfavor', xml);
|
||||||
|
var id = new_form.id.replace('disfavor', 'favor');
|
||||||
|
$('form#'+id).replace(new_form);
|
||||||
|
}};
|
||||||
|
|
||||||
|
var disoptions = {dataType: 'xml',
|
||||||
|
success: function(xml) {
|
||||||
|
var new_form = $('form.favor', xml);
|
||||||
|
var id = new_form.id.replace('favor', 'disfavor');
|
||||||
|
$('form#'+id).replace(new_form);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
$("form.favor").ajaxForm(options);
|
$("form.favor").ajaxForm(favoptions);
|
||||||
$("form.disfavor").ajaxForm(options);
|
$("form.disfavor").ajaxForm(disoptions);
|
||||||
});
|
});
|
||||||
|
|
||||||
function doreply(nick) {
|
function doreply(nick) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user