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();
} else {
// Remove placeholder if any
$('li.notice-reply-placeholder').remove();
list.find('li.notice-reply-placeholder').remove();
// Create the reply form entry at the end
var replyItem = $('li.notice-reply', list);
@ -638,10 +638,12 @@ var SN = { // StatusNet
var placeholder = $('<li class="notice-reply-placeholder">' +
'<input class="placeholder">' +
'</li>');
placeholder.click(function() {
placeholder.find('input')
.val(SN.msg('reply_placeholder'))
.focus(function() {
SN.U.NoticeInlineReplyTrigger(notice);
return false;
});
placeholder.find('input').val(SN.msg('reply_placeholder'));
list.append(placeholder);
},
@ -1015,8 +1017,7 @@ var SN = { // StatusNet
}
var NGW = form.find('.notice_data-geo_wrap');
var geocodeURL = NGW.attr('title');
NGW.removeAttr('title');
var geocodeURL = NGW.attr('data-api');
label
.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.find('button.close').click(function() {
form.find('[name=notice_data-geo]').removeAttr('checked').change();
return false;
});
form.append(wrapper);
}
@ -1309,6 +1311,28 @@ var SN = { // StatusNet
var form = $(this);
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->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
//$this->out->checkbox('notice_data-geo', _('Share my location'), true);