From 134319649f41796d804777f5740c5dae978f1a7a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 8 Nov 2009 11:38:33 +0100 Subject: Fix typo in doc/badge (bug 1958) --- doc-src/badge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/badge b/doc-src/badge index 1c368eb69..5499e334c 100644 --- a/doc-src/badge +++ b/doc-src/badge @@ -1,4 +1,4 @@ -Install the %%site.name%% badge on you blog or web site to show the latest updates +Install the %%site.name%% badge on your blog or web site to show the latest updates from you and your friends! -- cgit v1.2.3-54-g00ecf From 5c5a905eb94832f2f33dc6a0a99c77912a7ec09d Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 8 Nov 2009 22:55:53 +0000 Subject: Moved back to using lib twitterapi instead of api for 0.8.x --- plugins/Realtime/RealtimePlugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 0c7c1240c..181927968 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -240,13 +240,13 @@ class RealtimePlugin extends Plugin // FIXME: this code should be abstracted to a neutral third // party, like Notice::asJson(). I'm not sure of the ethics // of refactoring from within a plugin, so I'm just abusing - // the ApiAction method. Don't do this unless you're me! + // the TwitterApiAction method. Don't do this unless you're me! - require_once(INSTALLDIR.'/lib/api.php'); + require_once(INSTALLDIR.'/lib/twitterapi.php'); - $act = new ApiAction('/dev/null'); + $act = new TwitterApiAction('/dev/null'); - $arr = $act->twitterStatusArray($notice, true); + $arr = $act->twitter_status_array($notice, true); $arr['url'] = $notice->bestUrl(); $arr['html'] = htmlspecialchars($notice->rendered); $arr['source'] = htmlspecialchars($arr['source']); -- cgit v1.2.3-54-g00ecf From a0a9c7bcbf2d0cd041e9ada136213816600a7d84 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 9 Nov 2009 17:26:36 -0500 Subject: script to update avatar URLs on server --- scripts/updateavatarurl.php | 119 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 scripts/updateavatarurl.php diff --git a/scripts/updateavatarurl.php b/scripts/updateavatarurl.php new file mode 100644 index 000000000..acafa74b0 --- /dev/null +++ b/scripts/updateavatarurl.php @@ -0,0 +1,119 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'i:n:a'; +$longoptions = array('id=', 'nickname=', 'all'); + +$helptext = <<find()) { + while ($user->fetch()) { + updateAvatars($user); + } + } + } else { + throw new Exception("You have to provide an ID or nickname or 'all'."); + } +} catch (Exception $e) { + print $e->getMessage()."\n"; + exit(1); +} + +function updateAvatars($user) +{ + if (!have_option('q', 'quiet')) { + print "Updating avatars for user '".$user->nickname."' (".$user->id.")..."; + } + + $avatar = new Avatar(); + + $avatar->profile_id = $user->id; + + if (!$avatar->find()) { + if (have_option('v', 'verbose')) { + print "(none found)..."; + } + } else { + while ($avatar->fetch()) { + if (have_option('v', 'verbose')) { + if ($avatar->original) { + print "original..."; + } else { + print $avatar->width."..."; + } + } + + $orig = clone($avatar); + + $avatar->url = Avatar::url($avatar->filename); + + if ($avatar->url != $orig->url) { + $sql = + "UPDATE avatar SET url = '" . $avatar->url . "' ". + "WHERE profile_id = " . $avatar->profile_id . " ". + "AND width = " . $avatar->width . " " . + "AND height = " . $avatar->height . " "; + + if ($avatar->original) { + $sql .= "AND original = 1 "; + } + + if (!$avatar->query($sql)) { + throw new Exception("Can't update avatar for user " . $user->nickname . "."); + } + } + } + + } + if (have_option('v', 'verbose')) { + print "DONE.\n"; + } +} -- cgit v1.2.3-54-g00ecf From a6312cb79cabad68d305ca9f4f2e5b3340f03f42 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 9 Nov 2009 17:26:36 -0500 Subject: script to update avatar URLs on server --- scripts/updateavatarurl.php | 119 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 scripts/updateavatarurl.php diff --git a/scripts/updateavatarurl.php b/scripts/updateavatarurl.php new file mode 100644 index 000000000..acafa74b0 --- /dev/null +++ b/scripts/updateavatarurl.php @@ -0,0 +1,119 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'i:n:a'; +$longoptions = array('id=', 'nickname=', 'all'); + +$helptext = <<find()) { + while ($user->fetch()) { + updateAvatars($user); + } + } + } else { + throw new Exception("You have to provide an ID or nickname or 'all'."); + } +} catch (Exception $e) { + print $e->getMessage()."\n"; + exit(1); +} + +function updateAvatars($user) +{ + if (!have_option('q', 'quiet')) { + print "Updating avatars for user '".$user->nickname."' (".$user->id.")..."; + } + + $avatar = new Avatar(); + + $avatar->profile_id = $user->id; + + if (!$avatar->find()) { + if (have_option('v', 'verbose')) { + print "(none found)..."; + } + } else { + while ($avatar->fetch()) { + if (have_option('v', 'verbose')) { + if ($avatar->original) { + print "original..."; + } else { + print $avatar->width."..."; + } + } + + $orig = clone($avatar); + + $avatar->url = Avatar::url($avatar->filename); + + if ($avatar->url != $orig->url) { + $sql = + "UPDATE avatar SET url = '" . $avatar->url . "' ". + "WHERE profile_id = " . $avatar->profile_id . " ". + "AND width = " . $avatar->width . " " . + "AND height = " . $avatar->height . " "; + + if ($avatar->original) { + $sql .= "AND original = 1 "; + } + + if (!$avatar->query($sql)) { + throw new Exception("Can't update avatar for user " . $user->nickname . "."); + } + } + } + + } + if (have_option('v', 'verbose')) { + print "DONE.\n"; + } +} -- cgit v1.2.3-54-g00ecf From 499b3555df2a3c27f56f2931b3add15192fef1fc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 9 Nov 2009 17:41:51 -0500 Subject: broadcast profile changes from updateavatarurl.php --- scripts/updateavatarurl.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/updateavatarurl.php b/scripts/updateavatarurl.php index acafa74b0..dfcfc118c 100644 --- a/scripts/updateavatarurl.php +++ b/scripts/updateavatarurl.php @@ -69,6 +69,8 @@ try { function updateAvatars($user) { + $touched = false; + if (!have_option('q', 'quiet')) { print "Updating avatars for user '".$user->nickname."' (".$user->id.")..."; } @@ -108,11 +110,18 @@ function updateAvatars($user) if (!$avatar->query($sql)) { throw new Exception("Can't update avatar for user " . $user->nickname . "."); + } else { + $touched = true; } } } + } + if ($touched) { + $profile = $user->getProfile(); + common_broadcast_profile($profile); } + if (have_option('v', 'verbose')) { print "DONE.\n"; } -- cgit v1.2.3-54-g00ecf From c9eb7c1f0b60cbcf4672bcfca0814dd1bfc1dcf0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 11 Nov 2009 10:04:27 -0800 Subject: Bug 1969: rebuild corrupted l10n files which caused all UI strings to be shown as nulls (already done on 0.9.x in course of other major l10n changes) http://status.net/trac/ticket/1969 --- locale/it_IT/LC_MESSAGES/statusnet.mo | Bin 80186 -> 83401 bytes locale/mk_MK/LC_MESSAGES/statusnet.mo | Bin 37731 -> 50541 bytes locale/mk_MK/LC_MESSAGES/statusnet.po | 10 ---------- locale/pt_BR/LC_MESSAGES/statusnet.mo | Bin 76797 -> 83652 bytes locale/vi_VN/LC_MESSAGES/statusnet.mo | Bin 50650 -> 78725 bytes 5 files changed, 10 deletions(-) diff --git a/locale/it_IT/LC_MESSAGES/statusnet.mo b/locale/it_IT/LC_MESSAGES/statusnet.mo index 95764f1e2..00ab59804 100644 Binary files a/locale/it_IT/LC_MESSAGES/statusnet.mo and b/locale/it_IT/LC_MESSAGES/statusnet.mo differ diff --git a/locale/mk_MK/LC_MESSAGES/statusnet.mo b/locale/mk_MK/LC_MESSAGES/statusnet.mo index 0ac378c79..5dec309dd 100644 Binary files a/locale/mk_MK/LC_MESSAGES/statusnet.mo and b/locale/mk_MK/LC_MESSAGES/statusnet.mo differ 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 index 9db1638b0..a5a6f2725 100644 Binary files a/locale/pt_BR/LC_MESSAGES/statusnet.mo and b/locale/pt_BR/LC_MESSAGES/statusnet.mo differ diff --git a/locale/vi_VN/LC_MESSAGES/statusnet.mo b/locale/vi_VN/LC_MESSAGES/statusnet.mo index 65add28b4..b2f4dd370 100644 Binary files a/locale/vi_VN/LC_MESSAGES/statusnet.mo and b/locale/vi_VN/LC_MESSAGES/statusnet.mo differ -- cgit v1.2.3-54-g00ecf From 83b92d9ef01cdf640eb7f88e218569e6a5aebbdd Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 11 Nov 2009 15:37:17 -0500 Subject: Refactored the favorite button ajaxification to a separate function --- js/util.js | 83 ++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 45 insertions(+), 38 deletions(-) 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() { -- cgit v1.2.3-54-g00ecf From 03022c6e601f223c92216af9748c764786cf46c2 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 11 Nov 2009 15:38:28 -0500 Subject: Resetup the ajaxification for replies and favors after inf. scrolling Made the selector much more specific, so it only works on pages that have notices --- plugins/InfiniteScroll/infinitescroll.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/InfiniteScroll/infinitescroll.js b/plugins/InfiniteScroll/infinitescroll.js index ae4d53d09..5084af91f 100644 --- a/plugins/InfiniteScroll/infinitescroll.js +++ b/plugins/InfiniteScroll/infinitescroll.js @@ -2,7 +2,13 @@ jQuery(document).ready(function($){ $('notices_primary').infinitescroll({ debug: true, 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 : "Loading the next set of posts...", donetext : "Congratulations, you\'ve reached the end of the Internet.", @@ -11,5 +17,7 @@ jQuery(document).ready(function($){ itemSelector : "#notices_primary ol.notices li" },function(){ NoticeAttachments(); + NoticeReply(); + NoticeFavors(); }); }); -- cgit v1.2.3-54-g00ecf From 4f1b7fe575bec23ae9b6a595c0524ddd30434310 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 11 Nov 2009 15:39:23 -0500 Subject: Disable debug mode (so there are no messages written to the javascript console) --- plugins/InfiniteScroll/infinitescroll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/InfiniteScroll/infinitescroll.js b/plugins/InfiniteScroll/infinitescroll.js index 5084af91f..9e5593d25 100644 --- a/plugins/InfiniteScroll/infinitescroll.js +++ b/plugins/InfiniteScroll/infinitescroll.js @@ -1,6 +1,6 @@ jQuery(document).ready(function($){ $('notices_primary').infinitescroll({ - debug: true, + debug: false, infiniteScroll : false, nextSelector : 'body#public li.nav_next a,'+ 'body#all li.nav_next a,'+ -- cgit v1.2.3-54-g00ecf From c28b9ce31a0d20d3ee1907f6ab3aa197175b7411 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 12 Nov 2009 10:24:18 +0000 Subject: Removed old comments --- plugins/Meteor/meteorupdater.js | 2 -- 1 file changed, 2 deletions(-) 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() { -- cgit v1.2.3-54-g00ecf From 3752c1fdcee53c7e609d77600591b7de78b7ce3b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 12 Nov 2009 10:37:43 +0000 Subject: Removed extra showScript() call at the bottom of the document. 0.8.x is using for scripts whereas 0.9.x puts it before . This also fixes the duplicate posts --- plugins/Realtime/RealtimePlugin.php | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 181927968..0f0d0f9f4 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -230,7 +230,6 @@ class RealtimePlugin extends Plugin } $action->showContentBlock(); - $action->showScripts(); $action->elementEnd('body'); return false; // No default processing } -- cgit v1.2.3-54-g00ecf From 3bf1024771537b4499ffbf8e2e7c25be30cc204d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 14 Nov 2009 13:14:20 -0800 Subject: Fix regression from ba199ad4ec47e6b0c067a3b2a15882d3836ea009: typo in refactoring caused fatal error on unrecognized message source Example report from live site: http://identi.ca/notice/14629110 --- lib/mailbox.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3-54-g00ecf From e4d191334f5b2e40a4cd97e1c23677d4712b7700 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 16 Nov 2009 16:19:27 -0500 Subject: Only show local notices or (remote notices if they're supposed to be shown) --- plugins/Realtime/RealtimePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 0f0d0f9f4..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'); } -- cgit v1.2.3-54-g00ecf From 629532e2da239b791b245ce702170d0b8de9c0ef Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 16 Nov 2009 22:00:15 +0000 Subject: Added update delay and max notice count --- plugins/Realtime/realtimeupdate.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index e82b4dbfb..59045c094 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -34,6 +34,8 @@ RealtimeUpdate = { _favorurl: '', _deleteurl: '', _updatecounter: 0, + _updatedelay: 500, + _maxnotices: 50, init: function(userid, replyurl, favorurl, deleteurl) { @@ -76,11 +78,16 @@ 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").remove(); + } + NoticeReply(); RealtimeUpdate._updatecounter += 1; document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; - }, 500); + }, RealtimeUpdate._updatedelay); }, makeNoticeItem: function(data) -- cgit v1.2.3-54-g00ecf From be73757131127c687090f925ff873ff385a88604 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 16 Nov 2009 22:16:08 +0000 Subject: Unbinding the events from Notice reply and favor for possible memory leaks --- plugins/Realtime/realtimeupdate.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 59045c094..16c96615e 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -80,6 +80,9 @@ RealtimeUpdate = { $("#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_in-reply-to").unbind('click'); $("#notices_primary .notice:last").remove(); } -- cgit v1.2.3-54-g00ecf From 8b4fd414218d162970cf997d260e070d0a5177fe Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 16 Nov 2009 22:16:55 +0000 Subject: Added NoticeFavors() for received notices --- plugins/Realtime/realtimeupdate.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 16c96615e..2ded33e93 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -86,6 +86,7 @@ RealtimeUpdate = { $("#notices_primary .notice:last").remove(); } + NoticeFavors(); NoticeReply(); RealtimeUpdate._updatecounter += 1; -- cgit v1.2.3-54-g00ecf From ca31504dd91560496c55bf9a781e2d72e3fb367a Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 17 Nov 2009 00:07:21 +0000 Subject: Using the right selector for notice_reply --- plugins/Realtime/realtimeupdate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 2ded33e93..132f79abb 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -82,7 +82,7 @@ RealtimeUpdate = { 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_in-reply-to").unbind('click'); + $("#notices_primary .notice:last .notice_reply").unbind('click'); $("#notices_primary .notice:last").remove(); } -- cgit v1.2.3-54-g00ecf From a6399ce73a7459a8ee7bc18f6b8c449e0b45b5fb Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 17 Nov 2009 00:28:56 +0000 Subject: Showing counter for new notices only if the window is on blur --- plugins/Realtime/realtimeupdate.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 132f79abb..fa0fefed4 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -36,6 +36,7 @@ RealtimeUpdate = { _updatecounter: 0, _updatedelay: 500, _maxnotices: 50, + _windowhasfocus: false, init: function(userid, replyurl, favorurl, deleteurl) { @@ -46,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' @@ -59,6 +62,7 @@ RealtimeUpdate = { RealtimeUpdate._updatecounter = 0; document.title = DT; + RealtimeUpdate._windowhasfocus = false; return false; }); @@ -89,8 +93,10 @@ RealtimeUpdate = { NoticeFavors(); NoticeReply(); - RealtimeUpdate._updatecounter += 1; - document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; + if (RealtimeUpdate._windowhasfocus === false) { + RealtimeUpdate._updatecounter += 1; + document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; + } }, RealtimeUpdate._updatedelay); }, -- cgit v1.2.3-54-g00ecf From f92574dbcb1f2d7cd0aaf3c9362db46fa066e888 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 18 Nov 2009 12:43:52 -0800 Subject: Add MuSTArD to notice sources --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 5c5c939dd..10ff0d55a 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -30,6 +30,7 @@ VALUES ('mbpidgin','mbpidgin','http://code.google.com/p/microblog-purple/', now()), ('Mobidentica', 'Mobidentica', 'http://www.substanceofcode.com/software/mobidentica/', now()), ('moconica','Moconica','http://moconica.com/', now()), + ('mustard', 'MuSTArDroid', 'https://launchpad.net/mustardroid', now()), ('nambu','Nambu','http://www.nambu.com/', now()), ('peoplebrowsr', 'PeopleBrowsr', 'http://www.peoplebrowsr.com/', now()), ('Pikchur','Pikchur','http://www.pikchur.com/', now()), -- cgit v1.2.3-54-g00ecf From 30f660b05c1b4938b192f88574ec5f90dd0d3bf6 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 20 Nov 2009 02:12:09 +0000 Subject: Using common_redirect --- plugins/MobileProfile/MobileProfilePlugin.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 9f8923396..c257f3fd8 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -63,9 +63,6 @@ class MobileProfilePlugin extends WAP20Plugin function onStartShowHTML($action) { - - - // XXX: This should probably graduate to WAP20Plugin // If they are on the mobile site, serve them MP @@ -162,8 +159,7 @@ class MobileProfilePlugin extends WAP20Plugin common_config('site', 'server'))) { // FIXME: Redirect to equivalent page on mobile site instead - header("Location: ".$this->_common_path('')); - exit(); + common_redirect($this->_common_path(''), 302); } } -- cgit v1.2.3-54-g00ecf From 2eed928837e767cb9d41bf73bdadd23df7cb8877 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 20 Nov 2009 03:06:12 +0000 Subject: Using the right form class name --- plugins/UserFlag/flagprofileform.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/UserFlag/flagprofileform.php b/plugins/UserFlag/flagprofileform.php index 262dad4a7..c20929a20 100644 --- a/plugins/UserFlag/flagprofileform.php +++ b/plugins/UserFlag/flagprofileform.php @@ -47,6 +47,18 @@ require_once INSTALLDIR.'/lib/form.php'; class FlagProfileForm extends ProfileActionForm { + /** + * class of the form + * Action this form provides + * + * @return string class of the form + */ + + function formClass() + { + return 'form_entity_flag'; + } + /** * Action this form provides * -- cgit v1.2.3-54-g00ecf From 3d2a2d4173739a36b45fa32535180b6534b083f9 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 19 Nov 2009 19:29:55 -0800 Subject: Fixed HXR response for flag user --- plugins/UserFlag/flagprofile.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php index 8ff2f1f72..b01d07e34 100644 --- a/plugins/UserFlag/flagprofile.php +++ b/plugins/UserFlag/flagprofile.php @@ -72,6 +72,34 @@ class FlagprofileAction extends ProfileFormAction return true; } + + /** + * Handle request + * + * Overriding the base Action's handle() here to deal check + * for Ajax and return an HXR response if necessary + * + * @param array $args $_REQUEST args; handled in prepare() + * + * @return void + */ + + function handle($args) + { + if ($this->boolean('ajax')) { + common_debug("ajax called for"); + } else { + common_debug("no ajax"); + } + + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $this->handlePost(); + if (!$this->boolean('ajax')) { + $this->returnToArgs(); + } + } + } + /** * Handle POST * @@ -97,6 +125,10 @@ class FlagprofileAction extends ProfileFormAction } $ufp->free(); + + if ($this->boolean('ajax')) { + $this->ajaxResults(); + } } function ajaxResults() { -- cgit v1.2.3-54-g00ecf From 50827d5e81c1b6a5c99e0d0fba2d6ed4c0d22875 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 19 Nov 2009 19:56:24 -0800 Subject: Don't show flag user button your own profile --- plugins/UserFlag/UserFlagPlugin.php | 2 +- plugins/UserFlag/flagprofile.php | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index c276c4b9f..97b999a2f 100644 --- a/plugins/UserFlag/UserFlagPlugin.php +++ b/plugins/UserFlag/UserFlagPlugin.php @@ -88,7 +88,7 @@ class UserFlagPlugin extends Plugin { $user = common_current_user(); - if (!empty($user)) { + if (!empty($user) && ($user->id != $profile->id)) { $action->elementStart('li', 'entity_flag'); diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php index b01d07e34..9bce7865b 100644 --- a/plugins/UserFlag/flagprofile.php +++ b/plugins/UserFlag/flagprofile.php @@ -86,12 +86,6 @@ class FlagprofileAction extends ProfileFormAction function handle($args) { - if ($this->boolean('ajax')) { - common_debug("ajax called for"); - } else { - common_debug("no ajax"); - } - if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->handlePost(); if (!$this->boolean('ajax')) { @@ -125,7 +119,7 @@ class FlagprofileAction extends ProfileFormAction } $ufp->free(); - + if ($this->boolean('ajax')) { $this->ajaxResults(); } -- cgit v1.2.3-54-g00ecf From b40948a700fa82110c28a3c8a48dc289e72163bd Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 20 Nov 2009 04:02:53 +0000 Subject: Removed call to NewDirectMessage() until IE return is fixed i.e.,