diff options
author | Zach Copley <zach@status.net> | 2009-12-03 12:51:21 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-12-03 12:51:21 -0800 |
commit | bf4ed35a90d5cc906dbae7c097551fb3a10f14d6 (patch) | |
tree | 6e4e4c172865c81ca8bc05672cd5e5f9256fc0fb /plugins | |
parent | 7ed3328c47ee9aac1d7663bce0c6c6349f7b2570 (diff) | |
parent | 9e0f89ba4ff1695c0137faa89c08f8b5c60050ac (diff) |
Merge branch '0.9.x'
* 0.9.x: (141 commits)
Reload the admin design panel page to show the new CSS when the
Only pick up new default site colors if the theme has NOT changed.
Delete design when user chooses to restore default design, instead
Localisation updates for !StatusNet from !translatewiki.net !sntrans
Do not rebuild/add .mo files by default
If an XHR notice is sent form a page that has no timeline, show a
Revert "If the page doesn't have .notices, silently skip the notice XHR response"
Revert "Clear/reset the XHR notice form on pages where there is no timeline"
Clear/reset the XHR notice form on pages where there is no timeline
If the page doesn't have .notices, silently skip the notice XHR response
Remove useless debugging statement
Moved form control styles (i.e., border and radius) out of base
add pluginhandler to list of daemons to shut down
Using box-shadow only on the current navigation item
Updated theme readme
Fix regression in password settings: users have been unable to change their passwords since introduction of ChangePassword event (later StartChangePassword) November 5 in commit d6ddb84132d7b9510ba82064c67f2a39822dab49
Ticket 2048: make OMB posting HTTP timeout configurable as $config['omb']['timeout']; defaults to 5 seconds instead of 20-second default in Yadis library
ticket 1100: add Drupal source link
Fix makefile wildcards for locale compilation (now works on Ubuntu 8.04)
typo fix: '$this' now spelled correctly. Looks like this'll fix acceptance of 'source' param for direct messages posted to API
...
Conflicts:
js/util.js
locale/ar/LC_MESSAGES/statusnet.po
locale/bg/LC_MESSAGES/statusnet.po
locale/ca/LC_MESSAGES/statusnet.po
locale/cs/LC_MESSAGES/statusnet.po
locale/de/LC_MESSAGES/statusnet.po
locale/el/LC_MESSAGES/statusnet.po
locale/en_GB/LC_MESSAGES/statusnet.po
locale/es/LC_MESSAGES/statusnet.po
locale/fi/LC_MESSAGES/statusnet.po
locale/fr/LC_MESSAGES/statusnet.po
locale/ga/LC_MESSAGES/statusnet.po
locale/he/LC_MESSAGES/statusnet.po
locale/is/LC_MESSAGES/statusnet.po
locale/it/LC_MESSAGES/statusnet.po
locale/ja/LC_MESSAGES/statusnet.po
locale/ko/LC_MESSAGES/statusnet.po
locale/mk/LC_MESSAGES/statusnet.po
locale/nb/LC_MESSAGES/statusnet.po
locale/nl/LC_MESSAGES/statusnet.po
locale/nn/LC_MESSAGES/statusnet.po
locale/pl/LC_MESSAGES/statusnet.po
locale/pt/LC_MESSAGES/statusnet.po
locale/pt_BR/LC_MESSAGES/statusnet.po
locale/ru/LC_MESSAGES/statusnet.po
locale/statusnet.po
locale/sv/LC_MESSAGES/statusnet.po
locale/te/LC_MESSAGES/statusnet.po
locale/tr/LC_MESSAGES/statusnet.po
locale/uk/LC_MESSAGES/statusnet.po
locale/vi/LC_MESSAGES/statusnet.po
locale/zh_CN/LC_MESSAGES/statusnet.po
locale/zh_TW/LC_MESSAGES/statusnet.po
plugins/Realtime/realtimeupdate.js
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/LilUrl/LilUrlPlugin.php | 2 | ||||
-rw-r--r-- | plugins/Mapstraction/usermap.js | 77 | ||||
-rw-r--r-- | plugins/MobileProfile/mp-screen.css | 45 | ||||
-rw-r--r-- | plugins/PtitUrl/PtitUrlPlugin.php | 9 | ||||
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 5 | ||||
-rw-r--r-- | plugins/Realtime/realtimeupdate.css | 37 | ||||
-rw-r--r-- | plugins/Realtime/realtimeupdate.js | 28 | ||||
-rw-r--r-- | plugins/TightUrl/TightUrlPlugin.php | 9 | ||||
-rwxr-xr-x | plugins/TwitterBridge/daemons/twitterstatusfetcher.php | 1 | ||||
-rw-r--r-- | plugins/UrlShortener/UrlShortenerPlugin.php | 8 | ||||
-rw-r--r-- | plugins/UserFlag/UserFlagPlugin.php | 10 | ||||
-rw-r--r-- | plugins/UserFlag/adminprofileflag.php | 5 | ||||
-rw-r--r-- | plugins/UserFlag/icon_flag.gif (renamed from plugins/UserFlag/flag.gif) | bin | 80 -> 80 bytes | |||
-rw-r--r-- | plugins/UserFlag/userflag.css | 4 |
14 files changed, 169 insertions, 71 deletions
diff --git a/plugins/LilUrl/LilUrlPlugin.php b/plugins/LilUrl/LilUrlPlugin.php index e906751e8..4a6f1cdc7 100644 --- a/plugins/LilUrl/LilUrlPlugin.php +++ b/plugins/LilUrl/LilUrlPlugin.php @@ -54,7 +54,7 @@ class LilUrlPlugin extends UrlShortenerPlugin if (!isset($y->body)) return; $x = $y->body->p[0]->a->attributes(); if (isset($x['href'])) { - return $x['href']; + return strval($x['href']); } } } diff --git a/plugins/Mapstraction/usermap.js b/plugins/Mapstraction/usermap.js index 270b7efea..e667dd579 100644 --- a/plugins/Mapstraction/usermap.js +++ b/plugins/Mapstraction/usermap.js @@ -1,14 +1,83 @@ $(document).ready(function() { - var mapstraction = new mxn.Mapstraction("map_canvas", _provider); + var notices = []; + $(".notice").each(function(){ + var notice = getNoticeFromElement($(this)); + if(notice['geo']) + notices.push(notice); + }); + if($("#map_canvas").length && notices.length>0) + { + showMapstraction($("#map_canvas"), notices); + } + + $('.geo').click(function(){ + var noticeElement = $(this).closest(".notice"); + notice = getNoticeFromElement(noticeElement); + + $.fn.jOverlay.options = { + color : '#000', + opacity : '0.6', + zIndex : 99, + center : false, + bgClickToClose : true, + autoHide : true, + css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'} + }; + var html="<div id='map_canvas_popup' class='gray smallmap' style='width: 542px; height: 500px' />"; + html+="<button class='close'>×</button>"; + html+=$("<div/>").append($(this).clone()).html(); + $().jOverlay({ "html": html }); + $('#jOverlayContent').show(); + $('#jOverlayContent button').click($.closeOverlay); + + showMapstraction($("#map_canvas_popup"), notice); + + return false; + }); +}); + +function getMicroformatValue(element) +{ + if(element[0].tagName.toLowerCase() == 'abbr'){ + return element.attr('title'); + }else{ + return element.text(); + } +} + +function getNoticeFromElement(noticeElement) +{ + var notice = {}; + if(noticeElement.find(".geo").length){ + var latlon = noticeElement.find(".geo").attr('title').split(";"); + notice['geo']={'coordinates': [ + parseFloat(latlon[0]), + parseFloat(latlon[1])] }; + } + notice['user']={ + 'profile_image_url': noticeElement.find("img.avatar").attr('src'), + 'profile_url': noticeElement.find(".author a.url").attr('href'), + 'screen_name': noticeElement.find(".author .nickname").text() + }; + notice['html']=noticeElement.find(".entry-content").html(); + notice['url']=noticeElement.find("a.timestamp").attr('href'); + notice['created_at']=noticeElement.find("abbr.published").text(); + return notice; +} + +function showMapstraction(element, notices) { + if(element instanceof jQuery) element = element[0]; + if(! $.isArray(notices)) notices = [notices]; + var mapstraction = new mxn.Mapstraction(element, _provider); var minLat = 181.0; var maxLat = -181.0; var minLon = 181.0; var maxLon = -181.0; - for (var i in _notices) + for (var i in notices) { - var n = _notices[i]; + var n = notices[i]; var lat = n['geo']['coordinates'][0]; var lon = n['geo']['coordinates'][1]; @@ -42,4 +111,4 @@ $(document).ready(function() { bounds = new mxn.BoundingBox(minLat, minLon, maxLat, maxLon); mapstraction.setBounds(bounds); -}); +} diff --git a/plugins/MobileProfile/mp-screen.css b/plugins/MobileProfile/mp-screen.css index 1bb0248ec..e05adeb83 100644 --- a/plugins/MobileProfile/mp-screen.css +++ b/plugins/MobileProfile/mp-screen.css @@ -1,3 +1,12 @@ +/** theme: mobile profile screen + * + * @package StatusNet + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + @import url(../../theme/base/css/display.css); @import url(../../theme/identica/css/display.css); @@ -64,8 +73,6 @@ width:auto; margin-left:0; } - - #site_nav_global_primary { margin:0; width:100%; @@ -81,7 +88,6 @@ float:left; font-size:0.9em; } - #form_notice { width:100%; } @@ -106,13 +112,16 @@ iPhone/iPod Touch, Android, Opera Mini Simulator display:none; } #form_notice #notice_data-attach { -top:auto; -bottom:0; -left:0; -right:auto; -opacity:1; -z-index:9; +position:static; +clear:both; width:65%; +height:auto; +display:block; +z-index:9; +padding:0; +margin:0; +background:none; +opacity:1; } #form_notice #notice_action-submit { @@ -168,9 +177,6 @@ margin-bottom:0; padding-top:4px; padding-bottom:4px; } -.notice .entry-title { - -} .notice div.entry-content { margin-left:0; width:65%; @@ -180,14 +186,21 @@ width:30%; margin-right:2%; } - +.notice-options form { +width:16px; +height:16px; +} +.notice-options a, +.notice-options input { +box-shadow:none; +-moz-box-shadow:none; +-webkit-box-shadow:none; +} .entity_profile { width:auto; } - - .entity_actions { margin-right:0; margin-left:0; @@ -239,8 +252,6 @@ height:auto; margin-right:5%; } - - #footer { width:96%; padding:2%; diff --git a/plugins/PtitUrl/PtitUrlPlugin.php b/plugins/PtitUrl/PtitUrlPlugin.php index ef453e96d..76a438dd5 100644 --- a/plugins/PtitUrl/PtitUrlPlugin.php +++ b/plugins/PtitUrl/PtitUrlPlugin.php @@ -47,11 +47,14 @@ class PtitUrlPlugin extends UrlShortenerPlugin { $response = $this->http_get(sprintf($this->serviceUrl,urlencode($url))); if (!$response) return; - $response = $this->tidy($response); - $y = @simplexml_load_string($response); + $dom = new DOMDocument(); + @$dom->loadHTML($response); + $y = @simplexml_import_dom($dom); if (!isset($y->body)) return; $xml = $y->body->center->table->tr->td->pre->a->attributes(); - if (isset($xml['href'])) return $xml['href']; + if (isset($xml['href'])) { + return strval($xml['href']); + } } } diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index b737e442a..cbfa6bae0 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -220,8 +220,9 @@ class RealtimePlugin extends Plugin $action->elementStart('body', (common_current_user()) ? array('id' => $action->trimmed('action'), - 'class' => 'user_in') - : array('id' => $action->trimmed('action'))); + 'class' => 'user_in realtime-popup') + : array('id' => $action->trimmed('action'), + 'class'=> 'realtime-popup')); // XXX hack to deal with JS that tries to get the // root url from page output diff --git a/plugins/Realtime/realtimeupdate.css b/plugins/Realtime/realtimeupdate.css index 0ab5dd32b..56f869354 100644 --- a/plugins/Realtime/realtimeupdate.css +++ b/plugins/Realtime/realtimeupdate.css @@ -1,3 +1,40 @@ +.realtime-popup address { +display:none; +} + +.realtime-popup #content { +width:93.5%; +} + +.realtime-popup #form_notice { +margin:18px 0 18px 1.795%; +width:93%; +max-width:451px; +} + +.realtime-popup #form_notice label[for=notice_data-text], +.realtime-popup h1 { +display:none; +} + +.realtime-popup #form_notice label[for=notice_data-attach], +.realtime-popup #form_notice #notice_data-attach { +top:0; +} + +.realtime-popup #form_notice #notice_data-attach { +left:auto; +right:0; +} + +.realtime-popup .entity_profile { +width:70%; +} +.realtime-popup .entity_actions { +margin-left:1%; +} + + #notices_primary { position:relative; } diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index ec027e11d..ce0297339 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -94,14 +94,12 @@ RealtimeUpdate = { $("#notices_primary .notice:first").fadeIn(1000); SN.U.FormXHR($('#'+noticeItemID+' .form_favor')); - SN.U.NoticeReply(); + SN.U.NoticeReplyTo($('#'+noticeItemID)); + SN.U.NoticeWithAttachment($('#'+noticeItemID)); }, purgeLastNoticeItem: function() { 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(); } }, @@ -270,7 +268,7 @@ RealtimeUpdate = { PP.bind('click', function() { window.open(url, '', - 'toolbar=no,resizable=yes,scrollbars=yes,status=yes,width=500,height=550'); + 'toolbar=no,resizable=yes,scrollbars=yes,status=no,menubar=no,personalbar=no,location=no,width=500,height=550'); return false; }); @@ -278,26 +276,6 @@ RealtimeUpdate = { initPopupWindow: function() { - $('address').hide(); - $('#content').css({'width':'93.5%'}); - - $('#form_notice').css({ - 'margin':'18px 0 18px 1.795%', - 'width':'93%', - 'max-width':'451px' - }); - - $('#form_notice label[for=notice_data-text], h1').css({'display': 'none'}); - - $('.notices li:first-child').css({'border-top-color':'transparent'}); - - $('#form_notice label[for="notice_data-attach"], #form_notice #notice_data-attach').css({'top':'0'}); - - $('#form_notice #notice_data-attach').css({ - 'left':'auto', - 'right':'0' - }); - $('.notices .entry-title a, .notices .entry-content a').bind('click', function() { window.open(this.href, ''); diff --git a/plugins/TightUrl/TightUrlPlugin.php b/plugins/TightUrl/TightUrlPlugin.php index 56414c8c8..6ced9afdc 100644 --- a/plugins/TightUrl/TightUrlPlugin.php +++ b/plugins/TightUrl/TightUrlPlugin.php @@ -48,10 +48,13 @@ class TightUrlPlugin extends UrlShortenerPlugin { $response = $this->http_get(sprintf($this->serviceUrl,urlencode($url))); if (!$response) return; - $response = $this->tidy($response); - $y = @simplexml_load_string($response); + $dom = new DOMDocument(); + @$dom->loadHTML($response); + $y = @simplexml_import_dom($dom); if (!isset($y->body)) return; $xml = $y->body->p[0]->code[0]->a->attributes(); - if (isset($xml['href'])) return $xml['href']; + if (isset($xml['href'])) { + return strval($xml['href']); + } } } diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php index b5428316b..eba1d563b 100755 --- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php +++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php @@ -109,7 +109,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon $flink->find(); $flinks = array(); - common_log(LOG_INFO, "hello"); while ($flink->fetch()) { diff --git a/plugins/UrlShortener/UrlShortenerPlugin.php b/plugins/UrlShortener/UrlShortenerPlugin.php index 37206aa89..027624b7a 100644 --- a/plugins/UrlShortener/UrlShortenerPlugin.php +++ b/plugins/UrlShortener/UrlShortenerPlugin.php @@ -68,14 +68,6 @@ abstract class UrlShortenerPlugin extends Plugin return $response->getBody(); } - protected function tidy($response) { - $response = str_replace(' ', ' ', $response); - $config = array('output-xhtml' => true); - $tidy = new tidy; - $tidy->parseString($response, $config, 'utf8'); - $tidy->cleanRepair(); - return (string)$tidy; - } //------------Below are the methods that connect StatusNet to the implementing Url Shortener plugin------------\\ function onInitializePlugin(){ diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index 1f1f19957..60c0c2c0a 100644 --- a/plugins/UserFlag/UserFlagPlugin.php +++ b/plugins/UserFlag/UserFlagPlugin.php @@ -138,19 +138,15 @@ class UserFlagPlugin extends Plugin function onEndShowStatusNetStyles($action) { - $action->elementStart('style', array('type' => 'text/css')); - $action->raw('.entity_flag input, .entity_flag p {'. - ' background:url('.common_path('plugins/UserFlag/flag.gif').') 5px 5px no-repeat;'. - ' }'); - $action->elementEnd('style'); - + $action->cssLink(common_path('plugins/UserFlag/userflag.css'), + null, 'screen, projection, tv'); return true; } function onEndShowScripts($action) { $action->elementStart('script', array('type' => 'text/javascript')); - $action->raw('/*<![CDATA[*/ SN.U.FormXHR($(".form_entity_flag")); /*]]>*/'); + $action->raw('/*<![CDATA[*/ if ($(".form_entity_flag").length > 0) { SN.U.FormXHR($(".form_entity_flag")); } /*]]>*/'); $action->elementEnd('script'); return true; } diff --git a/plugins/UserFlag/adminprofileflag.php b/plugins/UserFlag/adminprofileflag.php index 1ac76b506..20b808637 100644 --- a/plugins/UserFlag/adminprofileflag.php +++ b/plugins/UserFlag/adminprofileflag.php @@ -145,10 +145,15 @@ class FlaggedProfileListItem extends ProfileListItem $this->startActions(); if (Event::handle('StartProfileListItemActionElements', array($this))) { + $this->out->elementStart('li', 'entity_moderation'); + $this->out->element('p', null, _('Moderate')); + $this->out->elementStart('ul'); $this->showSandboxButton(); $this->showSilenceButton(); $this->showDeleteButton(); $this->showClearButton(); + $this->out->elementEnd('ul'); + $this->out->elementEnd('li'); Event::handle('EndProfileListItemActionElements', array($this)); } $this->endActions(); diff --git a/plugins/UserFlag/flag.gif b/plugins/UserFlag/icon_flag.gif Binary files differindex 68c8aee25..68c8aee25 100644 --- a/plugins/UserFlag/flag.gif +++ b/plugins/UserFlag/icon_flag.gif diff --git a/plugins/UserFlag/userflag.css b/plugins/UserFlag/userflag.css new file mode 100644 index 000000000..98da24cc9 --- /dev/null +++ b/plugins/UserFlag/userflag.css @@ -0,0 +1,4 @@ +.entity_flag input.submit, +.entity_flag p { +background:url(icon_flag.gif) 5px 5px no-repeat; +} |