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

This commit is contained in:
Craig Andrews 2009-11-18 17:04:42 -05:00
commit cac5a417f2
72 changed files with 18546 additions and 7274 deletions

View File

@ -117,61 +117,13 @@ class ApiGroupCreateAction extends ApiAuthAction
return; return;
} }
$group = new User_group(); $group = User_group::register(array('nickname' => $this->nickname,
'fullname' => $this->fullname,
$group->query('BEGIN'); 'homepage' => $this->homepage,
'description' => $this->description,
$group->nickname = $this->nickname; 'location' => $this->location,
$group->fullname = $this->fullname; 'aliases' => $this->aliases,
$group->homepage = $this->homepage; 'userid' => $this->user->id));
$group->description = $this->description;
$group->location = $this->location;
$group->created = common_sql_now();
$result = $group->insert();
if (!$result) {
common_log_db_error($group, 'INSERT', __FILE__);
$this->serverError(
_('Could not create group.'),
500,
$this->format
);
return;
}
$result = $group->setAliases($this->aliases);
if (!$result) {
$this->serverError(
_('Could not create aliases.'),
500,
$this->format
);
return;
}
$member = new Group_member();
$member->group_id = $group->id;
$member->profile_id = $this->user->id;
$member->is_admin = 1;
$member->created = $group->created;
$result = $member->insert();
if (!$result) {
common_log_db_error($member, 'INSERT', __FILE__);
$this->serverError(
_('Could not set group membership.'),
500,
$this->format
);
return;
}
$group->query('COMMIT');
switch($this->format) { switch($this->format) {
case 'xml': case 'xml':
$this->showSingleXmlGroup($group); $this->showSingleXmlGroup($group);

View File

@ -85,7 +85,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$this->lat = $this->trimmed('lat'); $this->lat = $this->trimmed('lat');
$this->lon = $this->trimmed('long'); $this->lon = $this->trimmed('long');
if (empty($this->source) || in_array($source, self::$reserved_sources)) { if (empty($this->source) || in_array($this->source, self::$reserved_sources)) {
$this->source = 'api'; $this->source = 'api';
} }

View File

@ -186,45 +186,13 @@ class NewgroupAction extends Action
assert(!is_null($cur)); assert(!is_null($cur));
$group = new User_group(); $group = User_group::register(array('nickname' => $nickname,
'fullname' => $fullname,
$group->query('BEGIN'); 'homepage' => $homepage,
'description' => $description,
$group->nickname = $nickname; 'location' => $location,
$group->fullname = $fullname; 'aliases' => $aliases,
$group->homepage = $homepage; 'userid' => $cur->id));
$group->description = $description;
$group->location = $location;
$group->created = common_sql_now();
$result = $group->insert();
if (!$result) {
common_log_db_error($group, 'INSERT', __FILE__);
$this->serverError(_('Could not create group.'));
}
$result = $group->setAliases($aliases);
if (!$result) {
$this->serverError(_('Could not create aliases.'));
}
$member = new Group_member();
$member->group_id = $group->id;
$member->profile_id = $cur->id;
$member->is_admin = 1;
$member->created = $group->created;
$result = $member->insert();
if (!$result) {
common_log_db_error($member, 'INSERT', __FILE__);
$this->serverError(_('Could not set group membership.'));
}
$group->query('COMMIT');
common_redirect($group->homeUrl(), 303); common_redirect($group->homeUrl(), 303);
} }

View File

@ -354,4 +354,66 @@ class User_group extends Memcached_DataObject
return $xs->getString(); return $xs->getString();
} }
static function register($fields) {
// MAGICALLY put fields into current scope
extract($fields);
$group = new User_group();
$group->query('BEGIN');
$group->nickname = $nickname;
$group->fullname = $fullname;
$group->homepage = $homepage;
$group->description = $description;
$group->location = $location;
$group->created = common_sql_now();
$result = $group->insert();
if (!$result) {
common_log_db_error($group, 'INSERT', __FILE__);
$this->serverError(
_('Could not create group.'),
500,
$this->format
);
return;
}
$result = $group->setAliases($aliases);
if (!$result) {
$this->serverError(
_('Could not create aliases.'),
500,
$this->format
);
return;
}
$member = new Group_member();
$member->group_id = $group->id;
$member->profile_id = $userid;
$member->is_admin = 1;
$member->created = $group->created;
$result = $member->insert();
if (!$result) {
common_log_db_error($member, 'INSERT', __FILE__);
$this->serverError(
_('Could not set group membership.'),
500,
$this->format
);
return;
}
$group->query('COMMIT');
return $group;
}
} }

