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

This commit is contained in:
Sarven Capadisli 2009-05-20 19:40:29 -04:00
commit d835267cc7
9 changed files with 325 additions and 279 deletions

View File

@ -82,7 +82,16 @@ class DesignsettingsAction extends AccountSettingsAction
$this->element('legend', null, _('Change background image')); $this->element('legend', null, _('Change background image'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
$this->elementStart('li'); $this->elementStart('li');
$this->element('p', null, _('Upload background image')); $this->element('label', array('for' => 'design_ background-image_file'),
_('Upload file'));
$this->element('input', array('name' => 'design_background-image_file',
'type' => 'file',
'id' => 'design_background-image_file'));
$this->element('p', 'form_guide', _('You can upload your personal background image. The maximum file size is 2Mb.'));
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
'value' => ImageFile::maxFileSizeInt()));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
@ -108,15 +117,22 @@ class DesignsettingsAction extends AccountSettingsAction
$userSwatch = ($userSwatch) ? json_decode($userSwatch, true) : $defaultSwatch; $userSwatch = ($userSwatch) ? json_decode($userSwatch, true) : $defaultSwatch;
$s = 0; $s = 0;
$labelSwatch = array('Background color', $labelSwatch = array('Background',
'Content background color', 'Content',
'Sidebar background color', 'Sidebar',
'Text color', 'Text',
'Link color'); 'Links');
foreach($userSwatch as $propertyvalue => $value) { foreach($userSwatch as $propertyvalue => $value) {
$foo = array_values($value); //Is this necessary? $value[0] doesn't work because of invalid key $foo = array_values($value);
$this->elementStart('li'); $this->elementStart('li');
$this->input("swatch-".$s, $labelSwatch[$s], $foo[0]); $this->element('label', array('for' => 'swatch-'.$s), _($labelSwatch[$s]));
$this->element('input', array('name' => 'swatch-'.$s, //prefer swatch[$s] ?
'type' => 'text',
'id' => 'swatch-'.$s,
'class' => 'swatch',
'maxlength' => '7',
'size' => '7',
'value' => $foo[0]));
$this->elementEnd('li'); $this->elementEnd('li');
$s++; $s++;
} }
@ -125,6 +141,11 @@ class DesignsettingsAction extends AccountSettingsAction
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->submit('save', _('Save')); $this->submit('save', _('Save'));
$this->element('input', array('id' => 'settings_design_reset',
'type' => 'reset',
'value' => 'Reset',
'class' => 'form_action-secondary'));
/*TODO: Check submitted form values: /*TODO: Check submitted form values:
json_encode(form values) json_encode(form values)
if submitted Swatch == DefaultSwatch, don't store in DB. if submitted Swatch == DefaultSwatch, don't store in DB.

View File

@ -3,219 +3,206 @@
if (!defined('LACONICA')) { exit(1); } if (!defined('LACONICA')) { exit(1); }
#If you have downloaded libraries in random little places, you // If you have downloaded libraries in random little places, you
#can add the paths here // can add the paths here
#$extra_path = array("/opt/php-openid-2.0.1", "/usr/local/share/php"); // $extra_path = array("/opt/php-openid-2.0.1", "/usr/local/share/php");
#set_include_path(implode(PATH_SEPARATOR, $extra_path) . PATH_SEPARATOR . get_include_path()); // set_include_path(implode(PATH_SEPARATOR, $extra_path) . PATH_SEPARATOR . get_include_path());
# We get called by common.php, $config is a tree with lots of config // We get called by common.php, $config is a tree with lots of config
# options // options
# These are for configuring your URLs // These are for configuring your URLs
$config['site']['name'] = 'Just another Laconica microblog'; $config['site']['name'] = 'Just another Laconica microblog';
$config['site']['server'] = 'localhost'; $config['site']['server'] = 'localhost';
$config['site']['path'] = 'laconica'; $config['site']['path'] = 'laconica';
#$config['site']['fancy'] = false; // $config['site']['fancy'] = false;
#$config['site']['theme'] = 'default'; // $config['site']['theme'] = 'default';
#To enable the built-in mobile style sheet, defaults to false. // To enable the built-in mobile style sheet, defaults to false.
#$config['site']['mobile'] = true; // $config['site']['mobile'] = true;
#For contact email, defaults to $_SERVER["SERVER_ADMIN"] // For contact email, defaults to $_SERVER["SERVER_ADMIN"]
#$config['site']['email'] = 'admin@example.net'; // $config['site']['email'] = 'admin@example.net';
#Brought by... // Brought by...
#$config['site']['broughtby'] = 'Individual or Company'; // $config['site']['broughtby'] = 'Individual or Company';
#$config['site']['broughtbyurl'] = 'http://example.net/'; // $config['site']['broughtbyurl'] = 'http://example.net/';
#If you don't want to let users register (say, for a one-person install) // If you don't want to let users register (say, for a one-person install)
#Crude but effective -- register everybody, then lock down // Crude but effective -- register everybody, then lock down
#$config['site']['closed'] = true; // $config['site']['closed'] = true;
#Only allow registration for people invited by another user // Only allow registration for people invited by another user
#$config['site']['inviteonly'] = true; // $config['site']['inviteonly'] = true;
#Make the site invisible to non-logged-in users // Make the site invisible to non-logged-in users
#$config['site']['private'] = true; // $config['site']['private'] = true;
# 'direct' for direct notice links in sections // If you want logging sent to a file instead of syslog
# 'attachment' for notice attachment links in sections // $config['site']['logfile'] = '/tmp/laconica.log';
# left undefined, no link is showed
#$config['site']['notice_link'] = 'attachment';
#$config['site']['notice_link'] = 'direct';
# If you want logging sent to a file instead of syslog // Enables extra log information, for example full details of PEAR DB errors
#$config['site']['logfile'] = '/tmp/laconica.log'; // $config['site']['logdebug'] = true;
# Enables extra log information, for example full details of PEAR DB errors // To set your own logo, overriding the one in the theme
#$config['site']['logdebug'] = true; // $config['site']['logo'] = '/mylogo.png';
#To set your own logo, overriding the one in the theme // This is a PEAR DB DSN, see http://pear.php.net/manual/en/package.database.db.intro-dsn.php
#$config['site']['logo'] = '/mylogo.png'; // Set it to match your actual database
# This is a PEAR DB DSN, see http://pear.php.net/manual/en/package.database.db.intro-dsn.php
# Set it to match your actual database
$config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica'; $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica';
#$config['db']['ini_your_db_name'] = $config['db']['schema_location'].'/laconica.ini'; // $config['db']['ini_your_db_name'] = $config['db']['schema_location'].'/laconica.ini';
# *** WARNING *** WARNING *** WARNING *** WARNING *** // *** WARNING *** WARNING *** WARNING *** WARNING ***
# Setting debug to a non-zero value will expose your DATABASE PASSWORD to Web users. // Setting debug to a non-zero value will expose your DATABASE PASSWORD to Web users.
# !!!!!! DO NOT SET THIS ON PRODUCTION SERVERS !!!!!! DB_DataObject's bug, btw, not // !!!!!! DO NOT SET THIS ON PRODUCTION SERVERS !!!!!! DB_DataObject's bug, btw, not
# ours. // ours.
# *** WARNING *** WARNING *** WARNING *** WARNING *** // *** WARNING *** WARNING *** WARNING *** WARNING ***
#$config['db']['debug'] = 0; // $config['db']['debug'] = 0;
#$config['db']['db_driver'] = 'MDB2'; // $config['db']['db_driver'] = 'MDB2';
#Database type. For mysql, these defaults are fine. For postgresql, set // Database type. For mysql, these defaults are fine. For postgresql, set
#'quote_identifiers' to true and 'type' to 'pgsql': // 'quote_identifiers' to true and 'type' to 'pgsql':
#$config['db']['quote_identifiers'] = false; // $config['db']['quote_identifiers'] = false;
#$config['db']['type'] = 'mysql'; // $config['db']['type'] = 'mysql';
#session_set_cookie_params(0, '/'. $config['site']['path'] .'/'); // session_set_cookie_params(0, '/'. $config['site']['path'] .'/');
#Standard fancy-url clashes prevented by not allowing nicknames on a blacklist // Standard fancy-url clashes prevented by not allowing nicknames on a blacklist
#Add your own here. Note: empty array by default // Add your own here. Note: empty array by default
#$config['nickname']['blacklist'][] = 'scobleizer'; // $config['nickname']['blacklist'][] = 'scobleizer';
# sphinx search // sphinx search
$config['sphinx']['enabled'] = false; $config['sphinx']['enabled'] = false;
$config['sphinx']['server'] = 'localhost'; $config['sphinx']['server'] = 'localhost';
$config['sphinx']['port'] = 3312; $config['sphinx']['port'] = 3312;
# Users to populate the 'Featured' tab // Users to populate the 'Featured' tab
#$config['nickname']['featured'][] = 'scobleizer'; // $config['nickname']['featured'][] = 'scobleizer';
# xmpp // xmpp
#$config['xmpp']['enabled'] = false; // $config['xmpp']['enabled'] = false;
#$config['xmpp']['server'] = 'server.example.net'; // $config['xmpp']['server'] = 'server.example.net';
#$config['xmpp']['host'] = NULL; # Only set if different from server // $config['xmpp']['host'] = NULL; // Only set if different from server
#$config['xmpp']['port'] = 5222; // $config['xmpp']['port'] = 5222;
#$config['xmpp']['user'] = 'update'; // $config['xmpp']['user'] = 'update';
#$config['xmpp']['encryption'] = false; // $config['xmpp']['encryption'] = false;
#$config['xmpp']['resource'] = 'uniquename'; // $config['xmpp']['resource'] = 'uniquename';
#$config['xmpp']['password'] = 'blahblahblah'; // $config['xmpp']['password'] = 'blahblahblah';
#$config['xmpp']['public'][] = 'someindexer@example.net'; // $config['xmpp']['public'][] = 'someindexer@example.net';
#$config['xmpp']['debug'] = false; // $config['xmpp']['debug'] = false;
#Default locale info // Default locale info
#$config['site']['timezone'] = 'Pacific/Auckland'; // $config['site']['timezone'] = 'Pacific/Auckland';
#$config['site']['language'] = 'en_NZ'; // $config['site']['language'] = 'en_NZ';
#Email info, used for all outbound email // Email info, used for all outbound email
#$config['mail']['notifyfrom'] = 'microblog@example.net'; // $config['mail']['notifyfrom'] = 'microblog@example.net';
#$config['mail']['domain'] = 'microblog.example.net'; // $config['mail']['domain'] = 'microblog.example.net';
# See http://pear.php.net/manual/en/package.mail.mail.factory.php for options // See http://pear.php.net/manual/en/package.mail.mail.factory.php for options
#$config['mail']['backend'] = 'smtp'; // $config['mail']['backend'] = 'smtp';
#$config['mail']['params'] = array( // $config['mail']['params'] = array(
# 'host' => 'localhost', // 'host' => 'localhost',
# 'port' => 25, // 'port' => 25,
# ); // );
#For incoming email, if enabled. Defaults to site server name. // For incoming email, if enabled. Defaults to site server name.
#$config['mail']['domain'] = 'incoming.example.net'; // $config['mail']['domain'] = 'incoming.example.net';
#exponential decay factor for tags, default 10 days // exponential decay factor for tags, default 10 days
#raise this if traffic is slow, lower it if it's fast // raise this if traffic is slow, lower it if it's fast
#$config['tag']['dropoff'] = 86400.0 * 10; // $config['tag']['dropoff'] = 86400.0 * 10;
#exponential decay factor for popular (most favorited notices) // exponential decay factor for popular (most favorited notices)
#default 10 days -- similar to tag dropoff // default 10 days -- similar to tag dropoff
#$config['popular']['dropoff'] = 86400.0 * 10; // $config['popular']['dropoff'] = 86400.0 * 10;
#optionally show non-local messages in public timeline // optionally show non-local messages in public timeline
#$config['public']['localonly'] = false; // $config['public']['localonly'] = false;
#hide certain users from public pages, by ID // hide certain users from public pages, by ID
#$config['public']['blacklist'][] = 123; // $config['public']['blacklist'][] = 123;
#$config['public']['blacklist'][] = 2307; // $config['public']['blacklist'][] = 2307;
#Mark certain notice sources as automatic and thus not // Mark certain notice sources as automatic and thus not
#appropriate for public feed // appropriate for public feed
#$config['public]['autosource'][] = 'twitterfeed'; // $config['public]['autosource'][] = 'twitterfeed';
#$config['public]['autosource'][] = 'rssdent'; // $config['public]['autosource'][] = 'rssdent';
#$config['public]['autosource'][] = 'Ping.Fm'; // $config['public]['autosource'][] = 'Ping.Fm';
#$config['public]['autosource'][] = 'HelloTxt'; // $config['public]['autosource'][] = 'HelloTxt';
#$config['public]['autosource'][] = 'Updating.Me'; // $config['public]['autosource'][] = 'Updating.Me';
#Do notice broadcasts offline // Do notice broadcasts offline
#If you use this, you must run the six offline daemons in the // If you use this, you must run the six offline daemons in the
#background. See the README for details. // background. See the README for details.
#$config['queue']['enabled'] = true; // $config['queue']['enabled'] = true;
#Queue subsystem // Queue subsystem
#subsystems: internal (default) or stomp // subsystems: internal (default) or stomp
#using stomp requires an external message queue server // using stomp requires an external message queue server
#$config['queue']['subsystem'] = 'stomp'; // $config['queue']['subsystem'] = 'stomp';
#$config['queue']['stomp_server'] = 'tcp://localhost:61613'; // $config['queue']['stomp_server'] = 'tcp://localhost:61613';
#use different queue_basename for each laconica instance managed by the server // use different queue_basename for each laconica instance managed by the server
#$config['queue']['queue_basename'] = 'laconica'; // $config['queue']['queue_basename'] = 'laconica';
#The following customise the behaviour of the various daemons: // The following customise the behaviour of the various daemons:
#$config['daemon']['piddir'] = '/var/run'; // $config['daemon']['piddir'] = '/var/run';
#$config['daemon']['user'] = false; // $config['daemon']['user'] = false;
#$config['daemon']['group'] = false; // $config['daemon']['group'] = false;
#For installations with high traffic, laconica can use MemCached to cache // For installations with high traffic, laconica can use MemCached to cache
#frequently requested information. Only enable the following if you have // frequently requested information. Only enable the following if you have
#MemCached up and running: // MemCached up and running:
#$config['memcached']['enabled'] = false; // $config['memcached']['enabled'] = false;
#$config['memcached']['server'] = 'localhost'; // $config['memcached']['server'] = 'localhost';
#$config['memcached']['port'] = 11211; // $config['memcached']['port'] = 11211;
# Enable bidirectional Twitter bridge // Twitter integration source attribute. Note: default is Laconica
#$config['twitterbridge']['enabled'] = true; // $config['integration']['source'] = 'Laconica';
#Twitter integration source attribute. Note: default is Laconica // Edit throttling. Off by default. If turned on, you can only post 20 notices
#$config['integration']['source'] = 'Laconica'; // every 10 minutes. Admins may want to play with the settings to minimize inconvenience for
// real users without getting uncontrollable floods from spammers or runaway bots.
# Edit throttling. Off by default. If turned on, you can only post 20 notices // $config['throttle']['enabled'] = true;
# every 10 minutes. Admins may want to play with the settings to minimize inconvenience for // $config['throttle']['count'] = 100;
# real users without getting uncontrollable floods from spammers or runaway bots. // $config['throttle']['timespan'] = 3600;
#$config['throttle']['enabled'] = true; // List of users banned from posting (nicknames and/or IDs)
#$config['throttle']['count'] = 100; // $config['profile']['banned'][] = 'hacker';
#$config['throttle']['timespan'] = 3600; // $config['profile']['banned'][] = 12345;
# List of users banned from posting (nicknames and/or IDs) // Config section for the built-in Facebook application
#$config['profile']['banned'][] = 'hacker'; // $config['facebook']['apikey'] = 'APIKEY';
#$config['profile']['banned'][] = 12345; // $config['facebook']['secret'] = 'SECRET';
# Config section for the built-in Facebook application // Add Google Analytics
#$config['facebook']['apikey'] = 'APIKEY'; // require_once('plugins/GoogleAnalyticsPlugin.php');
#$config['facebook']['secret'] = 'SECRET'; // $ga = new GoogleAnalyticsPlugin('your secret code');
# Facebook Connect plugin (Needs valid APIKEY above) // Use Templating (template: /tpl/index.php)
#require_once(INSTALLDIR.'/plugins/FBConnect/FBConnectPlugin.php'); // require_once('plugins/TemplatePlugin.php');
#$fbc = new FBConnectPlugin(); // $tpl = new TemplatePlugin();
# Add Google Analytics // Don't allow saying the same thing more than once per hour
# require_once('plugins/GoogleAnalyticsPlugin.php'); // $config['site']['dupelimit'] = 3600;
# $ga = new GoogleAnalyticsPlugin('your secret code'); // Don't enforce the dupe limit
// $config['site']['dupelimit'] = -1;
# Use Templating (template: /tpl/index.php) // Base string for minting Tag URIs in Atom feeds. Defaults to
# require_once('plugins/TemplatePlugin.php'); // "yourserver,2009". This needs to be configured properly for your Atom
# $tpl = new TemplatePlugin(); // feeds to validate. See: http://www.faqs.org/rfcs/rfc4151.html and
// http://taguri.org/ Examples:
// $config['integration']['taguri'] = 'example.net,2008';
// $config['integration']['taguri'] = 'admin@example.net,2009-03-09'
#Don't allow saying the same thing more than once per hour // Don't use SSL
#$config['site']['dupelimit'] = 3600; // $config['site']['ssl'] = 'never';
#Don't enforce the dupe limit // Use SSL only for sensitive pages (like login, password change)
#$config['site']['dupelimit'] = -1; // $config['site']['ssl'] = 'sometimes';
// Use SSL for all pages
// $config['site']['ssl'] = 'always';
#Base string for minting Tag URIs in Atom feeds. Defaults to // Use a different hostname for SSL-encrypted pages
#"yourserver,2009". This needs to be configured properly for your Atom // $config['site']['sslserver'] = 'secure.example.org';
#feeds to validate. See: http://www.faqs.org/rfcs/rfc4151.html and
#http://taguri.org/ Examples:
#$config['integration']['taguri'] = 'example.net,2008';
#$config['integration']['taguri'] = 'admin@example.net,2009-03-09'
#Don't use SSL // If you have a lot of status networks on the same server, you can
#$config['site']['ssl'] = 'never'; // store the site data in a database and switch as follows
#Use SSL only for sensitive pages (like login, password change) // Status_network::setupDB('localhost', 'statusnet', 'statuspass', 'statusnet');
#$config['site']['ssl'] = 'sometimes'; // if (!Status_network::setupSite($_server, $_path)) {
#Use SSL for all pages // print "Error\n";
#$config['site']['ssl'] = 'always'; // exit(1);
// }
#Use a different hostname for SSL-encrypted pages
#$config['site']['sslserver'] = 'secure.example.org';
#If you have a lot of status networks on the same server, you can
#store the site data in a database and switch as follows
#Status_network::setupDB('localhost', 'statusnet', 'statuspass', 'statusnet');
#if (!Status_network::setupSite($_server, $_path)) {
# print "Error\n";
# exit(1);
#}

View File

@ -1,29 +1,30 @@
/** Init for Farbtastic library and page setup
*
* @package Laconica
* @author Sarven Capadisli <csarven@controlyourself.ca>
* @copyright 2009 Control Yourself, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://laconi.ca/
*/
$(document).ready(function() { $(document).ready(function() {
function UpdateColors(e) { function UpdateColors(S) {
var S = f.linked; C = $(S).val();
var C = f.color; switch (parseInt(S.id.slice(-1))) {
case 0: default:
if (S && S.value && S.value != C) { $('body').css({'background-color':C});
UpdateSwatch(S); break;
case 1:
switch (parseInt(f.linked.id.slice(-1))) { $('#content').css({'background-color':C});
case 1: default: break;
$('body').css({'background-color':C}); case 2:
break; $('#aside_primary').css({'background-color':C});
case 2: break;
$('#content').css({'background-color':C}); case 3:
break; $('body').css({'color':C});
case 3: break;
$('#aside_primary').css({'background-color':C}); case 4:
break; $('a').css({'color':C});
case 4: break;
$('body').css({'color':C});
break;
case 5:
$('a').css({'color':C});
break;
}
S.value = C;
} }
} }
@ -33,35 +34,52 @@ $(document).ready(function() {
} }
function UpdateSwatch(e) { function UpdateSwatch(e) {
$(e).css({ $(e).css({"background-color": e.value,
"background-color": e.value, "color": f.hsl[2] > 0.5 ? "#000": "#fff"});
"color": f.hsl[2] > 0.5 ? "#000": "#fff"
});
} }
$('#settings_design_color').append('<div id="color-picker"></div>'); function SynchColors(e) {
$('#color-picker').hide(); var S = f.linked;
var C = f.color;
var f = $.farbtastic('#color-picker', UpdateColors); if (S && S.value && S.value != C) {
var swatches = $('#settings_design_color input'); S.value = C;
UpdateSwatch(S);
UpdateColors(S);
}
}
swatches function Init() {
.each(UpdateColors) $('#settings_design_color').append('<div id="color-picker"></div>');
$('#color-picker').hide();
.blur(function() { f = $.farbtastic('#color-picker', SynchColors);
$(this).val($(this).val().toUpperCase()); swatches = $('#settings_design_color .swatch');
})
.focus(function() { swatches
$('#color-picker').show(); .each(SynchColors)
UpdateFarbtastic(this); .blur(function() {
}) $(this).val($(this).val().toUpperCase());
})
.change(function() { .focus(function() {
UpdateFarbtastic(this); $('#color-picker').show();
UpdateSwatch(this); UpdateFarbtastic(this);
}).change() })
.change(function() {
; UpdateFarbtastic(this);
UpdateSwatch(this);
UpdateColors(this);
}).change();
}
var f, swatches;
Init();
$('#form_settings_design').bind('reset', function(){
setTimeout(function(){
swatches.each(function(){UpdateColors(this);});
$('#color-picker').remove();
swatches.unbind();
Init();
},10);
});
}); });

