Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x

This commit is contained in:
Zach Copley 2011-03-10 17:16:28 -08:00
commit 3730b650ab
3 changed files with 33 additions and 9 deletions

View File

@ -599,7 +599,7 @@ var SN = { // StatusNet
nextStep(); nextStep();
} else { } else {
// Remove placeholder if any // Remove placeholder if any
$('li.notice-reply-placeholder').remove(); list.find('li.notice-reply-placeholder').remove();
// Create the reply form entry at the end // Create the reply form entry at the end
var replyItem = $('li.notice-reply', list); var replyItem = $('li.notice-reply', list);
@ -638,10 +638,12 @@ var SN = { // StatusNet
var placeholder = $('<li class="notice-reply-placeholder">' + var placeholder = $('<li class="notice-reply-placeholder">' +
'<input class="placeholder">' + '<input class="placeholder">' +
'</li>'); '</li>');
placeholder.click(function() { placeholder.find('input')
SN.U.NoticeInlineReplyTrigger(notice); .val(SN.msg('reply_placeholder'))
}); .focus(function() {
placeholder.find('input').val(SN.msg('reply_placeholder')); SN.U.NoticeInlineReplyTrigger(notice);
return false;
});
list.append(placeholder); list.append(placeholder);
}, },
@ -1015,8 +1017,7 @@ var SN = { // StatusNet
} }
var NGW = form.find('.notice_data-geo_wrap'); var NGW = form.find('.notice_data-geo_wrap');
var geocodeURL = NGW.attr('title'); var geocodeURL = NGW.attr('data-api');
NGW.removeAttr('title');
label label
.attr('title', label.text()); .attr('title', label.text());
@ -1116,6 +1117,7 @@ var SN = { // StatusNet
wrapper = $('<div class="'+SN.C.S.Success+' geo_status_wrapper"><button class="close" style="float:right">&#215;</button><div class="geo_status"></div></div>'); wrapper = $('<div class="'+SN.C.S.Success+' geo_status_wrapper"><button class="close" style="float:right">&#215;</button><div class="geo_status"></div></div>');
wrapper.find('button.close').click(function() { wrapper.find('button.close').click(function() {
form.find('[name=notice_data-geo]').removeAttr('checked').change(); form.find('[name=notice_data-geo]').removeAttr('checked').change();
return false;
}); });
form.append(wrapper); form.append(wrapper);
} }
@ -1309,6 +1311,28 @@ var SN = { // StatusNet
var form = $(this); var form = $(this);
SN.Init.NoticeFormSetup(form); SN.Init.NoticeFormSetup(form);
}); });
// Make inline reply forms self-close when clicking out.
$('body').bind('click', function(e) {
var openReplies = $('li.notice-reply');
if (openReplies.length > 0) {
var target = $(e.target);
openReplies.each(function() {
// Did we click outside this one?
var replyItem = $(this);
if (replyItem.has(e.target).length == 0) {
var textarea = replyItem.find('.notice_data-text:first');
var cur = $.trim(textarea.val());
// Only close if there's been no edit.
if (cur == '' || cur == textarea.data('initialText')) {
var parentNotice = replyItem.closest('li.notice');
replyItem.remove();
SN.U.NoticeInlineReplyPlaceholder(parentNotice);
}
}
});
}
});
} }
}, },

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -208,7 +208,7 @@ class NoticeForm extends Form
$this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? (empty($this->profile->location_ns) ? null : $this->profile->location_ns) : $this->location_ns, 'location_ns'); $this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? (empty($this->profile->location_ns) ? null : $this->profile->location_ns) : $this->location_ns, 'location_ns');
$this->out->elementStart('div', array('class' => 'notice_data-geo_wrap', $this->out->elementStart('div', array('class' => 'notice_data-geo_wrap',
'title' => common_local_url('geocode'))); 'data-api' => common_local_url('geocode')));
// @fixme checkbox method allows no way to change the id without changing the name // @fixme checkbox method allows no way to change the id without changing the name
//$this->out->checkbox('notice_data-geo', _('Share my location'), true); //$this->out->checkbox('notice_data-geo', _('Share my location'), true);