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

This commit is contained in:
Sarven Capadisli 2009-05-23 22:28:36 -04:00
commit 5a1c95d52f
5 changed files with 46 additions and 38 deletions

View File

@ -9,6 +9,7 @@ VALUES
('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()), ('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()),
('Facebook','Facebook','http://apps.facebook.com/identica/', now()), ('Facebook','Facebook','http://apps.facebook.com/identica/', now()),
('feed2omb','feed2omb','http://projects.ciarang.com/p/feed2omb/', now()), ('feed2omb','feed2omb','http://projects.ciarang.com/p/feed2omb/', now()),
('gravity', 'Gravity', 'http://mobileways.de/gravity', now()),
('Gwibber','Gwibber','http://launchpad.net/gwibber', now()), ('Gwibber','Gwibber','http://launchpad.net/gwibber', now()),
('HelloTxt','HelloTxt','http://hellotxt.com/', now()), ('HelloTxt','HelloTxt','http://hellotxt.com/', now()),
('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()), ('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()),

View File

@ -35,15 +35,17 @@ function main()
function checkPrereqs() function checkPrereqs()
{ {
$pass = true;
if (file_exists(INSTALLDIR.'/config.php')) { if (file_exists(INSTALLDIR.'/config.php')) {
?><p class="error">Config file &quot;config.php&quot; already exists.</p> ?><p class="error">Config file &quot;config.php&quot; already exists.</p>
<?php <?php
return false; $pass = false;
} }
if (version_compare(PHP_VERSION, '5.0.0', '<')) { if (version_compare(PHP_VERSION, '5.0.0', '<')) {
?><p class="error">Require PHP version 5 or greater.</p><?php ?><p class="error">Require PHP version 5 or greater.</p><?php
return false; $pass = false;
} }
$reqs = array('gd', 'mysql', 'curl', $reqs = array('gd', 'mysql', 'curl',
@ -53,7 +55,7 @@ function checkPrereqs()
foreach ($reqs as $req) { foreach ($reqs as $req) {
if (!checkExtension($req)) { if (!checkExtension($req)) {
?><p class="error">Cannot load required extension: <code><?php echo $req; ?></code></p><?php ?><p class="error">Cannot load required extension: <code><?php echo $req; ?></code></p><?php
return false; $pass = false;
} }
} }
@ -61,17 +63,17 @@ function checkPrereqs()
?><p class="error">Cannot write config file to: <code><?php echo INSTALLDIR; ?></code></p> ?><p class="error">Cannot write config file to: <code><?php echo INSTALLDIR; ?></code></p>
<p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?></code> <p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?></code>
<?php <?php
return false; $pass = false;
} }
if (!is_writable(INSTALLDIR.'/avatar/')) { if (!is_writable(INSTALLDIR.'/avatar/')) {
?><p class="error">Cannot write avatar directory: <code><?php echo INSTALLDIR; ?>/avatar/</code></p> ?><p class="error">Cannot write avatar directory: <code><?php echo INSTALLDIR; ?>/avatar/</code></p>
<p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/avatar/</code></p> <p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/avatar/</code></p>
<? <?
return false; $pass = false;
} }
return true; return $pass;
} }
function checkExtension($name) function checkExtension($name)
@ -173,36 +175,38 @@ function handlePost()
<dd> <dd>
<ul> <ul>
<?php <?php
$fail = false;
if (empty($host)) { if (empty($host)) {
updateStatus("No hostname specified.", true); updateStatus("No hostname specified.", true);
showForm(); $fail = true;
return;
} }
if (empty($database)) { if (empty($database)) {
updateStatus("No database specified.", true); updateStatus("No database specified.", true);
showForm(); $fail = true;
return;
} }
if (empty($username)) { if (empty($username)) {
updateStatus("No username specified.", true); updateStatus("No username specified.", true);
showForm(); $fail = true;
return;
} }
if (empty($password)) { if (empty($password)) {
updateStatus("No password specified.", true); updateStatus("No password specified.", true);
showForm(); $fail = true;
return;
} }
if (empty($sitename)) { if (empty($sitename)) {
updateStatus("No sitename specified.", true); updateStatus("No sitename specified.", true);
showForm(); $fail = true;
return;
} }
if($fail){
showForm();
return;
}
updateStatus("Starting installation..."); updateStatus("Starting installation...");
updateStatus("Checking database..."); updateStatus("Checking database...");
$conn = mysql_connect($host, $username, $password); $conn = mysql_connect($host, $username, $password);
@ -247,7 +251,7 @@ function handlePost()
} }
updateStatus("Done!"); updateStatus("Done!");
if ($path) $path .= '/'; if ($path) $path .= '/';
updateStatus("You can visit your <a href='/$path'>new Laconica site</a)."); updateStatus("You can visit your <a href='/$path'>new Laconica site</a>.");
?> ?>
<?php <?php
@ -257,16 +261,17 @@ function writeConf($sitename, $sqlUrl, $fancy, $path)
{ {
$res = file_put_contents(INSTALLDIR.'/config.php', $res = file_put_contents(INSTALLDIR.'/config.php',
"<?php\n". "<?php\n".
"if (!defined('LACONICA')) { exit(1); }\n\n".
"\$config['site']['name'] = \"$sitename\";\n\n". "\$config['site']['name'] = \"$sitename\";\n\n".
($fancy ? "\$config['site']['fancy'] = true;\n\n":''). ($fancy ? "\$config['site']['fancy'] = true;\n\n":'').
"\$config['site']['path'] = \"$path\";\n\n". "\$config['site']['path'] = \"$path\";\n\n".
"\$config['db']['database'] = \"$sqlUrl\";\n\n"); "\$config['db']['database'] = \"$sqlUrl\";\n\n".
"?>");
return $res; return $res;
} }
function runDbScript($filename, $conn) function runDbScript($filename, $conn)
{ {
return true;
$sql = trim(file_get_contents($filename)); $sql = trim(file_get_contents($filename));
$stmts = explode(';', $sql); $stmts = explode(';', $sql);
foreach ($stmts as $stmt) { foreach ($stmts as $stmt) {
@ -290,13 +295,13 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head> <head>
<title>Install Laconica</title> <title>Install Laconica</title>
<link rel="stylesheet" type="text/css" href="theme/base/css/display.css?version=0.8" media="screen, projection, tv"/> <link rel="shortcut icon" href="favicon.ico"/>
<link rel="stylesheet" type="text/css" href="theme/default/css/display.css?version=0.8" media="screen, projection, tv"/> <link rel="stylesheet" type="text/css" href="theme/default/css/display.css?version=0.8" media="screen, projection, tv"/>
<!--[if IE]><link rel="stylesheet" type="text/css" href="theme/base/css/ie.css?version=0.8" /><![endif]--> <!--[if IE]><link rel="stylesheet" type="text/css" href="theme/base/css/ie.css?version=0.8" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" theme/base/css/ie6.css?version=0.8" /><![endif]--> <!--[if lte IE 6]><link rel="stylesheet" type="text/css" theme/base/css/ie6.css?version=0.8" /><![endif]-->
<!--[if IE]><link rel="stylesheet" type="text/css" href="theme/earthy/css/ie.css?version=0.8" /><![endif]--> <!--[if IE]><link rel="stylesheet" type="text/css" href="theme/default/css/ie.css?version=0.8" /><![endif]-->
<script src='js/jquery.min.js'></script> <script src="js/jquery.min.js"></script>
<script src='js/install.js'></script> <script src="js/install.js"></script>
</head> </head>
<body id="install"> <body id="install">
<div id="wrap"> <div id="wrap">

View File

@ -203,7 +203,6 @@ $(document).ready(function(){
$("#notices_primary .notices").prepend(document._importNode(li, true)); $("#notices_primary .notices").prepend(document._importNode(li, true));
$("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").css({display:"none"});
$("#notices_primary .notice:first").fadeIn(2500); $("#notices_primary .notice:first").fadeIn(2500);
NoticeHover();
NoticeReply(); NoticeReply();
} }
} }
@ -221,24 +220,23 @@ $(document).ready(function(){
NoticeReply(); NoticeReply();
}); });
function NoticeHover() { function NoticeHover() {
$("#content .notice").hover( function mouseHandler(e) {
function () { $(e.target).closest('li.hentry')[(e.type === 'mouseover') ? 'addClass' : 'removeClass']('hover');
$(this).addClass('hover'); };
}, $('#content .notices').mouseover(mouseHandler);
function () { $('#content .notices').mouseout(mouseHandler);
$(this).removeClass('hover');
}
);
} }
function NoticeReply() { function NoticeReply() {
if ($('#notice_data-text').length > 0) { if ($('#notice_data-text').length > 0) {
$('#content .notice').each(function() { $('#content .notice').each(function() {
var notice = $(this); var notice = $(this)[0];
$('.notice_reply', $(this)).click(function() { $($('.notice_reply', notice)[0]).click(function() {
var nickname = ($('.author .nickname', notice).length > 0) ? $('.author .nickname', notice) : $('.author .nickname'); var nickname = ($('.author .nickname', notice).length > 0) ? $($('.author .nickname', notice)[0]) : $('.author .nickname');
NoticeReplySet(nickname.text(), $('.notice_id', notice).text()); NoticeReplySet(nickname.text(), $($('.notice_id', notice)[0]).text());
return false; return false;
}); });
}); });

View File

@ -193,7 +193,9 @@ background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-r
} }
.notices div.entry-content, .notices div.entry-content,
.notices div.notice-options { .notices div.notice-options,
.notices li.hover .notices div.entry-content,
.notices li.hover .notices div.notice-options {
opacity:0.4; opacity:0.4;
} }
.notices li.hover div.entry-content, .notices li.hover div.entry-content,

View File

@ -193,7 +193,9 @@ background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-r
} }
.notices div.entry-content, .notices div.entry-content,
.notices div.notice-options { .notices div.notice-options,
.notices li.hover .notices div.entry-content,
.notices li.hover .notices div.notice-options {
opacity:0.4; opacity:0.4;
} }
.notices li.hover div.entry-content, .notices li.hover div.entry-content,