View File

@ -30,6 +30,7 @@ VALUES
('mbpidgin','mbpidgin','http://code.google.com/p/microblog-purple/', now()), ('mbpidgin','mbpidgin','http://code.google.com/p/microblog-purple/', now()),
('Mobidentica', 'Mobidentica', 'http://www.substanceofcode.com/software/mobidentica/', now()), ('Mobidentica', 'Mobidentica', 'http://www.substanceofcode.com/software/mobidentica/', now()),
('moconica','Moconica','http://moconica.com/', now()), ('moconica','Moconica','http://moconica.com/', now()),
('mustard', 'MuSTArDroid', 'https://launchpad.net/mustardroid', now()),
('nambu','Nambu','http://www.nambu.com/', now()), ('nambu','Nambu','http://www.nambu.com/', now()),
('peoplebrowsr', 'PeopleBrowsr', 'http://www.peoplebrowsr.com/', now()), ('peoplebrowsr', 'PeopleBrowsr', 'http://www.peoplebrowsr.com/', now()),
('Pikchur','Pikchur','http://www.pikchur.com/', now()), ('Pikchur','Pikchur','http://www.pikchur.com/', now()),

View File

@ -77,6 +77,6 @@ class UnblockForm extends ProfileActionForm
function description() function description()
{ {
return _('Unlock this user'); return _('Unblock this user');
} }
} }

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -118,6 +118,13 @@ class RealtimePlugin extends Plugin
return true; return true;
} }
function onEndShowStatusNetStyles($action)
{
$action->cssLink(common_path('plugins/Realtime/realtimeupdate.css'),
null, 'screen, projection, tv');
return true;
}
function onEndNoticeSave($notice) function onEndNoticeSave($notice)
{ {
$paths = array(); $paths = array();

View File

@ -0,0 +1,49 @@
#notices_primary {
position:relative;
}
#realtime_actions {
position: absolute;
top: -20px;
right: 0;
margin: 0 0 11px 0;
}
#realtime_actions li {
margin-left: 18px;
list-style-type: none;
float: left;
}
#realtime_actions button {
width: 16px;
height: 16px;
display: block;
border: none;
cursor: pointer;
text-indent: -9999px;
float: left;
}
#realtime_play {
background: url(icon_play.gif) no-repeat 47% 47%;
margin-left: 4px;
}
#realtime_pause {
background: url(icon_pause.gif) no-repeat 47% 47%;
}
#realtime_popup {
background: url(icon_external.gif) no-repeat 0 30%;
}
#queued_counter {
float:left;
line-height:1.2;
}
#showstream #notices_primary {
margin-top: 18px;
}

View File