View File

@ -1,39 +1,48 @@
$(function(){ /** Init for Jcrop library and page setup
var x = ($('#avatar_crop_x').val()) ? $('#avatar_crop_x').val() : 0; *
var y = ($('#avatar_crop_y').val()) ? $('#avatar_crop_y').val() : 0; * @package Laconica
var w = ($('#avatar_crop_w').val()) ? $('#avatar_crop_w').val() : $("#avatar_original img").attr("width"); * @author Sarven Capadisli <csarven@controlyourself.ca>
var h = ($('#avatar_crop_h').val()) ? $('#avatar_crop_h').val() : $("#avatar_original img").attr("height"); * @copyright 2009 Control Yourself, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://laconi.ca/
*/
jQuery("#avatar_original img").Jcrop({ $(function(){
onChange: showPreview, var x = ($('#avatar_crop_x').val()) ? $('#avatar_crop_x').val() : 0;
setSelect: [ x, y, w, h ], var y = ($('#avatar_crop_y').val()) ? $('#avatar_crop_y').val() : 0;
onSelect: updateCoords, var w = ($('#avatar_crop_w').val()) ? $('#avatar_crop_w').val() : $("#avatar_original img").attr("width");
aspectRatio: 1, var h = ($('#avatar_crop_h').val()) ? $('#avatar_crop_h').val() : $("#avatar_original img").attr("height");
boxWidth: 480,
boxHeight: 480,
bgColor: '#000',
bgOpacity: .4
});
});
function showPreview(coords) { jQuery("#avatar_original img").Jcrop({
var rx = 96 / coords.w; onChange: showPreview,
var ry = 96 / coords.h; setSelect: [ x, y, w, h ],
onSelect: updateCoords,
aspectRatio: 1,
boxWidth: 480,
boxHeight: 480,
bgColor: '#000',
bgOpacity: .4
});
});
var img_width = $("#avatar_original img").attr("width"); function showPreview(coords) {
var img_height = $("#avatar_original img").attr("height"); var rx = 96 / coords.w;
var ry = 96 / coords.h;
$('#avatar_preview img').css({ var img_width = $("#avatar_original img").attr("width");
width: Math.round(rx *img_width) + 'px', var img_height = $("#avatar_original img").attr("height");
height: Math.round(ry * img_height) + 'px',
marginLeft: '-' + Math.round(rx * coords.x) + 'px',
marginTop: '-' + Math.round(ry * coords.y) + 'px'
});
};
function updateCoords(c) { $('#avatar_preview img').css({
$('#avatar_crop_x').val(c.x); width: Math.round(rx *img_width) + 'px',
$('#avatar_crop_y').val(c.y); height: Math.round(ry * img_height) + 'px',
$('#avatar_crop_w').val(c.w); marginLeft: '-' + Math.round(rx * coords.x) + 'px',
$('#avatar_crop_h').val(c.h); marginTop: '-' + Math.round(ry * coords.y) + 'px'
}; });
};
function updateCoords(c) {
$('#avatar_crop_x').val(c.x);
$('#avatar_crop_y').val(c.y);
$('#avatar_crop_w').val(c.w);
$('#avatar_crop_h').val(c.h);
};

