Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x

This commit is contained in:
Evan Prodromou 2009-04-23 05:24:13 -04:00
commit 85c7b8df71
6 changed files with 48 additions and 10 deletions

View File

@ -93,7 +93,7 @@ class AllAction extends ProfileAction
if (common_logged_in()) {
$current_user = common_current_user();
if ($this->user->id === $current_user->id) {
$message .= _('Try subscribing to more people, [join a group](%%action.groups) or post something yourself.');
$message .= _('Try subscribing to more people, [join a group](%%action.groups%%) or post something yourself.');
} else {
$message .= sprintf(_('You can try to [nudge %s](../%s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
}

View File

@ -172,15 +172,54 @@ class NewmessageAction extends Action
$this->notify($user, $this->other, $message);
$url = common_local_url('outbox', array('nickname' => $user->nickname));
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
$this->element('title', null, _('Message sent'));
$this->elementEnd('head');
$this->elementStart('body');
$this->element('p', array('id' => 'command_result'),
sprintf(_('Direct message to %s sent'),
$this->other->nickname));
$this->elementEnd('body');
$this->elementEnd('html');
} else {
$url = common_local_url('outbox',
array('nickname' => $user->nickname));
common_redirect($url, 303);
}
}
common_redirect($url, 303);
/**
* Show an Ajax-y error message
*
* Goes back to the browser, where it's shown in a popup.
*
* @param string $msg Message to show
*
* @return void
*/
function ajaxErrorMsg($msg)
{
$this->startHTML('text/xml;charset=utf-8', true);
$this->elementStart('head');
$this->element('title', null, _('Ajax Error'));
$this->elementEnd('head');
$this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body');
$this->elementEnd('html');
}
function showForm($msg = null)
{
$this->msg = $msg;
if ($msg && $this->boolean('ajax')) {
$this->ajaxErrorMsg($msg);
return;
}
$this->msg = $msg;
$this->showPage();
}

View File

@ -8,6 +8,7 @@ VALUES
('deskbar','Deskbar-Applet','http://www.gnome.org/projects/deskbar-applet/', now()),
('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()),
('Facebook','Facebook','http://apps.facebook.com/identica/', now()),
('feed2omb','feed2omb','http://projects.ciarang.com/p/feed2omb/', now()),
('Gwibber','Gwibber','http://launchpad.net/gwibber', now()),
('HelloTxt','HelloTxt','http://hellotxt.com/', now()),
('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()),

View File

@ -192,10 +192,8 @@ $(document).ready(function(){
$("#notice_action-submit").removeClass("disabled");
}
};
if (document.body.id != 'inbox' && document.body.id != 'outbox') {
$("#form_notice").ajaxForm(PostNotice);
$("#form_notice").each(addAjaxHidden);
}
$("#form_notice").ajaxForm(PostNotice);
$("#form_notice").each(addAjaxHidden);
NoticeHover();
NoticeReply();
});

View File

@ -192,7 +192,7 @@ $_config_files[] = INSTALLDIR.'/config.php';
$_have_a_config = false;
foreach ($_config_files as $_config_file) {
if (file_exists($_config_file)) {
if (@file_exists($_config_file)) {
include_once($_config_file);
$_have_a_config = true;
}

View File

@ -980,7 +980,7 @@ function common_root_url($ssl=false)
function common_good_rand($bytes)
{
// XXX: use random.org...?
if (file_exists('/dev/urandom')) {
if (@file_exists('/dev/urandom')) {
return common_urandom($bytes);
} else { // FIXME: this is probably not good enough
return common_mtrand($bytes);