counter.text(remaining);
if (remaining <= 0) {
- counter.addClass("toomuch");
+ $("#status_form").addClass("response_error");
} else {
- counter.removeClass("toomuch");
+ $("#status_form").removeClass("response_error");
}
}
// XXX: refactor this code
var favoptions = { dataType: 'xml',
- success: function(xml) { var new_form = document._importNode($('form', xml).get(0), true);
+ success: function(xml) { alert("success");var new_form = document._importNode($('form', xml).get(0), true);
var dis = new_form.id;
var fav = dis.replace('disfavor', 'favor');
$('form#'+fav).replaceWith(new_form);
$("form.unsubscribe").ajaxForm(UnSubscribe);
$("form.subscribe").each(addAjaxHidden);
$("form.unsubscribe").each(addAjaxHidden);
+
+
+ var PostNotice = { dataType: 'xml',
+ beforeSubmit: function(formData, jqForm, options) { if ($("#status_textarea").get(0).value.length == 0) {
+ $("#status_form").addClass("response_error");
+ return false;
+ }
+ return true;
+ },
+ success: function(xml) {
+ if ($(".error", xml).length > 0) {
+ var response_error = document._importNode($(".error", xml).get(0), true);
+ response_error = response_error.textContent || response_error.innerHTML;
+ alert(response_error);
+ }
+ else {
+ $("#notices").prepend(document._importNode($("li", xml).get(0), true));
+ $("#status_textarea").val("");
+ counter();
+ $(".notice_single:first").css({display:"none"});
+ $(".notice_single:first").fadeIn(2500);
+ }
+ }
+ }
+ $("#status_form").ajaxForm(PostNotice);
+ $("#status_form").each(addAjaxHidden);
});
function doreply(nick,id) {
input#favor, input.favor,
input#disfavor, input.disfavor {
background-color:#fcfff5;
+ background-color:transparent;
background-image:url(icon_heart-02.gif);
background-repeat:no-repeat;
cursor: pointer;
font-size: 13px;
line-height: 16px;
border-bottom: 1px solid #dec5b5;
+ background-color:#FCFFF5;
+ opacity:1;
}
.notice_single:hover {
background-color: #f7ebcc;
padding: 0;
}
#notice_delete_form #confirmation_text {
- display: block;
+ display: block;
font-size: 14px;
font-weight: bold;
}
+
input#submit_yes, input#submit_no {
margin: 18px 10px 0px 0px;
padding: 4px;
font-weight: bold;
text-align: right;
}
+.response_error textarea,
+.response_error .on_max {
+background-color:#fee;
+}
+
+
+
/* ----- Subscribe Form ----- */
#content .subscribe .submit, #content .unsubscribe .submit, #remotesubscribe .button, #remotesubscribe {
clear: left;
display: inline;
margin: 0;
padding: 0;
- }
\ No newline at end of file
+ }