View File

@ -19,7 +19,7 @@
if (!defined('LACONICA')) { exit(1); } if (!defined('LACONICA')) { exit(1); }
define('LACONICA_VERSION', '0.7.3'); define('LACONICA_VERSION', '0.8.0dev');
define('AVATAR_PROFILE_SIZE', 96); define('AVATAR_PROFILE_SIZE', 96);
define('AVATAR_STREAM_SIZE', 48); define('AVATAR_STREAM_SIZE', 48);

View File

@ -120,22 +120,28 @@ class FBConnectPlugin extends Plugin
$apikey = common_config('facebook', 'apikey'); $apikey = common_config('facebook', 'apikey');
$plugin_path = common_path('plugins/FBConnect'); $plugin_path = common_path('plugins/FBConnect');
$url = common_get_returnto(); $login_url = common_get_returnto();
if ($url) { if ($login_url) {
// We don't have to return to it again // We don't have to return to it again
common_set_returnto(null); common_set_returnto(null);
} else { } else {
$url = common_local_url('public'); $url = common_local_url('public');
} }
$logout_url = common_local_url('logout');
$html = sprintf('<script type="text/javascript">FB.init("%s", "%s/xd_receiver.htm"); $html = sprintf('<script type="text/javascript">FB.init("%s", "%s/xd_receiver.htm");
function refresh_page() { function goto_login() {
window.location = "%s"; window.location = "%s";
} }
</script>', $apikey, $plugin_path, $url); function goto_logout() {
window.location = "%s";
}
</script>', $apikey, $plugin_path, $login_url, $logout_url);
$action->raw($html); $action->raw($html);
@ -170,8 +176,8 @@ class FBConnectPlugin extends Plugin
$text = _('Logout'); $text = _('Logout');
$html = sprintf('<li id="nav_logout"><a href="%s" title="%s" ' . $html = sprintf('<li id="nav_logout"><a href="%s" title="%s" ' .
'onclick="FB.Connect.logoutAndRedirect(\'%s\')">%s</a></li>', 'onclick="FB.Connect.logout(function() { goto_logout() })">%s</a></li>',
$logout_url, $title, $logout_url, $text); $logout_url, $title, $text);
$action->raw($html); $action->raw($html);
@ -198,7 +204,7 @@ class FBConnectPlugin extends Plugin
if (!$user) { if (!$user) {
$action->elementStart('li'); $action->elementStart('li');
$action->element('fb:login-button', array('onlogin' => 'refresh_page()', $action->element('fb:login-button', array('onlogin' => 'goto_login()',
'length' => 'long')); 'length' => 'long'));
$action->elementEnd('li'); $action->elementEnd('li');
} }