@ -66,26 +66,26 @@ RealtimeUpdate = {
receive: function(data) receive: function(data)
{ {
id = data.id;
// Don't add it if it already exists
if ($("#notice-"+id).length > 0) {
return;
}
if (RealtimeUpdate._paused === false) { if (RealtimeUpdate._paused === false) {
RealtimeUpdate.purgeLastNoticeItem(); RealtimeUpdate.purgeLastNoticeItem();
RealtimeUpdate.insertNoticeItem(data); RealtimeUpdate.insertNoticeItem(data);
RealtimeUpdate.updateWindowCounter();
} }
else { else {
RealtimeUpdate._queuedNotices.push(data); RealtimeUpdate._queuedNotices.push(data);
RealtimeUpdate.updateQueuedCounter();
} }
RealtimeUpdate.updateWindowCounter();
}, },
insertNoticeItem: function(data) { insertNoticeItem: function(data) {
// Don't add it if it already exists
if ($("#notice-"+data.id).length > 0) {
return;
}
var noticeItem = RealtimeUpdate.makeNoticeItem(data); var noticeItem = RealtimeUpdate.makeNoticeItem(data);
$("#notices_primary .notices").prepend(noticeItem); $("#notices_primary .notices").prepend(noticeItem);
$("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").css({display:"none"});
@ -192,21 +192,7 @@ RealtimeUpdate = {
initActions: function(url, timeline, path) initActions: function(url, timeline, path)
{ {
var NP = $('#notices_primary'); var NP = $('#notices_primary');
NP.prepend('<ul id="realtime_actions"><li id="realtime_pauseplay"></li><li id="realtime_timeline"></li></ul>'); NP.prepend('<ul id="realtime_actions"><li id="realtime_playpause"></li><li id="realtime_timeline"></li></ul>');
NP.css({'position':'relative'});
$('#realtime_actions').css({
'position':'absolute',
'top':'-20px',
'right':'0',
'margin':'0 0 11px 0'
});
$('#realtime_actions li').css({
'margin-left':'18px',
'list-style-type':'none',
'float':'left'
});
RealtimeUpdate._pluginPath = path; RealtimeUpdate._pluginPath = path;
@ -221,20 +207,11 @@ RealtimeUpdate = {
showPause: function() showPause: function()
{ {
RT_PP = $('#realtime_pauseplay'); RT_PP = $('#realtime_playpause');
RT_PP.empty(); RT_PP.empty();
RT_PP.append('<button id="realtime_pause" class="pause" title="Pause">Pause</button>'); RT_PP.append('<button id="realtime_pause" class="pause" title="Pause">Pause</button>');
RT_P = $('#realtime_pause'); RT_P = $('#realtime_pause');
$('#realtime_pause').css({
'background':'url('+RealtimeUpdate._pluginPath+'icon_pause.gif) no-repeat 47% 47%',
'width':'16px',
'height':'16px',
'display':'block',
'border':'none',
'cursor':'pointer',
'text-indent':'-9999px'
});
RT_P.bind('click', function() { RT_P.bind('click', function() {
RealtimeUpdate._paused = true; RealtimeUpdate._paused = true;
@ -245,20 +222,11 @@ RealtimeUpdate = {
showPlay: function() showPlay: function()
{ {
RT_PP = $('#realtime_pauseplay'); RT_PP = $('#realtime_playpause');
RT_PP.empty(); RT_PP.empty();
RT_PP.append('<button id="realtime_play" class="play" title="Play">Play</button>'); RT_PP.append('<span id="queued_counter"></span> <button id="realtime_play" class="play" title="Play">Play</button>');
RT_P = $('#realtime_play'); RT_P = $('#realtime_play');
RT_P.css({
'background':'url('+RealtimeUpdate._pluginPath+'icon_play.gif) no-repeat 47% 47%',
'width':'16px',
'height':'16px',
'display':'block',
'border':'none',
'cursor':'pointer',
'text-indent':'-9999px'
});
RT_P.bind('click', function() { RT_P.bind('click', function() {
RealtimeUpdate._paused = false; RealtimeUpdate._paused = false;
@ -270,12 +238,25 @@ RealtimeUpdate = {
}); });
}, },
showQueuedNotices: function() { showQueuedNotices: function()
{
$.each(RealtimeUpdate._queuedNotices, function(i, n) { $.each(RealtimeUpdate._queuedNotices, function(i, n) {
RealtimeUpdate.insertNoticeItem(n); RealtimeUpdate.insertNoticeItem(n);
}); });
RealtimeUpdate._queuedNotices = []; RealtimeUpdate._queuedNotices = [];
RealtimeUpdate.removeQueuedCounter();
},
updateQueuedCounter: function()
{
$('#realtime_playpause #queued_counter').html('('+RealtimeUpdate._queuedNotices.length+')');
},
removeQueuedCounter: function()
{
$('#realtime_playpause #queued_counter').empty();
}, },
initAddPopup: function(url, timeline, path) initAddPopup: function(url, timeline, path)
@ -284,17 +265,6 @@ RealtimeUpdate = {
NP.append('<button id="realtime_popup" title="Pop up in a window">Pop up</button>'); NP.append('<button id="realtime_popup" title="Pop up in a window">Pop up</button>');
var PP = $('#realtime_popup'); var PP = $('#realtime_popup');
PP.css({
'background':'transparent url('+ path + 'icon_external.gif) no-repeat 0 30%',
'width':'16px',
'height':'16px',
'display':'block',
'border':'none',
'cursor':'pointer',
'text-indent':'-9999px'
});
$('#showstream #notices_primary').css({'margin-top':'18px'});
PP.bind('click', function() { PP.bind('click', function() {
window.open(url, window.open(url,
'', '',