diff options
author | Evan Prodromou <evan@status.net> | 2009-11-17 11:00:10 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-11-17 11:00:10 -0500 |
commit | f63e00d4a2bf99101084f73c7ab1f4ec0301e97d (patch) | |
tree | b41ae1762a7e8740f3ebedfa88368121664ca4b5 | |
parent | 18e61e631bac89e420af4bba1dc9f3cf51196c17 (diff) | |
parent | 55025986db72a1dce02e8e8c4d1a5d22185d2361 (diff) |
Merge branch '0.8.x' of git@gitorious.org:statusnet/mainline into 0.8.x
-rw-r--r-- | actions/userbyid.php | 7 | ||||
-rw-r--r-- | js/util.js | 83 | ||||
-rw-r--r-- | lib/mailbox.php | 2 | ||||
-rw-r--r-- | locale/it_IT/LC_MESSAGES/statusnet.mo | bin | 80186 -> 83401 bytes | |||
-rw-r--r-- | locale/mk_MK/LC_MESSAGES/statusnet.mo | bin | 37731 -> 50541 bytes | |||
-rw-r--r-- | locale/mk_MK/LC_MESSAGES/statusnet.po | 10 | ||||
-rw-r--r-- | locale/pt_BR/LC_MESSAGES/statusnet.mo | bin | 76797 -> 83652 bytes | |||
-rw-r--r-- | locale/vi_VN/LC_MESSAGES/statusnet.mo | bin | 50650 -> 78725 bytes | |||
-rw-r--r-- | plugins/InfiniteScroll/infinitescroll.js | 12 | ||||
-rw-r--r-- | plugins/Meteor/meteorupdater.js | 2 | ||||
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 5 | ||||
-rw-r--r-- | plugins/Realtime/realtimeupdate.js | 52 | ||||
-rw-r--r-- | theme/base/css/display.css | 5 |
13 files changed, 104 insertions, 74 deletions
diff --git a/actions/userbyid.php b/actions/userbyid.php index 802bcb081..86a61f20b 100644 --- a/actions/userbyid.php +++ b/actions/userbyid.php @@ -74,8 +74,11 @@ class UserbyidAction extends Action $this->clientError(_('No such user.')); } - // support redirecting to FOAF rdf/xml if the agent prefers it - $page_prefs = 'application/rdf+xml,text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2'; + // Support redirecting to FOAF rdf/xml if the agent prefers it... + // Internet Explorer doesn't specify "text/html" and does list "*/*" + // at least through version 8. We need to list text/html up front to + // ensure that only user-agents who specifically ask for RDF get it. + $page_prefs = 'text/html,application/xhtml+xml,application/rdf+xml,application/xml;q=0.3,text/xml;q=0.2'; $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null; $type = common_negotiate_type(common_accept_to_prefs($httpaccept), diff --git a/js/util.js b/js/util.js index 2165957c3..879bb38ae 100644 --- a/js/util.js +++ b/js/util.js @@ -81,32 +81,6 @@ $(document).ready(function(){ // XXX: refactor this code - var favoptions = { dataType: 'xml', - beforeSubmit: function(data, target, options) { - $(target).addClass('processing'); - return true; - }, - success: function(xml) { 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#'+dis).ajaxForm(disoptions).each(addAjaxHidden); - } - }; - - var disoptions = { dataType: 'xml', - beforeSubmit: function(data, target, options) { - $(target).addClass('processing'); - return true; - }, - success: function(xml) { var new_form = document._importNode($('form', xml).get(0), true); - var fav = new_form.id; - var dis = fav.replace('favor', 'disfavor'); - $('form#'+dis).replaceWith(new_form); - $('form#'+fav).ajaxForm(favoptions).each(addAjaxHidden); - } - }; - var joinoptions = { dataType: 'xml', success: function(xml) { var new_form = document._importNode($('form', xml).get(0), true); var leave = new_form.id; @@ -125,20 +99,8 @@ $(document).ready(function(){ } }; - function addAjaxHidden() { - var ajax = document.createElement('input'); - ajax.setAttribute('type', 'hidden'); - ajax.setAttribute('name', 'ajax'); - ajax.setAttribute('value', 1); - this.appendChild(ajax); - } - - $("form.form_favor").ajaxForm(favoptions); - $("form.form_disfavor").ajaxForm(disoptions); $("form.form_group_join").ajaxForm(joinoptions); $("form.form_group_leave").ajaxForm(leaveoptions); - $("form.form_favor").each(addAjaxHidden); - $("form.form_disfavor").each(addAjaxHidden); $("form.form_group_join").each(addAjaxHidden); $("form.form_group_leave").each(addAjaxHidden); @@ -252,6 +214,7 @@ $(document).ready(function(){ $('#'+li.id).fadeIn(2500); NoticeReply(); NoticeAttachments(); + NoticeFavors(); } } $("#notice_data-text").val(""); @@ -270,8 +233,52 @@ $(document).ready(function(){ NoticeReply(); NoticeAttachments(); NoticeDataAttach(); + NoticeFavors(); }); +function addAjaxHidden() { + var ajax = document.createElement('input'); + ajax.setAttribute('type', 'hidden'); + ajax.setAttribute('name', 'ajax'); + ajax.setAttribute('value', 1); + this.appendChild(ajax); +} + +function NoticeFavors() { + + // XXX: refactor this code + var favoptions = { dataType: 'xml', + beforeSubmit: function(data, target, options) { + $(target).addClass('processing'); + return true; + }, + success: function(xml) { 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#'+dis).ajaxForm(disoptions).each(addAjaxHidden); + } + }; + + var disoptions = { dataType: 'xml', + beforeSubmit: function(data, target, options) { + $(target).addClass('processing'); + return true; + }, + success: function(xml) { var new_form = document._importNode($('form', xml).get(0), true); + var fav = new_form.id; + var dis = fav.replace('favor', 'disfavor'); + $('form#'+dis).replaceWith(new_form); + $('form#'+fav).ajaxForm(favoptions).each(addAjaxHidden); + } + }; + + $("form.form_favor").ajaxForm(favoptions); + $("form.form_disfavor").ajaxForm(disoptions); + $("form.form_favor").each(addAjaxHidden); + $("form.form_disfavor").each(addAjaxHidden); +} + function NoticeReply() { if ($('#notice_data-text').length > 0 && $('#content .notice_reply').length > 0) { $('#content .notice').each(function() { diff --git a/lib/mailbox.php b/lib/mailbox.php index e1d384a06..90a58b4c4 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -282,7 +282,7 @@ class MailboxAction extends CurrentUserDesignAction $ns->name); $this->elementEnd('span'); } else { - $this->out->element('span', 'device', $source_name); + $this->element('span', 'device', $source_name); } break; } diff --git a/locale/it_IT/LC_MESSAGES/statusnet.mo b/locale/it_IT/LC_MESSAGES/statusnet.mo Binary files differindex 95764f1e2..00ab59804 100644 --- a/locale/it_IT/LC_MESSAGES/statusnet.mo +++ b/locale/it_IT/LC_MESSAGES/statusnet.mo diff --git a/locale/mk_MK/LC_MESSAGES/statusnet.mo b/locale/mk_MK/LC_MESSAGES/statusnet.mo Binary files differindex 0ac378c79..5dec309dd 100644 --- a/locale/mk_MK/LC_MESSAGES/statusnet.mo +++ b/locale/mk_MK/LC_MESSAGES/statusnet.mo diff --git a/locale/mk_MK/LC_MESSAGES/statusnet.po b/locale/mk_MK/LC_MESSAGES/statusnet.po index d4c4eb235..4dfadc61e 100644 --- a/locale/mk_MK/LC_MESSAGES/statusnet.po +++ b/locale/mk_MK/LC_MESSAGES/statusnet.po @@ -4667,16 +4667,6 @@ msgstr "" msgid "%1$s is now listening to " msgstr "%1$s сега ги следи вашите забелешки за %2$s." -#: lib/mail.php:254 -#, fuzzy, php-format -msgid "Location: %s\n" -msgstr "Локација" - -#: lib/mail.php:256 -#, fuzzy, php-format -msgid "Homepage: %s\n" -msgstr "Домашна страница" - #: lib/mail.php:258 #, php-format msgid "" diff --git a/locale/pt_BR/LC_MESSAGES/statusnet.mo b/locale/pt_BR/LC_MESSAGES/statusnet.mo Binary files differindex 9db1638b0..a5a6f2725 100644 --- a/locale/pt_BR/LC_MESSAGES/statusnet.mo +++ b/locale/pt_BR/LC_MESSAGES/statusnet.mo diff --git a/locale/vi_VN/LC_MESSAGES/statusnet.mo b/locale/vi_VN/LC_MESSAGES/statusnet.mo Binary files differindex 65add28b4..b2f4dd370 100644 --- a/locale/vi_VN/LC_MESSAGES/statusnet.mo +++ b/locale/vi_VN/LC_MESSAGES/statusnet.mo diff --git a/plugins/InfiniteScroll/infinitescroll.js b/plugins/InfiniteScroll/infinitescroll.js index ae4d53d09..9e5593d25 100644 --- a/plugins/InfiniteScroll/infinitescroll.js +++ b/plugins/InfiniteScroll/infinitescroll.js @@ -1,8 +1,14 @@ jQuery(document).ready(function($){ $('notices_primary').infinitescroll({ - debug: true, + debug: false, infiniteScroll : false, - nextSelector : "li.nav_next a", + nextSelector : 'body#public li.nav_next a,'+ + 'body#all li.nav_next a,'+ + 'body#showstream li.nav_next a,'+ + 'body#replies li.nav_next a,'+ + 'body#showfavorites li.nav_next a,'+ + 'body#showgroup li.nav_next a,'+ + 'body#favorited li.nav_next a', loadingImg : $('address .url')[0].href+'plugins/InfiniteScroll/ajax-loader.gif', text : "<em>Loading the next set of posts...</em>", donetext : "<em>Congratulations, you\'ve reached the end of the Internet.</em>", @@ -11,5 +17,7 @@ jQuery(document).ready(function($){ itemSelector : "#notices_primary ol.notices li" },function(){ NoticeAttachments(); + NoticeReply(); + NoticeFavors(); }); }); diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index 9ce68775b..cdd1d63fa 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -1,6 +1,4 @@ // Update the local timeline from a Meteor server -// XXX: If @a is subscribed to @b, @a should get @b's notices in @a's Personal timeline. -// Do Replies timeline. var MeteorUpdater = function() { diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 181927968..a21c33b10 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -132,8 +132,8 @@ class RealtimePlugin extends Plugin // Add to the public timeline - if ($notice->is_local || - ($notice->is_local == 0 && !common_config('public', 'localonly'))) { + if ($notice->is_local == Notice::LOCAL_PUBLIC || + ($notice->is_local == Notice::REMOTE_OMB && !common_config('public', 'localonly'))) { $paths[] = array('public'); } @@ -230,7 +230,6 @@ class RealtimePlugin extends Plugin } $action->showContentBlock(); - $action->showScripts(); $action->elementEnd('body'); return false; // No default processing } diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index e82b4dbfb..3141e742a 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -34,6 +34,9 @@ RealtimeUpdate = { _favorurl: '', _deleteurl: '', _updatecounter: 0, + _updatedelay: 500, + _maxnotices: 50, + _windowhasfocus: false, init: function(userid, replyurl, favorurl, deleteurl) { @@ -44,7 +47,9 @@ RealtimeUpdate = { DT = document.title; - $(window).blur(function() { + $(window).bind('focus', function(){ RealtimeUpdate._windowhasfocus = true; }); + + $(window).bind('blur', function() { $('#notices_primary .notice').css({ 'border-top-color':$('#notices_primary .notice:last').css('border-top-color'), 'border-top-style':'dotted' @@ -57,6 +62,7 @@ RealtimeUpdate = { RealtimeUpdate._updatecounter = 0; document.title = DT; + RealtimeUpdate._windowhasfocus = false; return false; }); @@ -76,11 +82,22 @@ RealtimeUpdate = { $("#notices_primary .notices").prepend(noticeItem); $("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").fadeIn(1000); + + if ($('#notices_primary .notice').length > RealtimeUpdate._maxnotices) { + $("#notices_primary .notice:last .form_disfavor").unbind('submit'); + $("#notices_primary .notice:last .form_favor").unbind('submit'); + $("#notices_primary .notice:last .notice_reply").unbind('click'); + $("#notices_primary .notice:last").remove(); + } + + NoticeFavors(); NoticeReply(); - RealtimeUpdate._updatecounter += 1; - document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; - }, 500); + if (RealtimeUpdate._windowhasfocus === false) { + RealtimeUpdate._updatecounter += 1; + document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; + } + }, RealtimeUpdate._updatedelay); }, makeNoticeItem: function(data) @@ -163,12 +180,14 @@ RealtimeUpdate = { addPopup: function(url, timeline, iconurl) { - $('#notices_primary').css({'position':'relative'}); - $('#notices_primary').prepend('<button id="realtime_timeline" title="Pop up in a window">Pop up</button>'); + var NP = $('#notices_primary'); + NP.css({'position':'relative'}); + NP.prepend('<button id="realtime_timeline" title="Pop up in a window">Pop up</button>'); - $('#realtime_timeline').css({ + var RT = $('#realtime_timeline'); + RT.css({ 'margin':'0 0 11px 0', - 'background':'transparent url('+ iconurl + ') no-repeat 0% 30%', + 'background':'transparent url('+ iconurl + ') no-repeat 0 30%', 'padding':'0 0 0 20px', 'display':'block', 'position':'absolute', @@ -176,15 +195,15 @@ RealtimeUpdate = { 'right':'0', 'border':'none', 'cursor':'pointer', - 'color':$("a").css("color"), + 'color':$('a').css('color'), 'font-weight':'bold', 'font-size':'1em' }); - - $('#realtime_timeline').click(function() { + $('#showstream #notices_primary').css({'margin-top':'18px'}); + RT.bind('click', function() { window.open(url, - timeline, - 'toolbar=no,resizable=yes,scrollbars=yes,status=yes'); + '', + 'toolbar=no,resizable=yes,scrollbars=yes,status=yes,width=500,height=550'); return false; }); @@ -192,7 +211,6 @@ RealtimeUpdate = { initPopupWindow: function() { - window.resizeTo(500, 550); $('address').hide(); $('#content').css({'width':'93.5%'}); @@ -212,6 +230,12 @@ RealtimeUpdate = { 'left':'auto', 'right':'0' }); + + $('.notices .entry-title a, .notices .entry-content a').bind('click', function() { + window.open(this.href, ''); + + return false; + }); } } diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 7706fba48..e19938e4f 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -537,7 +537,7 @@ font-size:0.8em; /* entity_profile */ .entity_profile { position:relative; -width:74.702%; +width:73%; min-height:123px; float:left; margin-bottom:18px; @@ -604,7 +604,8 @@ font-style:italic; /*entity_actions*/ .entity_actions { float:right; -margin-left:2.35%; +margin-left:2%; +margin-bottom:18px; max-width:25%; } .entity_actions h2 { |