View File

@ -214,7 +214,8 @@ class TwitterStatusFetcher extends Daemon
return; return;
} }
foreach ($timeline as $status) { // Reverse to preserve order
foreach (array_reverse($timeline) as $status) {
// Hacktastic: filter out stuff coming from this Laconica // Hacktastic: filter out stuff coming from this Laconica
$source = mb_strtolower(common_config('integration', 'source')); $source = mb_strtolower(common_config('integration', 'source'));

View File

@ -1161,6 +1161,17 @@ width:400px;
margin-right:28px; margin-right:28px;
} }
#settings_design_color .form_data li {
width:33%;
}
#settings_design_color .form_data label {
float:none;
}
#settings_design_color .form_data .swatch {
padding:11px;
margin-left:0;
}
.instructions ul { .instructions ul {
list-style-position:inside; list-style-position:inside;
} }

View File

@ -72,13 +72,6 @@ border-top-color:#D1D9E4;
border-top-color:#C3D6DF; border-top-color:#C3D6DF;
} }
#content .notice p.entry-content a:visited {
background-color:#fcfcfc;
}
#content .notice p.entry-content .vcard a {
background-color:#fcfffc;
}
#aside_primary { #aside_primary {
background-color:#CEE1E9; background-color:#CEE1E9;
} }